|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.universAAL.middleware.bus.member.BusMember
org.universAAL.middleware.bus.member.Subscriber
org.universAAL.middleware.context.ContextSubscriber
public abstract class ContextSubscriber
Provides the interface to be implemented by context subscribers together with shared code. Only instances of this class can subscribe for context events. The convention of the context bus regarding the registration parameters is the following:
ContextProvider
.ContextEventPattern
s as their
initial subscriptions and can always add new (and remove old) subscriptions
dynamically.
Field Summary |
---|
Fields inherited from class org.universAAL.middleware.bus.member.BusMember |
---|
busResourceURI, owner, theBus |
Constructor Summary | |
---|---|
protected |
ContextSubscriber(ModuleContext connectingModule,
ContextEventPattern[] initialSubscriptions)
Creates a Context Subscriber and immediately registers a set of Context Event Patterns for it, so it receives the matching events. |
Method Summary | |
---|---|
protected void |
addNewRegParams(ContextEventPattern[] newSubscriptions)
Registers more ContextEventPattern for this Subscriber in addition to those that might have passed initially |
void |
busDyingOut(AbstractBus b)
This method is called when the bus is stopped to announce this to the bus members. |
abstract void |
communicationChannelBroken()
Method to be called when the communication of the Subsccriber with the Context Bus is lost. |
ContextEventPattern[] |
getAllProvisions()
Returns all provisions registered by all ContextPublisher s on all
instances of context bus in the current AAL Space. |
String |
getMyID()
|
abstract void |
handleContextEvent(ContextEvent event)
Method to be called when an Event forwarded in the Context Bus matches one of the Patterns registered by this Subscriber. |
void |
handleEvent(BusMessage m)
|
protected void |
removeMatchingRegParams(ContextEventPattern[] oldSubscriptions)
Unregisters a set of ContextEventPattern that had been previously registered for this Subscriber. |
Methods inherited from class org.universAAL.middleware.bus.member.BusMember |
---|
close, getType, getURI |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected ContextSubscriber(ModuleContext connectingModule, ContextEventPattern[] initialSubscriptions)
connectingModule
- The module context of the module creating the PublisherinitialSubscriptions
- Array of ContextEventPattern that are immediately registered
for this Subscriber
NullPointerException
- if newSubscriptions is null or one of the elements of that
array is nullMethod Detail |
---|
protected final void addNewRegParams(ContextEventPattern[] newSubscriptions)
newSubscriptions
- The additional array of ContextEventPattern
NullPointerException
- if newSubscriptions is null or one of the elements of that
array is nullprotected final void removeMatchingRegParams(ContextEventPattern[] oldSubscriptions)
oldSubscriptions
- public abstract void communicationChannelBroken()
public final void busDyingOut(AbstractBus b)
BusMember
busDyingOut
in class BusMember
b
- bus on which this member has been registeredAbstractBus
public ContextEventPattern[] getAllProvisions()
ContextPublisher
s on all
instances of context bus in the current AAL Space.
public abstract void handleContextEvent(ContextEvent event)
event
- The Context Event that matched the registered Patterns
NullPointerException
- if the event is nullpublic final void handleEvent(BusMessage m)
public String getMyID()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |