public class BasicSubscriptionContext extends java.lang.Object implements SubscriptionContext
SubscriptionContext
for an entity or other user of a SubscriptionManager
.Constructor and Description |
---|
BasicSubscriptionContext(java.util.Map<java.lang.String,?> flags,
SubscriptionManager manager,
java.lang.Object subscriber) |
BasicSubscriptionContext(SubscriptionManager manager,
java.lang.Object subscriber) |
Modifier and Type | Method and Description |
---|---|
java.util.Set<SubscriptionHandle> |
getSubscriptions()
Return the subscriptions associated with this context
|
<T> void |
publish(SensorEvent<T> event) |
<T> SubscriptionHandle |
subscribe(Entity producer,
Sensor<T> sensor,
groovy.lang.Closure c) |
<T> SubscriptionHandle |
subscribe(Entity producer,
Sensor<T> sensor,
SensorEventListener<? super T> listener) |
<T> SubscriptionHandle |
subscribe(java.util.Map<java.lang.String,java.lang.Object> newFlags,
Entity producer,
Sensor<T> sensor,
groovy.lang.Closure c) |
<T> SubscriptionHandle |
subscribe(java.util.Map<java.lang.String,java.lang.Object> newFlags,
Entity producer,
Sensor<T> sensor,
SensorEventListener<? super T> listener)
As
SubscriptionManager.subscribe(Map, Entity, Sensor, SensorEventListener) with default subscription parameters for this context |
<T> SubscriptionHandle |
subscribeToChildren(Entity parent,
Sensor<T> sensor,
groovy.lang.Closure c) |
<T> SubscriptionHandle |
subscribeToChildren(Entity parent,
Sensor<T> sensor,
SensorEventListener<? super T> listener) |
<T> SubscriptionHandle |
subscribeToChildren(java.util.Map<java.lang.String,java.lang.Object> newFlags,
Entity parent,
Sensor<T> sensor,
groovy.lang.Closure c) |
<T> SubscriptionHandle |
subscribeToChildren(java.util.Map<java.lang.String,java.lang.Object> newFlags,
Entity parent,
Sensor<T> sensor,
SensorEventListener<? super T> listener) |
<T> SubscriptionHandle |
subscribeToMembers(Group parent,
Sensor<T> sensor,
groovy.lang.Closure c) |
<T> SubscriptionHandle |
subscribeToMembers(Group parent,
Sensor<T> sensor,
SensorEventListener<? super T> listener) |
<T> SubscriptionHandle |
subscribeToMembers(java.util.Map<java.lang.String,java.lang.Object> newFlags,
Group parent,
Sensor<T> sensor,
groovy.lang.Closure c) |
<T> SubscriptionHandle |
subscribeToMembers(java.util.Map<java.lang.String,java.lang.Object> newFlags,
Group parent,
Sensor<T> sensor,
SensorEventListener<? super T> listener) |
boolean |
unsubscribe(SubscriptionHandle subscriptionId) |
int |
unsubscribeAll()
causes all subscriptions to be deregistered
|
public BasicSubscriptionContext(SubscriptionManager manager, java.lang.Object subscriber)
public BasicSubscriptionContext(java.util.Map<java.lang.String,?> flags, SubscriptionManager manager, java.lang.Object subscriber)
public <T> SubscriptionHandle subscribe(Entity producer, Sensor<T> sensor, groovy.lang.Closure c)
public <T> SubscriptionHandle subscribe(java.util.Map<java.lang.String,java.lang.Object> newFlags, Entity producer, Sensor<T> sensor, groovy.lang.Closure c)
public <T> SubscriptionHandle subscribe(Entity producer, Sensor<T> sensor, SensorEventListener<? super T> listener)
subscribe
in interface SubscriptionContext
SubscriptionContext.subscribe(Map, Entity, Sensor, SensorEventListener)
public <T> SubscriptionHandle subscribe(java.util.Map<java.lang.String,java.lang.Object> newFlags, Entity producer, Sensor<T> sensor, SensorEventListener<? super T> listener)
SubscriptionContext
SubscriptionManager.subscribe(Map, Entity, Sensor, SensorEventListener)
with default subscription parameters for this contextsubscribe
in interface SubscriptionContext
public <T> SubscriptionHandle subscribeToChildren(Entity parent, Sensor<T> sensor, groovy.lang.Closure c)
public <T> SubscriptionHandle subscribeToChildren(java.util.Map<java.lang.String,java.lang.Object> newFlags, Entity parent, Sensor<T> sensor, groovy.lang.Closure c)
public <T> SubscriptionHandle subscribeToChildren(Entity parent, Sensor<T> sensor, SensorEventListener<? super T> listener)
subscribeToChildren
in interface SubscriptionContext
SubscriptionContext.subscribe(Map, Entity, Sensor, SensorEventListener)
public <T> SubscriptionHandle subscribeToChildren(java.util.Map<java.lang.String,java.lang.Object> newFlags, Entity parent, Sensor<T> sensor, SensorEventListener<? super T> listener)
subscribeToChildren
in interface SubscriptionContext
SubscriptionContext.subscribe(Map, Entity, Sensor, SensorEventListener)
public <T> SubscriptionHandle subscribeToMembers(Group parent, Sensor<T> sensor, groovy.lang.Closure c)
public <T> SubscriptionHandle subscribeToMembers(java.util.Map<java.lang.String,java.lang.Object> newFlags, Group parent, Sensor<T> sensor, groovy.lang.Closure c)
public <T> SubscriptionHandle subscribeToMembers(Group parent, Sensor<T> sensor, SensorEventListener<? super T> listener)
subscribeToMembers
in interface SubscriptionContext
SubscriptionContext.subscribe(Map, Entity, Sensor, SensorEventListener)
public <T> SubscriptionHandle subscribeToMembers(java.util.Map<java.lang.String,java.lang.Object> newFlags, Group parent, Sensor<T> sensor, SensorEventListener<? super T> listener)
subscribeToMembers
in interface SubscriptionContext
SubscriptionContext.subscribe(Map, Entity, Sensor, SensorEventListener)
public boolean unsubscribe(SubscriptionHandle subscriptionId)
unsubscribe
in interface SubscriptionContext
SubscriptionManager.unsubscribe(SubscriptionHandle)
public <T> void publish(SensorEvent<T> event)
publish
in interface SubscriptionContext
SubscriptionManager.publish(SensorEvent)
public java.util.Set<SubscriptionHandle> getSubscriptions()
getSubscriptions
in interface SubscriptionContext
public int unsubscribeAll()
SubscriptionContext
unsubscribeAll
in interface SubscriptionContext