org.apache.tuscany.sca.node
Interface SCAClient

All Known Implementing Classes:
Node2Impl, NodeImpl, NodeImplementationLauncherBootstrap.NodeFacade, SCANode2Factory.NodeProxy, SCANodeFactory.NodeProxy

public interface SCAClient

Provides client access to the services in a domain.


Method Summary
<B,R extends org.osoa.sca.CallableReference<B>>
R
cast(B target)
          Cast a type-safe reference to a CallahbleReference.
<B> B
getService(java.lang.Class<B> businessInterface, java.lang.String serviceName)
          Returns a proxy for a service provided by a component in the SCA domain.
<B> org.osoa.sca.ServiceReference<B>
getServiceReference(java.lang.Class<B> businessInterface, java.lang.String serviceName)
          Returns a ServiceReference for a service provided by a component in the SCA domain.
 

Method Detail

cast

<B,R extends org.osoa.sca.CallableReference<B>> R cast(B target)
                                                 throws java.lang.IllegalArgumentException
Cast a type-safe reference to a CallahbleReference. Converts a type-safe reference to an equivalent CallableReference; if the target refers to a service then a ServiceReference will be returned, if the target refers to a callback then a CallableReference will be returned.

Type Parameters:
B - the Java type of the business interface for the reference
R - the type of reference to be returned
Parameters:
target - a reference proxy provided by the SCA runtime
Returns:
a CallableReference equivalent for the proxy
Throws:
java.lang.IllegalArgumentException - if the supplied instance is not a reference supplied by the SCA runtime

getService

<B> B getService(java.lang.Class<B> businessInterface,
                 java.lang.String serviceName)
Returns a proxy for a service provided by a component in the SCA domain.

Type Parameters:
B - the Java type of the business interface for the service
Parameters:
businessInterface - the interface that will be used to invoke the service
serviceName - the name of the service
Returns:
an object that implements the business interface

getServiceReference

<B> org.osoa.sca.ServiceReference<B> getServiceReference(java.lang.Class<B> businessInterface,
                                                         java.lang.String serviceName)
Returns a ServiceReference for a service provided by a component in the SCA domain.

Type Parameters:
B - the Java type of the business interface for the service
Parameters:
businessInterface - the interface that will be used to invoke the service
serviceName - the name of the service
Returns:
a ServiceReference for the designated service