com.scalagent.kjoram.Connection Class Reference

Inherited by com.scalagent.kjoram.QueueConnection, and com.scalagent.kjoram.TopicConnection.

Inheritance diagram for com.scalagent.kjoram.Connection:

Inheritance graph
[legend]
Collaboration diagram for com.scalagent.kjoram.Connection:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Connection (FactoryParameters factoryParameters, ConnectionItf connectionImpl) throws JMSException
String getUserName ()
String toString ()
boolean equals (Object obj)
ConnectionConsumer createConnectionConsumer (Destination dest, String selector, ServerSessionPool sessionPool, int maxMessages) throws JMSException
ConnectionConsumer createDurableConnectionConsumer (Topic topic, String subName, String selector, ServerSessionPool sessPool, int maxMessages) throws JMSException
Session createSession (boolean transacted, int acknowledgeMode) throws JMSException
void setExceptionListener (ExceptionListener listener) throws JMSException
ExceptionListener getExceptionListener () throws JMSException
void setClientID (String clientID) throws JMSException
String getClientID () throws JMSException
ConnectionMetaData getMetaData () throws JMSException
void start () throws JMSException
void stop () throws JMSException
void close () throws JMSException

Package Functions

synchronized void onException (JMSException jE)
synchronized int nextRequestId ()
synchronized String nextSessionId ()
synchronized String nextMessageId ()
synchronized String nextSubName ()
synchronized void schedule (com.scalagent.kjoram.util.TimerTask task)
AbstractJmsReply syncRequest (AbstractJmsRequest request) throws JMSException
void asyncRequest (AbstractJmsRequest request) throws IllegalStateException
void distribute (AbstractJmsReply reply)

Package Attributes

FactoryParameters factoryParameters
Driver driver
boolean started = false
boolean closing = false
boolean closed = false
Vector sessions
Vector cconsumers
Hashtable requestsTable
Hashtable repliesTable
String name = null

Detailed Description

Definition at line 34 of file Connection.java.


Constructor & Destructor Documentation

com.scalagent.kjoram.Connection.Connection ( FactoryParameters  factoryParameters,
ConnectionItf  connectionImpl 
) throws JMSException

Creates a Connection instance.

Parameters:
factoryParameters The factory parameters.
connectionImpl The actual connection to wrap.
Exceptions:
JMSSecurityException If the user identification is incorrect.
IllegalStateException If the server is not listening.

Definition at line 98 of file Connection.java.

References com.scalagent.kjoram.ConnectionItf.createDriver(), com.scalagent.kjoram.Connection.driver, com.scalagent.kjoram.Connection.factoryParameters, com.scalagent.kjoram.jms.CnxConnectReply.getCnxKey(), com.scalagent.kjoram.jms.CnxConnectReply.getProxyId(), com.scalagent.kjoram.ConnectionItf.getUserName(), com.scalagent.kjoram.Connection.name, com.scalagent.kjoram.Connection.repliesTable, com.scalagent.kjoram.Connection.requestsTable, com.scalagent.kjoram.Connection.sessions, com.scalagent.kjoram.util.Daemon.start(), com.scalagent.kjoram.Connection.syncRequest(), and com.scalagent.kjoram.FactoryParameters.txPendingTimer.

Here is the call graph for this function:


Member Function Documentation

String com.scalagent.kjoram.Connection.toString (  ) 

String image of the connection.

Definition at line 140 of file Connection.java.

Referenced by com.scalagent.kjoram.Driver.Driver(), com.scalagent.kjoram.Connection.equals(), com.scalagent.kjoram.Driver.toString(), and com.scalagent.kjoram.ConnectionConsumer.toString().

boolean com.scalagent.kjoram.Connection.equals ( Object  obj  ) 

Specializes this Object method; returns true if the parameter is a Connection instance sharing the same proxy identifier and connection key.

Definition at line 150 of file Connection.java.

References com.scalagent.kjoram.Connection.toString().

Referenced by com.scalagent.kjoram.MessageConsumer.MessageConsumer().

