|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.joram.client.jms.Connection
public class Connection
Implements the javax.jms.Connection
interface.
A Connection object allows the client's active connection to the Joram server. Connections support concurrent use, it serves several purposes:
Nested Class Summary | |
---|---|
(package private) class |
Connection.AtomicCounter
|
(package private) class |
Connection.Closer
This class synchronizes the close. |
private static class |
Connection.Status
Status of the connection. |
Field Summary | |
---|---|
private java.util.Vector |
cconsumers
Vector of the connection's consumers. |
private Connection.Closer |
closer
Used to synchronize the method close() |
private FactoryParameters |
factoryParameters
The factory's parameters. |
private int |
hashCode
|
private int |
key
Connection key. |
static org.objectweb.util.monolog.api.Logger |
logger
|
private Connection.AtomicCounter |
messagesC
Messages counter. |
private ConnectionMetaData |
metaData
Connection meta data. |
private RequestMultiplexer |
mtpx
The request multiplexer used to communicate with the user proxy. |
private java.lang.String |
proxyId
Client's agent proxy identifier. |
private Requestor |
requestor
The requestor used to communicate with the user proxy. |
private java.util.Vector |
sessions
Vector of the connection's sessions. |
private Connection.AtomicCounter |
sessionsC
Sessions counter. |
private int |
status
Status of the connection. |
private java.lang.String |
stringImage
|
private Connection.AtomicCounter |
subsC
Subscriptions counter. |
Constructor Summary | |
---|---|
Connection(FactoryParameters factoryParameters,
RequestChannel requestChannel)
Creates a Connection instance. |
Method Summary | |
---|---|
protected void |
addSession(Session session)
Called here and by sub-classes. |
protected void |
checkClosed()
Checks if the connection is closed. |
(package private) void |
checkConsumers(java.lang.String agentId)
Called by temporary destinations deletion. |
void |
cleanup()
Used by OutboundConnection in the connector layer. |
void |
close()
API method for closing the connection; even if the connection appears to be broken, closes the sessions. |
(package private) void |
closeConnectionConsumer(MultiSessionConsumer cc)
Called by MultiSessionConsumer. |
(package private) void |
closeSession(Session session)
Called by Session. |
javax.jms.ConnectionConsumer |
createConnectionConsumer(javax.jms.Destination dest,
java.lang.String selector,
javax.jms.ServerSessionPool sessionPool,
int maxMessages)
API method. |
private javax.jms.ConnectionConsumer |
createConnectionConsumer(javax.jms.Destination dest,
java.lang.String subName,
java.lang.String selector,
javax.jms.ServerSessionPool sessionPool,
int maxMessages)
|
javax.jms.ConnectionConsumer |
createDurableConnectionConsumer(javax.jms.Topic topic,
java.lang.String subName,
java.lang.String selector,
javax.jms.ServerSessionPool sessPool,
int maxMessages)
API method. |
javax.jms.Session |
createSession(boolean transacted,
int acknowledgeMode)
API method. |
(package private) void |
doClose()
|
boolean |
equals(java.lang.Object obj)
Returns true if the parameter is a Connection instance
sharing the same proxy identifier and connection key. |
boolean |
getAsyncSend()
Indicates whether the messages produced are asynchronously sent or not (without or with acknowledgement). |
java.lang.String |
getClientID()
API method. |
javax.jms.ExceptionListener |
getExceptionListener()
API method. |
boolean |
getImplicitAck()
Indicates whether the messages consumed are implicitly acknowledged or not. |
java.util.List |
getInInterceptors()
returns the list of IN message interceptors. |
javax.jms.ConnectionMetaData |
getMetaData()
API method. |
java.util.List |
getOutInterceptors()
returns the list of OUT message interceptors. |
java.lang.String |
getOutLocalAddress()
Returns the local IP address on which the TCP connection is activated. |
int |
getOutLocalPort()
Returns the local IP address port on which the TCP connection is activated This attribute is inherited from FactoryParameters. |
int |
getQueueMessageReadMax()
Get the maximum number of messages that can be read at once from a queue for this Connection. |
protected RequestMultiplexer |
getRequestMultiplexer()
|
int |
getTopicAckBufferMax()
Get the maximum number of acknowledgements that can be buffered when using Session.DUPS_OK_ACKNOWLEDGE mode for this Connection. |
int |
getTopicActivationThreshold()
Get the threshold of activation for this Connection. |
int |
getTopicPassivationThreshold()
Get the threshold of passivation for this Connection. |
long |
getTxPendingTimer()
Returns the duration in seconds during which a JMS transacted (non XA) session might be pending; above that duration the session is rolled back and closed; the 0 value means "no timer". |
int |
hashCode()
|
(package private) boolean |
isStopped()
|
(package private) java.lang.String |
nextMessageId()
Returns a new message identifier. |
(package private) java.lang.String |
nextSessionId()
Returns a new session identifier. |
(package private) java.lang.String |
nextSubName()
Returns a new subscription name. |
void |
setClientID(java.lang.String clientID)
API method. |
void |
setExceptionListener(javax.jms.ExceptionListener listener)
API method. |
private void |
setStatus(int status)
|
void |
start()
API method for starting the connection. |
void |
stop()
API method for stopping the connection; even if the connection appears to be broken, stops the sessions. |
(package private) AbstractJmsReply |
syncRequest(AbstractJmsRequest request)
|
java.lang.String |
toString()
String image of the connection. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static org.objectweb.util.monolog.api.Logger logger
private RequestMultiplexer mtpx
private Requestor requestor
private ConnectionMetaData metaData
private Connection.AtomicCounter sessionsC
private Connection.AtomicCounter messagesC
private Connection.AtomicCounter subsC
private java.lang.String proxyId
private int key
private FactoryParameters factoryParameters
private int status
private java.util.Vector sessions
private java.util.Vector cconsumers
private Connection.Closer closer
private java.lang.String stringImage
private int hashCode
Constructor Detail |
---|
public Connection(FactoryParameters factoryParameters, RequestChannel requestChannel) throws javax.jms.JMSException
Connection
instance.
factoryParameters
- The factory parameters.requestChannel
- The actual connection to wrap.
javax.jms.JMSSecurityException
- If the user identification is incorrect.
javax.jms.IllegalStateException
- If the server is not listening.
javax.jms.JMSException
Method Detail |
---|
private void setStatus(int status)
boolean isStopped()
public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
true
if the parameter is a Connection
instance
sharing the same proxy identifier and connection key.
equals
in class java.lang.Object
public final long getTxPendingTimer()
FactoryParameters.txPendingTimer
public final boolean getImplicitAck()
This attribute is inherited from FactoryParameters, by default false.
FactoryParameters.implicitAck
,
Session.isImplicitAck()
public final boolean getAsyncSend()
This attribute is inherited from FactoryParameters, by default false.
FactoryParameters.asyncSend
,
Session.isAsyncSend()
public final int getQueueMessageReadMax()
This attribute is inherited from FactoryParameters, default value is 1.
FactoryParameters.queueMessageReadMax
,
Session.getQueueMessageReadMax()
public final int getTopicAckBufferMax()
This attribute is inherited from FactoryParameters, default value is 0.
FactoryParameters.topicAckBufferMax
,
Session.getTopicAckBufferMax()
public final int getTopicPassivationThreshold()
This threshold is the maximum messages number over which the subscription is passivated.
This attribute is inherited from FactoryParameters, default value is Integer.MAX_VALUE.
FactoryParameters.topicPassivationThreshold
,
Session.getTopicPassivationThreshold()
public final int getTopicActivationThreshold()
This threshold is the minimum messages number below which the subscription is activated.
This attribute is inherited from FactoryParameters, default value is 0.
FactoryParameters.topicActivationThreshold
,
Session.getTopicActivationThreshold()
public final java.lang.String getOutLocalAddress()
This attribute is inherited from FactoryParameters.
FactoryParameters.outLocalAddress
public final int getOutLocalPort()
This attribute is inherited from FactoryParameters.
FactoryParameters.outLocalPort
public final java.util.List getInInterceptors()
called
when receiving
a message.
public final java.util.List getOutInterceptors()
called
when sending
a message.
protected final void checkClosed() throws javax.jms.IllegalStateException
javax.jms.IllegalStateException
public javax.jms.ConnectionConsumer createConnectionConsumer(javax.jms.Destination dest, java.lang.String selector, javax.jms.ServerSessionPool sessionPool, int maxMessages) throws javax.jms.JMSException
createConnectionConsumer
in interface javax.jms.Connection
javax.jms.IllegalStateException
- If the connection is closed.
javax.jms.InvalidSelectorException
- If the selector syntax is wrong.
javax.jms.InvalidDestinationException
- If the target destination does
not exist.
javax.jms.JMSException
- If the method fails for any other reason.public javax.jms.ConnectionConsumer createDurableConnectionConsumer(javax.jms.Topic topic, java.lang.String subName, java.lang.String selector, javax.jms.ServerSessionPool sessPool, int maxMessages) throws javax.jms.JMSException
createDurableConnectionConsumer
in interface javax.jms.Connection
javax.jms.IllegalStateException
- If the connection is closed.
javax.jms.InvalidSelectorException
- If the selector syntax is wrong.
javax.jms.InvalidDestinationException
- If the target topic does
not exist.
javax.jms.JMSException
- If the method fails for any other reason.private javax.jms.ConnectionConsumer createConnectionConsumer(javax.jms.Destination dest, java.lang.String subName, java.lang.String selector, javax.jms.ServerSessionPool sessionPool, int maxMessages) throws javax.jms.JMSException
javax.jms.JMSException
public javax.jms.Session createSession(boolean transacted, int acknowledgeMode) throws javax.jms.JMSException
createSession
in interface javax.jms.Connection
javax.jms.IllegalStateException
- If the connection is closed.
javax.jms.JMSException
- In case of an invalid acknowledge mode.protected void addSession(Session session)
public void setExceptionListener(javax.jms.ExceptionListener listener) throws javax.jms.JMSException
setExceptionListener
in interface javax.jms.Connection
javax.jms.IllegalStateException
- If the connection is closed.
javax.jms.JMSException
public javax.jms.ExceptionListener getExceptionListener() throws javax.jms.JMSException
getExceptionListener
in interface javax.jms.Connection
javax.jms.IllegalStateException
- If the connection is closed.
javax.jms.JMSException
public void setClientID(java.lang.String clientID) throws javax.jms.JMSException
setClientID
in interface javax.jms.Connection
javax.jms.IllegalStateException
- Systematically thrown.
javax.jms.JMSException
public java.lang.String getClientID() throws javax.jms.JMSException
getClientID
in interface javax.jms.Connection
javax.jms.IllegalStateException
- If the connection is closed.
javax.jms.JMSException
public javax.jms.ConnectionMetaData getMetaData() throws javax.jms.JMSException
getMetaData
in interface javax.jms.Connection
javax.jms.IllegalStateException
- If the connection is closed.
javax.jms.JMSException
public void start() throws javax.jms.JMSException
start
in interface javax.jms.Connection
javax.jms.IllegalStateException
- If the connection is closed or broken.
javax.jms.JMSException
public void stop() throws javax.jms.JMSException
stop
in interface javax.jms.Connection
javax.jms.IllegalStateException
- If the connection is closed or broken.
javax.jms.JMSException
public void close() throws javax.jms.JMSException
close
in interface javax.jms.Connection
javax.jms.JMSException
- Actually never thrown.void doClose()
public void cleanup()
java.lang.String nextSessionId()
java.lang.String nextMessageId()
java.lang.String nextSubName()
void closeSession(Session session)
void closeConnectionConsumer(MultiSessionConsumer cc)
AbstractJmsReply syncRequest(AbstractJmsRequest request) throws javax.jms.JMSException
javax.jms.JMSException
void checkConsumers(java.lang.String agentId) throws javax.jms.JMSException
javax.jms.JMSException
protected final RequestMultiplexer getRequestMultiplexer()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |