Apache Tuscany SCA Kernel Sub-Project

org.apache.tuscany.spi.wire
Interface InvocationChain

All Known Subinterfaces:
InboundInvocationChain, OutboundInvocationChain

public interface InvocationChain

An inbound or outbound invocation pipeline for a service operation. Wires consist of 1..n invocation chains associated with the operations of the service contract the wire represents. Invocation chains are associated with the outbound or inbound side of a wire are bridged or "connected" when an assembly is processed. Outbound chains are only connected to inbound chains and vice versa.

Invocation chains contain at least one Interceptor that process invocations in an around-style manner. In some scenarios, a service proxy may only contain inbound invocation chains, for example, when a service is resolved through a locate operation by a non-component client. In this case, there will be no outbound invocation chains and the target invoker will be held by the target-side and passed down the pipeline.

A Message is used to pass data associated with an invocation through the chain. Messages contain a TargetInvoker responsible for dispatching to a target instance and may be cached on the source-side. Caching allows various optimizations such as avoiding target instance resolution when the client-side lifecycle scope is a shorter duration than the target.

Version:
$Rev: 441749 $ $Date: 2006-09-08 23:55:02 -0700 (Fri, 08 Sep 2006) $

Method Summary
 void addInterceptor(Interceptor interceptor)
          Adds an interceptor to the chain
 void addInterceptor(int index, Interceptor interceptor)
          Adds an interceptor at the given position in the interceptor stack
 Interceptor getHeadInterceptor()
          Returns the first interceptor in the chain
 Operation getOperation()
          Returns the target operation for this invocation chain
 Interceptor getTailInterceptor()
          Returns the last interceptor in the chain
 Interceptor getTargetInterceptor()
          Returns the head interceptor of the birdged target-side chain
 TargetInvoker getTargetInvoker()
          Returns the target invoker that is passed down the chain
 void prepare()
          Signals to the chain that its configuration is complete.
 void setTargetInterceptor(Interceptor interceptor)
          Sets the head interceptor of the bridged target-side chain
 void setTargetInvoker(TargetInvoker invoker)
          Sets the target invoker to pass down the chain
 

Method Detail

getOperation

Operation getOperation()
Returns the target operation for this invocation chain


setTargetInvoker

void setTargetInvoker(TargetInvoker invoker)
Sets the target invoker to pass down the chain


getTargetInvoker

TargetInvoker getTargetInvoker()
Returns the target invoker that is passed down the chain


addInterceptor

void addInterceptor(Interceptor interceptor)
Adds an interceptor to the chain


addInterceptor

void addInterceptor(int index,
                    Interceptor interceptor)
Adds an interceptor at the given position in the interceptor stack

Parameters:
index - the position in the interceptor stack to add the interceptor
interceptor - the interceptor to add

getHeadInterceptor

Interceptor getHeadInterceptor()
Returns the first interceptor in the chain


getTailInterceptor

Interceptor getTailInterceptor()
Returns the last interceptor in the chain


setTargetInterceptor

void setTargetInterceptor(Interceptor interceptor)
Sets the head interceptor of the bridged target-side chain


getTargetInterceptor

Interceptor getTargetInterceptor()
Returns the head interceptor of the birdged target-side chain


prepare

void prepare()
Signals to the chain that its configuration is complete. Implementations may use this callback to prepare their invocation chains.


Apache Tuscany SCA Kernel Sub-Project

-