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

java.lang.Object
  extended by org.apache.tuscany.sca.core.invocation.NonBlockingInterceptor
All Implemented Interfaces:
Interceptor, Invoker

public class NonBlockingInterceptor
extends java.lang.Object
implements Interceptor

Adds non-blocking behavior to an invocation chain


Constructor Summary
NonBlockingInterceptor(WorkScheduler workScheduler)
           
NonBlockingInterceptor(WorkScheduler workScheduler, Interceptor next)
           
 
Method Summary
 Invoker getNext()
          Returns the next invoker or null
 Message invoke(Message msg)
          Process a synchronous wire
 void setNext(Invoker next)
          Sets the next invoker
 void setWorkScheduler(WorkScheduler workScheduler)
          Sets desired workScheduler to NonBlockingInterceptor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NonBlockingInterceptor

public NonBlockingInterceptor(WorkScheduler workScheduler)

NonBlockingInterceptor

public NonBlockingInterceptor(WorkScheduler workScheduler,
                              Interceptor next)
Method Detail

setWorkScheduler

public void setWorkScheduler(WorkScheduler workScheduler)
Sets desired workScheduler to NonBlockingInterceptor. This is a useful function for the extension framework to set desired workmanager on the InvocationChain, other than default workmanager which is set per Tuscany runtime. Using this function, extension framework can set desired workmanager on InvocationChain during post wire processing.

Parameters:
workScheduler - workScheduler which contains workmanager

invoke

public Message invoke(Message msg)
Description copied from interface: Invoker
Process a synchronous wire

Specified by:
invoke in interface Invoker
Parameters:
msg - The request Message for the wire
Returns:
The response Message from the wire

getNext

public Invoker getNext()
Description copied from interface: Interceptor
Returns the next invoker or null

Specified by:
getNext in interface Interceptor
Returns:
The next Invoker

setNext

public void setNext(Invoker next)
Description copied from interface: Interceptor
Sets the next invoker

Specified by:
setNext in interface Interceptor
Parameters:
next - The next invoker