Here is the call graph for this function:

ConnectionConsumer com.scalagent.kjoram.Connection.createConnectionConsumer ( Destination  dest,
String  selector,
ServerSessionPool  sessionPool,
int  maxMessages 
) throws JMSException

API method.

Exceptions:
IllegalStateException If the connection is closed.
InvalidSelectorException If the selector syntax is wrong.
InvalidDestinationException If the target destination does not exist.
JMSException If the method fails for any other reason.

Definition at line 167 of file Connection.java.

References com.scalagent.kjoram.Connection.closed.

ConnectionConsumer com.scalagent.kjoram.Connection.createDurableConnectionConsumer ( Topic  topic,
String  subName,
String  selector,
ServerSessionPool  sessPool,
int  maxMessages 
) throws JMSException

API method.

Exceptions:
IllegalStateException If the connection is closed.
InvalidSelectorException If the selector syntax is wrong.
InvalidDestinationException If the target topic does not exist.
JMSException If the method fails for any other reason.

Reimplemented in com.scalagent.kjoram.QueueConnection, and com.scalagent.kjoram.TopicConnection.

Definition at line 189 of file Connection.java.

References com.scalagent.kjoram.Connection.closed.

Session com.scalagent.kjoram.Connection.createSession ( boolean  transacted,
int  acknowledgeMode 
) throws JMSException

API method.

Exceptions:
IllegalStateException If the connection is closed.
JMSException In case of an invalid acknowledge mode.

Definition at line 209 of file Connection.java.

References com.scalagent.kjoram.Connection.closed.

void com.scalagent.kjoram.Connection.setExceptionListener ( ExceptionListener  listener  )  throws JMSException

API method.

Exceptions:
IllegalStateException If the connection is closed.

Definition at line 224 of file Connection.java.

References com.scalagent.kjoram.Connection.closed.

ExceptionListener com.scalagent.kjoram.Connection.getExceptionListener (  )  throws JMSException

API method.

Exceptions:
IllegalStateException If the connection is closed.

Definition at line 238 of file Connection.java.

References com.scalagent.kjoram.Connection.closed.

synchronized void com.scalagent.kjoram.Connection.onException ( JMSException  jE  )  [package]

Passes an asynchronous exception to the exception listener, if any.

Parameters:
jE The asynchronous JMSException.

Definition at line 251 of file Connection.java.

References com.scalagent.kjoram.excepts.ExceptionListener.onException().

Referenced by com.scalagent.kjoram.Connection.distribute(), and com.scalagent.kjoram.Driver.run().

Here is the call graph for this function:

void com.scalagent.kjoram.Connection.setClientID ( String  clientID  )  throws JMSException

API method.

Exceptions:
IllegalStateException Systematically thrown.

Definition at line 265 of file Connection.java.

String com.scalagent.kjoram.Connection.getClientID (  )  throws JMSException

API method.

Exceptions:
IllegalStateException If the connection is closed.

Definition at line 276 of file Connection.java.

References com.scalagent.kjoram.Connection.closed.

ConnectionMetaData com.scalagent.kjoram.Connection.getMetaData (  )  throws JMSException

API method.

Exceptions:
IllegalStateException If the connection is closed.

Definition at line 289 of file Connection.java.

References com.scalagent.kjoram.Connection.closed.

void com.scalagent.kjoram.Connection.start (  )  throws JMSException

API method for starting the connection.

Exceptions:
IllegalStateException If the connection is closed or broken.

Definition at line 304 of file Connection.java.

References com.scalagent.kjoram.Connection.asyncRequest(), com.scalagent.kjoram.Connection.closed, com.scalagent.kjoram.Session.repliesIn, com.scalagent.kjoram.Connection.sessions, com.scalagent.kjoram.Session.start(), and com.scalagent.kjoram.Connection.started.

Here is the call graph for this function:

void com.scalagent.kjoram.Connection.stop (  )  throws JMSException

API method for stopping the connection; even if the connection appears to be broken, stops the sessions.

Exceptions:
IllegalStateException If the connection is closed or broken.

