Package org.apache.commons.lang3.event
Class EventUtils.EventBindingInvocationHandler
- java.lang.Object
-
- org.apache.commons.lang3.event.EventUtils.EventBindingInvocationHandler
-
- All Implemented Interfaces:
java.lang.reflect.InvocationHandler
- Enclosing class:
- EventUtils
private static class EventUtils.EventBindingInvocationHandler extends java.lang.Object implements java.lang.reflect.InvocationHandler
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Set<java.lang.String>
eventTypes
private java.lang.String
methodName
private java.lang.Object
target
-
Constructor Summary
Constructors Constructor Description EventBindingInvocationHandler(java.lang.Object target, java.lang.String methodName, java.lang.String[] eventTypes)
Creates a new instance ofEventBindingInvocationHandler
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private boolean
hasMatchingParametersMethod(java.lang.reflect.Method method)
Checks whether a method for the passed in parameters can be found.java.lang.Object
invoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] parameters)
Handles a method invocation on the proxy object.
-
-
-
Constructor Detail
-
EventBindingInvocationHandler
EventBindingInvocationHandler(java.lang.Object target, java.lang.String methodName, java.lang.String[] eventTypes)
Creates a new instance ofEventBindingInvocationHandler
.- Parameters:
target
- the target object for method invocationsmethodName
- the name of the method to be invokedeventTypes
- the names of the supported event types
-
-
Method Detail
-
invoke
public java.lang.Object invoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] parameters) throws java.lang.Throwable
Handles a method invocation on the proxy object.- Specified by:
invoke
in interfacejava.lang.reflect.InvocationHandler
- Parameters:
proxy
- the proxy instancemethod
- the method to be invokedparameters
- the parameters for the method invocation- Returns:
- the result of the method call
- Throws:
java.lang.Throwable
- if an error occurs
-
hasMatchingParametersMethod
private boolean hasMatchingParametersMethod(java.lang.reflect.Method method)
Checks whether a method for the passed in parameters can be found.- Parameters:
method
- the listener method invoked- Returns:
- a flag whether the parameters could be matched
-
-