2016/05/28 - Apache Tuscany has been retired.

For more information, please explore the Attic.



org.apache.tuscany.sca.host.embedded.impl
Class DefaultSCADomain

java.lang.Object
  extended by org.apache.tuscany.sca.host.embedded.SCADomain
      extended by org.apache.tuscany.sca.host.embedded.impl.DefaultSCADomain
Direct Known Subclasses:
WebSCADomain

public class DefaultSCADomain
extends SCADomain

A default SCA domain facade implementation.


Field Summary
 
Fields inherited from class org.apache.tuscany.sca.host.embedded.SCADomain
theDomain
 
Constructor Summary
DefaultSCADomain(java.lang.ClassLoader runtimeClassLoader, java.lang.ClassLoader applicationClassLoader, java.lang.String domainURI, java.lang.String contributionLocation, java.lang.String... composites)
          Constructs a new domain facade.
 
Method Summary
<B,R extends org.osoa.sca.CallableReference<B>>
R
cast(B target)
          Cast a type-safe reference to a CallableReference.
 void close()
          Close the SCA domain.
 Component getComponent(java.lang.String componentName)
           
 ComponentManager getComponentManager()
           
 java.util.Set<java.lang.String> getComponentNames()
           
<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.
 java.lang.String getURI()
          Returns the URI of the SCA Domain.
 void init()
           
 void startComponent(java.lang.String componentName)
           
 void stopComponent(java.lang.String componentName)
           
 
Methods inherited from class org.apache.tuscany.sca.host.embedded.SCADomain
connect, newInstance, newInstance, newInstance, removeInstance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultSCADomain

public DefaultSCADomain(java.lang.ClassLoader runtimeClassLoader,
                        java.lang.ClassLoader applicationClassLoader,
                        java.lang.String domainURI,
                        java.lang.String contributionLocation,
                        java.lang.String... composites)
Constructs a new domain facade.

Parameters:
domainURI -
contributionLocation -
composites -
Method Detail

init

public void init()

close

public void close()
Description copied from class: SCADomain
Close the SCA domain.

Overrides:
close in class SCADomain

cast

public <B,R extends org.osoa.sca.CallableReference<B>> R cast(B target)
                                                 throws java.lang.IllegalArgumentException
Description copied from class: SCADomain
Cast a type-safe reference to a CallableReference. 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 class SCADomain
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 class: SCADomain
Returns a proxy for a service provided by a component in the SCA domain.

Specified by:
getService in class SCADomain
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 class: SCADomain
Returns a ServiceReference for a service provided by a component in the SCA domain.

Specified by:
getServiceReference in class SCADomain
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

getURI

public java.lang.String getURI()
Description copied from class: SCADomain
Returns the URI of the SCA Domain.

Specified by:
getURI in class SCADomain
Returns:
the URI of the SCA Domain

getComponentManager

public ComponentManager getComponentManager()
Overrides:
getComponentManager in class SCADomain

getComponentNames

public java.util.Set<java.lang.String> getComponentNames()

getComponent

public Component getComponent(java.lang.String componentName)

startComponent

public void startComponent(java.lang.String componentName)
                    throws ActivationException
Throws:
ActivationException

stopComponent

public void stopComponent(java.lang.String componentName)
                   throws ActivationException
Throws:
ActivationException