IConnectionFactory

An application uses a connection factory to create a connection.

    Inheritance hierarchy:
    IBM.XMS.IPropertyContext
       |
       +----IBM.XMS.IConnectionFactory
    

For a list of the XMS defined properties of a ConnectionFactory object, see Properties of ConnectionFactory.

Parent topic: .NET interfaces


Methods

    Summary of methods:

    Method Description
    CreateConnection Create a connection factory with the default properties.
    CreateConnection Create a connection using a specified user identity.


CreateConnection - Create Connection Factory (using the default user identity)

    Interface:
    IConnection CreateConnection();
    

Create a connection factory with the default properties.

If we are connecting to IBM MQ and XMSC_USERID is not set, then the queue manager uses the userID of the logged on user by default. If you require further connection-level authentication of individual users we can write a client authentication exit which is configured in IBM MQ.

    Parameters:
    None

    Exceptions:

    • XMSException


CreateConnection - Create Connection (using a specified user identity)

    Interface:
    IConnection CreateConnection(String userId, String password);
    

Create a connection using a specified user identity.

If we are connecting to IBM MQ and XMSC_USERID is not set, then the queue manager uses the userID of the logged on user by default. If you require further connection-level authentication of individual users we can write a client authentication exit which is configured in IBM MQ.

The connection is created in stopped mode. No messages are delivered until the application calls Connection.start().

    Parameters:

      userID (input)
      A String object encapsulating the user identifier to be used to authenticate the application. If you provide a null, an attempt is made to create the connection without authentication.

      password (input)
      A String object encapsulating the password to be used to authenticate the application. If you provide a null, an attempt is made to create the connection without authentication.

    Returns:
    The Connection object.

    Exceptions:

    • XMSException
    • XMS_X_SECURITY_EXCEPTION


Inherited properties and methods

The following methods are inherited from the IPropertyContext interface: