org.apache.tuscany.sca.implementation.node.launcher
Class NodeImplementationLauncherBootstrap.NodeFacade

java.lang.Object
  extended by org.apache.tuscany.sca.implementation.node.launcher.NodeImplementationLauncherBootstrap.NodeFacade
All Implemented Interfaces:
SCAClient, SCANode
Enclosing class:
NodeImplementationLauncherBootstrap

public static class NodeImplementationLauncherBootstrap.NodeFacade
extends java.lang.Object
implements SCANode, SCAClient

A node facade.


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 referenceName)
          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

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

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 referenceName)
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
referenceName - the name of the service
Returns:
a ServiceReference for the designated service