biz.hammurapi.dispatch
Class IntrospectingInvocationTarget

java.lang.Object
  extended by biz.hammurapi.dispatch.IntrospectingInvocationTarget
All Implemented Interfaces:
InvocationTarget

public class IntrospectingInvocationTarget
extends java.lang.Object
implements InvocationTarget

This class introspects an object passed to the constructor and creates invocation handlers for methods with one argument and the name provided in the constructor. Invocation handler would not invoke target method with incompatible argument.

Author:
Pavel Vlasov

Constructor Summary
IntrospectingInvocationTarget(java.lang.Object targetInstance, java.lang.String methodName, java.lang.Class parameterType)
          Introspects the target and creates an array of invocation handlers.
 
Method Summary
 java.util.Collection getInvocationHandlers()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IntrospectingInvocationTarget

public IntrospectingInvocationTarget(java.lang.Object targetInstance,
                                     java.lang.String methodName,
                                     java.lang.Class parameterType)
Introspects the target and creates an array of invocation handlers. Invocation handlers created by introspection report their return types as fact types. getFactTypes() returns empty array if return type is void.

Parameters:
targetInstance - Target instance
methodName - Method name
parameterType - Invocation handlers shall accept arguments of this type. Can be null.
Method Detail

getInvocationHandlers

public java.util.Collection getInvocationHandlers()
Specified by:
getInvocationHandlers in interface InvocationTarget
Returns:
Handlers for this target.


Copyright © 2005 Hammurapi Group. All Rights Reserved.