org.universAAL.middleware.service
Class ServiceCallee

Package class diagram package ServiceCallee
java.lang.Object
  extended by org.universAAL.middleware.bus.member.BusMember
      extended by org.universAAL.middleware.bus.member.Callee
          extended by org.universAAL.middleware.service.ServiceCallee
Direct Known Subclasses:
AHServiceProvider, CalleeExample, ContextHistoryCallee, ContinuaHdpManagerProvider, DroolsReasonerProvider, ExporterActuatorCallee, ExporterDimmerCallee, ExporterSensorCallee, FS20Server, KnxServiceCallee, LightingProvider, LightingProvider1, LightingProviderLevel1, LightingProviderLevel2, LightingProviderLevel3, MainButtonProvider, ReasoningProvider, SCallee, SCallee, SCallee, SCallee, SCallee, ServiceCalleeWrapper, ServiceProvider, ServiceProvider, UIPreferencesSCallee, UserPasswordCallee, UserPasswordCallee, UtilActuatorCallee, UtilEditorCallee, UtilSensorCallee, WrapperS

public abstract class ServiceCallee
extends Callee

This is an abstract class that the service callee members of the service bus must derive from. According to the convention of the service bus regarding the registration parameters the

  • ServiceCallee-s may pass an array of ServiceProfiles
  • Author:
    mtazari - Saied Tazari

    Field Summary
     
    Fields inherited from class org.universAAL.middleware.bus.member.BusMember
    busResourceURI, owner, theBus
     
    Constructor Summary
    protected ServiceCallee(ModuleContext context, ServiceProfile[] realizedServices)
              The default constructor for this class.
     
    Method Summary
    protected  void addNewServiceProfiles(ServiceProfile[] realizedServices)
              Registers additional services to be provided by this ServiceCalee.
     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 ServiceCalee.
     
    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

    ServiceCallee

    protected ServiceCallee(ModuleContext context,
                            ServiceProfile[] realizedServices)
    The default constructor for this class.

    Parameters:
    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.
    Throws:
    NullPointerException - if realizedServices is null or one of the elements of that array is null
    Method Detail

    addNewServiceProfiles

    protected final void addNewServiceProfiles(ServiceProfile[] realizedServices)
    Registers additional services to be provided by this ServiceCalee.

    Parameters:
    realizedServices - the new services.
    Throws:
    NullPointerException - if realizedServices is null or one of the elements of that array is null

    removeMatchingProfiles

    protected final void removeMatchingProfiles(ServiceProfile[] realizedServices)
    Removes a specified set of services that were previously provided by this ServiceCalee.

    Parameters:
    realizedServices - the services that need to be removed.

    communicationChannelBroken

    public abstract void communicationChannelBroken()
    This abstract method is called for each member of the bus when the bus is being stopped.


    busDyingOut

    public final void busDyingOut(AbstractBus b)
    Description copied from class: BusMember
    This method is called when the bus is stopped to announce this to the bus members.

    Specified by:
    busDyingOut in class BusMember
    Parameters:
    b - bus on which this member has been registered
    See Also:
    BusMember.busDyingOut(AbstractBus)

    handleCall

    public abstract ServiceResponse handleCall(ServiceCall call)
    The actual service method of the ServiceCallee. It is called by the bus whenever there is a call that need to be serviced by this ServiceCallee.

    Parameters:
    call - the call that needs to be serviced.
    Returns:
    the result of the call execution.

    handleRequest

    public void handleRequest(BusMessage m)
    Handles a peer-to-peer request representing a ServiceCall coming from the bus.

    Parameters:
    m - request message coming from the bus.

    getMyID

    public String getMyID()
    Get the ID of this bus member.

    Returns:
    the ID of this bus member.


    Copyright © 2014 universAAL Consortium. All Rights Reserved.