|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.batch.item.adapter.AbstractMethodInvokingDelegator<T>
public abstract class AbstractMethodInvokingDelegator<T>
Superclass for delegating classes which dynamically call a custom method of injected object. Provides convenient API for dynamic method invocation shielding subclasses from low-level details and exception handling.
| Constructor Summary | |
|---|---|
AbstractMethodInvokingDelegator()
|
|
| Method Summary | |
|---|---|
void |
afterPropertiesSet()
|
protected T |
invokeDelegateMethod()
Invoker the target method with no arguments. |
protected T |
invokeDelegateMethodWithArgument(Object object)
Invokes the target method with given argument. |
protected T |
invokeDelegateMethodWithArguments(Object[] args)
Invokes the target method with given arguments. |
void |
setArguments(Object[] arguments)
|
void |
setTargetMethod(String targetMethod)
|
void |
setTargetObject(Object targetObject)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractMethodInvokingDelegator()
| Method Detail |
|---|
protected T invokeDelegateMethod()
DynamicMethodInvocationException - if the MethodInvoker used throws exceptionprotected T invokeDelegateMethodWithArgument(Object object)
object - argument for the target method
DynamicMethodInvocationException - if the MethodInvoker used throws exceptionprotected T invokeDelegateMethodWithArguments(Object[] args)
args - arguments for the invoked method
DynamicMethodInvocationException - if the MethodInvoker used throws exception
public void afterPropertiesSet()
throws Exception
afterPropertiesSet in interface InitializingBeanExceptionpublic void setTargetObject(Object targetObject)
targetObject - the delegate - bean id can be used to set this value in Spring configurationpublic void setTargetMethod(String targetMethod)
targetMethod - name of the method to be invoked on setTargetObject(Object).public void setArguments(Object[] arguments)
arguments - arguments values for the {setTargetMethod(String).
These are not expected to change during the lifetime of the delegator
and will be used only when the subclass tries to invoke the target method
without providing explicit argument values.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||