Definition at line 341 of file Connection.java.

References com.scalagent.kjoram.Connection.closed, com.scalagent.kjoram.Session.repliesIn, com.scalagent.kjoram.Connection.sessions, com.scalagent.kjoram.Connection.started, com.scalagent.kjoram.Session.stop(), and com.scalagent.kjoram.Connection.syncRequest().

Referenced by com.scalagent.kjoram.Connection.close().

Here is the call graph for this function:

void com.scalagent.kjoram.Connection.close (  )  throws JMSException

API method for closing the connection; even if the connection appears to be broken, closes the sessions.

Exceptions:
JMSException Actually never thrown.

Definition at line 397 of file Connection.java.

References com.scalagent.kjoram.Connection.cconsumers, com.scalagent.kjoram.ConnectionItf.close(), com.scalagent.kjoram.ConnectionConsumer.close(), com.scalagent.kjoram.Session.close(), com.scalagent.kjoram.Connection.closed, com.scalagent.kjoram.Connection.closing, com.scalagent.kjoram.Connection.driver, com.scalagent.kjoram.Connection.repliesTable, com.scalagent.kjoram.Connection.requestsTable, com.scalagent.kjoram.Connection.sessions, com.scalagent.kjoram.util.Daemon.stop(), com.scalagent.kjoram.Connection.stop(), and com.scalagent.kjoram.Driver.stopping.

Referenced by com.scalagent.kjoram.Driver.run().

Here is the call graph for this function:

synchronized int com.scalagent.kjoram.Connection.nextRequestId (  )  [package]

Returns a new request identifier.

Definition at line 459 of file Connection.java.

Referenced by com.scalagent.kjoram.Connection.asyncRequest(), com.scalagent.kjoram.ConnectionConsumer.ConnectionConsumer(), com.scalagent.kjoram.MessageConsumer.onMessage(), com.scalagent.kjoram.MessageConsumer.receive(), com.scalagent.kjoram.MessageConsumer.setMessageListener(), and com.scalagent.kjoram.Connection.syncRequest().

synchronized String com.scalagent.kjoram.Connection.nextSessionId (  )  [package]

Returns a new session identifier.

Definition at line 467 of file Connection.java.

Referenced by com.scalagent.kjoram.Session.Session().

synchronized String com.scalagent.kjoram.Connection.nextMessageId (  )  [package]

Returns a new message identifier.

Definition at line 476 of file Connection.java.

synchronized String com.scalagent.kjoram.Connection.nextSubName (  )  [package]

Returns a new subscription name.

Definition at line 485 of file Connection.java.

Referenced by com.scalagent.kjoram.ConnectionConsumer.ConnectionConsumer(), and com.scalagent.kjoram.MessageConsumer.MessageConsumer().

synchronized void com.scalagent.kjoram.Connection.schedule ( com.scalagent.kjoram.util.TimerTask  task  )  [package]

Schedules a session task to the connection's timer.

Definition at line 494 of file Connection.java.

References com.scalagent.kjoram.Connection.factoryParameters, and com.scalagent.kjoram.FactoryParameters.txPendingTimer.

Referenced by com.scalagent.kjoram.Session.prepareAck(), and com.scalagent.kjoram.Session.prepareSend().

AbstractJmsReply com.scalagent.kjoram.Connection.syncRequest ( AbstractJmsRequest  request  )  throws JMSException [package]

Method sending a synchronous request to the server and waiting for an answer.

Exceptions:
IllegalStateException If the connection is closed or broken.
JMSSecurityException When sending a request to a destination not accessible because of security.
InvalidDestinationException When sending a request to a destination that no longer exists.
JMSException If the request failed for any other reason.

Definition at line 516 of file Connection.java.

References com.scalagent.kjoram.Connection.closed, com.scalagent.kjoram.Connection.nextRequestId(), com.scalagent.kjoram.Connection.repliesTable, com.scalagent.kjoram.Connection.requestsTable, com.scalagent.kjoram.ConnectionItf.send(), and com.scalagent.kjoram.excepts.JMSException.setLinkedException().

