com.ibm.retail.AEF.client
Class ItemSalesListenerProxy

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
                                |
                                +--com.ibm.retail.AEF.client.ItemSalesListenerProxy
All Implemented Interfaces:
AEFListenerProxyInterface, ItemSalesListener, POSAppEventListener, java.rmi.Remote, java.io.Serializable

public class ItemSalesListenerProxy
extends AEFEventListenerProxy
implements AEFListenerProxyInterface, ItemSalesListener

ItemSalesListenerProxy provides a proxy object for remote listeners to monitor the Item events of its 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 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  com.ibm.retail.AEF.data.POSDataProvider dataProvider
           
protected static java.lang.reflect.Method itemAddedMethod
           
protected static java.lang.reflect.Method itemDepositAddedMethod
           
protected static java.lang.reflect.Method itemDepositRemovedMethod
           
protected static java.lang.reflect.Method itemRefundMethod
           
protected static java.lang.reflect.Method itemRemovedMethod
           
protected  com.ibm.retail.AEF.event.ItemSalesListener listener
           
 
Fields inherited from class com.ibm.retail.AEF.client.AEFEventListenerProxy
dispatchQueueName, SOCKET_CONNECT_TIMEOUT, 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
ItemSalesListenerProxy(com.ibm.retail.AEF.data.POSDataProvider dataProvider, com.ibm.retail.AEF.event.ItemSalesListener listener)
          Construct a ItemSalesListenerProxy.
 
Method Summary
(package private) static java.lang.String copyright()
           
 void itemAdded(com.ibm.retail.AEF.event.ItemSalesEvent evt)
          An item was added to the transaction.
 void itemDepositAdded(com.ibm.retail.AEF.event.ItemSalesEvent evt)
          A deposit was added to the transaction.
 void itemDepositRemoved(com.ibm.retail.AEF.event.ItemSalesEvent evt)
          An item deposit was removed from the transaction.
 void itemRefund(com.ibm.retail.AEF.event.ItemSalesEvent evt)
          An item refund was performed in this transaction.
 void itemRemoved(com.ibm.retail.AEF.event.ItemSalesEvent evt)
          An item was removed from the transaction.
 void removeListener()
          Remove the proxy listener from the POSDataProvider.
 
Methods inherited from class com.ibm.retail.AEF.client.AEFEventListenerProxy
dispatchEvent, getDispatchQueueName, getListenerMethod, setDispatchQueueName
 
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

itemAddedMethod

protected static java.lang.reflect.Method itemAddedMethod

itemRemovedMethod

protected static java.lang.reflect.Method itemRemovedMethod

itemDepositAddedMethod

protected static java.lang.reflect.Method itemDepositAddedMethod

itemDepositRemovedMethod

protected static java.lang.reflect.Method itemDepositRemovedMethod

itemRefundMethod

protected static java.lang.reflect.Method itemRefundMethod

dataProvider

protected com.ibm.retail.AEF.data.POSDataProvider dataProvider

listener

protected com.ibm.retail.AEF.event.ItemSalesListener listener
Constructor Detail

ItemSalesListenerProxy

public ItemSalesListenerProxy(com.ibm.retail.AEF.data.POSDataProvider dataProvider,
                              com.ibm.retail.AEF.event.ItemSalesListener listener)
                       throws java.rmi.RemoteException,
                              AEFException
Construct a ItemSalesListenerProxy. This method registers the proxy as a listener with the POSDataProvider and begins event notification to the proxy client listener.

Parameters:
dataProvider - instance of POSDataProvider which is the source of events
listener - client listener which receives the event notification via this proxy
Throws:
java.rmi.RemoteException
AEFException - Among the possible AEFException error codes are:
AEFConst.NO_LISTENER_SUPPORT
Method Detail

copyright

static java.lang.String copyright()

removeListener

public void removeListener()
                    throws java.rmi.RemoteException,
                           AEFException
Remove the proxy listener from the POSDataProvider. Ends notification of events.

Specified by:
removeListener in interface AEFListenerProxyInterface
Throws:
java.rmi.RemoteException
AEFException - Among the possible AEFException error codes are:
AEFConst.NO_LISTENER_SUPPORT

itemAdded

public void itemAdded(com.ibm.retail.AEF.event.ItemSalesEvent evt)
               throws java.rmi.RemoteException
An item was added to the transaction.

Specified by:
itemAdded in interface ItemSalesListener
Parameters:
evt - contains details of the item event
Throws:
java.rmi.RemoteException - if a listener can not be notified

itemRemoved

public void itemRemoved(com.ibm.retail.AEF.event.ItemSalesEvent evt)
                 throws java.rmi.RemoteException
An item was removed from the transaction.

Specified by:
itemRemoved in interface ItemSalesListener
Parameters:
evt - contains details of the item event
Throws:
java.rmi.RemoteException - if a listener can not be notified

itemDepositAdded

public void itemDepositAdded(com.ibm.retail.AEF.event.ItemSalesEvent evt)
                      throws java.rmi.RemoteException
A deposit was added to the transaction.

Specified by:
itemDepositAdded in interface ItemSalesListener
Parameters:
evt - contains details of the item event
Throws:
java.rmi.RemoteException - if a listener can not be notified

itemDepositRemoved

public void itemDepositRemoved(com.ibm.retail.AEF.event.ItemSalesEvent evt)
                        throws java.rmi.RemoteException
An item deposit was removed from the transaction.

Specified by:
itemDepositRemoved in interface ItemSalesListener
Parameters:
evt - contains details of the item event
Throws:
java.rmi.RemoteException - if a listener can not be notified

itemRefund

public void itemRefund(com.ibm.retail.AEF.event.ItemSalesEvent evt)
                throws java.rmi.RemoteException
An item refund was performed in this transaction.

Specified by:
itemRefund in interface ItemSalesListener
Parameters:
evt - contains details of the item event
Throws:
java.rmi.RemoteException - if a listener can not be notified


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