org.springframework.integration.jpa.outbound
Class JpaOutboundGateway
java.lang.Object
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.handler.AbstractMessageHandler
org.springframework.integration.handler.AbstractReplyProducingMessageHandler
org.springframework.integration.jpa.outbound.JpaOutboundGateway
- All Implemented Interfaces:
- org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.InitializingBean, org.springframework.core.Ordered, NamedComponent, Orderable, MessageHandler, MessageProducer, TrackableComponent
public class JpaOutboundGateway
- extends AbstractReplyProducingMessageHandler
The Jpa Outbound Gateway will allow you to make outbound operations to either:
- submit (insert, delete) data to a database using JPA
- retrieve (select) data from a database
Depending on the selected OutboundGatewayType
, the outbound gateway
will use either the JpaExecutor
's poll method or its
executeOutboundJpaOperation method.
In order to initialize the adapter, you must provide a JpaExecutor
as
constructor.
- Since:
- 2.2
- Author:
- Gunnar Hillert
Fields inherited from interface org.springframework.core.Ordered |
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE |
Method Summary |
protected java.lang.Object |
handleRequestMessage(Message<?> requestMessage)
Subclasses must implement this method to handle the request Message. |
protected void |
onInit()
Subclasses may implement this for initialization logic. |
void |
setGatewayType(OutboundGatewayType gatewayType)
|
void |
setProducesReply(boolean producesReply)
If set to 'false', this component will act as an Outbound Channel Adapter. |
Methods inherited from class org.springframework.integration.context.IntegrationObjectSupport |
afterPropertiesSet, getBeanFactory, getComponentName, getConversionService, getTaskScheduler, setBeanFactory, setBeanName, setComponentName, setConversionService, setTaskScheduler, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
JpaOutboundGateway
public JpaOutboundGateway(JpaExecutor jpaExecutor)
- Constructor taking an
JpaExecutor
that wraps all JPA Operations.
- Parameters:
jpaExecutor
- Must not be null
onInit
protected void onInit()
- Description copied from class:
IntegrationObjectSupport
- Subclasses may implement this for initialization logic.
- Overrides:
onInit
in class AbstractReplyProducingMessageHandler
handleRequestMessage
protected java.lang.Object handleRequestMessage(Message<?> requestMessage)
- Description copied from class:
AbstractReplyProducingMessageHandler
- Subclasses must implement this method to handle the request Message. The return
value may be a Message, a MessageBuilder, or any plain Object. The base class
will handle the final creation of a reply Message from any of those starting
points. If the return value is null, the Message flow will end here.
- Specified by:
handleRequestMessage
in class AbstractReplyProducingMessageHandler
setGatewayType
public void setGatewayType(OutboundGatewayType gatewayType)
- Parameters:
gatewayType
-
setProducesReply
public void setProducesReply(boolean producesReply)
- If set to 'false', this component will act as an Outbound Channel Adapter.
If not explicitly set this property will default to 'true'.
- Parameters:
producesReply
- Defaults to 'true'.