org.fosstrak.llrp.adaptor
Class AdaptorCallback

java.lang.Object
  extended by java.rmi.server.RemoteObject
      extended by java.rmi.server.RemoteServer
          extended by java.rmi.server.UnicastRemoteObject
              extended by org.fosstrak.llrp.adaptor.AdaptorCallback
All Implemented Interfaces:
java.io.Serializable, java.rmi.Remote, AsynchronousNotifiable

public class AdaptorCallback
extends java.rmi.server.UnicastRemoteObject
implements AsynchronousNotifiable

creates a callback instance that retrieves asynchronous messages.

Author:
sawielan
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Constructor Summary
AdaptorCallback(boolean remote)
          creates a callback instance that retrieves asynchronous messages.
 
Method Summary
 void notify(byte[] message, java.lang.String readerName)
          when an asynchronous message arrived, this method will be invoked.
 void notifyError(LLRPRuntimeException e, java.lang.String readerName)
          this method can be called asynchronously when there occurs an asynchronous error or exception.
 void setWorker(AdaptorWorker worker)
          sets the worker that holds this callback.
 
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
 

Constructor Detail

AdaptorCallback

public AdaptorCallback(boolean remote)
                throws java.rmi.RemoteException
creates a callback instance that retrieves asynchronous messages.

Parameters:
remote - true if run remotely.
Throws:
java.rmi.RemoteException - when there is an rmi exception.
Method Detail

notify

public void notify(byte[] message,
                   java.lang.String readerName)
            throws java.rmi.RemoteException
Description copied from interface: AsynchronousNotifiable
when an asynchronous message arrived, this method will be invoked.

Specified by:
notify in interface AsynchronousNotifiable
Parameters:
message - the LLRPMessage arrived asynchronously.
readerName - the nam eof the reader that read the message.
Throws:
java.rmi.RemoteException - when there has been an error in the communication.

setWorker

public void setWorker(AdaptorWorker worker)
sets the worker that holds this callback.

Parameters:
worker - the worker that holds this callback.

notifyError

public void notifyError(LLRPRuntimeException e,
                        java.lang.String readerName)
                 throws java.rmi.RemoteException
Description copied from interface: AsynchronousNotifiable
this method can be called asynchronously when there occurs an asynchronous error or exception.

Specified by:
notifyError in interface AsynchronousNotifiable
Parameters:
e - the exception that was triggered.
readerName - the name of the reader that triggered the error.
Throws:
java.rmi.RemoteException - when there has been an error in the communication.


Copyright © 2009. All Rights Reserved.