org.apache.tuscany.sca.core.invocation
Class InvocationChainImpl

java.lang.Object
  extended by org.apache.tuscany.sca.core.invocation.InvocationChainImpl
All Implemented Interfaces:
InvocationChain

public class InvocationChainImpl
extends java.lang.Object
implements InvocationChain

Default implementation of an invocation chain


Constructor Summary
InvocationChainImpl(Operation sourceOperation, Operation targetOperation, boolean forReference)
           
 
Method Summary
 void addInterceptor(Interceptor interceptor)
          Adds an interceptor to the chain.
 void addInterceptor(int index, Interceptor interceptor)
           
 void addInterceptor(java.lang.String phase, Interceptor interceptor)
          Add an interceptor to the given phase
 void addInvoker(Invoker invoker)
          Adds an invoker to the chain
 boolean allowsPassByReference()
          Indicate if the data can be passed in by reference as they won't be mutated.
 Invoker getHeadInvoker()
          Returns the first invoker in the chain.
 Operation getSourceOperation()
          Returns the source operation for this invocation chain.
 Invoker getTailInvoker()
           
 Operation getTargetOperation()
          Returns the target operation for this invocation chain.
 void setAllowsPassByReference(boolean allowsPBR)
          Force the invocation to allow pass-by-reference
 void setSourceOperation(Operation sourceOperation)
           
 void setTargetOperation(Operation operation)
          Updates the target operation for this invocation chain.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InvocationChainImpl

public InvocationChainImpl(Operation sourceOperation,
                           Operation targetOperation,
                           boolean forReference)
Method Detail

getTargetOperation

public Operation getTargetOperation()
Description copied from interface: InvocationChain
Returns the target operation for this invocation chain.

Specified by:
getTargetOperation in interface InvocationChain
Returns:
The target operation for this invocation chain

setTargetOperation

public void setTargetOperation(Operation operation)
Description copied from interface: InvocationChain
Updates the target operation for this invocation chain.

Specified by:
setTargetOperation in interface InvocationChain
Parameters:
operation - The new target operation for this invocation chain

addInterceptor

public void addInterceptor(Interceptor interceptor)
Description copied from interface: InvocationChain
Adds an interceptor to the chain. For reference side, it will be added to Phase.REFERENCE. For service side, it will be added to Phase.SERVICE

Specified by:
addInterceptor in interface InvocationChain
Parameters:
interceptor - The interceptor to add

addInvoker

public void addInvoker(Invoker invoker)
Description copied from interface: InvocationChain
Adds an invoker to the chain

Specified by:
addInvoker in interface InvocationChain
Parameters:
invoker - The invoker to add

getHeadInvoker

public Invoker getHeadInvoker()
Description copied from interface: InvocationChain
Returns the first invoker in the chain.

Specified by:
getHeadInvoker in interface InvocationChain
Returns:
The first invoker in the chain

getTailInvoker

public Invoker getTailInvoker()
Specified by:
getTailInvoker in interface InvocationChain
Returns:
The last invoker in the chain

getSourceOperation

public Operation getSourceOperation()
Description copied from interface: InvocationChain
Returns the source operation for this invocation chain.

Specified by:
getSourceOperation in interface InvocationChain
Returns:
the sourceOperation

setSourceOperation

public void setSourceOperation(Operation sourceOperation)
Parameters:
sourceOperation - the sourceOperation to set

addInterceptor

public void addInterceptor(int index,
                           Interceptor interceptor)
Specified by:
addInterceptor in interface InvocationChain
Parameters:
index - The position in the interceptor stack to add the interceptor
interceptor - The interceptor to add

addInterceptor

public void addInterceptor(java.lang.String phase,
                           Interceptor interceptor)
Description copied from interface: InvocationChain
Add an interceptor to the given phase

Specified by:
addInterceptor in interface InvocationChain

allowsPassByReference

public boolean allowsPassByReference()
Description copied from interface: InvocationChain
Indicate if the data can be passed in by reference as they won't be mutated.

Specified by:
allowsPassByReference in interface InvocationChain
Returns:
true if pass-by-reference is allowed

setAllowsPassByReference

public void setAllowsPassByReference(boolean allowsPBR)
Description copied from interface: InvocationChain
Force the invocation to allow pass-by-reference

Specified by:
setAllowsPassByReference in interface InvocationChain