Fabric3 JDK Proxy Extension

org.fabric3.implementation.proxy.jdk
Class MultiThreadedCallbackInvocationHandler<T>

java.lang.Object
  extended by org.fabric3.implementation.proxy.jdk.AbstractCallbackInvocationHandler<T>
      extended by org.fabric3.implementation.proxy.jdk.MultiThreadedCallbackInvocationHandler<T>
All Implemented Interfaces:
InvocationHandler

public class MultiThreadedCallbackInvocationHandler<T>
extends AbstractCallbackInvocationHandler<T>

Responsible for dispatching to a callback service from multi-threaded component instances such as composite scope components. Since callback proxies for multi-threaded components may dispatch to multiple callback services, this implementation must determine the correct target service based on the current CallFrame. For example, if clients A and A' implementing the same callback interface C invoke B, the callback proxy representing C must correctly dispatch back to A and A'. This is done by recording the callback URI in the current CallFrame as the forward invoke is made.

Version:
$Rev: 11083 $ $Date: 2012-06-21 10:38:50 +0000 (Thu, 21 Jun 2012) $

Constructor Summary
MultiThreadedCallbackInvocationHandler(Class<T> interfaze, Map<String,Map<Method,org.fabric3.spi.wire.InvocationChain>> mappings)
          Constructor.
 
Method Summary
 Object invoke(Object proxy, Method method, Object[] args)
           
 
Methods inherited from class org.fabric3.implementation.proxy.jdk.AbstractCallbackInvocationHandler
handleProxyMethod, invoke
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultiThreadedCallbackInvocationHandler

public MultiThreadedCallbackInvocationHandler(Class<T> interfaze,
                                              Map<String,Map<Method,org.fabric3.spi.wire.InvocationChain>> mappings)
Constructor. In multi-threaded instances such as composite scoped components, multiple forward invocations may be received simultaneously. As a result, since callback proxies stored in instance variables may represent multiple clients, they must map the correct one for the request being processed on the current thread. The mappings parameter keys a callback URI representing the client to the set of invocation chains for the callback service.

Parameters:
interfaze - the callback service interface implemented by the proxy
mappings - the callback URI to invocation chain mappings
Method Detail

invoke

public Object invoke(Object proxy,
                     Method method,
                     Object[] args)
              throws Throwable
Throws:
Throwable

Fabric3 JDK Proxy Extension

Copyright © 2007-2012 Metaform Systems.