public class ProxySCaller extends ServiceCaller implements ProxyBusMember
ServiceCall
s and injects them to the bus in other
to get a ServiceResponse
from the represented ServiceCallee
. ServiceCallee
. BusMember
, like the other proxies;
thus it does not register to buses.busResourceURI, owner, theBus
Constructor and Description |
---|
ProxySCaller(ModuleContext context,
ServiceProfile[] profiles,
String proxiedBusMember)
Constructor.
|
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 |
close()
Unregisters the Subscriber from the bus.
|
void |
communicationChannelBroken()
This abstract method is called for each member of the bus when the bus is
being stopped.
|
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 . |
void |
handleResponse(String reqID,
ServiceResponse response)
Will be called automatically in a new thread whenever the response
corresponding to a previous call to
ServiceCaller.sendRequest(ServiceRequest)
is ready. |
boolean |
isCompatible(Resource[] registrationParameters)
A single ProxySCaller is able to manage all
ProxySCallee s; thus the first registered ProxySCaller
is the one that is compatible, and represents all ServiceCaller s. |
void |
removeRemoteProxyReference(BusMemberReference remoteReference)
Disconnect a concrete remote proxy.
|
void |
removeRemoteProxyReferences(Session session)
Disconnect from all references that use the same session.
|
void |
removeSubscriptionParameters(Resource[] newParams)
When a update of registration parameters is required.
|
addAvailabilitySubscription, busDyingOut, call, call, getAllServices, getMatchingService, getMatchingService, getMatchingService, getMyID, handleReply, inject, inject, removeAvailabilitySubscription, sendCall, sendCall, sendRequest
getComment, getLabel, getType, getURI, setComment, setLabel
public ProxySCaller(ModuleContext context, ServiceProfile[] profiles, String proxiedBusMember)
context
- profiles
- proxiedBusMember
- public String getBusMemberId()
BusMember
.getBusMemberId
in interface ProxyBusMember
public 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 ProxyBusMember
remoteReference
- The reference to a remote proxy, its busmemberid and the
session through which to find it.public void removeRemoteProxyReference(BusMemberReference remoteReference)
removeRemoteProxyReference
in interface ProxyBusMember
remoteReference
- the remote's proxy reference to stop communicating with.public void removeRemoteProxyReferences(Session session)
removeRemoteProxyReferences
in interface ProxyBusMember
session
- the session that is to be disconnected.public Collection<BusMemberReference> getRemoteProxiesReferences()
getRemoteProxiesReferences
in interface ProxyBusMember
public Resource[] getSubscriptionParameters()
BusMember
being proxied by
this proxy.getSubscriptionParameters
in interface ProxyBusMember
public 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 ProxyBusMember
session
- the session through which the message was received.busMessage
- the actual message received.public boolean isCompatible(Resource[] registrationParameters)
ProxySCallee
s; thus the first registered ProxySCaller
is the one that is compatible, and represents all ServiceCaller
s.isCompatible
in interface ProxyBusMember
public void addSubscriptionParameters(Resource[] newParams)
addSubscriptionParameters
in interface ProxyBusMember
newParams
- the new parameters to use.public void removeSubscriptionParameters(Resource[] newParams)
removeSubscriptionParameters
in interface ProxyBusMember
newParams
- the new parameters to use.public void close()
close
in interface ProxyBusMember
close
in class BusMember
public void communicationChannelBroken()
ServiceCaller
communicationChannelBroken
in class ServiceCaller
public void handleResponse(String reqID, ServiceResponse response)
ServiceCaller
ServiceCaller.sendRequest(ServiceRequest)
is ready.handleResponse
in class ServiceCaller
reqID
- the ID returned by the previous call to
ServiceCaller.sendRequest(ServiceRequest)
.response
- the expected response.Copyright © 2015 universAAL Consortium. All Rights Reserved.