org.universAAL.middleware.service.impl
Class ServiceStrategy

Package class diagram package ServiceStrategy
java.lang.Object
  extended by java.lang.Thread
      extended by org.universAAL.middleware.bus.model.BusStrategy
          extended by org.universAAL.middleware.service.impl.ServiceStrategy
All Implemented Interfaces:
Runnable

public class ServiceStrategy
extends BusStrategy

This class implements the BusStrategy for the ServiceBus

Author:
mtazari - Saied Tazari

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
protected  ILocalServiceSearchResultsData localServiceSearchResults
           
protected  ILocalServicesIndexData localServicesIndex
           
protected  ILocalWaitingCallersData localWaitingCallers
           
protected  PeerCard theCoordinator
           
 
Fields inherited from class org.universAAL.middleware.bus.model.BusStrategy
bus, busModule, commModule
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
ServiceStrategy(CommunicationModule commModule, ModuleContext mc)
           
 
Method Summary
protected  IServiceStrategyDataFactory createServiceStrategyDataFactory()
           
 ServiceProfile[] getAllServiceProfiles(String serviceURI)
          This method returns all the globally registered Service Profiles for the given service URI
 HashMap getAllServiceProfilesWithCalleeIDs(String serviceURI)
           
 void handle(BusMessage msg, String senderID)
          Handle the message.
protected  void notifyOnFoundCoordinator()
           
protected  void waitForCoordinatorToBeKnown()
           
 
Methods inherited from class org.universAAL.middleware.bus.model.BusStrategy
buildChannelMessage, getBusMember, getLocalBusByName, handleMessage, run, send, setBus, stopThread
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

localWaitingCallers

protected ILocalWaitingCallersData localWaitingCallers

localServicesIndex

protected ILocalServicesIndexData localServicesIndex

localServiceSearchResults

protected ILocalServiceSearchResultsData localServiceSearchResults

theCoordinator

protected PeerCard theCoordinator
Constructor Detail

ServiceStrategy

public ServiceStrategy(CommunicationModule commModule,
                       ModuleContext mc)
Method Detail

createServiceStrategyDataFactory

protected IServiceStrategyDataFactory createServiceStrategyDataFactory()

handle

public void handle(BusMessage msg,
                   String senderID)
Description copied from class: BusStrategy
Handle the message. This method is different from the handleMessage(), in that handeMessage() handle the message asynchronously, while queuing the messages to preserve the order of the messages. This method is executed synchronously, without any queuing.

Specified by:
handle in class BusStrategy
Parameters:
msg - message
senderID - sender (bus member) ID
See Also:
#handle(BusMessage, String)

waitForCoordinatorToBeKnown

protected void waitForCoordinatorToBeKnown()
                                    throws InterruptedException
Throws:
InterruptedException

notifyOnFoundCoordinator

protected void notifyOnFoundCoordinator()

getAllServiceProfiles

public ServiceProfile[] getAllServiceProfiles(String serviceURI)
This method returns all the globally registered Service Profiles for the given service URI

Parameters:
serviceURI - - the URI of the Service whose profiles are returned
Returns:
ServiceProfile[] - the service profiles of the given service

getAllServiceProfilesWithCalleeIDs

public HashMap getAllServiceProfilesWithCalleeIDs(String serviceURI)


Copyright © 2014 universAAL Consortium. All Rights Reserved.