| |
|
| java.lang.Object com.jcorporate.expresso.services.asyncprocess.DefaultAsyncProcessor
DefaultAsyncProcessor | public class DefaultAsyncProcessor implements AsyncProcessor(Code) | | This is a default implementation of the AsyncProcessor. It has specific
claim timeout, specific threads and queue size, and a particular order of
dealing with things. A different kind of implementation might, for example,
dispatch the requests to another machine for processing and return the result.
This asynchronous processor relies on the set up tables for the following parameters.
parameters are missing from the set up table then the default values will be used instead.
These parameters are:
- AsyncClaimTimeout: when the job is completed there is always the chance
that it will never be claimed by the client a for example if they close their
browser window. AsyncClaimTimeout specifies in milliseconds how long to wait
before discarding
a completed job. The default value is 30 minutes.
- AsyncNumThreads: This value specifies how many threads
the asynchronous processor has available to process waiting processes.
the default value for this is 10 threads.
- AsyncQueueSize: When all threads are occupied with running processes
this parameter specifies how he processes to hold in a waiting queue
before throwing a queue full exception. The default value for this
is 20.
author: Michael Rimov version: $Revision: 1.12 $ on $Date: 2004/11/17 20:48:17 $ |
Inner Class :class ProcessWrapper | |
Method Summary | |
public synchronized AsyncTicket | addToQueue(AsyncProcess newProcess) | public AsyncTicket | addToQueue(AsyncProcess newProcess, long waitTimeout) Similar to addToQueue(AsyncProcess), but it tries to wait for the specified
period of time before returning to see if the process completes during
that time.
Parameters: newProcess - The AsyncProcess to add to the queue Parameters: waitTimeout - the number of milliseconds to wait to see if the processcompletes in that time. | public synchronized void | destroy() | public AsyncProcessResult | getProcessResult(AsyncTicket ticketId) | public AsyncProcessResult | getProcessResult(AsyncTicket ticketId, long waitTimeout) Retrieve the result of the process waiting up to a specified time for the
process to complete
Parameters: ticketId - the ticket ID Parameters: waitTimeout - the time in ms to wait for the process to complete beforereturning. | LinkedList | getQueue() Retrieve the queue. |
DEFAULT_PROCESSSOR_PROPERTIES_FILE | final public static String DEFAULT_PROCESSSOR_PROPERTIES_FILE(Code) | | |
claimTimeout | long claimTimeout(Code) | | |
numThreads | int numThreads(Code) | | |
DefaultAsyncProcessor | public DefaultAsyncProcessor()(Code) | | |
addToQueue | public synchronized AsyncTicket addToQueue(AsyncProcess newProcess) throws QueueFullException(Code) | | Add an asynchronous process ot the queue
Parameters: newProcess - the AsyncProcess implementation to run AsyncTicket object for use in reeming the process' status. throws: QueueFullException - if there are too many jobs waiting. |
addToQueue | public AsyncTicket addToQueue(AsyncProcess newProcess, long waitTimeout) throws QueueFullException(Code) | | Similar to addToQueue(AsyncProcess), but it tries to wait for the specified
period of time before returning to see if the process completes during
that time.
Parameters: newProcess - The AsyncProcess to add to the queue Parameters: waitTimeout - the number of milliseconds to wait to see if the processcompletes in that time. AsyncTicket instance. |
destroy | public synchronized void destroy()(Code) | | Destroys all threads;
|
getProcessResult | public AsyncProcessResult getProcessResult(AsyncTicket ticketId)(Code) | | Retrieve the result of the process
Parameters: ticketId - the ticket id of the process java.lang.Object |
getProcessResult | public AsyncProcessResult getProcessResult(AsyncTicket ticketId, long waitTimeout)(Code) | | Retrieve the result of the process waiting up to a specified time for the
process to complete
Parameters: ticketId - the ticket ID Parameters: waitTimeout - the time in ms to wait for the process to complete beforereturning. AsyncProcessResult |
getQueue | LinkedList getQueue()(Code) | | Retrieve the queue. This function purposefully has package access.
java.util.LinkedList |
|
|
|