org.apache.tuscany.core.system.context
Class SystemEntryPointContext
java.lang.Object
org.apache.tuscany.core.context.impl.AbstractLifecycle
org.apache.tuscany.core.context.impl.AbstractContext
org.apache.tuscany.core.system.context.SystemEntryPointContext
- All Implemented Interfaces:
- Context, EntryPointContext, EventPublisher, Lifecycle
public class SystemEntryPointContext
- extends AbstractContext
- implements EntryPointContext
Manages an entry point into a system module. System entry points cache a direct (i.e. non-proxied) reference to a
component instance.
- Version:
- $Rev: 397183 $ $Date: 2006-04-26 07:38:42 -0400 (Wed, 26 Apr 2006) $
Method Summary |
java.lang.Object |
getHandler()
Returns the handler responsible for flowing a request through the entry point |
java.lang.Object |
getInstance(QualifiedName qName)
Returns the instance associated with the requested name, which may be in a atomic or composite form. |
java.lang.Class |
getServiceInterface()
Returns the service interface configured for the entry poitn |
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 |
SystemEntryPointContext
public SystemEntryPointContext(java.lang.String name,
java.lang.String targetName,
java.lang.Class serviceInterface,
ContextResolver resolver)
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()
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
getHandler
public java.lang.Object getHandler()
throws TargetException
- Description copied from interface:
EntryPointContext
- Returns the handler responsible for flowing a request through the entry point
- Specified by:
getHandler
in interface EntryPointContext
- Throws:
TargetException
getServiceInterface
public java.lang.Class getServiceInterface()
- Description copied from interface:
EntryPointContext
- Returns the service interface configured for the entry poitn
- Specified by:
getServiceInterface
in interface EntryPointContext
-