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

For more information, please explore the Attic.


org.apache.tuscany.sca.host.embedded
Class SCADomain

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

public abstract class SCADomain
extends java.lang.Object

A handle to an SCA domain.

Version:
$Rev: 538951 $ $Date: 2007-05-17 15:47:55 +0100 (Thu, 17 May 2007) $

Constructor Summary
SCADomain()
           
 
Method Summary
abstract
<B,R extends CallableReference<B>>
R
cast(B target)
          Cast a type-safe reference to a CallableReference.
 void close()
          Close the SCA domain.
static SCADomain connect(java.lang.String domainURI)
          Returns an SCADomain representing a remote SCA domain.
abstract
<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.
abstract
<B> 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.
abstract  java.lang.String getURI()
          Returns the URI of the SCA Domain.
static SCADomain newInstance()
          Returns a new instance of a local SCA domain.
static SCADomain newInstance(java.lang.String composite)
          Returns a new instance of a local SCA domain.
static SCADomain newInstance(java.lang.String domainURI, java.lang.String contributionLocation, java.lang.String... composites)
          Returns a new instance of a local SCA domain.
static void removeInstance(SCADomain domainInstance)
          Removes the specified local SCA Domain instance
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SCADomain

public SCADomain()
Method Detail

newInstance

public static SCADomain newInstance()
Returns a new instance of a local SCA domain.

Returns:

newInstance

public static SCADomain newInstance(java.lang.String composite)
Returns a new instance of a local SCA domain. The specified deployable composite will be included in the SCA domain.

Parameters:
composite - the deployable composite to include in the SCA domain.
Returns:

newInstance

public static SCADomain newInstance(java.lang.String domainURI,
                                    java.lang.String contributionLocation,
                                    java.lang.String... composites)
Returns a new instance of a local SCA domain. The specified deployable composites will be included in the SCA domain.

Parameters:
domainURI - the URI of the SCA domain
contributionLocation - the location of an SCA contribution
composites - the deployable composites to include in the SCA domain.
Returns:

removeInstance

public static void removeInstance(SCADomain domainInstance)
Removes the specified local SCA Domain instance

Parameters:
domainInstance - the instance to be removed

connect

public static SCADomain connect(java.lang.String domainURI)
Returns an SCADomain representing a remote SCA domain.

Parameters:
domainURI - the URI of the SCA domain
Returns:

close

public void close()
Close the SCA domain.


getURI

public abstract java.lang.String getURI()
Returns the URI of the SCA Domain.

Returns:
the URI of the SCA Domain

cast

public abstract <B,R extends CallableReference<B>> R cast(B target)
                                             throws java.lang.IllegalArgumentException
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.

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 abstract <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.

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 abstract <B> 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.

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