net.dpml.util
Class ContextInvocationHandler

java.lang.Object
  extended bynet.dpml.util.ContextInvocationHandler
All Implemented Interfaces:
InvocationHandler

public final class ContextInvocationHandler
extends Object
implements InvocationHandler

Invoication handler utility for a Context inner-class.

Version:
1.0.1
Author:
Digital Product Meta Library

Method Summary
static Object getProxiedInstance(Class clazz, Map map)
          Construct a new context instance implementing the supplied class and backed by entries in the supplied map.
 Object invoke(Object proxy, Method method, Object[] args)
          Invoke the specified method on underlying object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getProxiedInstance

public static Object getProxiedInstance(Class clazz,
                                        Map map)
Construct a new context instance implementing the supplied class and backed by entries in the supplied map.

Parameters:
clazz - the context inner class
map - a map of context entry keys to values
Returns:
the proxied context instance

invoke

public Object invoke(Object proxy,
                     Method method,
                     Object[] args)
              throws Throwable
Invoke the specified method on underlying object. This is called by the proxy object.

Specified by:
invoke in interface InvocationHandler
Parameters:
proxy - the proxy object
method - the method invoked on proxy object
args - the arguments supplied to method
Returns:
the return value of method
Throws:
Throwable - if an error occurs