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
|
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, parameters, sequence, synapseConfiguration, synapseEnvironment
Constructor and Description |
---|
JmsStore() |
Modifier and Type | Method and Description |
---|---|
boolean |
cleanup(javax.jms.Connection connection,
javax.jms.Session session,
boolean error)
Cleans up the JMS Connection and Session associated with a JMS client.
|
void |
clear()
Delete all the Messages in the Message Store
|
boolean |
closeConnection(javax.jms.Connection connection)
Closes the given JMS Connection.
|
boolean |
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) |
boolean |
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
|
boolean |
reset(javax.jms.Connection connection,
javax.jms.Session session,
boolean error)
Resets the JMS session for next message
|
void |
setCachedProducer(MessageProducer cachedProducer) |
void |
setParameters(Map<String,Object> parameters)
set the implementation specific parameters
|
dequeued, difference, enqueued, getArtifactContainerName, getDescription, getFileName, getLock, getName, getParameters, isEdited, nextConsumerId, nextProducerId, notifyMessageAddition, notifyMessageRemoval, registerObserver, setArtifactContainerName, setDescription, setFileName, setIsEdited, setName, size, unregisterObserver
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()
MessageStore
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()
ManagedLifecycle
destroy
in interface ManagedLifecycle
destroy
in class AbstractMessageStore
public javax.jms.Connection newConnection() throws javax.jms.JMSException
javax.jms.JMSException
public javax.jms.Session newSession(javax.jms.Connection connection, int mode, boolean isProducerSession) throws javax.jms.JMSException
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
public javax.jms.MessageProducer newProducer(javax.jms.Session session) throws javax.jms.JMSException
session
- A JMS Session.javax.jms.JMSException
public javax.jms.MessageConsumer newConsumer(javax.jms.Session session) throws javax.jms.JMSException
session
- A JMS Sessionjavax.jms.JMSException
public boolean newWriteConnection()
public boolean closeWriteConnection()
public javax.jms.Connection producerConnection()
public boolean closeConnection(javax.jms.Connection connection)
connection
- The JMS Connection to be closed.public boolean reset(javax.jms.Connection connection, javax.jms.Session session, boolean error)
connection
- JMS Connectionsession
- JMS Session associated with the given connectionerror
- Is this method called upon an errortrue
if the reset is successful. false
otherwise.public boolean cleanup(javax.jms.Connection connection, javax.jms.Session session, boolean error)
connection
- JMS Connectionsession
- JMS Session associated with the given connectionerror
- is this method called upon an errortrue
if the cleanup is successful. false
otherwise.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)
Copyright © 2005–2017 Apache Software Foundation. All rights reserved.