|
BEA Systems, Inc. | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.connecterra.util.event.AbstractEventProcessor
com.connecterra.ale.reader.AbstractPhysicalDevice
public abstract class AbstractPhysicalDevice
This is the base class for the device driver framework. All device
driver implementations must extend this class or one of its derived
classes. See the Device Framework and Development
Kit
document for a basic tutorial on writing a device driver using
the framework.
Implementations which extend this class must implement or override
the AbstractPhysicalDevice.initialize(PluginConfig)
, AbstractPhysicalDevice.initializeSession(Requests)
, AbstractPhysicalDevice.updateRequests(com.connecterra.ale.reader.AbstractPhysicalDevice.Requests, com.connecterra.ale.reader.AbstractPhysicalDevice.Requests)
, and AbstractPhysicalDevice.sendStatusRequest()
methods. The implementation must also provide
a public static
method. This method is used by the framework to prompt the user
for appropriate configuration for the driver before it is
instantiated.
PluginMeta
getPluginMeta()
This class extends AbstractEventProcessor
. The event
mechanism is the primary means of synchronization for device
drivers, and is used by the channel framework. The
AbstractEventProcessor always has an AlarmClock, so AbstractEventProcessor.doLater(long, com.connecterra.util.event.Event)
can always be used when delayed
processing is required.
Nested Class Summary | |
---|---|
static interface |
AbstractPhysicalDevice.AFIReadingTagProcessor
A AbstractPhysicalDevice.TagProcessor should implement this interface if the device provides special
support for efficiently reading the AFI value of a tag that has already been
inventoried. |
static interface |
AbstractPhysicalDevice.BankReadTagProcessor
TagProcessors should implement this
interface if the device can read data from memory banks on the
associated tag. |
static interface |
AbstractPhysicalDevice.BankTagProcessor
A convenience interface that combines AbstractPhysicalDevice.BankReadTagProcessor
and AbstractPhysicalDevice.BankWriteTagProcessor |
static interface |
AbstractPhysicalDevice.BankWriteTagProcessor
TagProcessors should implement this interface if the device can write data
to memory banks on the associated tag. |
static interface |
AbstractPhysicalDevice.EPCglobalClass1Gen2TagProcessor
TagProcessors should implement this
interface if the device supports full EPCglobal Class 1 Gen 2
tag functionality. |
static interface |
AbstractPhysicalDevice.EPCglobalTagProcessor
A convenience interface that combines AbstractPhysicalDevice.EPCglobalTagReadProcessor and AbstractPhysicalDevice.EPCglobalTagWriteProcessor |
static interface |
AbstractPhysicalDevice.EPCglobalTagReadProcessor
TagProcessors should implement this
interface if the object in question is identified by an EPC or
otherwise contains an EPC value. |
static interface |
AbstractPhysicalDevice.EPCglobalTagWriteProcessor
TagProcessors should implement this
interface if the device has the capability of modifying the
associated tag's EPC value. |
static class |
AbstractPhysicalDevice.EPCTagData
Base class for TagProcessors that are associated with a DeviceUnit, and which contain DeviceTagReports that always store EPC data as the tag identity. |
protected class |
AbstractPhysicalDevice.Requests
Represents all of the subscribed DeviceUnitRequests on a device, and all the tags which have
been reported for any of those DeviceUnitRequests. |
static class |
AbstractPhysicalDevice.TagData
Base class for TagProcessors that are associated with a DeviceUnit |
static class |
AbstractPhysicalDevice.TagProcessor
The base class of objects which can be passed to AbstractPhysicalDevice.processOpSpecs(com.connecterra.ale.reader.AbstractPhysicalDevice.TagProcessor, java.util.List) . |
static class |
AbstractPhysicalDevice.TagResultException
This exception should be thrown from a TagProcessor exception with an appropriate OpStatus, and failure info String if the OpStatus is not OK. |
Nested classes/interfaces inherited from class com.connecterra.util.event.AbstractEventProcessor |
---|
AbstractEventProcessor.PeriodicEventHandle |
Field Summary | |
---|---|
protected ChannelManager |
m_channelManager
|
Constructor Summary | |
---|---|
AbstractPhysicalDevice()
Creates a new AbstractPhysicalDevice instance. |
Method Summary | |
---|---|
static void |
addAFIParametersToPluginMeta(DynamicConfigFactory factory,
PluginMeta pm)
Adds the "Read Tag
AFI" and "Forced AFI
value" parameters to the PluginMeta. |
protected void |
addDeviceChannel(DeviceChannel chan)
Add a new DeviceChannel to the device. |
void |
addDeviceUnit(DeviceUnit ant)
Add a new DeviceUnit to the physical device. |
static void |
addForceAFIParameterToPluginMeta(DynamicConfigFactory factory,
PluginMeta pm)
Adds the "Forced AFI value" parameter to the PluginMeta. |
static void |
addReadAFIParameterToPluginMeta(DynamicConfigFactory factory,
PluginMeta pm)
Adds the "Read Tag AFI" parameter to the PluginMeta. |
void |
addReaderThread(Thread t)
Inform the framework about a thread created by the device driver. |
void |
addTagData(AbstractPhysicalDevice.TagData td)
|
static void |
addToPluginMeta(DynamicConfigFactory factory,
PluginMeta pm)
Adds appropriate PluginParameterMeta objects to the PluginMeta as needed by the framework. |
ChannelManager.State |
getChannelState()
|
DeviceUnit |
getDeviceUnit(int num)
Returns the DeviceUnit with the given number. |
int |
getForcedAFIValue()
|
Logger |
getLogger()
This logger is used to inform the user of manager state transitions and other relevant information from each of the channels. |
Set |
getLogicalReaderSet()
|
String |
getPhysicalDeviceName()
|
void |
initialize(PluginConfig config)
|
protected void |
initializeSession()
|
protected void |
initializeSession(AbstractPhysicalDevice.Requests curReqs)
|
boolean |
isForceAFI()
|
boolean |
isReadAFI()
|
protected List |
processOpSpecs(AbstractPhysicalDevice.TagProcessor tp,
List opSpecs)
Execute the opSpecs on a single TagProcessor. |
void |
removeReaderThread(Thread t)
Inform the framework about a thread which is no longer running, so that cleanup is no logner needed. |
void |
report(DeviceUnit deviceUnit,
boolean cycleComplete)
|
protected void |
sendStatusRequest()
This driver method is used to verify communications with the device. |
void |
setDeviceAttributes(String manufacturer,
String model,
DeviceCapabilities capabilities)
Set the telemetry attributes for device manufacturer name and model. |
void |
shutdown()
Initiate whatever process is necessary to do an orderly shutdown of the subsystem. |
void |
terminate()
Initiate whatever process is necessary to forcibly shut down the subsystem. |
String |
toString()
The ChannelManager uses the toString() method to get a printable name which is used in log messages issued when the channel changes state. |
protected void |
updateRequests(AbstractPhysicalDevice.Requests prevReqs,
AbstractPhysicalDevice.Requests curReqs)
|
void |
waitForShutdown(long timeout)
Wait for the shutdown process initiated by Controllable.shutdown() to
complete. |
void |
waitForTermination(long timeout)
Wait for the termination process initiated by Controllable.terminate() to complete. |
Methods inherited from class com.connecterra.util.event.AbstractEventProcessor |
---|
doASAP, doASAPOrBlock, doASAPOrDrop, doASAPOrThrow, doLater, doPeriodic, getEventReceiver |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.connecterra.util.plugin.Plugin |
---|
initialize |
Methods inherited from interface com.bea.rfid.edge.api.telemetry.Telemetered |
---|
getDeviceAttributes, getDeviceType, getTelemetryAssociatedIdentity, telemeter |
Methods inherited from interface com.connecterra.ale.reader.ChannelManager.Proxy |
---|
initialize, listenerExecute |
Methods inherited from interface com.connecterra.util.event.EventProcessor |
---|
handleEvent |
Field Detail |
---|
protected ChannelManager m_channelManager
Constructor Detail |
---|
public AbstractPhysicalDevice()
AbstractPhysicalDevice
instance.
Method Detail |
---|
public static void addToPluginMeta(DynamicConfigFactory factory, PluginMeta pm)
Currently this adds no parameters, but this could change in the future.
factory
- a DynamicConfigFactory
valuepm
- a PluginMeta
valuepublic static void addReadAFIParameterToPluginMeta(DynamicConfigFactory factory, PluginMeta pm)
factory
- a DynamicConfigFactory
valuepm
- a PluginMeta
valuepublic static void addForceAFIParameterToPluginMeta(DynamicConfigFactory factory, PluginMeta pm)
factory
- a DynamicConfigFactory
valuepm
- a PluginMeta
valuepublic static void addAFIParametersToPluginMeta(DynamicConfigFactory factory, PluginMeta pm)
"Read Tag
AFI"
and "Forced AFI
value"
parameters to the PluginMeta.
factory
- a DynamicConfigFactory
valuepm
- a PluginMeta
valuepublic String toString()
ChannelManager.Proxy
toString
in interface ChannelManager.Proxy
toString
in class Object
public String getPhysicalDeviceName()
getPhysicalDeviceName
in interface PhysicalDevice
public Set getLogicalReaderSet()
Set of LogicalReaders
associated with the physical reader
public void initialize(PluginConfig config) throws com.connecterra.ale.reader.DeviceConfigurationException, com.connecterra.ale.resources.PluginLoadException
com.connecterra.ale.reader.DeviceConfigurationException
com.connecterra.ale.resources.PluginLoadException
public boolean isReadAFI()
public boolean isForceAFI()
public int getForcedAFIValue()
public void setDeviceAttributes(String manufacturer, String model, DeviceCapabilities capabilities)
manufacturer
- a String
valuemodel
- a String
valuecapabilities
- a DeviceCapabilities
valueprotected void addDeviceChannel(DeviceChannel chan)
AbstractPhysicalDevice.initialize(PluginConfig)
method, based on
configuration.
chan
- a DeviceChannel
valueprotected void initializeSession() throws IOException
IOException
public void addDeviceUnit(DeviceUnit ant)
AbstractPhysicalDevice.initialize(PluginConfig)
for each DeviceUnit
named in the configuration.
ant
- a DeviceUnit
valuepublic DeviceUnit getDeviceUnit(int num)
num
- the device unit number
DeviceUnit
valuepublic Logger getLogger()
ChannelManager.Proxy
getLogger
in interface ChannelManager.Proxy
Logger
value which should be used for
all logs pertaining to this device.protected void initializeSession(AbstractPhysicalDevice.Requests curReqs) throws IOException
IOException
protected void updateRequests(AbstractPhysicalDevice.Requests prevReqs, AbstractPhysicalDevice.Requests curReqs) throws IOException
IOException
public void addTagData(AbstractPhysicalDevice.TagData td)
public void report(DeviceUnit deviceUnit, boolean cycleComplete)
protected void sendStatusRequest() throws IOException
ByteStreamDeviceChannel.getInputStream()
), or let an
asynchronous listener read the response when it arrives.
IOException
- if an error occursprotected List processOpSpecs(AbstractPhysicalDevice.TagProcessor tp, List opSpecs) throws IOException
tp
- TagProcessor the tag to operate on, and how to do itopSpecs
- List of DeviceOpSpec describing what to do to the tag
IOException
public void addReaderThread(Thread t)
t
- a Thread
valuepublic void removeReaderThread(Thread t)
t
- a Thread
valuepublic void shutdown()
Controllable
This method should not block for a long time, so that multiple systems can be shut down in parallel.
shutdown
in interface Controllable
shutdown
in class AbstractEventProcessor
public void waitForShutdown(long timeout) throws InterruptedException
Controllable
Controllable.shutdown()
to
complete.
waitForShutdown
in interface Controllable
timeout
- If the timeout elapses before the shutdown process
has completed, return anyway.
InterruptedException
public void terminate()
Controllable
This method should not block for a long time, so that multiple systems can be shut down in parallel.
terminate
in interface Controllable
public void waitForTermination(long timeout) throws InterruptedException
Controllable
Controllable.terminate()
to complete.
waitForTermination
in interface Controllable
timeout
- If the timeout elapses before the shutdown process
has completed, return anyway.
InterruptedException
public ChannelManager.State getChannelState()
ChannelManager
|
Documentation is available at ${DOCSWEBROOT} Copyright 2007 BEA Systems Inc. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |