Tuscany Core

org.apache.tuscany.core.context.impl
Class EntryPointContextImpl

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.context.impl.EntryPointContextImpl
All Implemented Interfaces:
Context, EntryPointContext, EventPublisher, Lifecycle

public class EntryPointContextImpl
extends AbstractContext
implements EntryPointContext

The default implementation of an entry point context

Version:
$Rev: 397183 $ $Date: 2006-04-26 07:38:42 -0400 (Wed, 26 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
EntryPointContextImpl(java.lang.String name, SourceWireFactory sourceWireFactory, MessageFactory messageFactory)
          Creates a new entry point
 
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 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

EntryPointContextImpl

public EntryPointContextImpl(java.lang.String name,
                             SourceWireFactory sourceWireFactory,
                             MessageFactory messageFactory)
                      throws ContextInitException
Creates a new entry point

Parameters:
name - the entry point name
sourceWireFactory - the proxy factory containing the invocation chains for the entry point
messageFactory - a factory for generating invocation messages
Throws:
ContextInitException - if an error occurs creating the entry point
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()
           throws ContextInitException
Description copied from interface: Lifecycle
Starts the Lifecycle.

Specified by:
start in interface Lifecycle
Throws:
ContextInitException

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

Tuscany Core

-