org.apache.tuscany.sca.core.assembly
Class RuntimeWireImpl

java.lang.Object
  extended by org.apache.tuscany.sca.core.assembly.RuntimeWireImpl
All Implemented Interfaces:
java.lang.Cloneable, RuntimeWire

public class RuntimeWireImpl
extends java.lang.Object
implements RuntimeWire


Constructor Summary
RuntimeWireImpl(EndpointReference source, EndpointReference target, InterfaceContractMapper interfaceContractMapper, WorkScheduler workScheduler, RuntimeWireProcessor wireProcessor, MessageFactory messageFactory, ConversationManager conversationManager)
           
 
Method Summary
 void addToCache(EndpointReference callback, RuntimeWire clonedWire)
           
 java.lang.Object clone()
           
 InvocationChain getBindingInvocationChain()
          Get the invocation chain for the binding-specific handling
 ConversationManager getConversationManager()
           
 InvocationChain getInvocationChain(Operation operation)
          Lookup the invocation chain by operation
 java.util.List<InvocationChain> getInvocationChains()
          Returns the invocation chains for service operations associated with the wire
 EndpointReference getSource()
          Get the source of the wire
 EndpointReference getTarget()
          Get the target of the wire
 java.lang.Object invoke(Message msg)
          This invoke method assumes that the binding invocation chain is in force and that there will be an operation selector element there to determine which operation to call
 java.lang.Object invoke(Operation operation, Message msg)
          Invoke an operation with a context message
 java.lang.Object invoke(Operation operation, java.lang.Object[] args)
          Invoke an operation with given arguments
 RuntimeWire lookupCache(EndpointReference callback)
           
 void rebuild()
          Force the invocation chains to be rebuilt
 void releaseClonedWire(RuntimeWire wire)
           
 void releaseWire()
           
 void setTarget(EndpointReference target)
          Rebind the runtime wire with the given target
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RuntimeWireImpl

public RuntimeWireImpl(EndpointReference source,
                       EndpointReference target,
                       InterfaceContractMapper interfaceContractMapper,
                       WorkScheduler workScheduler,
                       RuntimeWireProcessor wireProcessor,
                       MessageFactory messageFactory,
                       ConversationManager conversationManager)
Parameters:
source -
target -
interfaceContractMapper -
workScheduler -
wireProcessor -
messageFactory -
conversationManager -
Method Detail

getInvocationChains

public java.util.List<InvocationChain> getInvocationChains()
Description copied from interface: RuntimeWire
Returns the invocation chains for service operations associated with the wire

Specified by:
getInvocationChains in interface RuntimeWire
Returns:
the invocation chains for service operations associated with the wire

getBindingInvocationChain

public InvocationChain getBindingInvocationChain()
Description copied from interface: RuntimeWire
Get the invocation chain for the binding-specific handling

Specified by:
getBindingInvocationChain in interface RuntimeWire
Returns:

getInvocationChain

public InvocationChain getInvocationChain(Operation operation)
Description copied from interface: RuntimeWire
Lookup the invocation chain by operation

Specified by:
getInvocationChain in interface RuntimeWire
Parameters:
operation - The operation
Returns:
The invocation chain for the given operation

invoke

public java.lang.Object invoke(Message msg)
                        throws java.lang.reflect.InvocationTargetException
Description copied from interface: RuntimeWire
This invoke method assumes that the binding invocation chain is in force and that there will be an operation selector element there to determine which operation to call

Specified by:
invoke in interface RuntimeWire
Parameters:
msg - The message
Returns:
The result
Throws:
java.lang.reflect.InvocationTargetException

invoke

public java.lang.Object invoke(Operation operation,
                               java.lang.Object[] args)
                        throws java.lang.reflect.InvocationTargetException
Description copied from interface: RuntimeWire
Invoke an operation with given arguments

Specified by:
invoke in interface RuntimeWire
Parameters:
operation - The operation
args - The arguments
Returns:
The result
Throws:
java.lang.reflect.InvocationTargetException

invoke

public java.lang.Object invoke(Operation operation,
                               Message msg)
                        throws java.lang.reflect.InvocationTargetException
Description copied from interface: RuntimeWire
Invoke an operation with a context message

Specified by:
invoke in interface RuntimeWire
Parameters:
operation - The operation
msg - The message
Returns:
The result
Throws:
java.lang.reflect.InvocationTargetException

getSource

public EndpointReference getSource()
Description copied from interface: RuntimeWire
Get the source of the wire

Specified by:
getSource in interface RuntimeWire
Returns:
The end point reference of the source

getTarget

public EndpointReference getTarget()
Description copied from interface: RuntimeWire
Get the target of the wire

Specified by:
getTarget in interface RuntimeWire
Returns:
The end point reference of the target

setTarget

public void setTarget(EndpointReference target)
Description copied from interface: RuntimeWire
Rebind the runtime wire with the given target

Specified by:
setTarget in interface RuntimeWire
Parameters:
target - The target endpoint reference

rebuild

public void rebuild()
Description copied from interface: RuntimeWire
Force the invocation chains to be rebuilt

Specified by:
rebuild in interface RuntimeWire

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Specified by:
clone in interface RuntimeWire
Overrides:
clone in class java.lang.Object
Returns:
a clone of the runtime wire
Throws:
java.lang.CloneNotSupportedException
See Also:
Object.clone()

getConversationManager

public ConversationManager getConversationManager()
Returns:
the conversationManager

lookupCache

public RuntimeWire lookupCache(EndpointReference callback)

addToCache

public void addToCache(EndpointReference callback,
                       RuntimeWire clonedWire)

releaseClonedWire

public void releaseClonedWire(RuntimeWire wire)

releaseWire

public void releaseWire()