public class JMSConnectionResourceFactory extends Object
| Modifier and Type | Field and Description |
|---|---|
protected String |
clientId
The
String instance representing the client id of the durable subscription. |
protected JMSConstants.JMSDestinationType |
destinationType
Represents whether to listen queue or topic.
|
protected String |
jmsSpec
The
String instance representing the jms spec version. |
| Constructor and Description |
|---|
JMSConnectionResourceFactory(Properties properties)
Initialization of JMS ConnectionFactory with the user specified properties.
|
| Modifier and Type | Method and Description |
|---|---|
void |
closeConnection(javax.jms.Connection connection)
Close a JMS
Connection. |
void |
closeConsumer(javax.jms.MessageConsumer messageConsumer)
Close a JMS
MessageConsumer. |
void |
closeProducer(javax.jms.MessageProducer messageProducer)
Close a JMS
MessageProducer. |
void |
closeSession(javax.jms.Session session)
Close a JMS
Session. |
javax.jms.Connection |
createConnection()
Create a
Connection instance using the initialized configurations. |
javax.jms.Destination |
createDestination(javax.jms.Session session,
String destinationName)
To create the destination.
|
javax.jms.MessageProducer |
createMessageProducer(javax.jms.Session session)
Create
MessageProducer instance for the provided session. |
javax.jms.Session |
createSession(javax.jms.Connection connection)
Create JMS
Session instance on top of the provided Connection instance. |
javax.jms.XAConnection |
createXAConnection()
Create a
XAConnection instance using the initialized configurations. |
javax.jms.XASession |
createXASession(javax.jms.XAConnection xAConnection)
Create JMS
XASession instance on top of the provided Connection instance. |
javax.jms.ConnectionFactory |
getConnectionFactory()
To get the JMS Connection Factory.
|
protected String |
getConnectionFactoryString()
Get ConnectionFactory Name.
|
JMSConstants.JMSDestinationType |
getDestinationType()
Get destination type of this Connection factory.
|
String |
getJmsSpec()
Get JMS specification version.
|
Properties |
getProperties() |
int |
getSessionAckMode() |
boolean |
isTransactedSession() |
boolean |
isxATransacted() |
void |
notifyError(javax.jms.JMSException ex)
This method will get invoked by the JMS Connection Error listener whenever as error occurs in the
JMS Connection level.
|
void |
start(javax.jms.Connection connection)
Start the jms connection to start the message delivery.
|
void |
stop(javax.jms.Connection connection)
Stop the jms connection to stop the message delivery.
|
protected JMSConstants.JMSDestinationType destinationType
public JMSConnectionResourceFactory(Properties properties) throws JMSConnectorException
properties - Properties to be added to the initial context.JMSConnectorException - Thrown when initial context name is wrong or when creating connection factory.public javax.jms.ConnectionFactory getConnectionFactory()
throws JMSConnectorException
JMSConnectorException - Thrown when creating jms connection.public javax.jms.Connection createConnection()
throws javax.jms.JMSException
Connection instance using the initialized configurations.javax.jms.JMSException - thrown when creating the connection object from JMS connection factory.public javax.jms.XAConnection createXAConnection()
throws javax.jms.JMSException
XAConnection instance using the initialized configurations.javax.jms.JMSException - thrown when creating the XAconnection object from JMS XAconnection factory.public javax.jms.Destination createDestination(javax.jms.Session session,
String destinationName)
throws JMSConnectorException
session - relevant session to create the destination.destinationName - Destination jms destination.JMSConnectorException - Thrown when looking up destination.public javax.jms.Session createSession(javax.jms.Connection connection)
throws JMSConnectorException
Session instance on top of the provided Connection instance.connection - JMS Connection.JMSConnectorException - Error when creating the JMS Session.public javax.jms.XASession createXASession(javax.jms.XAConnection xAConnection)
throws JMSConnectorException
XASession instance on top of the provided Connection instance.xAConnection - JMS Connection.JMSConnectorException - Error when creating the XASession.public javax.jms.MessageProducer createMessageProducer(javax.jms.Session session)
throws JMSConnectorException
MessageProducer instance for the provided session.session - JMS Session instance.JMSConnectorException - Error when creating the JMS Message Producer.public boolean isTransactedSession()
public boolean isxATransacted()
public int getSessionAckMode()
public Properties getProperties()
public void notifyError(javax.jms.JMSException ex)
This can be used to close all the Connections, Sessions, Producer, Consumers created on top of this Connection factory and initialize again.
ex - JMS Exception that occurred in Connection.public String getJmsSpec()
public JMSConstants.JMSDestinationType getDestinationType()
public void closeConnection(javax.jms.Connection connection)
throws javax.jms.JMSException
Connection.connection - Connection that need to be closed.javax.jms.JMSException - if an error occurs while closing the connection.public void closeSession(javax.jms.Session session)
throws javax.jms.JMSException
Session.session - Session that needs to be closed.javax.jms.JMSException - if an error occurs while closing the session.public void closeProducer(javax.jms.MessageProducer messageProducer)
throws javax.jms.JMSException
MessageProducer.messageProducer - JMS Message Producer that needs to be closed.javax.jms.JMSException - if an error occurs while closing the producer.public void closeConsumer(javax.jms.MessageConsumer messageConsumer)
throws javax.jms.JMSException
MessageConsumer.messageConsumer - JMS Message Consumer that needs to be closed.javax.jms.JMSException - if an error occurs while closing the consumer.public void start(javax.jms.Connection connection)
throws JMSConnectorException,
javax.jms.JMSSecurityException
connection - Connection that need to be started.JMSConnectorException - Thrown when starting jms connection.javax.jms.JMSSecurityException - Thrown for issues in security (eg: credentials).public void stop(javax.jms.Connection connection)
throws JMSConnectorException
connection - JMS connection that need to be stopped.JMSConnectorException - Thrown when stopping jms connection.protected String getConnectionFactoryString()
Copyright © 2019 WSO2. All rights reserved.