ABLE 2.0.0 07/02/2003 10:25:01

com.ibm.able
Interface AbleEventQueueManager

All Superinterfaces:
java.io.Serializable
All Known Subinterfaces:
AbleAgent, AbleBean, AbleDataSink, AbleDataSource

public interface AbleEventQueueManager
extends java.io.Serializable

The AbleEventQueueManager interface provides methods to manage a thread for asynchronously processing events placed on an event quene and for managing timer events.

If asynchronous events are enabled and the asynchronous thread of control is started, the bean will awaken whenever an asynchronous event is placed on the bean's internal event queue and call AbleEventQueueProcessor.processAbleEvent(com.ibm.able.AbleEvent).

If processing timer events is enabled and the asynchronous thread of control is started, the bean will awaken at periodic intervals as specified in the "sleep time" variable, and call AbleEventQueueProcessor.processTimerEvent().


Method Summary
 void flushAbleEventQueue()
          Removes all events from the event queue.
 int getAbleEventProcessingEnabled()
          Returns the state of asynchronous ABLE event processing.
 int getAbleEventQueueSize()
          Returns the number of events on the event queue.
 long getSleepTime()
          Returns the current sleep time setting.
 boolean isAbleEventPostingEnabled()
          Indicates whether asynchronous ABLE event posting is enabled or disabled.
 boolean isAbleEventProcessingEnabled()
          Indicates whether asynchronous ABLE event processing is enabled or disabled.
 boolean isTimerEventProcessingEnabled()
          Indicates if automatic periodic processing is enabled or disabled.
 void quitEnabledEventProcessing()
          Stop the bean's asynchronous thread of control.
 void restartEnabledEventProcessing()
          Restart the bean's asynchronous thread of control after the bean has moved from one system to another.
 void resumeEnabledEventProcessing()
          Resume the bean's suspended asynchronous thread of control.
 void setAbleEventProcessingEnabled(int theEnabledFlag)
          Sets whether asynchronous ABLE event processing is enabled or disabled.
 void setSleepTime(long theSleepTime)
          Sets the sleep time interval for the asynchronous timed processing loop.
 void setTimerEventProcessingEnabled(boolean theEnabledFlag)
          Specify whether automatic periodic processing is enabled or disabled.
 void startEnabledEventProcessing()
          Start the bean's asynchronous thread of control.
 void suspendEnabledEventProcessing()
          Temporarily suspend the bean's asynchronous thread of control.
 

Method Detail

setSleepTime

public void setSleepTime(long theSleepTime)
Sets the sleep time interval for the asynchronous timed processing loop.
Parameters:
theSleepTime - The number of milliseconds for which the process is to sleep before it awakes and calls AbleEventQueueProcessor.processTimerEvent().

getSleepTime

public long getSleepTime()
Returns the current sleep time setting.
Returns:
The current sleep time setting in milliseconds.

setTimerEventProcessingEnabled

public void setTimerEventProcessingEnabled(boolean theEnabledFlag)
Specify whether automatic periodic processing is enabled or disabled. When enabled and the asynchronous thread of control is started, the bean will awaken at periodic intervals as specified by sleepTime, and call the processTimerEvent() method.
Parameters:
theEnabledFlag - Specify true if the bean is to awaken every N milliseconds and call AbleEventQueueProcessor.processTimerEvent(); specify false if no automatic periodic processing is to take place while the asynchronous thread of control is running.

isTimerEventProcessingEnabled

public boolean isTimerEventProcessingEnabled()
Indicates if automatic periodic processing is enabled or disabled.
Returns:
true if the bean will awaken every N milliseconds; false otherwise.

setAbleEventProcessingEnabled

public void setAbleEventProcessingEnabled(int theEnabledFlag)
                                   throws java.lang.IllegalArgumentException
Sets whether asynchronous ABLE event processing is enabled or disabled. This method can be used before the asynchronous thread of control is started in order to set the bean's initial behavior; the method can also be used while the thread is running to start and stop the behavior.
Parameters:
theEnabledFlag - Specify one of the following values:
  • Able.ProcessingEnabled_PostingEnabled
  • Able.ProcessingEnabled_PostingDisabled
  • Able.ProcessingDisabled_PostingEnabled
  • Able.ProcessingDisabled_PostingDisabled
    Throws:
    java.lang.IllegalArgumentException - If the parameter is not a valid value.

  • getAbleEventProcessingEnabled

    public int getAbleEventProcessingEnabled()
    Returns the state of asynchronous ABLE event processing.
    Returns:
    The event processing state, one of the following values:
  • Able.ProcessingEnabled_PostingEnabled
  • Able.ProcessingEnabled_PostingDisabled
  • Able.ProcessingDisabled_PostingEnabled
  • Able.ProcessingDisabled_PostingDisabled

  • isAbleEventPostingEnabled

    public boolean isAbleEventPostingEnabled()
    Indicates whether asynchronous ABLE event posting is enabled or disabled.
    Returns:
    true if Able events are permitted to be placed on the event queue; false otherwise.

    isAbleEventProcessingEnabled

    public boolean isAbleEventProcessingEnabled()
    Indicates whether asynchronous ABLE event processing is enabled or disabled.
    Returns:
    true if Able events are permitted to be taken from the event queue and processed; false otherwise.

    flushAbleEventQueue

    public void flushAbleEventQueue()
    Removes all events from the event queue.

    Note that unless event Posting is disabled before clearing the event queue, new events may arrive on the queue as soon as it has been cleared!


    getAbleEventQueueSize

    public int getAbleEventQueueSize()
    Returns the number of events on the event queue.

    Note that unless both event Posting and event Processing are disabled, the number may be invalid as soon as it is returned.

    Returns:
    The number of events on the queue.

    startEnabledEventProcessing

    public void startEnabledEventProcessing()
    Start the bean's asynchronous thread of control.

    In this thread, the bean can perform one, both, or none of these actions, depending on what is enabled:

    If either is enabled, the thread begins running, and the bean's state changes to AbleState.Waiting
    See Also:
    setTimerEventProcessingEnabled(boolean), setAbleEventProcessingEnabled(int), quitEnabledEventProcessing()

    quitEnabledEventProcessing

    public void quitEnabledEventProcessing()
                                    throws AbleException
    Stop the bean's asynchronous thread of control. The bean's state changes to AbleState.Unknown.

    Timer event processing and ABLE event processing cease, but if event Posting is still enabled, events may still be placed on the internal event queue by other processes.

    Throws:
    AbleException - If an error occurs.
    See Also:
    startEnabledEventProcessing(), setAbleEventProcessingEnabled(int)

    suspendEnabledEventProcessing

    public void suspendEnabledEventProcessing()
                                       throws AbleException
    Temporarily suspend the bean's asynchronous thread of control. The bean's state changes to AbleState.Unknown.

    Timer event processing and ABLE event processing cease, but if event Posting is still enabled, events may still be placed on the internal event queue by other processes.

    Throws:
    AbleException - If an error occurs.
    See Also:
    resumeEnabledEventProcessing(), setAbleEventProcessingEnabled(int)

    resumeEnabledEventProcessing

    public void resumeEnabledEventProcessing()
                                      throws AbleException
    Resume the bean's suspended asynchronous thread of control. The bean's state changes to AbleState.Waiting.

    Timer event processing and ABLE event processing resume if these actions are enabled.

    Throws:
    AbleException - If an error occurs.
    See Also:
    suspendEnabledEventProcessing(), setAbleEventProcessingEnabled(int), setTimerEventProcessingEnabled(boolean)

    restartEnabledEventProcessing

    public void restartEnabledEventProcessing()
                                       throws AbleException
    Restart the bean's asynchronous thread of control after the bean has moved from one system to another. The bean's state changes to AbleState.Waiting.

    Timer event processing and ABLE event processing resume if these actions are enabled.

    Throws:
    AbleException - If an error occurs.
    See Also:
    setAbleEventProcessingEnabled(int), setTimerEventProcessingEnabled(boolean)

    ABLE 2.0.0 07/02/2003 10:25:01

    (C) Copyright IBM Corporation 1999, 2003