com.ibm.retail.AEF.client
Class AEFEventListenerProxy

java.lang.Object
  |
  +--java.rmi.server.RemoteObject
        |
        +--java.rmi.server.RemoteServer
              |
              +--java.rmi.server.UnicastRemoteObject
                    |
                    +--com.ibm.retail.AEF.util.AEFRemoteObject
                          |
                          +--com.ibm.retail.AEF.client.AEFEventListenerProxy
All Implemented Interfaces:
java.rmi.Remote, java.io.Serializable
Direct Known Subclasses:
AEFPropertyListenerProxyImpl, CashReceiptListenerProxy, CouponListenerProxy, CustomerListenerProxy, DiscountListenerProxy, GenericListenerProxy, ItemSalesListenerProxy, OperatorListenerProxy, OptionsListenerProxy, PointsListenerProxy, ReportListenerProxy, ScaleListenerProxy, SessionStatusListenerProxy, StateChangeListenerProxy, TenderListenerProxy, TransactionStatusListenerProxy, TransactionTotalsListenerProxy, WorkstationStatusListenerProxy

public class AEFEventListenerProxy
extends com.ibm.retail.AEF.util.AEFRemoteObject

The AEFEventListenerProxy class provides a base class for the client listener proxy objects used to monitor the events of an associated terminal session.

Remote proxy objects extend the appropriate RMI server classes which handle the RMI duties for the client (so the client does not need to deal with rmi server issues). The proxy objects also perform the role of event dispatching.

By default, the listener proxy object will perform event queuing on an AEF event thread. This relieves the client of any "thread swapping" responsibilities and insures that the AEF event dispatching performance is not affected by client processing. To override this default behavior, use the setDispatchQueue() method. The proxy utilizes the EventDispatcher for queueing event listener notification.

To further ensure that the AEF event dispatching thread is not blocked by non-responsive clients, proxies use a default RMI timeout value as specified in config.properties. This value may be overridden using a timeout value on the proxy constructor.

To use a proxy object, the client must implement the listener interface and get the POSDataProvider object from the AEFSession to monitor. The proxy object is then constructed passing a reference to the client and the data provider. The proxy object performs the listener registration and forwards all events from the data provider to the client.

See Also:
Sample Usage, EventDispatcher, Serialized Form

Field Summary
protected  java.lang.String dispatchQueueName
           
static int SOCKET_CONNECT_TIMEOUT
           
static int SOCKET_READ_TIMEOUT
           
 
Fields inherited from class com.ibm.retail.AEF.util.AEFRemoteObject
DEFAULT_CONNECT_TIMEOUT, DEFAULT_READ_TIMEOUT
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Constructor Summary
AEFEventListenerProxy()
          Construct an AEFEventListenerProxy
AEFEventListenerProxy(int soTimeout, int connectTimeout)
          Construct an AEFEventListenerProxy.
 
Method Summary
(package private) static java.lang.String copyright()
           
 void dispatchEvent(java.lang.Object evt, java.lang.Object listener, java.lang.reflect.Method listenerMethod)
          Dispatch an event.
 java.lang.String getDispatchQueueName()
          Get the dispatch queue name
protected static java.lang.reflect.Method getListenerMethod(java.lang.Class eventClass, java.lang.Class listenerClass, java.lang.String methodName)
          Determine a listener method
 void setDispatchQueueName(java.lang.String queue)
          Set the dispatch queue name.
 
Methods inherited from class com.ibm.retail.AEF.util.AEFRemoteObject
getClientSocketConnectTimeout, getClientSocketReadTimeout
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

SOCKET_READ_TIMEOUT

public static int SOCKET_READ_TIMEOUT

SOCKET_CONNECT_TIMEOUT

public static int SOCKET_CONNECT_TIMEOUT

dispatchQueueName

protected java.lang.String dispatchQueueName
Constructor Detail

AEFEventListenerProxy

public AEFEventListenerProxy()
                      throws java.rmi.RemoteException
Construct an AEFEventListenerProxy


AEFEventListenerProxy

public AEFEventListenerProxy(int soTimeout,
                             int connectTimeout)
                      throws java.rmi.RemoteException
Construct an AEFEventListenerProxy. This constructor overrides the default timeout value.

Method Detail

copyright

static java.lang.String copyright()

getDispatchQueueName

public java.lang.String getDispatchQueueName()
Get the dispatch queue name

Returns:
dispatch queue name
See Also:
AEF_QUEUE, AWT_QUEUE, NO_QUEUE

setDispatchQueueName

public void setDispatchQueueName(java.lang.String queue)
Set the dispatch queue name. Defaults to the AEF_QUEUE.

Parameters:
queue - the dispatch queue name identifier
See Also:
AEF_QUEUE, AWT_QUEUE, NO_QUEUE

dispatchEvent

public void dispatchEvent(java.lang.Object evt,
                          java.lang.Object listener,
                          java.lang.reflect.Method listenerMethod)
Dispatch an event.

Parameters:
evt - the event object to be dispatched
listener - the listener object to receive the event
listenerMethod - the listener method to be invoked for notification

getListenerMethod

protected static java.lang.reflect.Method getListenerMethod(java.lang.Class eventClass,
                                                            java.lang.Class listenerClass,
                                                            java.lang.String methodName)
Determine a listener method

Parameters:
eventClass - the event class
listenerClass - the listener class
methodName - the listener method name
Returns:
the method for listener notification


Copyright © 2004 IBM. All Rights Reserved.
Generated: July 19 2004