|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.commons.messenger.SessionFactory
public class 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 | |
---|---|
protected Properties |
properties
the properties used to create the connection |
Constructor Summary | |
---|---|
SessionFactory()
|
Method Summary | |
---|---|
void |
addProperty(String name,
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 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 |
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 |
String |
getPassword()
Returns the optional password used when creating a new JMS connection via a JMS ConnectionFactory |
Properties |
getProperties()
Returns the Properties that can be used to configure the connection creation |
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(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(String clientID)
Sets the clientID used on the current connection. |
void |
setConnection(javax.jms.Connection connection)
|
void |
setConnectionFactory(javax.jms.ConnectionFactory connectionFactory)
|
void |
setPassword(String password)
|
void |
setProperties(Properties properties)
|
void |
setTopic(boolean topic)
Sets whether to use a Topic or Queue connection/session |
void |
setTransacted(boolean transacted)
|
void |
setUsername(String username)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Properties properties
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(String value)
value
- is either "auto", "client" or "dups_ok"
IllegalArgumentException
- if the value is not one of the correct valuespublic String getUsername()
public void setUsername(String username)
public String getPassword()
public void setPassword(String password)
public Properties getProperties()
public void setProperties(Properties properties)
public void addProperty(String name, String value)
public boolean isTopic()
public void setTopic(boolean topic)
public String getClientID()
public void setClientID(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 Properties createProperties()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |