|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.messenger.SessionFactory
SessionFactory
is a Factory of JMS Session objects.
It can be configured with a JMS Connection object to use or can use
a JMS ConnectionFactory instance to create the JMS Connection lazily
Field Summary | |
private int |
acknowlegeMode
JMS acknowlege mode used on each session |
private java.lang.String |
clientID
The client ID for the connection |
private javax.jms.Connection |
connection
The JMS connection used to create JMS sessions |
private javax.jms.ConnectionFactory |
connectionFactory
The JMS ConnectionFactory used to create JMS Connection instances |
private static org.apache.commons.logging.Log |
log
Logger |
private java.lang.String |
password
the optional password used when creating a new JMS connection via a JMS ConnectionFactory |
protected java.util.Properties |
properties
the properties used to create the connection |
private boolean |
topic
Whether to use a Topic or Queue connection/session |
private boolean |
transacted
whether JMS sessions should be transacted |
private java.lang.String |
username
the optional username used when creating a new JMS connection via a JMS ConnectionFactory |
Constructor Summary | |
SessionFactory()
|
Method Summary | |
void |
addProperty(java.lang.String name,
java.lang.String value)
|
void |
close()
Closes the JMS Connection that this object is using, if any |
javax.jms.Connection |
createConnection()
Factory method used to create a connection |
protected javax.jms.ConnectionFactory |
createConnectionFactory()
Factory method used to create a connection factory. |
protected java.util.Properties |
createProperties()
Factory method used to create the initial JNDI context properties. |
protected javax.jms.QueueConnection |
createQueueConnection(javax.jms.QueueConnectionFactory queueConnectionFactory)
|
javax.jms.ServerSessionPool |
createServerSessionPool(javax.jms.MessageListener messageListener,
int maxThreads)
|
javax.jms.Session |
createSession()
Creates a new Session instance |
javax.jms.Session |
createSession(javax.jms.Connection connection)
Creates a new Session instance |
protected javax.jms.TopicConnection |
createTopicConnection(javax.jms.TopicConnectionFactory topicConnectionFactory)
|
int |
getAcknowledgeMode()
Returns the JMS acknowledge mode used by the JMS sessions created by this session |
java.lang.String |
getClientID()
Returns the clientID used on the current connection. |
javax.jms.Connection |
getConnection()
Returns the JMS connection used to create new sessions |
javax.jms.ConnectionFactory |
getConnectionFactory()
Returns the JMS ConnectionFactory used to create a new connection |
java.lang.String |
getPassword()
Returns the optional password used when creating a new JMS connection via a JMS ConnectionFactory |
java.util.Properties |
getProperties()
Returns the Properties that can be used to configure the connection creation |
java.lang.String |
getUsername()
Returns the optional username used when creating a new JMS connection via a JMS ConnectionFactory |
boolean |
isTopic()
|
boolean |
isTransacted()
Returns true if sessions created by this factory should be transacted |
void |
setAcknowledge(java.lang.String value)
A String based setter method to allow this property to be defined easily from within the digester XML file. |
void |
setAcknowledgeMode(int acknowlegeMode)
|
void |
setClientID(java.lang.String clientID)
Sets the clientID used on the current connection. |
void |
setConnection(javax.jms.Connection connection)
|
void |
setConnectionFactory(javax.jms.ConnectionFactory connectionFactory)
|
void |
setPassword(java.lang.String password)
|
void |
setProperties(java.util.Properties properties)
|
void |
setTopic(boolean topic)
Sets whether to use a Topic or Queue connection/session |
void |
setTransacted(boolean transacted)
|
void |
setUsername(java.lang.String username)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final org.apache.commons.logging.Log log
private javax.jms.Connection connection
private javax.jms.ConnectionFactory connectionFactory
private int acknowlegeMode
private boolean transacted
private java.lang.String username
private java.lang.String password
protected java.util.Properties properties
private boolean topic
private java.lang.String clientID
Constructor Detail |
public SessionFactory()
Method Detail |
public javax.jms.Session createSession(javax.jms.Connection connection) throws javax.jms.JMSException
javax.jms.JMSException
public javax.jms.Session createSession() throws javax.jms.JMSException
javax.jms.JMSException
public javax.jms.ServerSessionPool createServerSessionPool(javax.jms.MessageListener messageListener, int maxThreads) throws javax.jms.JMSException
javax.jms.JMSException
public javax.jms.Connection createConnection() throws javax.jms.JMSException
javax.jms.JMSException
public void close() throws javax.jms.JMSException
javax.jms.JMSException
public javax.jms.Connection getConnection() throws javax.jms.JMSException
javax.jms.JMSException
public void setConnection(javax.jms.Connection connection) throws javax.jms.JMSException
javax.jms.JMSException
public javax.jms.ConnectionFactory getConnectionFactory() throws javax.jms.JMSException
javax.jms.JMSException
public void setConnectionFactory(javax.jms.ConnectionFactory connectionFactory)
public boolean isTransacted()
public void setTransacted(boolean transacted)
public int getAcknowledgeMode()
public void setAcknowledgeMode(int acknowlegeMode)
public void setAcknowledge(java.lang.String value)
java.lang.IllegalArgumentException
- if the value is not one of the correct valuespublic java.lang.String getUsername()
public void setUsername(java.lang.String username)
public java.lang.String getPassword()
public void setPassword(java.lang.String password)
public java.util.Properties getProperties()
public void setProperties(java.util.Properties properties)
public void addProperty(java.lang.String name, java.lang.String value)
public boolean isTopic()
public void setTopic(boolean topic)
public java.lang.String getClientID()
public void setClientID(java.lang.String clientID)
clientID
- The clientID to setprotected javax.jms.QueueConnection createQueueConnection(javax.jms.QueueConnectionFactory queueConnectionFactory) throws javax.jms.JMSException
javax.jms.JMSException
protected javax.jms.TopicConnection createTopicConnection(javax.jms.TopicConnectionFactory topicConnectionFactory) throws javax.jms.JMSException
javax.jms.JMSException
protected javax.jms.ConnectionFactory createConnectionFactory() throws javax.jms.JMSException
javax.jms.JMSException
protected java.util.Properties createProperties()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |