Class BuilderConfigurationWrapperFactory.BuilderConfigurationWrapperInvocationHandler

  • All Implemented Interfaces:
    java.lang.reflect.InvocationHandler
    Enclosing class:
    BuilderConfigurationWrapperFactory

    private static final class BuilderConfigurationWrapperFactory.BuilderConfigurationWrapperInvocationHandler
    extends java.lang.Object
    implements java.lang.reflect.InvocationHandler
    A specialized InvocationHandler implementation for wrapper configurations. Here the logic of accessing a wrapped builder is implemented.
    • Method Detail

      • handleConfigurationInvocation

        private java.lang.Object handleConfigurationInvocation​(java.lang.reflect.Method method,
                                                               java.lang.Object[] args)
                                                        throws java.lang.ReflectiveOperationException,
                                                               ConfigurationException
        Handles a method invocation on the associated builder's configuration object.
        Parameters:
        method - the method to be invoked
        args - method arguments
        Returns:
        the return value of the method
        Throws:
        java.lang.Exception - if an error occurs
        java.lang.ReflectiveOperationException
        ConfigurationException
      • handleEventSourceInvocation

        private java.lang.Object handleEventSourceInvocation​(java.lang.reflect.Method method,
                                                             java.lang.Object... args)
                                                      throws java.lang.ReflectiveOperationException
        Handles a method invocation on the EventSource interface. This method evaluates the current EventSourceSupport object in order to find the appropriate target for the invocation.
        Parameters:
        method - the method to be invoked
        args - method arguments
        Returns:
        the return value of the method
        Throws:
        java.lang.ReflectiveOperationException - if an error occurs
      • invoke

        public java.lang.Object invoke​(java.lang.Object proxy,
                                       java.lang.reflect.Method method,
                                       java.lang.Object[] args)
                                throws java.lang.ReflectiveOperationException,
                                       ConfigurationException
        Handles method invocations. This implementation handles methods of two different interfaces:
        • Methods from the EventSource interface are handled according to the current support level.
        • Other method calls are delegated to the builder's configuration object.
        Specified by:
        invoke in interface java.lang.reflect.InvocationHandler
        Parameters:
        proxy - the proxy object
        method - the method to be invoked
        args - method arguments
        Returns:
        the return value of the method
        Throws:
        java.lang.ReflectiveOperationException - if an error occurs
        ConfigurationException - if an error occurs