Referenced by com.scalagent.kjoram.MessageConsumer.close(), com.scalagent.kjoram.ConnectionConsumer.close(), com.scalagent.kjoram.Session.commit(), com.scalagent.kjoram.Connection.Connection(), com.scalagent.kjoram.ConnectionConsumer.ConnectionConsumer(), com.scalagent.kjoram.Session.createTemporaryQueue(), com.scalagent.kjoram.Session.createTemporaryTopic(), com.scalagent.kjoram.Session.createTopic(), com.scalagent.kjoram.TemporaryTopic.delete(), com.scalagent.kjoram.TemporaryQueue.delete(), com.scalagent.kjoram.Session.deny(), com.scalagent.kjoram.QueueBrowser.getEnumeration(), com.scalagent.kjoram.MessageConsumer.MessageConsumer(), com.scalagent.kjoram.MessageConsumer.onMessage(), com.scalagent.kjoram.MessageConsumer.receive(), com.scalagent.kjoram.Session.run(), com.scalagent.kjoram.MessageConsumer.setMessageListener(), com.scalagent.kjoram.Connection.stop(), and com.scalagent.kjoram.Session.unsubscribe().

Here is the call graph for this function:

void com.scalagent.kjoram.Connection.asyncRequest ( AbstractJmsRequest  request  )  throws IllegalStateException [package]

Actually sends an asynchronous request to the server.

Exceptions:
IllegalStateException If the connection is closed or broken.

Definition at line 601 of file Connection.java.

References com.scalagent.kjoram.Connection.closed, com.scalagent.kjoram.Connection.nextRequestId(), com.scalagent.kjoram.Connection.requestsTable, and com.scalagent.kjoram.ConnectionItf.send().

Referenced by com.scalagent.kjoram.Session.acknowledge(), com.scalagent.kjoram.ConnectionConsumer.ConnectionConsumer(), com.scalagent.kjoram.Session.deny(), com.scalagent.kjoram.Session.distribute(), com.scalagent.kjoram.MessageConsumer.onMessage(), com.scalagent.kjoram.MessageConsumer.receive(), com.scalagent.kjoram.Session.run(), com.scalagent.kjoram.MessageConsumer.setMessageListener(), and com.scalagent.kjoram.Connection.start().

Here is the call graph for this function:

void com.scalagent.kjoram.Connection.distribute ( AbstractJmsReply  reply  )  [package]

Method called by the driver for distributing the server replies it gets on the connection.

Server replies are either synchronous replies to client requests, or asynchronous message deliveries, or asynchronous exceptions notifications.

Definition at line 635 of file Connection.java.

References com.scalagent.kjoram.jms.AbstractJmsReply.getCorrelationId(), com.scalagent.kjoram.jms.AbstractJmsReply.getKey(), com.scalagent.kjoram.Connection.onException(), com.scalagent.kjoram.Connection.repliesTable, and com.scalagent.kjoram.Connection.requestsTable.

Referenced by com.scalagent.kjoram.Driver.run().

Here is the call graph for this function:


Member Data Documentation

FactoryParameters com.scalagent.kjoram.Connection.factoryParameters [package]

The factory's parameters.

Definition at line 62 of file Connection.java.

Referenced by com.scalagent.kjoram.Connection.Connection(), com.scalagent.kjoram.QueueConnection.QueueConnection(), com.scalagent.kjoram.Connection.schedule(), com.scalagent.kjoram.Session.Session(), and com.scalagent.kjoram.TopicConnection.TopicConnection().

Driver com.scalagent.kjoram.Connection.driver [package]

Driver listening to asynchronous deliveries.

Definition at line 65 of file Connection.java.

Referenced by com.scalagent.kjoram.Connection.close(), and com.scalagent.kjoram.Connection.Connection().

boolean com.scalagent.kjoram.Connection.started = false [package]

true if the connection is started.

Definition at line 68 of file Connection.java.

