org.fosstrak.ale.server.readers.llrp
Class LLRPManager

java.lang.Object
  extended by org.fosstrak.ale.server.readers.llrp.LLRPManager
All Implemented Interfaces:
org.fosstrak.llrp.client.LLRPExceptionHandler, org.fosstrak.llrp.client.MessageHandler

public class LLRPManager
extends java.lang.Object
implements org.fosstrak.llrp.client.LLRPExceptionHandler, org.fosstrak.llrp.client.MessageHandler

the LLRPManager is a singleton providing access to the llrp-client-adaptor. the manager starts an instance of the llrp-client-adaptor and tries to register this adaptor into rmi. the adaptor is run on a thread to allow the application to proceed. if there occurs an error that does not allow the manager to proceed the error condition is signaled by the static error flag.

Author:
sawielan

Field Summary
static java.lang.String ADAPTOR_NAME_PREFIX
           
static java.lang.String CONFIGURATION_FILE
          the path to the configuration file.
static java.lang.String PROP_MGMT_CFG
          the name of the property of the adapter management configuration file.
 
Method Summary
 void decReferenceCount(java.lang.String readerName)
          decrements the link counter of the reader. the link counter is needed as several logical readers from fc can point to the same physical reader in the reader module. if no logical reader of the fc points to the physical reader, this reader is considered to be used no more therefore if counter is zero the reader gets undefined.
 org.fosstrak.llrp.adaptor.Adaptor getAdaptor()
          return a reference to the llrp gui client adaptor management.
static LLRPManager getInstance()
          create the singleton instance of the LLRPManager.
 void handle(java.lang.String adaptorName, java.lang.String readerName, org.llrp.ltk.types.LLRPMessage message)
           
 void incReference(java.lang.String readerName)
          increments the link counter on a reader. the link counter is needed as several logical readers from fc can point to the same physical reader in the reader module.
static boolean isErroneous()
           
 void postExceptionToGUI(org.fosstrak.llrp.client.LLRPExceptionHandlerTypeMap eTypeMap, org.fosstrak.llrp.adaptor.exception.LLRPRuntimeException e, java.lang.String adaptorName, java.lang.String readerName)
          receives an asynchronous exception and posts this one.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONFIGURATION_FILE

public static final java.lang.String CONFIGURATION_FILE
the path to the configuration file.

See Also:
Constant Field Values

PROP_MGMT_CFG

public static final java.lang.String PROP_MGMT_CFG
the name of the property of the adapter management configuration file.

See Also:
Constant Field Values

ADAPTOR_NAME_PREFIX

public static final java.lang.String ADAPTOR_NAME_PREFIX
See Also:
Constant Field Values
Method Detail

getAdaptor

public org.fosstrak.llrp.adaptor.Adaptor getAdaptor()
return a reference to the llrp gui client adaptor management.

Returns:
an instance of the llrp gui client adaptor management.

incReference

public void incReference(java.lang.String readerName)
increments the link counter on a reader. the link counter is needed as several logical readers from fc can point to the same physical reader in the reader module.

Parameters:
readerName - the name of the reader.

decReferenceCount

public void decReferenceCount(java.lang.String readerName)
                       throws java.rmi.RemoteException,
                              org.fosstrak.llrp.adaptor.exception.LLRPRuntimeException
decrements the link counter of the reader. the link counter is needed as several logical readers from fc can point to the same physical reader in the reader module. if no logical reader of the fc points to the physical reader, this reader is considered to be used no more therefore if counter is zero the reader gets undefined.

Parameters:
readerName - the name of the reader.
Throws:
org.fosstrak.llrp.adaptor.exception.LLRPRuntimeException - when there is an exception in the reader module.
java.rmi.RemoteException - when there is an rmi exception.

isErroneous

public static boolean isErroneous()
Returns:
true if the manager was not started correctly or crashed.

getInstance

public static LLRPManager getInstance()
create the singleton instance of the LLRPManager.

Returns:
an instance of the singleton LLRPManager.
Throws:
org.fosstrak.ale.wsdl.ale.epcglobal.ImplementationExceptionResponse

postExceptionToGUI

public void postExceptionToGUI(org.fosstrak.llrp.client.LLRPExceptionHandlerTypeMap eTypeMap,
                               org.fosstrak.llrp.adaptor.exception.LLRPRuntimeException e,
                               java.lang.String adaptorName,
                               java.lang.String readerName)
receives an asynchronous exception and posts this one. (comes from ExceptionHandler).

Specified by:
postExceptionToGUI in interface org.fosstrak.llrp.client.LLRPExceptionHandler

handle

public void handle(java.lang.String adaptorName,
                   java.lang.String readerName,
                   org.llrp.ltk.types.LLRPMessage message)
Specified by:
handle in interface org.fosstrak.llrp.client.MessageHandler


Copyright © 2009. All Rights Reserved.