Class CustomOperationWrapper
- java.lang.Object
-
- de.gebit.integrity.operations.custom.CustomOperationWrapper
-
public class CustomOperationWrapper extends java.lang.Object
The custom operation wrapper is used to wrap a custom operation class and instance for execution. The wrapper does perform class loading and instantiation.- Author:
- Rene Schneider - initial API and implementation
-
-
Constructor Summary
Constructors Constructor Description CustomOperationWrapper(CustomOperation anOperation, com.google.inject.Injector anInjector)
Creates a new wrapper instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.reflect.Method
determineExecuteMethod()
Searches the operation class for the "execute" method, and returns the corresponding reflection method instance.protected java.lang.Class<?>
determinePostfixParameterTargetType()
Determines the type of the operation postfix parameter.protected java.lang.Class<?>
determinePrefixParameterTargetType()
Determines the type of the operation prefix parameter.java.lang.Object
executeOperation()
Executes the wrapped operation logic.
-
-
-
Constructor Detail
-
CustomOperationWrapper
public CustomOperationWrapper(CustomOperation anOperation, com.google.inject.Injector anInjector) throws java.lang.ClassNotFoundException
Creates a new wrapper instance. This also loads the actual operation implementation class using the injected classloader.- Parameters:
anOperation
- the operation to wrapanInjector
- the Guice injector (can't wait to inject it because we require stuff injected during construction)- Throws:
java.lang.ClassNotFoundException
- if the operations' class could not be found
-
-
Method Detail
-
executeOperation
public java.lang.Object executeOperation() throws UnexecutableException
Executes the wrapped operation logic.- Returns:
- the result of the operation
- Throws:
UnexecutableException
- if the operation cannot be executed for any reason
-
determinePrefixParameterTargetType
protected java.lang.Class<?> determinePrefixParameterTargetType()
Determines the type of the operation prefix parameter.- Returns:
- the expected type
-
determinePostfixParameterTargetType
protected java.lang.Class<?> determinePostfixParameterTargetType()
Determines the type of the operation postfix parameter.- Returns:
- the expected type
-
determineExecuteMethod
protected java.lang.reflect.Method determineExecuteMethod()
Searches the operation class for the "execute" method, and returns the corresponding reflection method instance.- Returns:
- the method representation
-
-