IConnection
A Connection object represents the active connection of the application to a messaging server.
- Inheritance hierarchy:
-
IBM.XMS.IPropertyContext | +----IBM.XMS.IConnection
For a list of the XMS defined properties of a Connection object, see Properties of Connection.
Parent topic: .NET interfaces.NET properties
- Summary of .NET properties:
-
.NET property Description ClientID Get and set the client identifier for the connection. ExceptionListener Get the exception listener that is registered with the connection, and register an exception listener with the connection. MetaData Get the metadata for the connection.
Get and set the client
identifier for the connection. The client identifier can
either be preconfigured by the administrator in a ConnectionFactory,
or assigned by setting ClientID. A client identifier is used
only to support durable subscriptions in the publish/subscribe domain,
and is ignored in the point-to-point domain. If an application
sets a client identifier for a connection, the application must do
so immediately after creating the connection, and before performing
any other operation on the connection. If the application tries to
set a client identifier after this point, the call throws exception
IllegalStateException. This property is not valid for a real-time
connection to a broker.
Get the exception
listener that is registered with the connection, and register an exception
listener with the connection. If no exception listener
is registered with the connection, the method returns null. If an
exception listener is already registered with the connection, you
can cancel the registration by specifying a null instead of the exception
listener. For more information about using exception listeners, see Use message and
exception listeners in .NET.
Get the metadata for
the connection.
Close the connection. If
an application tries to close a connection that is already closed,
the call is ignored.
Create a session.
For
a real-time connection to a broker, the value must be False.
For a real-time connection to a broker, the value must be
AcknowledgeMode.AutoAcknowledge or AcknowledgeMode.DupsOkAcknowledge
This
parameter is ignored if the session is transacted. For more information about acknowledgment modes,
see Message
acknowledgment.
Start or restart
the delivery of incoming messages for the connection. The call
is ignored if the connection is already started.
Stop the delivery
of incoming messages for the connection. The call is ignored
if the connection is already stopped.
ClientID - Get and Set Client ID
String ClientID
{
get;
set;
}
ExceptionListener - Get and Set Exception Listener
ExceptionListener ExceptionListener
{
get;
set;
}
Metadata - Get Metadata
IConnectionMetaData MetaData
{
get;
}
Methods
Method
Description
Close
Close the connection.
CreateSession
Create a session.
Start
Start or restart
the delivery of incoming messages for the connection.
Stop
Stop the delivery
of incoming messages for the connection.
Close - Close Connection
void Close();
CreateSession - Create Session
ISession CreateSession(Boolean transacted,
AcknowledgeMode acknowledgeMode);
Start - Start Connection
void Start();
Stop - Stop Connection
void Stop();
Inherited properties and methods
The following methods are inherited from the IPropertyContext interface: