Class LocalOptimizationServiceWrapper
- java.lang.Object
-
- org.technologybrewery.fermenter.stout.client.service.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 Summary
Constructors Constructor Description 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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectinvokeLocalService(String methodName, Class<?>[] parameterTypes, Object[] params)Invokes the wrapped service with the passed method name and parameter types.ObjectinvokeLocalService(String methodName, Object[] params)Invokes the wrapped service with the passed method name.
-
-
-
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 invokeparams- 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 invokeparamTypes- the types of the parameters to pass to the methodparams- the values of the parameters to pass to the method- Returns:
- the result of the method
-
-