org.apache.tuscany.sca.node
Class SCANode2Factory.NodeProxy

java.lang.Object
  extended by org.apache.tuscany.sca.node.SCANode2Factory.NodeProxy
All Implemented Interfaces:
SCAClient, SCANode, SCANode2
Enclosing class:
SCANode2Factory

public static class SCANode2Factory.NodeProxy
extends java.lang.Object
implements SCANode2, SCAClient


Method Summary
<B,R extends org.osoa.sca.CallableReference<B>>
R
cast(B target)
          Cast a type-safe reference to a CallahbleReference.
static
<T> T
createProxy(java.lang.Class<T> type, java.lang.Object node)
           
<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.
 void start()
          Start the composite loaded in the node.
 void stop()
          Stop the composite loaded in the node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createProxy

public static <T> T createProxy(java.lang.Class<T> type,
                                java.lang.Object node)

cast

public <B,R extends org.osoa.sca.CallableReference<B>> R cast(B target)
                                                 throws java.lang.IllegalArgumentException
Description copied from interface: SCAClient
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.

Specified by:
cast in interface SCAClient
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

public <B> B getService(java.lang.Class<B> businessInterface,
                        java.lang.String serviceName)
Description copied from interface: SCAClient
Returns a proxy for a service provided by a component in the SCA domain.

Specified by:
getService in interface SCAClient
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

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

Specified by:
getServiceReference in interface SCAClient
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

start

public void start()
Description copied from interface: SCANode
Start the composite loaded in the node.

Specified by:
start in interface SCANode

stop

public void stop()
Description copied from interface: SCANode
Stop the composite loaded in the node.

Specified by:
stop in interface SCANode