org.apache.avalon.fortress.impl.factory
Class PassThroughInvocationHandler

java.lang.Object
  extended by org.apache.avalon.fortress.impl.factory.PassThroughInvocationHandler
All Implemented Interfaces:
java.lang.reflect.InvocationHandler

final class PassThroughInvocationHandler
extends java.lang.Object
implements java.lang.reflect.InvocationHandler

InvocationHandler that just passes on all methods to target object.

Author:
Avalon Development Team

Field Summary
private  java.lang.Object m_object
          The target object delegated to.
 
Constructor Summary
PassThroughInvocationHandler(java.lang.Object object)
          Create an Invocation handler for specified object.
 
Method Summary
(package private)  java.lang.Object getObject()
          Retrieve the underlying object delegated to.
 java.lang.Object invoke(java.lang.Object proxy, java.lang.reflect.Method meth, java.lang.Object[] args)
          Invoke the appropriate method on underlying object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_object

private final java.lang.Object m_object
The target object delegated to.

Constructor Detail

PassThroughInvocationHandler

public PassThroughInvocationHandler(java.lang.Object object)
Create an Invocation handler for specified object.

Parameters:
object - the object to delegate to
Method Detail

invoke

public java.lang.Object invoke(java.lang.Object proxy,
                               java.lang.reflect.Method meth,
                               java.lang.Object[] args)
                        throws java.lang.Throwable
Invoke the appropriate method on underlying object.

Specified by:
invoke in interface java.lang.reflect.InvocationHandler
Parameters:
proxy - the proxy object
meth - the method
args - the arguments
Returns:
the return value of object
Throws:
java.lang.Throwable - method throws an exception

getObject

java.lang.Object getObject()
Retrieve the underlying object delegated to.

Returns:
the object delegated to