
public class ProxyContextPublisher extends ContextPublisher implements ProxyBusMember
ContextPublisher which will listen to remote
ProxyContextSubscriber' messages and reinject them in to the local
bus. ContextSubscribers may be represented locally by the
same ProxyContextPublisher.busResourceURI, owner, theBus| Constructor and Description |
|---|
ProxyContextPublisher(ModuleContext context) |
| 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 Publisher 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 |
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)
As long as the registration parameters are
ContextEventPattern,
they will always match. |
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.
|
busDyingOut, getMyID, publishclose, getComment, getLabel, getType, getURI, setComment, setLabelclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclosepublic ProxyContextPublisher(ModuleContext context)
public String getBusMemberId()
ProxyBusMemberBusMember.getBusMemberId in interface ProxyBusMemberpublic void addRemoteProxyReference(BusMemberReference remoteReference)
ProxyBusMemberBusMemberReference 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)
ProxyBusMemberRemove messageremoveRemoteProxyReference in interface ProxyBusMemberremoteReference - the remote's proxy reference to stop communicating with.public void removeRemoteProxyReferences(Session session)
ProxyBusMemberRemove messageremoveRemoteProxyReferences in interface ProxyBusMembersession - the session that is to be disconnected.public Collection<BusMemberReference> getRemoteProxiesReferences()
ProxyBusMembergetRemoteProxiesReferences in interface ProxyBusMemberpublic Resource[] getSubscriptionParameters()
ProxyBusMemberBusMember being proxied by
this proxy.getSubscriptionParameters in interface ProxyBusMemberpublic void handleMessage(Session session, WrappedBusMessage busMessage)
ProxyBusMemberWrappedBusMessage, 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)
ContextEventPattern,
they will always match. This means there will be only one proxy exporter
for all ContextSubscribers in the exported pool; since
registration parameters changing is ignored there is no merging problem.isCompatible in interface ProxyBusMemberpublic void addSubscriptionParameters(Resource[] newParams)
ProxyBusMemberaddSubscriptionParameters in interface ProxyBusMembernewParams - the new parameters to use.public void removeSubscriptionParameters(Resource[] newParams)
ProxyBusMemberremoveSubscriptionParameters in interface ProxyBusMembernewParams - the new parameters to use.public void communicationChannelBroken()
ContextPublishercommunicationChannelBroken in class ContextPublisherCopyright © 2018 universAAL Consortium. All rights reserved.