org.springframework.integration.util
Class AbstractMethodInvokingAdapter
java.lang.Object
org.springframework.integration.util.AbstractMethodInvokingAdapter
- All Implemented Interfaces:
- org.springframework.beans.factory.InitializingBean, org.springframework.core.Ordered, MethodInvoker
- Direct Known Subclasses:
- AbstractMessageHandlerAdapter, AnnotationMethodTransformerAdapter, PayloadTransformerAdapter
public abstract class AbstractMethodInvokingAdapter
- extends java.lang.Object
- implements MethodInvoker, org.springframework.beans.factory.InitializingBean, org.springframework.core.Ordered
An base class for adapters that invoke a specified method and target object.
Either a Method
reference or a 'methodName' may be provided, but both
are not necessary. In fact, while preference is given to a Method
reference if available, an Exception will be thrown if a non-matching
'methodName' has also been provided. Therefore, to avoid such ambiguity,
it is recommended to provide just one or the other.
- Author:
- Mark Fisher
Fields inherited from interface org.springframework.core.Ordered |
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
logger
protected final org.apache.commons.logging.Log logger
object
private volatile java.lang.Object object
method
private volatile java.lang.reflect.Method method
methodName
private volatile java.lang.String methodName
order
private volatile int order
invoker
private volatile MethodInvoker invoker
initialized
private volatile boolean initialized
initializationMonitor
private final java.lang.Object initializationMonitor
AbstractMethodInvokingAdapter
public AbstractMethodInvokingAdapter()
setObject
public void setObject(java.lang.Object object)
getObject
protected java.lang.Object getObject()
setMethod
public void setMethod(java.lang.reflect.Method method)
getMethod
protected java.lang.reflect.Method getMethod()
setMethodName
public void setMethodName(java.lang.String methodName)
getMethodName
protected java.lang.String getMethodName()
setOrder
public void setOrder(int order)
getOrder
public int getOrder()
- Specified by:
getOrder
in interface org.springframework.core.Ordered
isInitialized
protected boolean isInitialized()
afterPropertiesSet
public void afterPropertiesSet()
- Specified by:
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
initialize
protected void initialize()
- Subclasses may override this method for custom initialization requirements.
invokeMethod
public java.lang.Object invokeMethod(java.lang.Object... args)
throws java.lang.Exception
- Specified by:
invokeMethod
in interface MethodInvoker
- Throws:
java.lang.Exception