Tuscany Core

org.apache.tuscany.core.system.context
Class SystemExternalServiceContext

java.lang.Object
  extended by org.apache.tuscany.core.context.impl.AbstractLifecycle
      extended by org.apache.tuscany.core.context.impl.AbstractContext
          extended by org.apache.tuscany.core.system.context.SystemExternalServiceContext
All Implemented Interfaces:
Context, EventPublisher, ExternalServiceContext, Lifecycle

public class SystemExternalServiceContext
extends AbstractContext
implements ExternalServiceContext

An implementation of an external service for system wiring. As system components are not proxied and the system binding is by-reference, the implementation caches a reference to its configured target.

Version:
$Rev: 393369 $ $Date: 2006-04-11 22:36:42 -0400 (Tue, 11 Apr 2006) $

Field Summary
 
Fields inherited from class org.apache.tuscany.core.context.impl.AbstractLifecycle
lifecycleState, name
 
Fields inherited from interface org.apache.tuscany.core.context.Lifecycle
CONFIG_ERROR, ERROR, INITIALIZED, INITIALIZING, RUNNING, STARTED, STOPPED, STOPPING, UNINITIALIZED
 
Constructor Summary
SystemExternalServiceContext(java.lang.String name, ObjectFactory factory)
           
 
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 org.apache.tuscany.core.context.impl.AbstractLifecycle
addListener, addListener, getLifecycleState, getListeners, getName, publish, removeListener, setName, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.tuscany.core.context.EventPublisher
addListener, addListener, publish, removeListener
 
Methods inherited from interface org.apache.tuscany.core.context.Lifecycle
getLifecycleState, getName, setName
 

Constructor Detail

SystemExternalServiceContext

public SystemExternalServiceContext(java.lang.String name,
                                    ObjectFactory factory)
Method Detail

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

start

public void start()
Description copied from interface: Lifecycle
Starts the Lifecycle.

Specified by:
start in interface Lifecycle

stop

public void stop()
Description copied from interface: Lifecycle
Stops the Lifecycle.

Specified by:
stop in interface Lifecycle

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

Tuscany Core

-