Referenced by com.scalagent.kjoram.MessageConsumer.setMessageListener(), com.scalagent.kjoram.Connection.start(), and com.scalagent.kjoram.Connection.stop().

boolean com.scalagent.kjoram.Connection.closing = false [package]

true if the connection is closing.

Definition at line 70 of file Connection.java.

Referenced by com.scalagent.kjoram.Connection.close(), and com.scalagent.kjoram.Driver.run().

boolean com.scalagent.kjoram.Connection.closed = false [package]

true if the connection is closed.

Definition at line 72 of file Connection.java.

Referenced by com.scalagent.kjoram.Connection.asyncRequest(), com.scalagent.kjoram.Connection.close(), com.scalagent.kjoram.TopicConnection.createConnectionConsumer(), com.scalagent.kjoram.QueueConnection.createConnectionConsumer(), com.scalagent.kjoram.Connection.createConnectionConsumer(), com.scalagent.kjoram.TopicConnection.createDurableConnectionConsumer(), com.scalagent.kjoram.Connection.createDurableConnectionConsumer(), com.scalagent.kjoram.QueueConnection.createQueueSession(), com.scalagent.kjoram.Connection.createSession(), com.scalagent.kjoram.TopicConnection.createTopicSession(), com.scalagent.kjoram.Connection.getClientID(), com.scalagent.kjoram.Connection.getExceptionListener(), com.scalagent.kjoram.Connection.getMetaData(), com.scalagent.kjoram.Connection.setExceptionListener(), com.scalagent.kjoram.Connection.start(), com.scalagent.kjoram.Connection.stop(), and com.scalagent.kjoram.Connection.syncRequest().

Vector com.scalagent.kjoram.Connection.sessions [package]

Vector of the connection's sessions.

Definition at line 74 of file Connection.java.

Referenced by com.scalagent.kjoram.Session.close(), com.scalagent.kjoram.Connection.close(), com.scalagent.kjoram.Connection.Connection(), com.scalagent.kjoram.TemporaryTopic.delete(), com.scalagent.kjoram.TemporaryQueue.delete(), com.scalagent.kjoram.Session.Session(), com.scalagent.kjoram.Connection.start(), and com.scalagent.kjoram.Connection.stop().

Vector com.scalagent.kjoram.Connection.cconsumers [package]

Vector of the connection's consumers.

Definition at line 76 of file Connection.java.

Referenced by com.scalagent.kjoram.ConnectionConsumer.close(), com.scalagent.kjoram.Connection.close(), and com.scalagent.kjoram.ConnectionConsumer.ConnectionConsumer().

Hashtable com.scalagent.kjoram.Connection.requestsTable [package]

Table holding requests related objects, either locks of synchronous requests, or asynchronous consumers.

Definition at line 81 of file Connection.java.

Referenced by com.scalagent.kjoram.Connection.asyncRequest(), com.scalagent.kjoram.MessageConsumer.close(), com.scalagent.kjoram.ConnectionConsumer.close(), com.scalagent.kjoram.Connection.close(), com.scalagent.kjoram.Connection.Connection(), com.scalagent.kjoram.ConnectionConsumer.ConnectionConsumer(), com.scalagent.kjoram.Session.distribute(), com.scalagent.kjoram.Connection.distribute(), com.scalagent.kjoram.MessageConsumer.onMessage(), com.scalagent.kjoram.Driver.run(), com.scalagent.kjoram.MessageConsumer.setMessageListener(), and com.scalagent.kjoram.Connection.syncRequest().

Hashtable com.scalagent.kjoram.Connection.repliesTable [package]

Table holding the server replies to synchronous requests.

Definition at line 85 of file Connection.java.

Referenced by com.scalagent.kjoram.MessageConsumer.close(), com.scalagent.kjoram.Connection.close(), com.scalagent.kjoram.Connection.Connection(), com.scalagent.kjoram.Connection.distribute(), and com.scalagent.kjoram.Connection.syncRequest().


The documentation for this class was generated from the following file:
Generated on Tue Sep 16 16:15:16 2008 for joram by  doxygen 1.5.0