Class MethodInvokingMessageSource
java.lang.Object
org.springframework.integration.util.AbstractExpressionEvaluator
org.springframework.integration.endpoint.AbstractMessageSource<Object>
org.springframework.integration.endpoint.MethodInvokingMessageSource
- All Implemented Interfaces:
Aware
,BeanFactoryAware
,BeanNameAware
,DisposableBean
,InitializingBean
,Lifecycle
,MessageSource<Object>
,IntegrationPattern
,NamedComponent
,IntegrationInboundManagement
,IntegrationManagement
,ManageableLifecycle
public class MethodInvokingMessageSource extends AbstractMessageSource<Object> implements ManageableLifecycle
A
MessageSource
implementation that
invokes a no-argument method so that its return value may be sent to a channel.- Author:
- Mark Fisher, Gary Russell, Artem Bilan
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.integration.support.management.IntegrationManagement
IntegrationManagement.ManagementOverrides
-
Field Summary
Fields inherited from class org.springframework.integration.util.AbstractExpressionEvaluator
EXPRESSION_PARSER, logger
Fields inherited from interface org.springframework.integration.support.management.IntegrationManagement
METER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAME
-
Constructor Summary
Constructors Constructor Description MethodInvokingMessageSource()
-
Method Summary
Modifier and Type Method Description protected Object
doReceive()
Subclasses must implement this method.String
getComponentType()
boolean
isRunning()
protected void
onInit()
void
setMethod(Method method)
void
setMethodName(String methodName)
void
setObject(Object object)
void
start()
void
stop()
Methods inherited from class org.springframework.integration.endpoint.AbstractMessageSource
buildMessage, destroy, getBeanName, getComponentName, getManagedName, getManagedType, getOverrides, isLoggingEnabled, receive, registerMetricsCaptor, setBeanName, setHeaderExpressions, setLoggingEnabled, setManagedName, setManagedType
Methods inherited from class org.springframework.integration.util.AbstractExpressionEvaluator
afterPropertiesSet, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, getBeanFactory, getEvaluationContext, getEvaluationContext, getMessageBuilderFactory, setBeanFactory, setConversionService
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.integration.support.management.IntegrationManagement
getThisAs
Methods inherited from interface org.springframework.integration.core.MessageSource
getIntegrationPatternType
-
Constructor Details
-
MethodInvokingMessageSource
public MethodInvokingMessageSource()
-
-
Method Details
-
setObject
-
setMethod
-
setMethodName
-
getComponentType
- Specified by:
getComponentType
in interfaceNamedComponent
-
onInit
protected void onInit()- Overrides:
onInit
in classAbstractExpressionEvaluator
-
start
public void start()- Specified by:
start
in interfaceLifecycle
- Specified by:
start
in interfaceManageableLifecycle
-
stop
public void stop()- Specified by:
stop
in interfaceLifecycle
- Specified by:
stop
in interfaceManageableLifecycle
-
isRunning
public boolean isRunning()- Specified by:
isRunning
in interfaceLifecycle
- Specified by:
isRunning
in interfaceManageableLifecycle
-
doReceive
Description copied from class:AbstractMessageSource
Subclasses must implement this method. Typically the returned value will be thepayload
of type T, but the returned value may also be aMessage
instance whose payload is of type T; also can beAbstractIntegrationMessageBuilder
which is used for additional headers population.- Specified by:
doReceive
in classAbstractMessageSource<Object>
- Returns:
- The value returned.
-