org.apache.tuscany.core.context.impl
Class ExternalServiceContextImpl
java.lang.Object
org.apache.tuscany.core.context.impl.AbstractLifecycle
org.apache.tuscany.core.context.impl.AbstractContext
org.apache.tuscany.core.context.impl.ExternalServiceContextImpl
- All Implemented Interfaces:
- Context, EventPublisher, ExternalServiceContext, Lifecycle
public class ExternalServiceContextImpl
- extends AbstractContext
- implements ExternalServiceContext
The default implementation of an external service context
- Version:
- $Rev: 400253 $ $Date: 2006-05-06 03:08:53 -0400 (Sat, 06 May 2006) $
Method Summary |
java.lang.Object |
getHandler()
Returns the handler responsible for flowing a request through the external service |
java.lang.Object |
getInstance(QualifiedName qName)
Returns the instance associated with the requested name, which may be in a atomic or composite form. |
void |
start()
Starts the Lifecycle. |
void |
stop()
Stops the Lifecycle. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
ExternalServiceContextImpl
public ExternalServiceContextImpl(java.lang.String name,
TargetWireFactory targetWireFactory,
ObjectFactory targetInstanceFactory)
- Creates an external service context
- Parameters:
name
- the name of the external servicetargetWireFactory
- the factory which creates proxies implementing the configured service interface for the
external service. There is always only one proxy factory as an external service is configured with one
servicetargetInstanceFactory
- the object factory that creates an artifact capabile of communicating over the
binding transport configured on the external service. The object factory may implement a caching strategy.
start
public void start()
throws CoreRuntimeException
- Description copied from interface:
Lifecycle
- Starts the Lifecycle.
- Specified by:
start
in interface Lifecycle
- Throws:
CoreRuntimeException
stop
public void stop()
throws CoreRuntimeException
- Description copied from interface:
Lifecycle
- Stops the Lifecycle.
- Specified by:
stop
in interface Lifecycle
- Throws:
CoreRuntimeException
getInstance
public java.lang.Object getInstance(QualifiedName qName)
throws TargetException
- Description copied from interface:
Context
- Returns the instance associated with the requested name, which may be in a atomic or composite form. Atomic (i.e.
leaf) contexts will return an instance associated with the service name part of the compound name, which may be
null.
Composite contexts will return an instance (likely a proxy) of a contained entry point context. In this case, the
port name on the qualified name will correspond to the composite context name and the part name will be used to
retrieve the contained entry point context. The latter may be null. If the contained context is not an entry
point context, an exception will be thrown.
- Specified by:
getInstance
in interface Context
- Parameters:
qName
- a qualified name of the requested instance
- Returns:
- the implementation instance or a proxy to it
- Throws:
TargetException
- if an error occurs retrieving the instance or the requested component is not an entry
point.- See Also:
CompositeContext
,
EntryPoint
getHandler
public java.lang.Object getHandler()
throws TargetException
- Description copied from interface:
ExternalServiceContext
- Returns the handler responsible for flowing a request through the external service
- Specified by:
getHandler
in interface ExternalServiceContext
- Throws:
TargetException
-