org.araneaframework.framework
Interface ManagedServiceContext

All Superinterfaces:
Serializable
All Known Subinterfaces:
PathInfoServiceContext, SessionServiceContext, ThreadContext, TopServiceContext
All Known Implementing Classes:
BaseServiceRouterService.ServiceRouterContextImpl

public interface ManagedServiceContext
extends Serializable

A managed service context provides the means to have more control over child services. A good example is StandardThreadServiceRouterService which handles requests from multiple threads (windows) in the same session by having different children for different windows and the current service ID is determined via getCurrentId().

Author:
"Toomas Römer" , Jevgeni Kabanov (ekabanov at araneaframework dot org)

Method Summary
 Service addService(Object id, Service service)
          Adds a child service with the specified id.
 Service addService(Object id, Service service, Long timeToLive)
          Adds a child service with the specified id, and specifies that service may be killed by service manager after it has been inactive for specified time.
 void close(Object id)
          Closes the service under the key id.
 Object getCurrentId()
          Returns the id of the current service.
 Service getService(Object id)
           
 

Method Detail

getCurrentId

public Object getCurrentId()
Returns the id of the current service.


addService

public Service addService(Object id,
                          Service service)
Adds a child service with the specified id.


addService

public Service addService(Object id,
                          Service service,
                          Long timeToLive)
Adds a child service with the specified id, and specifies that service may be killed by service manager after it has been inactive for specified time. When the service is killed or whether it is killed at all is up to the implementation.


getService

public Service getService(Object id)
Returns:
a child service with the specified id.

close

public void close(Object id)
Closes the service under the key id.