public abstract class ServiceCallee extends Callee
ServiceCallee
-s may pass an array of
ServiceProfile
sbusResourceURI, owner, theBus
Modifier | Constructor and Description |
---|---|
protected |
ServiceCallee(ModuleContext context,
ServiceProfile[] realizedServices)
The default constructor for this class.
|
protected |
ServiceCallee(ModuleContext context,
ServiceProfile[] realizedServices,
boolean throwOnError)
The default constructor for this class.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addNewServiceProfiles(ServiceProfile[] realizedServices)
Registers additional services to be provided by this
ServiceCallee . |
protected void |
addNewServiceProfiles(ServiceProfile[] realizedServices,
boolean throwOnError)
Registers additional services to be provided by this
ServiceCallee . |
void |
busDyingOut(AbstractBus b)
This method is called when the bus is stopped to announce this to the bus
members.
|
abstract void |
communicationChannelBroken()
This abstract method is called for each member of the bus when the bus is
being stopped.
|
String |
getMyID()
Get the ID of this bus member.
|
abstract ServiceResponse |
handleCall(ServiceCall call)
The actual service method of the
ServiceCallee . |
void |
handleRequest(BusMessage m)
Handles a peer-to-peer request representing a
ServiceCall coming
from the bus. |
protected void |
removeMatchingProfiles(ServiceProfile[] realizedServices)
Removes a specified set of services that were previously provided by this
ServiceCallee . |
close, getComment, getLabel, getType, getURI, setComment, setLabel
protected ServiceCallee(ModuleContext context, ServiceProfile[] realizedServices)
context
- The OSGI bundle context where the ServiceBus is registered.
Note that if no service bus is registered at the time of
creation, this object will not be operational.realizedServices
- The initial set of services that are realized by this callee.NullPointerException
- if realizedServices is null or one of the elements of that
array is nullprotected ServiceCallee(ModuleContext context, ServiceProfile[] realizedServices, boolean throwOnError)
context
- The OSGI bundle context where the ServiceBus is registered.
Note that if no service bus is registered at the time of
creation, this object will not be operational.realizedServices
- The initial set of services that are realized by this callee.throwOnError
- Determines if an Exception should be thrown in case of an
error. In that case, none of the profiles will be registered.NullPointerException
- if realizedServices is null or one of the elements of that
array is nullProfileExistsException
- if one of the profiles exists already.SecurityException
- if one of the profiles is not allowed to be registered by
this module.protected final void addNewServiceProfiles(ServiceProfile[] realizedServices)
ServiceCallee
.realizedServices
- the new services.NullPointerException
- if realizedServices is null or one of the elements of that
array is nullprotected final void addNewServiceProfiles(ServiceProfile[] realizedServices, boolean throwOnError)
ServiceCallee
.realizedServices
- the new services.throwOnError
- Determines if an Exception should be thrown in case of an
error. In that case, none of the profiles will be registered.NullPointerException
- if realizedServices is null or one of the elements of that
array is nullProfileExistsException
- if one of the profiles exists already.SecurityException
- if one of the profiles is not allowed to be registered by
this module.protected final void removeMatchingProfiles(ServiceProfile[] realizedServices)
ServiceCallee
.realizedServices
- the services that need to be removed.public abstract void communicationChannelBroken()
public final void busDyingOut(AbstractBus b)
BusMember
busDyingOut
in class BusMember
b
- bus on which this member has been registeredBusMember.busDyingOut(AbstractBus)
public abstract ServiceResponse handleCall(ServiceCall call)
ServiceCallee
. It is called
by the bus whenever there is a call that need to be serviced by this
ServiceCallee
.call
- the call that needs to be serviced.public void handleRequest(BusMessage m)
ServiceCall
coming
from the bus.m
- request message coming from the bus.public String getMyID()
Copyright © 2018 universAAL Consortium. All rights reserved.