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

java.lang.Object
  extended by org.apache.tuscany.sca.host.embedded.SCADomain
      extended by org.apache.tuscany.sca.host.embedded.impl.EmbeddedSCADomain

public class EmbeddedSCADomain
extends SCADomain

An SCA domain facade implementation.


Field Summary
 
Fields inherited from class org.apache.tuscany.sca.host.embedded.SCADomain
theDomain
 
Constructor Summary
EmbeddedSCADomain(java.lang.ClassLoader runtimeClassLoader, java.lang.String domainURI)
          Constructs a new domain facade.
 
Method Summary
 void buildComposite(Composite composite)
           
<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.
 ComponentManager getComponentManager()
           
 CompositeActivator getCompositeActivator()
           
 CompositeBuilder getCompositeBuilder()
           
 ContributionService getContributionService()
           
 Composite getDomainComposite()
           
<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 start()
           
 void stop()
           
 
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

EmbeddedSCADomain

public EmbeddedSCADomain(java.lang.ClassLoader runtimeClassLoader,
                         java.lang.String domainURI)
Constructs a new domain facade.

Parameters:
runtimeClassLoader -
domainURI -
Method Detail

start

public void start()
           throws ActivationException
Throws:
ActivationException

stop

public void stop()
          throws ActivationException
Throws:
ActivationException

buildComposite

public void buildComposite(Composite composite)
                    throws CompositeBuilderException
Throws:
CompositeBuilderException

getContributionService

public ContributionService getContributionService()

getCompositeBuilder

public CompositeBuilder getCompositeBuilder()

getCompositeActivator

public CompositeActivator getCompositeActivator()

getDomainComposite

public Composite getDomainComposite()

getComponentManager

public ComponentManager getComponentManager()
Overrides:
getComponentManager in class SCADomain

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