Package com.adaptris.core.jms.sonic
Class LargeMessageConsumer
- java.lang.Object
-
- com.adaptris.core.AdaptrisMessageWorkerImp
-
- com.adaptris.core.AdaptrisMessageConsumerImp
-
- com.adaptris.core.jms.sonic.LargeMessageConsumer
-
- All Implemented Interfaces:
AdaptrisComponent
,AdaptrisMessageConsumer
,AdaptrisMessageWorker
,ComponentLifecycle
,ComponentLifecycleExtension
,LicensedComponent
,MessageEventGenerator
,StateManagedComponent
,javax.jms.MessageListener
,progress.message.jclient.ChannelListener
public class LargeMessageConsumer extends AdaptrisMessageConsumerImp implements javax.jms.MessageListener, progress.message.jclient.ChannelListener, LicensedComponent
Implementation of
AdaptrisMessageConsumer
which uses Sonic MQ Recoverable File Channels for Large Messages. See Sonic MQ Application Programming Guide Chapter 11 for a full description of this functionality.This should be configured with a jms-connection with the appropriate Sonic based VendorImplementation, otherwise results are undefined.
In the adapter configuration file this class is aliased as sonic-large-message-consumer which is the preferred alternative to the fully qualified classname when building your configuration.
License Required: STANDARD
-
-
Field Summary
-
Fields inherited from class com.adaptris.core.AdaptrisMessageWorkerImp
log
-
-
Constructor Summary
Constructors Constructor Description LargeMessageConsumer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ReceiveChannelConfig
getConfig()
Returns theLargeMessageConfig
to use.java.lang.Boolean
getDeleteWorkingFile()
java.lang.String
getQueue()
The Sonic Queue that will be used to initiate large message transfers.void
init()
boolean
isEnabled(License license)
protected java.lang.String
newThreadName()
void
onChannelStatus(progress.message.jclient.Channel channel, java.lang.Exception e)
void
onMessage(javax.jms.Message jmsMsg)
void
prepare()
void
setConfig(ReceiveChannelConfig cfg)
Sets theLargeMessageConfig
to use.void
setDeleteWorkingFile(java.lang.Boolean b)
Specify whether or not to delete the workfing file once processing is completevoid
setQueue(java.lang.String queue)
The Sonic Queue that will be used to initiate large message transfers.LargeMessageConsumer
withQueue(java.lang.String s)
-
Methods inherited from class com.adaptris.core.AdaptrisMessageConsumerImp
changeState, registerAdaptrisMessageListener, renameThread, requestClose, requestInit, requestStart, requestStop, retrieveAdaptrisMessageListener, retrieveComponentState
-
Methods inherited from class com.adaptris.core.AdaptrisMessageWorkerImp
createName, createQualifier, decode, encode, getEncoder, getIsTrackingEndpoint, getMessageFactory, getUniqueId, handleConnectionException, isTrackingEndpoint, registerConnection, registerEncoderMessageFactory, retrieveConnection, setEncoder, setIsTrackingEndpoint, setMessageFactory, setUniqueId, withMessageFactory, withUniqueID
-
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.AdaptrisMessageConsumer
consumeLocationKey
-
Methods inherited from interface com.adaptris.core.AdaptrisMessageWorker
decode, encode, getEncoder, getMessageFactory, handleConnectionException, registerConnection, retrieveConnection, setEncoder, setMessageFactory
-
Methods inherited from interface com.adaptris.core.ComponentLifecycle
close, start, stop
-
Methods inherited from interface com.adaptris.core.MessageEventGenerator
createName, createQualifier, isTrackingEndpoint
-
-
-
-
Method Detail
-
prepare
public void prepare() throws CoreException
- Specified by:
prepare
in interfaceComponentLifecycleExtension
- Throws:
CoreException
-
isEnabled
public boolean isEnabled(License license)
- Specified by:
isEnabled
in interfaceLicensedComponent
-
init
public void init() throws CoreException
- Specified by:
init
in interfaceComponentLifecycle
- Throws:
CoreException
- See Also:
ComponentLifecycle.init()
-
onMessage
public void onMessage(javax.jms.Message jmsMsg)
- Specified by:
onMessage
in interfacejavax.jms.MessageListener
- See Also:
MessageListener.onMessage(javax.jms.Message)
-
onChannelStatus
public void onChannelStatus(progress.message.jclient.Channel channel, java.lang.Exception e)
- Specified by:
onChannelStatus
in interfaceprogress.message.jclient.ChannelListener
-
getConfig
public ReceiveChannelConfig getConfig()
Returns the
LargeMessageConfig
to use.- Returns:
- the
LargeMessageConfig
to use
-
setConfig
public void setConfig(ReceiveChannelConfig cfg)
Sets the
LargeMessageConfig
to use. May not be null.- Parameters:
cfg
- theLargeMessageConfig
to use
-
getDeleteWorkingFile
public java.lang.Boolean getDeleteWorkingFile()
- Returns:
- the deleteWorkingFile
-
setDeleteWorkingFile
public void setDeleteWorkingFile(java.lang.Boolean b)
Specify whether or not to delete the workfing file once processing is complete- Parameters:
b
- the deleteWorkingFile to set, defaults to false.
-
withQueue
public LargeMessageConsumer withQueue(java.lang.String s)
-
newThreadName
protected java.lang.String newThreadName()
- Overrides:
newThreadName
in classAdaptrisMessageConsumerImp
-
getQueue
public java.lang.String getQueue()
The Sonic Queue that will be used to initiate large message transfers.
-
setQueue
public void setQueue(java.lang.String queue)
The Sonic Queue that will be used to initiate large message transfers.
-
-