Expresso 5-5-0

com.jcorporate.expresso.services.asyncprocess
Interface AsyncProcessor

All Known Implementing Classes:
DefaultAsyncProcessor

public interface AsyncProcessor

The AsyncProcessor is the entity that actually does the processing of the AsyncProcess objects. As with all interfaces, the actual implementations may be different from one another. DefaultAsyncProcessor is the one that is provided with Expresso.

Version:
$Revision: 1.2 $ on $Date: 2003/10/01 01:18:37 $
Author:
Michael Rimov

Field Summary
static String SESSION_KEY
          If you only do one process at a time, you can use this as the key to store your ticket in the user's session.
 
Method Summary
 AsyncTicket addToQueue(AsyncProcess newProcess)
          Adds a process to the queue to get complete
 AsyncTicket addToQueue(AsyncProcess newProcess, long waitTimeout)
          Add an asynchronous process ot the queue
 void destroy()
          Called when the process is destroyed.
 AsyncProcessResult getProcessResult(AsyncTicket ticketId)
          Retrieve the result of the process
 AsyncProcessResult getProcessResult(AsyncTicket ticketId, long waitTimeout)
          Retrieve the result of the process waiting up to a specified time for the process to complete
 

Field Detail

SESSION_KEY

public static final String SESSION_KEY
If you only do one process at a time, you can use this as the key to store your ticket in the user's session.

See Also:
Constant Field Values
Method Detail

getProcessResult

public AsyncProcessResult getProcessResult(AsyncTicket ticketId)
Retrieve the result of the process

Parameters:
ticketId - the ticket id of the process
Returns:
java.lang.Object

getProcessResult

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
waitTimeout - the time in ms to wait for the process to complete before returning.
Returns:
AsyncProcessResult

addToQueue

public AsyncTicket addToQueue(AsyncProcess newProcess)
                       throws QueueFullException
Adds a process to the queue to get complete

Parameters:
newProcess - the process to complete
Returns:
integer - ticketID
Throws:
QueueFullException

addToQueue

public AsyncTicket addToQueue(AsyncProcess newProcess,
                              long waitTimeout)
                       throws QueueFullException
Add an asynchronous process ot the queue

Parameters:
newProcess - the process to add to the queue
Returns:
AsyncTicket object for use in reeming the process' status.
Throws:
QueueFullException - if there are too many jobs waiting.

destroy

public void destroy()
Called when the process is destroyed.


Expresso 5-5-0

Please see www.jcorporate.com for information about new Expresso releases.