IBM WebSphere Application ServerTM
Release 7

com.ibm.websphere.sca
Class ServiceManager

java.lang.Object
  extended by com.ibm.websphere.sca.ServiceManager

public class ServiceManager
extends java.lang.Object

Represents a lookup scope for locating SCA services. ServiceManager provides methods to locate a service given an SCA service reference. It also provides methods to bind an SCA reference to an endpoint. From inside a service component, ServiceManager allows you to get a handle to the current service component metadata and create an endpoint reference for this component.


Field Summary
static java.lang.String COPYRIGHT
           
static ServiceManager INSTANCE
          The default ServiceManager instance.
 
Constructor Summary
ServiceManager()
          Constructs a new ServiceManager.
ServiceManager(java.io.InputStream inputStream)
          Constructs a new ServiceManager from an InputStream.
 
Method Summary
 EndpointReference createEndpointReference(InterfaceType interfaceType)
          Creates an endpoint reference for one of interfaces exposed by the current service component.
 Component getComponent()
          Returns the Component object representing the current SCDL component.
 commonj.sdo.Sequence getEndpointReferenceParameters()
          Returns the endpoint reference parameters associated with the current invocation.
 commonj.sdo.Sequence getEndpointReferenceProperties()
          Returns the endpoint reference properties associated with the current invocation.
 java.lang.Object getService(Reference reference, EndpointReference endpointReference)
          Locates the given service reference, binds the service reference to the given endpoint, and returns a proxy to the target service.
 java.lang.Object getService(java.lang.String referenceName, EndpointReference endpointReference)
          Locates the named service reference, binds the service reference to the given endpoint, and returns a proxy to the target service.
 java.lang.Object locateService(Reference reference)
          Locates the service wired to the given reference and returns a proxy to the service.
 java.lang.Object locateService(java.lang.String referenceName)
          Locates the service wired to the named reference and returns a proxy to the service.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COPYRIGHT

public static final java.lang.String COPYRIGHT
See Also:
Constant Field Values

INSTANCE

public static final ServiceManager INSTANCE
The default ServiceManager instance.

Constructor Detail

ServiceManager

public ServiceManager()
Constructs a new ServiceManager.


ServiceManager

public ServiceManager(java.io.InputStream inputStream)
Constructs a new ServiceManager from an InputStream.

Parameters:
inputStream - An inputStream for an SCDL references document containing a set of SCA service references to use.
Method Detail

locateService

public java.lang.Object locateService(java.lang.String referenceName)
Locates the service wired to the named reference and returns a proxy to the service. If the reference is typed using a Java interface, then the proxy implements this interface and the com.ibm.websphere.sca.Service dynamic invocation interface. If the reference is typed using a WSDL portType, then the proxy only implements the com.ibm.websphere.sca.Service dynamic invocation interface. In case of a Cardinality 0..n Standalone SCA Reference, a java.util.List is returned instead of a Service object.

Parameters:
referenceName - The name of the reference.
Returns:
A proxy to the target service.

locateService

public java.lang.Object locateService(Reference reference)
Locates the service wired to the given reference and returns a proxy to the service. If the reference is typed using a Java interface, then the proxy implements this interface and the com.ibm.websphere.sca.Service dynamic invocation interface. If the reference is typed using a WSDL portType, then the proxy only implements the com.ibm.websphere.sca.Service dynamic invocation interface. In case of a Cardinality 0..n Standalone SCA Reference, a java.util.List is returned instead of a Service object.

Parameters:
reference - An SCDL Reference object.
Returns:
A proxy to the target service.

createEndpointReference

public EndpointReference createEndpointReference(InterfaceType interfaceType)
Creates an endpoint reference for one of interfaces exposed by the current service component.

Parameters:
interfaceType - An InterfaceType object representing the interface provided by the endpoint.
Returns:
An endpoint reference.

getService

public java.lang.Object getService(java.lang.String referenceName,
                                   EndpointReference endpointReference)
Locates the named service reference, binds the service reference to the given endpoint, and returns a proxy to the target service. If the reference is typed using a Java interface, then the proxy implements this interface and the com.ibm.websphere.sca.Service dynamic invocation interface. If the reference is typed using a WSDL portType, then the proxy only implements the com.ibm.websphere.sca.Service dynamic invocation interface.

Parameters:
referenceName - The name of the reference.
endpointReference - The endpoint of the target service.
Returns:
A proxy to the target service.

getService

public java.lang.Object getService(Reference reference,
                                   EndpointReference endpointReference)
Locates the given service reference, binds the service reference to the given endpoint, and returns a proxy to the target service. If the reference is typed using a Java interface, then the proxy implements this interface and the com.ibm.websphere.sca.Service dynamic invocation interface. If the reference is typed using a WSDL portType, then the proxy only implements the com.ibm.websphere.sca.Service dynamic invocation interface.

Parameters:
reference - A Reference object representing the SCDL reference.
endpointReference - The endpoint of the target service.
Returns:
A proxy to the target service.

getEndpointReferenceProperties

public commonj.sdo.Sequence getEndpointReferenceProperties()
Returns the endpoint reference properties associated with the current invocation.

Returns:
The current endpoint reference properties.

getEndpointReferenceParameters

public commonj.sdo.Sequence getEndpointReferenceParameters()
Returns the endpoint reference parameters associated with the current invocation.

Returns:
The current endpoint reference parameters.

getComponent

public Component getComponent()
Returns the Component object representing the current SCDL component.

Returns:
The current component.

IBM WebSphere Application ServerTM
Release 7