org.apache.tuscany.sca.node.impl
Class NodeImpl

java.lang.Object
  extended by org.apache.tuscany.sca.node.impl.NodeImpl
All Implemented Interfaces:
SCAClient, SCANode
Direct Known Subclasses:
Node2Impl

public class NodeImpl
extends java.lang.Object
implements SCANode, SCAClient

A local representation of the SCADomain running on a single node


Method Summary
<B,R extends org.osoa.sca.CallableReference<B>>
R
cast(B target)
          Cast a type-safe reference to a CallahbleReference.
 Composite getComposite()
          Returns the composite being run by this node.
 CompositeActivator getCompositeActivator()
           
static java.net.URL getContributionURL(java.net.URL contributionArtifactURL, java.lang.String contributionArtifactPath)
           
 ExtensionPointRegistry getExtensionPointRegistry()
          Returns the extension point registry used by this 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 name)
          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

getContributionURL

public static java.net.URL getContributionURL(java.net.URL contributionArtifactURL,
                                              java.lang.String contributionArtifactPath)

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

getExtensionPointRegistry

public ExtensionPointRegistry getExtensionPointRegistry()
Returns the extension point registry used by this node.

Returns:

getComposite

public Composite getComposite()
Returns the composite being run by this node.

Returns:

getCompositeActivator

public CompositeActivator getCompositeActivator()