Class 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 of EventBindingInvocationHandler.
    • 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • target

        private final java.lang.Object target
      • methodName

        private final java.lang.String methodName
      • eventTypes

        private final java.util.Set<java.lang.String> eventTypes
    • Constructor Detail

      • EventBindingInvocationHandler

        EventBindingInvocationHandler​(java.lang.Object target,
                                      java.lang.String methodName,
                                      java.lang.String[] eventTypes)
        Creates a new instance of EventBindingInvocationHandler.
        Parameters:
        target - the target object for method invocations
        methodName - the name of the method to be invoked
        eventTypes - 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 interface java.lang.reflect.InvocationHandler
        Parameters:
        proxy - the proxy instance
        method - the method to be invoked
        parameters - 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