Class LocalOptimizationServiceWrapper


  • public class LocalOptimizationServiceWrapper
    extends Object
    Wraps a "locally optimized" service call to support reflection and reflection caching. This allows references to service implementation via runtime information so that we don't have a hard, compile-time binding between the client and domain modules.
    • Constructor Detail

      • LocalOptimizationServiceWrapper

        public LocalOptimizationServiceWrapper​(String serviceClassName)
        New instance that will wrap and cache the reflection methods for the given class name, if the class is found in the classpath.
        Parameters:
        serviceClassName - fully qualified name of the class
    • Method Detail

      • invokeLocalService

        public Object invokeLocalService​(String methodName,
                                         Object[] params)
        Invokes the wrapped service with the passed method name. See comment for indexClassForLocalOptimization for more detail about how we determine parameter types.
        Parameters:
        methodName - name of the method to invoke
        params - the values of the parameters to pass to the method
        Returns:
        the result of the method
      • invokeLocalService

        public Object invokeLocalService​(String methodName,
                                         Class<?>[] parameterTypes,
                                         Object[] params)
        Invokes the wrapped service with the passed method name and parameter types.
        Parameters:
        methodName - name of the method to invoke
        paramTypes - the types of the parameters to pass to the method
        params - the values of the parameters to pass to the method
        Returns:
        the result of the method