|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.objectweb.jonas_jms.JConnection
public class JConnection
Common methods used in JQueueConnection and JTopicConnection.
Field Summary | |
---|---|
protected boolean |
closed
|
protected boolean |
globaltx
|
protected static java.lang.String |
INTERNAL_USER_NAME
|
protected JConnectionFactory |
jcf
|
protected java.util.LinkedList |
sessionlist
|
protected static org.objectweb.transaction.jta.TransactionManager |
tm
|
protected java.lang.String |
user
|
protected javax.jms.XAConnection |
xac
|
Constructor Summary | |
---|---|
protected |
JConnection(JConnectionFactory jcf,
java.lang.String user)
Prepares the construction of a JConnection. |
|
JConnection(JConnectionFactory jcf,
javax.jms.XAConnectionFactory xacf)
Constructor of a JConnection for an anonymous user. |
|
JConnection(JConnectionFactory jcf,
javax.jms.XAConnectionFactory xacf,
java.lang.String user,
java.lang.String passwd)
Constructor of a JConnection for a specified user. |
Method Summary | |
---|---|
void |
close()
When this method is invoked it should not return until message processing has been orderly shut down. |
javax.jms.ConnectionConsumer |
createConnectionConsumer(javax.jms.Destination destination,
java.lang.String messageSelector,
javax.jms.ServerSessionPool sessionPool,
int maxMessages)
Creates a connection consumer for this connection (optional operation) |
javax.jms.ConnectionConsumer |
createDurableConnectionConsumer(javax.jms.Topic topic,
java.lang.String subscriptionName,
java.lang.String messageSelector,
javax.jms.ServerSessionPool sessionPool,
int maxMessages)
Creates a connection consumer for this connection (optional operation) |
javax.jms.Session |
createSession(boolean transacted,
int acknowledgeMode)
Creates a Session object. |
void |
finalClose()
|
java.lang.String |
getClientID()
Get the client identifier for this connection. |
javax.jms.ExceptionListener |
getExceptionListener()
Get the ExceptionListener for this Connection. |
javax.jms.ConnectionMetaData |
getMetaData()
Get the meta data for this connection. |
java.lang.String |
getUser()
Return the user associated to this connection |
protected void |
sessionClose(javax.jms.Session s)
A non transacted session has beem closed |
protected boolean |
sessionOpen(javax.jms.Session s)
A new non transacted session has been opened |
void |
setClientID(java.lang.String clientID)
Set the client identifier for this connection. |
void |
setExceptionListener(javax.jms.ExceptionListener listener)
Set an exception listener for this connection. |
void |
start()
Start (or restart) a Connection's delivery of incoming messages. |
void |
stop()
Used to temporarily stop a Connection's delivery of incoming messages. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected javax.jms.XAConnection xac
protected boolean closed
protected java.lang.String user
protected boolean globaltx
protected static org.objectweb.transaction.jta.TransactionManager tm
protected JConnectionFactory jcf
protected java.util.LinkedList sessionlist
protected static final java.lang.String INTERNAL_USER_NAME
Constructor Detail |
---|
protected JConnection(JConnectionFactory jcf, java.lang.String user) throws javax.jms.JMSException
javax.jms.JMSException
public JConnection(JConnectionFactory jcf, javax.jms.XAConnectionFactory xacf, java.lang.String user, java.lang.String passwd) throws javax.jms.JMSException
user
- user's namepasswd
- user's password
javax.jms.JMSException
public JConnection(JConnectionFactory jcf, javax.jms.XAConnectionFactory xacf) throws javax.jms.JMSException
javax.jms.JMSException
Method Detail |
---|
protected boolean sessionOpen(javax.jms.Session s)
protected void sessionClose(javax.jms.Session s)
public java.lang.String getUser()
public void close() throws javax.jms.JMSException
close
in interface javax.jms.Connection
javax.jms.JMSException
- - if JMS implementation fails to return the client ID for this
Connection due to some internalpublic void finalClose() throws javax.jms.JMSException
javax.jms.JMSException
public javax.jms.ConnectionConsumer createConnectionConsumer(javax.jms.Destination destination, java.lang.String messageSelector, javax.jms.ServerSessionPool sessionPool, int maxMessages) throws javax.jms.JMSException
createConnectionConsumer
in interface javax.jms.Connection
destination
- - the destination to accessmessageSelector
- - only messages with properties matching
the message selector expression are delivered.
A value of null or an empty string indicates that
there is no message selector for the message consumer.sessionPool
- - the server session pool to associate with this connection consumermaxMessages
- - the maximum number of messages that can be assigned to a server
session at one time
javax.jms.JMSException
public javax.jms.ConnectionConsumer createDurableConnectionConsumer(javax.jms.Topic topic, java.lang.String subscriptionName, java.lang.String messageSelector, javax.jms.ServerSessionPool sessionPool, int maxMessages) throws javax.jms.JMSException
createDurableConnectionConsumer
in interface javax.jms.Connection
topic
- - the topic to accesssubscriptionName
- - durable subscription namemessageSelector
- - only messages with properties matching
the message selector expression are delivered.
A value of null or an empty string indicates that
there is no message selector for the message consumer.sessionPool
- - the server session pool to associate with this connection consumermaxMessages
- - the maximum number of messages that can be assigned to a server
session at one time
javax.jms.JMSException
public javax.jms.Session createSession(boolean transacted, int acknowledgeMode) throws javax.jms.JMSException
createSession
in interface javax.jms.Connection
transacted
- - indicates whether the session is transactedacknowledgeMode
- indicates whether the consumer or the client
will acknowledge any messages it receives;
ignored if the session is transacted.
Legal values are Session.AUTO_ACKNOWLEDGE, Session.CLIENT_ACKNOWLEDGE,
and Session.DUPS_OK_ACKNOWLEDGE.
javax.jms.JMSException
public java.lang.String getClientID() throws javax.jms.JMSException
getClientID
in interface javax.jms.Connection
javax.jms.JMSException
- - if JMS implementation fails to return the client ID for this
Connection due to some internalpublic void setClientID(java.lang.String clientID) throws javax.jms.JMSException
setClientID
in interface javax.jms.Connection
clientID
- - the unique client identifier
javax.jms.JMSException
- - general exception if JMS implementation fails to set the client
ID for this Connection due to some internal error.
InvalidClientIDException
- - if JMS client specifies an invalid or duplicate client id.
java.lang.IllegalStateException
- - if attempting to set a connection's client identifier at
the wrong time or when it has been administratively configured.public javax.jms.ConnectionMetaData getMetaData() throws javax.jms.JMSException
getMetaData
in interface javax.jms.Connection
javax.jms.JMSException
- - general exception if JMS implementation fails to get the Connection
meta-data for this Connection.public javax.jms.ExceptionListener getExceptionListener() throws javax.jms.JMSException
getExceptionListener
in interface javax.jms.Connection
javax.jms.JMSException
- - general exception if JMS implementation fails to get
the Exception listener for this Connection.public void setExceptionListener(javax.jms.ExceptionListener listener) throws javax.jms.JMSException
setExceptionListener
in interface javax.jms.Connection
listener
- - the exception listener.
javax.jms.JMSException
- - general exception if JMS implementation fails to set
the Exception listener for this Connection.public void start() throws javax.jms.JMSException
start
in interface javax.jms.Connection
javax.jms.JMSException
- - if JMS implementation fails to start the message
delivery due to some internal error.public void stop() throws javax.jms.JMSException
stop
in interface javax.jms.Connection
javax.jms.JMSException
- - if JMS implementation fails to start the message
delivery due to some internal error.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |