ABLE, Version 1.1b

com.ibm.able.platform.agents
Class PlatformAgentProxyEventHandler

java.lang.Object
  |
  +--com.ibm.able.platform.agents.PlatformAgentProxyEventHandler

public class PlatformAgentProxyEventHandler
extends java.lang.Object
implements AbleEventListener, AbleEventQueueProcessor, java.io.Serializable

This class defines a listener and processor of remote events. An instance of this object can serve as a proxy between a remote generator of events and some other event listener/processor object that can't or doesn't want to make itself visible across a remote interface.

This object simply receives all remote events and immediately forwards them on to the specified (presumably local and ultimate) listener/processor object.

Version:
$Revision: 1.1 $, $Date: 2000/02/08 15:13:58 $
See Also:
Serialized Form

Constructor Summary
PlatformAgentProxyEventHandler(java.lang.Object theSpecifiedHandler)
          Create a new event handler.
 
Method Summary
static java.lang.String Copyright()
          Determine the copyright of this class.
 com.ibm.logging.Logger getLogger()
          Retrieve a logger object from the event queue's container.
 void handleAbleEvent(AbleEvent theAbleEvent)
          Handle an Able event.
 void processAbleEvent(AbleEvent theAbleEvent)
          Process an Able event synchronously; that is, on the same thread as the caller.
 void processNoEventProcessingEnabledSituation()
          Process the situation where neither timer nor Able event processing is enabled in the event queue, but the event queue's asynchronous thread of control has been started.
 void processTimerEvent()
          Process a timer expiration event synchronously; that is, on the same thread as the caller.
 void setState(int theState)
          Set the state of the event queue's container.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PlatformAgentProxyEventHandler

public PlatformAgentProxyEventHandler(java.lang.Object theSpecifiedHandler)
                               throws java.rmi.RemoteException
Create a new event handler.
Parameters:
theSpecifiedHandler - Any object that wants to listen for or process events. Any events caught by this listener are forwarded to the specified handler, which must implement both the AbleEventListener and AbleEventProcessor interfaces.

Throws:
java.rmi.RemoteException - On any error.
Method Detail

handleAbleEvent

public void handleAbleEvent(AbleEvent theAbleEvent)
                     throws java.rmi.RemoteException
Handle an Able event.

This method should be called by all Able event source objects in order to hand off an event to the object implementing this interface. Most implementations will check to see if the event should be processed synchronously (on the same thread as the caller) or asynchronously (on a separate thread).

In this implementation, the event is simply forwarded on to another Able event listener.

Specified by:
handleAbleEvent in interface AbleEventListener
Parameters:
theAbleEvent - The event to handle.

Throws:
java.rmi.RemoteException - On any error.

processAbleEvent

public void processAbleEvent(AbleEvent theAbleEvent)
                      throws java.rmi.RemoteException
Process an Able event synchronously; that is, on the same thread as the caller.

This method is called by an AbleEventQueue when the queue gets around to processing an asynchronous event. Note that this method also can be called directly from the handleAbleEvent() method described in the AbleEventListener interface when that method is given a synchronous event to handle.

Specified by:
processAbleEvent in interface AbleEventQueueProcessor
Parameters:
theAbleEvent - The event to process.


processTimerEvent

public void processTimerEvent()
                       throws java.rmi.RemoteException
Process a timer expiration event synchronously; that is, on the same thread as the caller.

This method is called by an AbleEventQueue when the queue's sleep timer goes off.

Specified by:
processTimerEvent in interface AbleEventQueueProcessor

processNoEventProcessingEnabledSituation

public void processNoEventProcessingEnabledSituation()
                                              throws java.rmi.RemoteException
Process the situation where neither timer nor Able event processing is enabled in the event queue, but the event queue's asynchronous thread of control has been started.

This method is called by an AbleEventQueue when the queue is neither enabled for timer processing nor Able event processing. When neither type of processing is enabled, the queue is in a tight processing loop, consuming CPU cycles. This method is called so that the event queue's container can do something about the situation or perform some other type of asynchronous processing.

Specified by:
processNoEventProcessingEnabledSituation in interface AbleEventQueueProcessor

setState

public void setState(int theState)
              throws java.rmi.RemoteException
Set the state of the event queue's container.

This method is called by an AbleEventQueue when the queue's run time loop changes state; for example, from Waiting to Active.

Specified by:
setState in interface AbleEventQueueProcessor
Parameters:
theState - An AbleState. value.


getLogger

public com.ibm.logging.Logger getLogger()
                                 throws java.rmi.RemoteException
Retrieve a logger object from the event queue's container.
Specified by:
getLogger in interface AbleEventQueueProcessor
Returns:
a Logger object; null is permitted to be returned.

Copyright

public static java.lang.String Copyright()
Determine the copyright of this class.
Returns:
A String containing this class's copyright statement.

ABLE, Version 1.1b

ABLE: Produced by Joe, Don, and Jeff who say, 'Thanks for your support.'