com.ibm.retail.AEF.client
Class KeyConsumerProxy

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.KeyConsumerProxy
All Implemented Interfaces:
KeyConsumer, KeyConsumerProxyInterface, java.rmi.Remote, java.io.Serializable

public class KeyConsumerProxy
extends com.ibm.retail.AEF.util.AEFRemoteObject
implements KeyConsumerProxyInterface, KeyConsumer

KeyConsumerProxy provides a proxy object for remote listeners/consumers of POS keyboard events.

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).

To use this proxy object, the client must implement the KeyConsumer interface and aqquire the Workstation object from the AEFSession to monitor. The proxy object is then constructed passing a reference to the client and the workstation. The proxy object provides the listener registration interface for the client and forwards all events from the workstation to the client.

NOTE: Since the KeyConsumer allows the client to consume events, this proxy does not use the event dispatching (thread swapping). All calls block between the AEF and the KeyConsumer client.

See Also:
Serialized Form

Field Summary
protected  com.ibm.retail.AEF.workstation.KeyConsumer consumer
           
static int SOCKET_CONNECT_TIMEOUT
           
static int SOCKET_READ_TIMEOUT
           
protected  com.ibm.retail.AEF.workstation.Workstation workstation
           
 
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
KeyConsumerProxy(com.ibm.retail.AEF.workstation.Workstation workstation, com.ibm.retail.AEF.workstation.KeyConsumer consumer)
          Construct a KeyConsumerProxy.
 
Method Summary
(package private) static java.lang.String copyright()
           
 boolean keyPress(com.ibm.retail.AEF.workstation.KeyCode key)
          A function or data key has been pressed.
 void removeConsumer()
          Remove the proxy listener from the Workstation.
 
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

workstation

protected com.ibm.retail.AEF.workstation.Workstation workstation

consumer

protected com.ibm.retail.AEF.workstation.KeyConsumer consumer
Constructor Detail

KeyConsumerProxy

public KeyConsumerProxy(com.ibm.retail.AEF.workstation.Workstation workstation,
                        com.ibm.retail.AEF.workstation.KeyConsumer consumer)
                 throws java.rmi.RemoteException,
                        AEFException
Construct a KeyConsumerProxy. This method registers the proxy as a listener with the Workstation and begins event notification to the proxy client listener.

Parameters:
workstation - instance of Workstation which is the source of key events
Throws:
java.rmi.RemoteException
AEFException - Among the possible AEFException error codes are:
AEFConst.NO_LISTENER_SUPPORT
Method Detail

copyright

static java.lang.String copyright()

removeConsumer

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

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

keyPress

public boolean keyPress(com.ibm.retail.AEF.workstation.KeyCode key)
                 throws java.rmi.RemoteException
A function or data key has been pressed.

Specified by:
keyPress in interface KeyConsumerProxyInterface
Parameters:
key - the KeyCode object contains information about the key press
java.rmi.RemoteException


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