Class
Encapsulate a server connection.
When a program first opens a connection, the connection is stoppedthat is, it does not deliver inbound messages. To begin the flow of inbound messages, the program must explicitly call the Start
method. (Outbound messages flow even before calling Start
.)
The EMS .NET API does not support the optional methods createConnectionConsumer
and createDurableConnectionConsumer
.
When a program uses a connection to send messages, the send calls can detect problems with the connection, and notify the client program (synchronously) by throwing exceptions.
However, when a program uses a connection only to receive messages, the client cannot catch such exceptions. Instead, programs can handle such exceptions asynchronously in one of two idioms. Programmers may select either idiombut not both (which would cause duplicate exception processing, with undefined behavior).
ExceptionHandler
events detect this type of problem in a .NET programming idiom.ExceptionListener
property mimics the way in which JMS provides similar functionality in a Java programming idiom.
Member
|
Description
|
---|---|
Events
|
|
ExceptionHandler
|
The client library raises an event if it detects a problem with the connection. The program implements a handler delegate to processes it asynchronously, and registers the delegate here. See Asynchronous Exceptions, above. See
EMSExceptionHandler .
|
Properties
|
|
ActiveURL
|
string {get;}
This property holds the URL of the server at the other endpoint of the connection. When the connection interacts with several servers in a fault-tolerant arrangement, this property indicates the current active server.
|
ClientID
|
string {get; set;}
This property holds the unique client ID of the connection.
Client IDs partition the namespace of durable subscribers; see
Session.CreateDurableSubscriber .
Administrators can configure
ConnectionFactory objects to assign client IDs to new connections. Alternatively, administrators can allow client programs to assign their own IDs. If the factory does not assign an ID, the program may set this property. However, it is illegal to overwrite an existing client ID value, and or to set this property after using the connection in any way (for example, after creating a session, or starting the connection); attempting to set this property in these situations results in IllegalStateException .
|
ExceptionListener
|
IExceptionListener {get; set;}
This is an alternate pathway for alerting a client program of connection problems. The program implements the exception listener interface, and registers an exception listener object by setting this property. When the client library detects a connection problem, it calls the listener’s
onException method with an exception argument that details the problem.
See Asynchronous Exceptions, above. See
IExceptionListener .
|
IsClosed
|
bool {get;}
This property is
true if the connection has been closed; otherwise false .
|
IsSecure
|
bool {get;}
This property is
true if the connection communicates with a secure protocol; otherwise false .
|
MetaData
|
ConnectionMetaData {get;}
Programs can get the connection’s metadata object.
|
TIBCO Enterprise Message Service™ .NET Reference System Release 4.3, February 2006 Copyright © TIBCO Software Inc. All rights reserved www.tibco.com |