Package com.adaptris.core.jms
Class AggregatingJmsConsumeService
- java.lang.Object
-
- com.adaptris.core.ServiceImp
-
- com.adaptris.core.services.aggregator.AggregatingConsumeServiceImpl<JmsConnection>
-
- com.adaptris.core.jms.AggregatingJmsConsumeService
-
- All Implemented Interfaces:
AdaptrisComponent,ComponentLifecycle,ComponentLifecycleExtension,ConnectedService,JmsActorConfig,MessageEventGenerator,Service,AggregatingConsumeService<JmsConnection>,StateManagedComponent
@ComponentProfile(summary="Allows you to aggregate messages from a JMS Queue", tag="service,aggregation,jms", recommended=JmsConnection.class) public class AggregatingJmsConsumeService extends AggregatingConsumeServiceImpl<JmsConnection> implements JmsActorConfig, ConnectedServiceImplentation ofAggregatingConsumeServicethat allows you to consume a related message from a queue based on some criteria.In the adapter configuration file this class is aliased as aggregating-jms-consume-service which is the preferred alternative to the fully qualified classname when building your configuration.
-
-
Field Summary
-
Fields inherited from class com.adaptris.core.ServiceImp
log
-
-
Constructor Summary
Constructors Constructor Description AggregatingJmsConsumeService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcloseService()intconfiguredAcknowledgeMode()Return the current acknowledge mode.CorrelationIdSourceconfiguredCorrelationIdSource()Return the current correlation id source.AdaptrisMessageListenerconfiguredMessageListener()return the current configured MessageListener.MessageTypeTranslatorconfiguredMessageTranslator()Return the currently configured messageTranslator.org.slf4j.LoggercurrentLogger()Return the configured logger.javax.jms.SessioncurrentSession()Return the current jms session.voiddoService(AdaptrisMessage msg)Apply the service to the message.AdaptrisConnectiongetConnection()Returns theAdaptrisConnectionto use.AggregatingJmsConsumergetJmsConsumer()protected voidinitService()booleanisManagedTransaction()voidprepare()Prepare for initialisation.longrollbackTimeout()How long we should wait after a rollback before continuing on with processingvoidsetConnection(AdaptrisConnection connection)Sets theAdaptrisConnectionto use.voidsetJmsConsumer(AggregatingJmsConsumer consumer)voidstart()Starts the component.voidstop()Stop the component-
Methods inherited from class com.adaptris.core.services.aggregator.AggregatingConsumeServiceImpl
start, stop
-
Methods inherited from class com.adaptris.core.ServiceImp
changeState, close, continueOnFailure, createName, createQualifier, getContinueOnFail, getIsTrackingEndpoint, getUniqueId, init, isBranching, isTrackingEndpoint, requestClose, requestInit, requestStart, requestStop, retrieveComponentState, setContinueOnFail, setIsTrackingEndpoint, setUniqueId
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.adaptris.core.AdaptrisComponent
getUniqueId
-
Methods inherited from interface com.adaptris.core.ComponentLifecycle
close, init
-
Methods inherited from interface com.adaptris.core.MessageEventGenerator
createName, createQualifier, isTrackingEndpoint
-
Methods inherited from interface com.adaptris.core.Service
continueOnFailure, isBranching, setUniqueId
-
Methods inherited from interface com.adaptris.core.StateManagedComponent
changeState, requestClose, requestInit, requestStart, requestStop, retrieveComponentState
-
-
-
-
Method Detail
-
initService
protected void initService() throws CoreException- Overrides:
initServicein classAggregatingConsumeServiceImpl<JmsConnection>- Throws:
CoreException
-
start
public void start() throws CoreExceptionDescription copied from interface:ComponentLifecycleStarts the component.Once a component is started it should be ready to process messages. In the case of
AdaptrisMessageConsumer, calling start will begin message delivery.- Specified by:
startin interfaceComponentLifecycle- Overrides:
startin classAggregatingConsumeServiceImpl<JmsConnection>- Throws:
CoreException- wrapping any underlyingExceptions
-
stop
public void stop()
Description copied from interface:ComponentLifecycleStop the componentA stopped component is not expected to be ready to process messages. In the case of
AdaptrisMessageConsumer, calling stop will pause message delivery. Throwing aRuntimeExceptionmay cause unintended consequences- Specified by:
stopin interfaceComponentLifecycle- Overrides:
stopin classAggregatingConsumeServiceImpl<JmsConnection>
-
closeService
protected void closeService()
- Overrides:
closeServicein classAggregatingConsumeServiceImpl<JmsConnection>
-
prepare
public void prepare() throws CoreExceptionDescription copied from interface:ComponentLifecycleExtensionPrepare for initialisation.- Specified by:
preparein interfaceComponentLifecycleExtension- Throws:
CoreException
-
doService
public void doService(AdaptrisMessage msg) throws ServiceException
Description copied from interface:ServiceApply the service to the message.
- Specified by:
doServicein interfaceService- Parameters:
msg- theAdaptrisMessageto process- Throws:
ServiceException- wrapping any underlyingExceptions
-
configuredMessageTranslator
public MessageTypeTranslator configuredMessageTranslator()
Description copied from interface:JmsActorConfigReturn the currently configured messageTranslator.- Specified by:
configuredMessageTranslatorin interfaceJmsActorConfig- Returns:
- the MessageTypeTranslator instance.
-
configuredAcknowledgeMode
public int configuredAcknowledgeMode()
Description copied from interface:JmsActorConfigReturn the current acknowledge mode.- Specified by:
configuredAcknowledgeModein interfaceJmsActorConfig- Returns:
- the session acknowledge mode.
-
configuredCorrelationIdSource
public CorrelationIdSource configuredCorrelationIdSource()
Description copied from interface:JmsActorConfigReturn the current correlation id source.- Specified by:
configuredCorrelationIdSourcein interfaceJmsActorConfig- Returns:
- the correlation id source
-
configuredMessageListener
public AdaptrisMessageListener configuredMessageListener()
Description copied from interface:JmsActorConfigreturn the current configured MessageListener.- Specified by:
configuredMessageListenerin interfaceJmsActorConfig- Returns:
- the adaptris message listener instance.
-
currentSession
public javax.jms.Session currentSession()
Description copied from interface:JmsActorConfigReturn the current jms session.- Specified by:
currentSessionin interfaceJmsActorConfig- Returns:
- the current javax.jms.Session
-
currentLogger
public org.slf4j.Logger currentLogger()
Description copied from interface:JmsActorConfigReturn the configured logger.- Specified by:
currentLoggerin interfaceJmsActorConfig- Returns:
- the logger.
-
rollbackTimeout
public long rollbackTimeout()
Description copied from interface:JmsActorConfigHow long we should wait after a rollback before continuing on with processing- Specified by:
rollbackTimeoutin interfaceJmsActorConfig- Returns:
- the timeout in ms.
-
getJmsConsumer
public AggregatingJmsConsumer getJmsConsumer()
-
setJmsConsumer
public void setJmsConsumer(AggregatingJmsConsumer consumer)
-
getConnection
public AdaptrisConnection getConnection()
Description copied from interface:ConnectedServiceReturns theAdaptrisConnectionto use.- Specified by:
getConnectionin interfaceConnectedService- Returns:
- the
AdaptrisConnection
-
setConnection
public void setConnection(AdaptrisConnection connection)
Description copied from interface:ConnectedServiceSets theAdaptrisConnectionto use.- Specified by:
setConnectionin interfaceConnectedService- Parameters:
connection- theAdaptrisConnectionto use
-
isManagedTransaction
public boolean isManagedTransaction()
- Specified by:
isManagedTransactionin interfaceJmsActorConfig- Returns:
- whether we are in a managed (XA) transaction
-
-