public class MethodInvokingMessageSource extends AbstractMessageSource<java.lang.Object> implements org.springframework.beans.factory.InitializingBean, org.springframework.context.Lifecycle
MessageSource
implementation that invokes a no-argument method so
that its return value may be sent to a channel.IntegrationManagement.ManagementOverrides
EXPRESSION_PARSER, logger
METER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAME
Constructor and Description |
---|
MethodInvokingMessageSource() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
protected java.lang.Object |
doReceive()
Subclasses must implement this method.
|
java.lang.String |
getComponentType() |
boolean |
isRunning() |
void |
setMethod(java.lang.reflect.Method method) |
void |
setMethodName(java.lang.String methodName) |
void |
setObject(java.lang.Object object) |
void |
start() |
void |
stop() |
buildMessage, getComponentName, getManagedName, getManagedType, getMessageCount, getMessageCountLong, getOverrides, isCountsEnabled, isLoggingEnabled, receive, registerMetricsCaptor, reset, setBeanName, setCountsEnabled, setHeaderExpressions, setLoggingEnabled, setManagedName, setManagedType
evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, getBeanFactory, getEvaluationContext, getEvaluationContext, getMessageBuilderFactory, setBeanFactory, setConversionService
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
setCounter
public void setObject(java.lang.Object object)
public void setMethod(java.lang.reflect.Method method)
public void setMethodName(java.lang.String methodName)
public java.lang.String getComponentType()
getComponentType
in interface NamedComponent
public void afterPropertiesSet() throws java.lang.Exception
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
afterPropertiesSet
in class AbstractExpressionEvaluator
java.lang.Exception
public void start()
start
in interface org.springframework.context.Lifecycle
public void stop()
stop
in interface org.springframework.context.Lifecycle
public boolean isRunning()
isRunning
in interface org.springframework.context.Lifecycle
protected java.lang.Object doReceive()
AbstractMessageSource
payload
of
type T, but the returned value may also be a Message
instance whose payload is of type T;
also can be AbstractIntegrationMessageBuilder
which is used for additional headers population.doReceive
in class AbstractMessageSource<java.lang.Object>