
Public Member Functions | |
| Start () | |
| Starts (or restarts) a connection's delivery of incoming messages. | |
| Stop () | |
| Temporarily stops a connection's delivery of incoming messages. | |
| Close () | |
| Closes the connection. | |
| ISession | CreateSession (Boolean Transacted, TAcknowledgementMode AcknowledgementMode) |
| Creates a new session to work on this connection. | |
| SetTransformer (const IMessageTransformer Transformer) | |
| Set the message transformer. | |
Public Attributes | |
| string | ClientID |
| The client identifier for this connection. | |
| Boolean | Closed |
| Returns true if the connection is closed. | |
| Boolean | Closing |
| Returns true if the connection is in the process of being closed. | |
| Boolean | Started |
| Returns true if this connection has been started. | |
| TBTJMSClient | Transport |
| The communication adapter. | |
Protected Member Functions | |
| CheckClosedOrFailed () | |
| simply throws an exception if the Connection is already closed or the Transport has failed | |
| CheckClientIDWasManuallySpecified () | |
| Ensures that the clientID was manually specified and not auto-generated. | |
A connection serves several purposes:
| TBTJMSConnection::CheckClosedOrFailed | ( | ) | [protected] |
simply throws an exception if the Connection is already closed or the Transport has failed
| JMSException |
| TBTJMSConnection::CheckClientIDWasManuallySpecified | ( | ) | [protected] |
Ensures that the clientID was manually specified and not auto-generated.
If the clientID was not specified this method will throw an exception. This method is used to ensure that the clientID + durableSubscriber name are used correctly.
| TBTJMSConnection::Start | ( | ) |
Starts (or restarts) a connection's delivery of incoming messages.
A call to start on a connection that has already been started is ignored.
| TBTJMSConnection::Stop | ( | ) |
Temporarily stops a connection's delivery of incoming messages.
Delivery can be restarted using the connection's Start method.
When the connection is stopped, delivery to all the connection's message consumers is inhibited: synchronous receives block, and messages are not delivered to message listeners.
This call blocks until receives and/or message listeners in progress have completed. todo does it block ? - unit tests
Stopping a connection has no effect on its ability to send messages. A call to stop on a connection that has already been stopped is ignored.
| TBTJMSConnection::Close | ( | ) |
Closes the connection.
Since a provider typically allocates significant resources on behalf of a connection, clients should close these resources when they are not needed.
| ISession TBTJMSConnection::CreateSession | ( | Boolean | Transacted, | |
| TAcknowledgementMode | AcknowledgementMode | |||
| ) |
Creates a new session to work on this connection.
| Transacted | - indicates whether the session is transacted | |
| AcknowledgementMode | - indicates whether the consumer or the client will acknowledge any messages it receives; ignored if the session is transacted. Legal values are amClientAcknowledge and amAutoAcknowledge. |
| TBTJMSConnection::SetTransformer | ( | const IMessageTransformer | Transformer | ) |
| string TBTJMSConnection::ClientID |
The client identifier for this connection.
The preferred way to assign a JMS client's client identifier is for it to be configured in a client-specific ConnectionFactory object and transparently assigned to the Connection object it creates.
Alternatively, a client can set a connection's client identifier using a provider-specific value. The facility to set a connection's client identifier explicitly is not a mechanism for overriding the identifier that has been administratively configured. It is provided for the case where no administratively specified identifier exists. If one does exist, an attempt to change it by setting it must throw an IllegalStateException. If a client sets the client identifier explicitly, it must do so immediately after it creates the connection and before any other action on the connection is taken. After this point, setting the client identifier is a programming error that should throw an IllegalStateException.
The purpose of the client identifier is to associate a connection and its objects with a state maintained on behalf of the client by a provider. The only such state identified by the JMS API is that required to support durable subscriptions.
If another connection with the same clientID is already running when this method is called, the JMS provider should detect the duplicate ID and throw an InvalidClientIDException.
SetClientID For writing
| Boolean TBTJMSConnection::Closed |
Returns true if the connection is closed.
| Boolean TBTJMSConnection::Closing |
Returns true if the connection is in the process of being closed.
| Boolean TBTJMSConnection::Started |
Returns true if this connection has been started.
SetStarted For writing
| TBTJMSClient TBTJMSConnection::Transport |
The communication adapter.