Runtime components : Channels components : HTML Channel : Tasks : Handling the processor timeout event
  
Handling the processor timeout event
The application can handle the processor timeout. The class ProcessorExpirationCheckManager uses the JDK scheduler to check expiration. It does not depend on traditional UNICOM® Digital Transformation Toolkit (UDTT™) event.
The following are the APIs provided by ProcessorExpirationCheckManager:
public static void addCSProcessorInactivityListener(CSProcessorInactivityListener listener )
public static void startExpirationCheckTask( long timeBetweenChecksValue)
public static synchronized void stopThread()
When the application handles the processor timeout, it needs to implement CSProcessorInactivityListener, and add the listener to ProcessorExpirationCheckManager and set the interval to check timeout. When the application is stopped, UDTT StartServerSerlvet calls the stopThread() method to dispose the thread to avoid that the thread is out of the control of the WebContianer.
Following is the usage sample:
// start the task and add listener
ProcessorExpirationCheckManager.addCSProcessorInactivityListener(aCSProcessorInactivityListener);
ProcessorExpirationCheckManager.startExpirationCheckTask( timeBetweenCheck );

// stop the task in servlet destroy() method
ProcessorExpirationCheckManager.stopThread();
Go up to
Tasks