org.demac.impl.j2me.context
Class ContextServiceImpl

java.lang.Object
  extended by org.demac.impl.j2me.context.ContextServiceImpl
All Implemented Interfaces:
ContextService, Service

public class ContextServiceImpl
extends java.lang.Object
implements ContextService

J2ME implementation of the ContextService.


Method Summary
 void addManagementSevice(ContextManagementService service)
           
 void addServiceObjectListener(ServiceObjectListener listener)
          Method to add a listener to the list of ServiceObjectListeners.
static ContextService getContextService()
           
 LocalDeviceContext getLocalDeviceContext()
           
 ContextManagementService getManagementSevice(ContextManagementHandle handle)
           
 RawDataService getService(ServiceHandle handle)
           
 RawDataService getService(ServiceHandle handle, Criteria criteria)
           
 void informServiceListeners(java.lang.String id, ServiceObject service)
           
 void initLocalContext(LocalDeviceContext localContext)
           
 boolean isServiceAvailable(ServiceHandle handle, java.lang.String type)
           
 boolean isServiceAvailable(ServiceHandle handle, java.lang.String type, Criteria criteria)
           
 boolean isStarted()
          Method to determine whether the Service is started or not.
 java.util.Iterator localAvailibleServices()
          Methode zum Auflisten aller lokal verfügbaren Dienste
 void lookupServiceObject(java.lang.String id, ServiceHandle handle, Criteria criteria)
          Method to look up Services in the local registry and in the vicinity.
 int removeLokalService(ServiceHandle serviceHandle)
          Methode zum Loeschen lokal verfügbaren Dienste
 void removeManagementSevice(ContextManagementHandle serviceHandle)
           
 void removeServiceObjectListener(ServiceObjectListener listener)
          Method to remove a listener from the list of ServiceObjectListeners.
 void start()
          Method to start the service.
 void stop()
          Method to stop the service.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getContextService

public static final ContextService getContextService()

isServiceAvailable

public boolean isServiceAvailable(ServiceHandle handle,
                                  java.lang.String type)
                           throws UnknownServiceException,
                                  ServiceNotReachableException
Specified by:
isServiceAvailable in interface ContextService
Throws:
UnknownServiceException
ServiceNotReachableException

removeLokalService

public int removeLokalService(ServiceHandle serviceHandle)
Methode zum Loeschen lokal verfügbaren Dienste

Specified by:
removeLokalService in interface ContextService
Returns:
1 falls erfolgreich, 0 falls Dienst nicht gefunden, -1 falls DSDM nicht gestartet.

localAvailibleServices

public java.util.Iterator localAvailibleServices()
Methode zum Auflisten aller lokal verfügbaren Dienste

Specified by:
localAvailibleServices in interface ContextService
Returns:
Iterator über deliveryMessages der lokal verfügbaren Dienste

isServiceAvailable

public boolean isServiceAvailable(ServiceHandle handle,
                                  java.lang.String type,
                                  Criteria criteria)
                           throws UnknownServiceException,
                                  ServiceNotReachableForCriteriaException
Specified by:
isServiceAvailable in interface ContextService
Throws:
UnknownServiceException
ServiceNotReachableForCriteriaException

getService

public RawDataService getService(ServiceHandle handle)
Specified by:
getService in interface ContextService

getService

public RawDataService getService(ServiceHandle handle,
                                 Criteria criteria)
Specified by:
getService in interface ContextService

start

public void start()
Description copied from interface: Service
Method to start the service.

Specified by:
start in interface Service

isStarted

public boolean isStarted()
Description copied from interface: Service
Method to determine whether the Service is started or not.

Specified by:
isStarted in interface Service
Returns:
the status

stop

public void stop()
Description copied from interface: Service
Method to stop the service.

Specified by:
stop in interface Service

getLocalDeviceContext

public LocalDeviceContext getLocalDeviceContext()
Specified by:
getLocalDeviceContext in interface ContextService

initLocalContext

public void initLocalContext(LocalDeviceContext localContext)
Specified by:
initLocalContext in interface ContextService

addManagementSevice

public void addManagementSevice(ContextManagementService service)
Specified by:
addManagementSevice in interface ContextService

removeManagementSevice

public void removeManagementSevice(ContextManagementHandle serviceHandle)
Specified by:
removeManagementSevice in interface ContextService

getManagementSevice

public ContextManagementService getManagementSevice(ContextManagementHandle handle)
Specified by:
getManagementSevice in interface ContextService

addServiceObjectListener

public void addServiceObjectListener(ServiceObjectListener listener)
Description copied from interface: ContextService
Method to add a listener to the list of ServiceObjectListeners.

Specified by:
addServiceObjectListener in interface ContextService
Parameters:
listener - the listener to add.

lookupServiceObject

public void lookupServiceObject(java.lang.String id,
                                ServiceHandle handle,
                                Criteria criteria)
                         throws UnknownServiceException,
                                ServiceNotReachableForCriteriaException
Description copied from interface: ContextService
Method to look up Services in the local registry and in the vicinity.

Specified by:
lookupServiceObject in interface ContextService
handle - org.demac.context.registry.ServiceHandle of the service that should be looked up.
criteria - org.demac.context.base.Criteria representing the non-functional properties that must be regarded.
Throws:
UnknownServiceException
ServiceNotReachableForCriteriaException

removeServiceObjectListener

public void removeServiceObjectListener(ServiceObjectListener listener)
Description copied from interface: ContextService
Method to remove a listener from the list of ServiceObjectListeners.

Specified by:
removeServiceObjectListener in interface ContextService
Parameters:
listener - the listener to remove.

informServiceListeners

public void informServiceListeners(java.lang.String id,
                                   ServiceObject service)