public abstract class AbstractSensor<T extends SensorSession> extends RifidiService implements SensorUpdate, CompositeSensor
Constructor and Description |
---|
AbstractSensor()
This constructor is only for CGLIB.
|
Modifier and Type | Method and Description |
---|---|
void |
addReceiver(Sensor receiver)
Add a sensor to the list of sensors that receive sensor reads from this
sensor.
|
abstract void |
applyPropertyChanges()
Send properties that have been modified to the physical reader
|
abstract java.lang.String |
createSensorSession()
Create a new sensor session.
|
abstract java.lang.String |
createSensorSession(SessionDTO sessionDTO)
This method is called when a sensor session is being created from a DTO,
such as restoring the session from persistance.
|
abstract void |
destroySensorSession(java.lang.String id)
Destroy a sesnor session.
|
java.util.Set<java.lang.String> |
getChildren()
Get the names of child sensors this sensor has.
|
ReaderDTO |
getDTO(Configuration config)
This method returns the Data Transfer Object for this Reader
|
java.lang.String |
getName()
Get the name of the sensor.
|
abstract java.util.Map<java.lang.String,SensorSession> |
getSensorSessions()
Get all currently created reader sessions.
|
java.lang.Boolean |
isImmutable()
Check if the sensor is immutable.
|
java.lang.Boolean |
isInUse()
Check if the sensor is in use.
|
EsperEventContainer |
receive(java.lang.Object receiver)
Objects subscribed to the sensor use this method to acquire the read
results.
|
void |
register(BundleContext context,
java.lang.String readerType)
Register the reader to OSGi.
|
void |
register(BundleContext context,
java.lang.String readerType,
java.util.Map<java.lang.String,java.lang.String> filterParams)
Register the reader to OSGi.
|
void |
removeReceiver(Sensor receiver)
Remove a sensor from the list of sensors that receive sensor reads from
this sensor.
|
void |
send(ReadCycle cycle)
Send sensor results to this sensor.
|
void |
sendEvent(java.lang.Object event)
Send a non ReadCycle event to esper.
|
void |
setName(java.lang.String name) |
void |
setNotifiyService(NotifierService notifierService)
Set the wrapper for the Notify Service.
|
void |
subscribe(java.lang.Object receiver)
Subscribe an object to the sensor.
|
java.lang.String |
toString() |
abstract void |
unbindCommandConfiguration(AbstractCommandConfiguration<?> commandConfiguration,
java.util.Map<?,?> properties)
Notifier the sensor that a command configuration has disappeared.
|
void |
unsubscribe(java.lang.Object receiver)
Unsubscribe an object from the sensor.
|
getAttribute, getAttributes, getAttributes, getID, getMBeanInfo, setAttribute, setAttributes, setID
public AbstractSensor()
public abstract java.lang.String createSensorSession() throws CannotCreateSessionException
CannotCreateSessionException
- - if the session cannot be createdpublic abstract java.lang.String createSensorSession(SessionDTO sessionDTO) throws CannotCreateSessionException
sessionDTO
- CannotCreateSessionException
- if the session cannot be createdpublic abstract java.util.Map<java.lang.String,SensorSession> getSensorSessions()
public abstract void destroySensorSession(java.lang.String id) throws CannotDestroySensorException
session
- CannotDestroySensorException
public abstract void applyPropertyChanges()
public abstract void unbindCommandConfiguration(AbstractCommandConfiguration<?> commandConfiguration, java.util.Map<?,?> properties)
commandConfiguration
- properties
- public EsperEventContainer receive(java.lang.Object receiver) throws NotSubscribedException
Sensor
receive
in interface Sensor
NotSubscribedException
public void subscribe(java.lang.Object receiver) throws DuplicateSubscriptionException
SensorUpdate
subscribe
in interface SensorUpdate
DuplicateSubscriptionException
public java.lang.String getName()
Sensor
public void unsubscribe(java.lang.Object receiver) throws NotSubscribedException
SensorUpdate
unsubscribe
in interface SensorUpdate
NotSubscribedException
public void removeReceiver(Sensor receiver)
SensorUpdate
removeReceiver
in interface SensorUpdate
public void addReceiver(Sensor receiver)
SensorUpdate
addReceiver
in interface SensorUpdate
public void setName(java.lang.String name) throws ImmutableException, InUseException
setName
in interface SensorUpdate
ImmutableException
InUseException
public void setNotifiyService(NotifierService notifierService)
wrapper
- The JMS Notifier to setpublic void send(ReadCycle cycle)
Sensor
public void sendEvent(java.lang.Object event)
Sensor
public java.lang.Boolean isImmutable()
Sensor
isImmutable
in interface Sensor
public java.lang.Boolean isInUse()
Sensor
public java.util.Set<java.lang.String> getChildren()
CompositeSensor
getChildren
in interface CompositeSensor
public ReaderDTO getDTO(Configuration config)
config
- The Configuration Object for this AbstractSensorpublic void register(BundleContext context, java.lang.String readerType)
type - "reader" reader - the reader type supplied as an argument serviceid - the service ID of the reader
context
- The Bundlecontext to usereaderType
- The Type of reader to register it aspublic void register(BundleContext context, java.lang.String readerType, java.util.Map<java.lang.String,java.lang.String> filterParams)
type - "reader" reader - the reader type supplied as an argument serviceid - the service ID of the reader
context
- The Bundlecontext to usereaderType
- The Type of reader to register it asfilterParams
- Any additional OSGi filter params to use when registering the
servicepublic java.lang.String toString()
toString
in class java.lang.Object