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 Interceptor
s and
MessageHandler
s 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) $
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 |
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
-