public class GatewayProxyFactoryBean extends AbstractEndpoint implements TrackableComponent, org.springframework.beans.factory.FactoryBean<java.lang.Object>, org.aopalliance.intercept.MethodInterceptor, org.springframework.beans.factory.BeanClassLoaderAware
ConversionService
set on the enclosing BeanFactory
under the name IntegrationUtils.INTEGRATION_CONVERSION_SERVICE_BEAN_NAME
to
perform type conversions when necessary (thanks to Jon Schneider's contribution and suggestion in INT-1230).lifecycleCondition, lifecycleLock
EXPRESSION_PARSER, logger
Constructor and Description |
---|
GatewayProxyFactoryBean()
Create a Factory whose service interface type can be configured by setter injection.
|
GatewayProxyFactoryBean(java.lang.Class<?> serviceInterface) |
Modifier and Type | Method and Description |
---|---|
protected java.lang.Object |
doInvoke(org.aopalliance.intercept.MethodInvocation invocation,
boolean runningOnCallerThread) |
protected void |
doStart()
Subclasses must implement this method with the start behavior.
|
protected void |
doStop()
Subclasses must implement this method with the stop behavior.
|
protected org.springframework.core.task.AsyncTaskExecutor |
getAsyncExecutor() |
java.util.Map<java.lang.reflect.Method,MessagingGatewaySupport> |
getGateways()
Return the Map of
Method to MessagingGatewaySupport
generated by this factory bean. |
java.lang.Object |
getObject() |
java.lang.Class<?> |
getObjectType() |
java.lang.Object |
invoke(org.aopalliance.intercept.MethodInvocation invocation) |
boolean |
isSingleton() |
protected void |
onInit()
Subclasses may implement this for initialization logic.
|
void |
setAsyncExecutor(java.util.concurrent.Executor executor)
Set the executor for use when the gateway method returns
Future or ListenableFuture . |
void |
setBeanClassLoader(java.lang.ClassLoader beanClassLoader) |
void |
setDefaultReplyChannel(org.springframework.messaging.MessageChannel defaultReplyChannel)
Set the default reply channel.
|
void |
setDefaultReplyChannelName(java.lang.String defaultReplyChannelName)
Set the default reply channel bean name.
|
void |
setDefaultReplyTimeout(java.lang.Long defaultReplyTimeout)
Set the default timeout value for receiving reply messages.
|
void |
setDefaultReplyTimeoutExpression(org.springframework.expression.Expression defaultReplyTimeout)
Set an expression to be evaluated to determine the default timeout value for
receiving reply messages.
|
void |
setDefaultReplyTimeoutExpressionString(java.lang.String defaultReplyTimeout)
Set an expression to be evaluated to determine the default timeout value for
receiving reply messages.
|
void |
setDefaultRequestChannel(org.springframework.messaging.MessageChannel defaultRequestChannel)
Set the default request channel.
|
void |
setDefaultRequestChannelName(java.lang.String defaultRequestChannelName)
Set the default request channel bean name.
|
void |
setDefaultRequestTimeout(java.lang.Long defaultRequestTimeout)
Set the default timeout value for sending request messages.
|
void |
setDefaultRequestTimeoutExpression(org.springframework.expression.Expression defaultRequestTimeout)
Set an expression to be evaluated to determine the default timeout value for
sending request messages.
|
void |
setDefaultRequestTimeoutExpressionString(java.lang.String defaultRequestTimeout)
Set an expression to be evaluated to determine the default timeout value for
sending request messages.
|
void |
setErrorChannel(org.springframework.messaging.MessageChannel errorChannel)
Set the error channel.
|
void |
setErrorChannelName(java.lang.String errorChannelName)
Set the error channel name.
|
void |
setGlobalMethodMetadata(GatewayMethodMetadata globalMethodMetadata) |
void |
setMapper(MethodArgsMessageMapper mapper)
|
void |
setMethodMetadataMap(java.util.Map<java.lang.String,GatewayMethodMetadata> methodMetadataMap) |
void |
setServiceInterface(java.lang.Class<?> serviceInterface)
Set the interface class that the generated proxy should implement.
|
void |
setShouldTrack(boolean shouldTrack) |
void |
setTypeConverter(org.springframework.beans.TypeConverter typeConverter) |
destroy, doStop, getPhase, getRole, isAutoStartup, isRunning, setAutoStartup, setPhase, setRole, setTaskScheduler, start, stop, stop
afterPropertiesSet, extractTypeIfPossible, getApplicationContext, getApplicationContextId, getBeanFactory, getChannelResolver, getComponentName, getComponentType, getConversionService, getExpression, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getComponentName, getComponentType
public GatewayProxyFactoryBean()
RequestReplyExchanger
, upon initialization.public GatewayProxyFactoryBean(java.lang.Class<?> serviceInterface)
public void setServiceInterface(java.lang.Class<?> serviceInterface)
RequestReplyExchanger
.serviceInterface
- The service interface.public void setDefaultRequestChannel(org.springframework.messaging.MessageChannel defaultRequestChannel)
defaultRequestChannel
- the channel to which request messages will
be sent if no request channel has been configured with an annotation.public void setDefaultRequestChannelName(java.lang.String defaultRequestChannelName)
defaultRequestChannelName
- the channel name to which request messages will
be sent if no request channel has been configured with an annotation.public void setDefaultReplyChannel(org.springframework.messaging.MessageChannel defaultReplyChannel)
defaultReplyChannel
- the channel from which reply messages will be
received if no reply channel has been configured with an annotationpublic void setDefaultReplyChannelName(java.lang.String defaultReplyChannelName)
defaultReplyChannelName
- the channel name from which reply messages will be
received if no reply channel has been configured with an annotationpublic void setErrorChannel(org.springframework.messaging.MessageChannel errorChannel)
errorChannel
- The error channel.public void setErrorChannelName(java.lang.String errorChannelName)
errorChannelName
- The error channel bean name.public void setDefaultRequestTimeout(java.lang.Long defaultRequestTimeout)
defaultRequestTimeout
- the timeout value in millisecondspublic void setDefaultRequestTimeoutExpression(org.springframework.expression.Expression defaultRequestTimeout)
defaultRequestTimeout
- the timeout value in millisecondspublic void setDefaultRequestTimeoutExpressionString(java.lang.String defaultRequestTimeout)
defaultRequestTimeout
- the timeout value in millisecondspublic void setDefaultReplyTimeout(java.lang.Long defaultReplyTimeout)
defaultReplyTimeout
- the timeout value in millisecondspublic void setDefaultReplyTimeoutExpression(org.springframework.expression.Expression defaultReplyTimeout)
defaultReplyTimeout
- the timeout value in millisecondspublic void setDefaultReplyTimeoutExpressionString(java.lang.String defaultReplyTimeout)
defaultReplyTimeout
- the timeout value in millisecondspublic void setShouldTrack(boolean shouldTrack)
setShouldTrack
in interface TrackableComponent
public void setAsyncExecutor(java.util.concurrent.Executor executor)
Future
or ListenableFuture
.
Set it to null to disable the async processing, and any
Future
return types must be returned by the downstream flow.executor
- The executor.public void setTypeConverter(org.springframework.beans.TypeConverter typeConverter)
public void setMethodMetadataMap(java.util.Map<java.lang.String,GatewayMethodMetadata> methodMetadataMap)
public void setGlobalMethodMetadata(GatewayMethodMetadata globalMethodMetadata)
public void setBeanClassLoader(java.lang.ClassLoader beanClassLoader)
setBeanClassLoader
in interface org.springframework.beans.factory.BeanClassLoaderAware
public final void setMapper(MethodArgsMessageMapper mapper)
mapper
- the mapper.protected org.springframework.core.task.AsyncTaskExecutor getAsyncExecutor()
public java.util.Map<java.lang.reflect.Method,MessagingGatewaySupport> getGateways()
Method
to MessagingGatewaySupport
generated by this factory bean.protected void onInit()
IntegrationObjectSupport
onInit
in class AbstractEndpoint
public java.lang.Class<?> getObjectType()
getObjectType
in interface org.springframework.beans.factory.FactoryBean<java.lang.Object>
public java.lang.Object getObject() throws java.lang.Exception
getObject
in interface org.springframework.beans.factory.FactoryBean<java.lang.Object>
java.lang.Exception
public boolean isSingleton()
isSingleton
in interface org.springframework.beans.factory.FactoryBean<java.lang.Object>
public java.lang.Object invoke(org.aopalliance.intercept.MethodInvocation invocation) throws java.lang.Throwable
invoke
in interface org.aopalliance.intercept.MethodInterceptor
java.lang.Throwable
protected java.lang.Object doInvoke(org.aopalliance.intercept.MethodInvocation invocation, boolean runningOnCallerThread) throws java.lang.Throwable
java.lang.Throwable
protected void doStart()
AbstractEndpoint
AbstractEndpoint.lifecycleLock
.doStart
in class AbstractEndpoint
protected void doStop()
AbstractEndpoint
AbstractEndpoint.lifecycleLock
.doStop
in class AbstractEndpoint