
public class ProxyContextSubscriber extends ContextSubscriber implements ProxyBusMember
BusMember is interested in, and sends
the ContextEvents to its representative so it can deliver it to the
remote BusMember.busResourceURI, owner, theBus| Constructor and Description |
|---|
ProxyContextSubscriber(ModuleContext connectingModule,
ContextEventPattern[] initialSubscriptions) |
| Modifier and Type | Method and Description |
|---|---|
void |
addRemoteProxyReference(BusMemberReference remoteReference)
Add a
BusMemberReference to the proxy. |
void |
addSubscriptionParameters(Resource[] newParams)
When a update of registration parameters is required.
|
void |
communicationChannelBroken()
Method to be called when the communication of the Subsccriber with the
Context Bus is lost.
|
String |
getBusMemberId()
Get the busmemberId.
|
Collection<BusMemberReference> |
getRemoteProxiesReferences()
List all current references for this proxy.
|
Resource[] |
getSubscriptionParameters()
Get the subscription parameters of the
BusMember being proxied by
this proxy. |
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 |
handleMessage(Session session,
WrappedBusMessage busMessage)
When a session receives a
WrappedBusMessage, it delivers it to
the ProxyBusMember which its
busMemberId matches the
WrappedBusMessage's destination. |
boolean |
isCompatible(Resource[] registrationParameters)
Used to check if a
ProxyBusMember is capable of assuming the
proxy duties of a requested proxy with the given parameters. |
void |
removeRemoteProxyReference(BusMemberReference remoteReference)
Remove a concrete remote proxy.
|
void |
removeRemoteProxyReferences(Session session)
Disconnect from all references that use the same session.Does not send
Remove message |
void |
removeSubscriptionParameters(Resource[] newParams)
When a update of registration parameters is required.
|
addNewRegParams, busDyingOut, getAllProvisions, getMyID, handleEvent, removeMatchingRegParamsclose, getComment, getLabel, getType, getURI, setComment, setLabelclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclosepublic ProxyContextSubscriber(ModuleContext connectingModule, ContextEventPattern[] initialSubscriptions)
connectingModule - initialSubscriptions - public String getBusMemberId()
BusMember.getBusMemberId in interface ProxyBusMemberpublic void addRemoteProxyReference(BusMemberReference remoteReference)
BusMemberReference to the proxy. This means that from this
moment on the remote proxy and the local proxy can (and should)
communicate with each other. addRemoteProxyReference in interface ProxyBusMemberremoteReference - The reference to a remote proxy, its busmemberid and the
session through which to find it.public void removeRemoteProxyReference(BusMemberReference remoteReference)
Remove messageremoveRemoteProxyReference in interface ProxyBusMemberremoteReference - the remote's proxy reference to stop communicating with.public void removeRemoteProxyReferences(Session session)
Remove messageremoveRemoteProxyReferences in interface ProxyBusMembersession - the session that is to be disconnected.public Collection<BusMemberReference> getRemoteProxiesReferences()
getRemoteProxiesReferences in interface ProxyBusMemberpublic Resource[] getSubscriptionParameters()
BusMember being proxied by
this proxy.getSubscriptionParameters in interface ProxyBusMemberpublic void handleMessage(Session session, WrappedBusMessage busMessage)
WrappedBusMessage, it delivers it to
the ProxyBusMember which its
busMemberId matches the
WrappedBusMessage's destination. The delivery is received through this
method.handleMessage in interface ProxyBusMembersession - the session through which the message was received.busMessage - the actual message received.public boolean isCompatible(Resource[] registrationParameters)
ProxyBusMember is capable of assuming the
proxy duties of a requested proxy with the given parameters. isCompatible in interface ProxyBusMemberpublic void addSubscriptionParameters(Resource[] newParams)
addSubscriptionParameters in interface ProxyBusMembernewParams - the new parameters to use.public void removeSubscriptionParameters(Resource[] newParams)
removeSubscriptionParameters in interface ProxyBusMembernewParams - the new parameters to use.public void communicationChannelBroken()
communicationChannelBroken in class ContextSubscriberpublic void handleContextEvent(ContextEvent event)
handleContextEvent in class ContextSubscriberevent - The Context Event that matched the registered PatternsCopyright © 2018 universAAL Consortium. All rights reserved.