SCA API

org.osoa.sca
Interface ModuleContext


public interface ModuleContext

Interface that can be used by SCA Components to access information about the Module that contains them.

Version:
$Rev: 408581 $ $Date: 2006-05-21 23:34:24 -0700 (Sun, 21 May 2006) $

Method Summary
 ServiceReference createServiceReferenceForSession(Object self)
          Create a reference to the supplied component.
 ServiceReference createServiceReferenceForSession(Object self, String serviceName)
          Create a reference to the named service implemented by the supplied component.
 String getName()
          Returns the name of the module.
 RequestContext getRequestContext()
          Returns the request context that corresponds to the last remotable service invocation.
 String getURI()
          Returns the absolute URI of the module component.
 Object locateService(String serviceName)
          Returns an object implementing the interface defined for the named service.
 ServiceReference newSession(String serviceName)
          Create a new session for stateful interaction with the named service.
 ServiceReference newSession(String serviceName, Object sessionId)
          Create a new session for stateful interaction with the named service using an application-supplied session identifier.
 

Method Detail

getName

String getName()
Returns the name of the module.

Returns:
the name of the module

getURI

String getURI()
Returns the absolute URI of the module component.

Returns:
the absolute URI of the module component

getRequestContext

RequestContext getRequestContext()
Returns the request context that corresponds to the last remotable service invocation. If this is invoked from outside an SCA component then null is returned.

Returns:
the current request context

locateService

Object locateService(String serviceName)
Returns an object implementing the interface defined for the named service.

Parameters:
serviceName - the name of another service in the current module
Returns:
an object that implements the service's interface

createServiceReferenceForSession

ServiceReference createServiceReferenceForSession(Object self)
Create a reference to the supplied component. The component must define only one service.

Parameters:
self - the component to be referenced
Returns:
a reference to the component

createServiceReferenceForSession

ServiceReference createServiceReferenceForSession(Object self,
                                                  String serviceName)
Create a reference to the named service implemented by the supplied component.

Parameters:
self - the component to be referenced
serviceName - the service to be referenced
Returns:
a reference to the service

newSession

ServiceReference newSession(String serviceName)
Create a new session for stateful interaction with the named service.

Parameters:
serviceName - the name of the service to interact with
Returns:
a reference to the service

newSession

ServiceReference newSession(String serviceName,
                            Object sessionId)
Create a new session for stateful interaction with the named service using an application-supplied session identifier.

Parameters:
serviceName - the name of the service to interact with
sessionId - a token that identifies this session
Returns:
a reference to the service

SCA API

-