Tuscany Core

org.apache.tuscany.core.context
Interface Context

All Superinterfaces:
EventPublisher, Lifecycle
All Known Subinterfaces:
AtomicContext, AutowireContext, CompositeContext, EntryPointContext, ExternalServiceContext, RuntimeContext, ScopeAwareContext, SystemCompositeContext
All Known Implementing Classes:
AbstractCompositeContext, AbstractContext, CompositeContextImpl, EntryPointContextImpl, ExternalServiceContextImpl, RuntimeContextImpl, SystemAtomicContext, SystemCompositeContextImpl, SystemEntryPointContext, SystemExternalServiceContext

public interface Context
extends EventPublisher, Lifecycle

An entity that provides an execution context for a runtime artifact or artifacts. A Context may be a composite, managing child contexts or it may be an atomic, i.e. leaf, context.

Version:
$Rev: 408581 $ $Date: 2006-05-21 23:34:24 -0700 (Sun, 21 May 2006) $

Field Summary
 
Fields inherited from interface org.apache.tuscany.core.context.Lifecycle
CONFIG_ERROR, ERROR, INITIALIZED, INITIALIZING, RUNNING, STARTED, STOPPED, STOPPING, UNINITIALIZED
 
Method Summary
 Object getInstance(QualifiedName qName)
          Returns the instance associated with the requested name, which may be in a atomic or composite form.
 
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, start, stop
 

Method Detail

getInstance

Object getInstance(QualifiedName qName)
                   throws TargetException
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.

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

Tuscany Core

-