Tuscany Core

org.apache.tuscany.core.context
Interface EntryPointContext

All Superinterfaces:
Context, EventPublisher, Lifecycle
All Known Implementing Classes:
EntryPointContextImpl, SystemEntryPointContext

public interface EntryPointContext
extends Context

The runtime artifact representing an entry point, EntryPointContext manages wire handler instances that expose service operations offered by a component in the parent composite. The wire handler instance is responsible for dispatching the request down an wire chain to the target instance. The wire chain may contain Interceptors and MessageHandlers that implement policies or perform mediations on the wire.

Entry point contexts are used by transport binding artifacts to invoke an operation on a service. The transport binding uses an InvocationHandler instance obtained from the EntryPointContext to perform the wire as in:

              CompositeContext compositeContext = ...
              EntryPointContext ctx = (EntryPointContext) compositeContext.getContext("source");
              Assert.assertNotNull(ctx);
              InvocationHandler handler = (InvocationHandler) ctx.getHandler();
              Object response = handler.invoke(null, operation, new Object[] { param });
 
The Proxy instance passed to InvocationHandler may be null as the client is invoking directly on the handler.

Alternatively, the following will return a proxy implementing the service interface exposed by the entry point:

              CompositeContext compositeContext = ...
              EntryPointContext ctx = (EntryPointContext) compositeContext.getContext("source");
              Assert.assertNotNull(ctx);
              HelloWorld proxy = (Helloworld) ctx.getInstance(null); // service name not necessary
 
The proxy returned will be backed by the entry point wire chain.

Version:
$Rev: 397183 $ $Date: 2006-04-26 07:38:42 -0400 (Wed, 26 Apr 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
 java.lang.Object getHandler()
          Returns the handler responsible for flowing a request through the entry point
 java.lang.Class getServiceInterface()
          Returns the service interface configured for the entry poitn
 
Methods inherited from interface org.apache.tuscany.core.context.Context
getInstance
 
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

getHandler

java.lang.Object getHandler()
                            throws TargetException
Returns the handler responsible for flowing a request through the entry point

Throws:
TargetException

getServiceInterface

java.lang.Class getServiceInterface()
Returns the service interface configured for the entry poitn


Tuscany Core

-