public class JmsStore extends AbstractMessageStore
Modifier and Type | Field and Description |
---|---|
static String |
CACHE
Whether to cache the connection or not
|
static String |
CONN_FACTORY |
static String |
CONNECTION_STRING |
static String |
CONSUMER_TIMEOUT |
static String |
DESTINATION
JMS destination (ie.
|
static String |
GUARANTEED_DELIVERY_ENABLE
Guaranteed delivery status
|
static String |
JMS_SPEC_11 |
static String |
JMS_VERSION
JMS Specification version
|
protected static org.apache.commons.logging.Log |
log |
static String |
NAMING_FACTORY_INITIAL |
static String |
PASSWORD
JMS Broker password
|
static String |
PROVIDER_URL |
static String |
QUEUE_PREFIX
JNDI Queue Prefix
|
static String |
USERNAME
JMS Broker username
|
description, fileName, lock, messageStoreMBean, messageStoreObservers, name, parameterKeyMap, parameters, sequence, synapseConfiguration
Constructor and Description |
---|
JmsStore() |
Modifier and Type | Method and Description |
---|---|
void |
cleanup(javax.jms.Connection connection,
javax.jms.Session session)
Cleans up the JMS Connection and Session associated with a JMS client.
|
void |
clear()
Delete all the Messages in the Message Store
|
void |
closeConnection(javax.jms.Connection connection)
Closes the given JMS Connection.
|
void |
closeWriteConnection()
Closes the existing JMS message producer connection.
|
void |
destroy()
This method should implement the destroying of the
implemented parts of the configuration.
|
MessageContext |
get(int index)
Return the Message in given index position
(this may depend on the implementation)
|
MessageContext |
get(String messageId)
Get the Message with the given ID from the Message store without removing it
|
List<MessageContext> |
getAll()
Get the All messages in the Message store without removing them from the queue
|
MessageConsumer |
getConsumer()
Returns a Message Consumer for this message store.
|
MessageProducer |
getProducer()
Returns a Message Producer for this message store.
|
int |
getType()
Returns the type of this message store.
|
void |
init(SynapseEnvironment se)
End of unsupported operations.
|
org.apache.axis2.context.MessageContext |
newAxis2Mc() |
javax.jms.Connection |
newConnection()
Creates a new JMS Connection.
|
javax.jms.MessageConsumer |
newConsumer(javax.jms.Session session)
Returns a new JMS Message Consumer.
|
javax.jms.MessageProducer |
newProducer(javax.jms.Session session)
Creates a new JMS Message Producer.
|
javax.jms.Session |
newSession(javax.jms.Connection connection,
int mode,
boolean isProducerSession)
Creates a new JMS Session.
|
MessageContext |
newSynapseMc(org.apache.axis2.context.MessageContext msgCtx) |
void |
newWriteConnection()
Creates a new JMS Message producer connection.
|
javax.jms.Connection |
producerConnection()
Returns the existing JMS message producer connection.
|
MessageContext |
remove()
JMS Message store does not support following operations.
|
MessageContext |
remove(String messageID)
Delete and return the MessageContext with given Message id
|
void |
reset(javax.jms.Connection connection,
javax.jms.Session session)
Resets the JMS session for next message
|
void |
setCachedProducer(MessageProducer cachedProducer) |
void |
setParameters(Map<String,Object> parameters)
set the implementation specific parameters
|
void |
setProducer(MessageProducer producer) |
addParameter, addParameterKey, dequeued, difference, enqueued, getArtifactContainerName, getDescription, getFileName, getLock, getName, getParameterKey, getParameterKeyMap, getParameters, isEdited, nextConsumerId, nextProducerId, notifyMessageAddition, notifyMessageRemoval, registerObserver, setArtifactContainerName, setDescription, setFileName, setIsEdited, setName, size, unregisterObserver
protected static final org.apache.commons.logging.Log log
public static final String USERNAME
public static final String PASSWORD
public static final String CACHE
public static final String DESTINATION
public static final String JMS_VERSION
public static final String CONSUMER_TIMEOUT
public static final String CONN_FACTORY
public static final String NAMING_FACTORY_INITIAL
public static final String CONNECTION_STRING
public static final String PROVIDER_URL
public static final String QUEUE_PREFIX
public static final String GUARANTEED_DELIVERY_ENABLE
public static final String JMS_SPEC_11
public MessageProducer getProducer()
MessageStore
public MessageConsumer getConsumer() throws SynapseException
MessageStore
SynapseException
public int getType()
MessageStore
Constants.JMS_MS
, Constants.INMEMORY_MS
,
or Constants.JDBC_MS
getType
in interface MessageStore
getType
in class AbstractMessageStore
public MessageContext remove() throws NoSuchElementException
NoSuchElementException
- if store is emptypublic void clear()
MessageStore
public MessageContext remove(String messageID)
MessageStore
messageID
- message id of the Messagepublic MessageContext get(int index)
MessageStore
index
- position of the messagepublic List<MessageContext> getAll()
MessageStore
public MessageContext get(String messageId)
MessageStore
messageId
- A message ID stringpublic void init(SynapseEnvironment se)
init
in interface ManagedLifecycle
init
in class AbstractMessageStore
se
- SynapseEnvironment to be used for initializationpublic void destroy() throws SynapseException
ManagedLifecycle
destroy
in interface ManagedLifecycle
destroy
in class AbstractMessageStore
SynapseException
public javax.jms.Connection newConnection() throws javax.jms.JMSException, StoreForwardException
javax.jms.JMSException
- on a JMS issueStoreForwardException
- on a non JMS issuepublic javax.jms.Session newSession(javax.jms.Connection connection, int mode, boolean isProducerSession) throws javax.jms.JMSException, StoreForwardException
connection
- The JMS Connection that must be used when creating the session.mode
- Acknowledgement mode that must be used for this session.isProducerSession
- Type of the session going to createjavax.jms.JMSException
- on a JMS related issueStoreForwardException
- on a non JMS related issuepublic javax.jms.MessageProducer newProducer(javax.jms.Session session) throws javax.jms.JMSException, StoreForwardException
session
- A JMS Session.javax.jms.JMSException
StoreForwardException
public javax.jms.MessageConsumer newConsumer(javax.jms.Session session) throws javax.jms.JMSException, StoreForwardException
session
- JMS Session to create consumer formjavax.jms.JMSException
- on JMS issue when creating consumer with JMS providerStoreForwardException
public void newWriteConnection() throws StoreForwardException, javax.jms.JMSException
StoreForwardException
- on a non JMS related issuejavax.jms.JMSException
- on a JMS issuepublic void closeWriteConnection() throws javax.jms.JMSException
javax.jms.JMSException
- on a JMS level issuepublic javax.jms.Connection producerConnection()
public void closeConnection(javax.jms.Connection connection) throws javax.jms.JMSException
connection
- The JMS Connection to be closed.javax.jms.JMSException
- on a JMS level issuepublic void reset(javax.jms.Connection connection, javax.jms.Session session) throws javax.jms.JMSException
connection
- JMS Connectionsession
- JMS Session associated with the given connectionjavax.jms.JMSException
public void cleanup(javax.jms.Connection connection, javax.jms.Session session) throws javax.jms.JMSException
connection
- JMS Connectionsession
- JMS Session associated with the given connectionjavax.jms.JMSException
public org.apache.axis2.context.MessageContext newAxis2Mc()
public MessageContext newSynapseMc(org.apache.axis2.context.MessageContext msgCtx)
public void setParameters(Map<String,Object> parameters)
MessageStore
setParameters
in interface MessageStore
setParameters
in class AbstractMessageStore
parameters
- A map of parameters or nullpublic void setCachedProducer(MessageProducer cachedProducer)
public void setProducer(MessageProducer producer)
Copyright © 2005–2019 Apache Software Foundation. All rights reserved.