public abstract class AbstractSubscriptionManager extends java.lang.Object implements SubscriptionManager
Modifier and Type | Class and Description |
---|---|
static class |
AbstractSubscriptionManager.EntitySensorToken |
Constructor and Description |
---|
AbstractSubscriptionManager() |
Modifier and Type | Method and Description |
---|---|
abstract <T> void |
publish(SensorEvent<T> event)
performs the actual publishing -- ie distribution to subscriptions
|
<T> SubscriptionHandle |
subscribe(Entity producer,
Sensor<T> sensor,
SensorEventListener<? super T> listener) |
<T> SubscriptionHandle |
subscribe(java.util.Map<java.lang.String,java.lang.Object> flags,
Entity producer,
Sensor<T> sensor,
SensorEventListener<? super T> listener)
This implementation handles the following flags, in addition to those described in the
SubscriptionManager
interface:
subscriberExecutionManagerTag - a tag to pass to execution manager (without setting any execution semantics / TaskPreprocessor);
if not supplied and there is a subscriber, this will be inferred from the subscriber and set up with SingleThreadedScheduler
eventFilter - a Predicate<SensorEvent> instance to filter what events are delivered
|
<T> SubscriptionHandle |
subscribeToChildren(Entity parent,
Sensor<T> sensor,
SensorEventListener<? super T> listener) |
<T> SubscriptionHandle |
subscribeToChildren(java.util.Map<java.lang.String,java.lang.Object> flags,
Entity parent,
Sensor<T> sensor,
SensorEventListener<? super T> listener)
Subscribe to
Sensor data changes and events on all children of a given Entity , supplying the
SensorEventListener to invoke when they occur. |
<T> SubscriptionHandle |
subscribeToMembers(Group parent,
Sensor<T> sensor,
SensorEventListener<? super T> listener) |
<T> SubscriptionHandle |
subscribeToMembers(java.util.Map<java.lang.String,java.lang.Object> flags,
Group parent,
Sensor<T> sensor,
SensorEventListener<? super T> listener)
Subscribe to
Sensor data changes and events on all members of a given Group , supplying the
SensorEventListener to invoke when they occur. |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getSubscriptionsForEntitySensor, getSubscriptionsForSubscriber, unsubscribe
public abstract <T> void publish(SensorEvent<T> event)
publish
in interface SubscriptionManager
public final <T> SubscriptionHandle subscribe(Entity producer, Sensor<T> sensor, SensorEventListener<? super T> listener)
subscribe
in interface SubscriptionManager
SubscriptionManager.subscribe(Map, Entity, Sensor, SensorEventListener)
public final <T> SubscriptionHandle subscribe(java.util.Map<java.lang.String,java.lang.Object> flags, Entity producer, Sensor<T> sensor, SensorEventListener<? super T> listener)
SubscriptionManager
interface:
subscribe
in interface SubscriptionManager
flags
- optional parameters to be associated with the subscriptionproducer
- entity to listen to, or null to listen to all entitiessensor
- sensor channel of events to listen to, or null for all sensors from the given producer(s)listener
- callback to invoke when an event occursSubscriptionManager.subscribe(Map, Entity, Sensor, SensorEventListener)
public final <T> SubscriptionHandle subscribeToChildren(Entity parent, Sensor<T> sensor, SensorEventListener<? super T> listener)
subscribeToChildren
in interface SubscriptionManager
SubscriptionManager.subscribeToChildren(Map, Entity, Sensor, SensorEventListener)
public final <T> SubscriptionHandle subscribeToChildren(java.util.Map<java.lang.String,java.lang.Object> flags, Entity parent, Sensor<T> sensor, SensorEventListener<? super T> listener)
SubscriptionManager
Sensor
data changes and events on all children of a given Entity
, supplying the
SensorEventListener
to invoke when they occur.
The subscriptions will be created recursively for all children, and the same listener callback will be invoked for each
sensor datum. The semantics are otherwise identical to the SubscriptionManager.subscribe(Map, Entity, Sensor, SensorEventListener)
method.subscribeToChildren
in interface SubscriptionManager
SubscriptionManager.subscribe(Map, Entity, Sensor, SensorEventListener)
public final <T> SubscriptionHandle subscribeToMembers(Group parent, Sensor<T> sensor, SensorEventListener<? super T> listener)
subscribeToMembers
in interface SubscriptionManager
SubscriptionManager.subscribeToChildren(Map, Entity, Sensor, SensorEventListener)
public final <T> SubscriptionHandle subscribeToMembers(java.util.Map<java.lang.String,java.lang.Object> flags, Group parent, Sensor<T> sensor, SensorEventListener<? super T> listener)
SubscriptionManager
Sensor
data changes and events on all members of a given Group
, supplying the
SensorEventListener
to invoke when they occur.
The subscriptions will be created recursively for all children, and the same listener callback will be invoked for each
sensor datum. The semantics are otherwise identical to the SubscriptionManager.subscribe(Map, Entity, Sensor, SensorEventListener)
method.subscribeToMembers
in interface SubscriptionManager
SubscriptionManager.subscribe(Map, Entity, Sensor, SensorEventListener)