BasicConnectionFactory (Message Queue, 5.1 API Specification)
Date: 2019-01-27

com.sun.messaging

## Class BasicConnectionFactory

- java.lang.Object
- - com.sun.messaging.AdministeredObject
  - - com.sun.messaging.BasicConnectionFactory

- All Implemented Interfaces:
    java.io.Serializable, javax.jms.ConnectionFactory
  Direct Known Subclasses:
    ConnectionFactory

      public class BasicConnectionFactory
      extends AdministeredObject
      implements javax.jms.ConnectionFactory

  A `BasicConnectionFactory` encapsulates Sun MQ specific configuration information for Sun MQ `ConnectionFactory` objects and is used to create Connections with a Sun MQ Java Message Service (JMS) provider.
  See Also:
    `javax.jms.ConnectionFactory`, `com.sun.messaging.ConnectionConfiguration`, Serialized Form

- - ### Field Summary

    - ### Fields inherited from class com.sun.messaging.AdministeredObject

      `AO_PROPERTY_TYPE_BOOLEAN, AO_PROPERTY_TYPE_INTEGER, AO_PROPERTY_TYPE_LIST, AO_PROPERTY_TYPE_LONG, AO_PROPERTY_TYPE_PROPERTYOWNER, AO_PROPERTY_TYPE_STRING, cachedConfigurationMap, configuration, configurationLabels, configurationTypes, cr, storedVersion, VERSION`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `` | `BasicConnectionFactory()` Constructs a BasicConnectionFactory with the default configuration.
    `protected` | `BasicConnectionFactory(java.lang.String defaultsBase)` Constructs a BasicConnectionFactory with the specified configuration.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `javax.jms.Connection` | `createConnection()` Creates a Connection with the default user identity.
    `javax.jms.Connection` | `createConnection(java.lang.String username, java.lang.String password)` Creates a Connection with a specified user identity.
    `javax.jms.JMSContext` | `createContext()`
    `javax.jms.JMSContext` | `createContext(int sessionMode)`
    `javax.jms.JMSContext` | `createContext(java.lang.String userName, java.lang.String password)`
    `javax.jms.JMSContext` | `createContext(java.lang.String userName, java.lang.String password, int sessionMode)`
    `java.lang.String` | `getConnectionType()` Returns the type of connections created by this `BasicConnectionFactory`.
    `protected static com.sun.messaging.jmq.jmsclient.ContainerType` | `getContainerType()`
    `void` | `setConnectionType(java.lang.String type)` Sets the type of connections created by this `BasicConnectionFactory`.
    `void` | `setDefaultConfiguration()` Sets the minimum `BasicConnectionFactory` configuration defaults required to connect to the Sun MQ Message Service.
    `java.lang.String` | `toString()` Returns a pretty printed version of the provider specific information for this ConnectionFactory object.

    - ### Methods inherited from class com.sun.messaging.AdministeredObject

      `dump, enumeratePropertyNames, getConfiguration, getCurrentConfiguration, getLabelForGroup, getPropertiesForGroup, getProperty, getPropertyForListValue, getPropertyGroups, getPropertyLabel, getPropertyListOtherName, getPropertyListValues, getPropertyType, getPropertyValueForListValue, getStoredVersion, getVERSION, isPropertyDeprecated, isPropertyHidden, isReadOnly, isStoredVersionCompatible, setProperty, setReadOnly`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### BasicConnectionFactory

          public BasicConnectionFactory()

      Constructs a BasicConnectionFactory with the default configuration.

    - #### BasicConnectionFactory

          protected BasicConnectionFactory(java.lang.String defaultsBase)

      Constructs a BasicConnectionFactory with the specified configuration.

  - ### Method Detail

    - #### createConnection

          public javax.jms.Connection createConnection()
                                                throws javax.jms.JMSException

      Creates a Connection with the default user identity. The default user identity is defined by the `ConnectionFactory` properties `imqDefaultUsername` and `imqDefaultPassword`
      Specified by:
        `createConnection` in interface `javax.jms.ConnectionFactory`
      Returns:
        a newly created Connection.
      Throws:
        `javax.jms.JMSException` - if a JMS error occurs.
      See Also:
        `ConnectionConfiguration.imqDefaultUsername`, `ConnectionConfiguration.imqDefaultPassword`

    - #### createConnection

          public javax.jms.Connection createConnection(java.lang.String username,
                                                       java.lang.String password)
                                                throws javax.jms.JMSException

      Creates a Connection with a specified user identity.
      Specified by:
        `createConnection` in interface `javax.jms.ConnectionFactory`
      Parameters:
        `username` - the caller's user name
        `password` - the caller's password
      Returns:
        a newly created connection.
      Throws:
        `javax.jms.JMSException` - if a JMS error occurs.

    - #### createContext

          public javax.jms.JMSContext createContext()

      Specified by:
        `createContext` in interface `javax.jms.ConnectionFactory`

    - #### createContext

          public javax.jms.JMSContext createContext(java.lang.String userName,
                                                    java.lang.String password)

      Specified by:
        `createContext` in interface `javax.jms.ConnectionFactory`

    - #### createContext

          public javax.jms.JMSContext createContext(java.lang.String userName,
                                                    java.lang.String password,
                                                    int sessionMode)

      Specified by:
        `createContext` in interface `javax.jms.ConnectionFactory`

    - #### createContext

          public javax.jms.JMSContext createContext(int sessionMode)

      Specified by:
        `createContext` in interface `javax.jms.ConnectionFactory`

    - #### getContainerType

          protected static com.sun.messaging.jmq.jmsclient.ContainerType getContainerType()

    - #### setConnectionType

          public final void setConnectionType(java.lang.String type)

      Sets the type of connections created by this `BasicConnectionFactory`.
      Parameters:
        `type` - The type of connections created by this `BasicConnectionFactory`.

    - #### getConnectionType

          public final java.lang.String getConnectionType()

      Returns the type of connections created by this `BasicConnectionFactory`.
      Returns:
        The type of connections created by this `BasicConnectionFactory`.

    - #### toString

          public java.lang.String toString()

      Returns a pretty printed version of the provider specific information for this ConnectionFactory object.
      Overrides:
        `toString` in class `AdministeredObject`
      Returns:
        the pretty printed string.

    - #### setDefaultConfiguration

          public void setDefaultConfiguration()

      Sets the minimum `BasicConnectionFactory` configuration defaults required to connect to the Sun MQ Message Service.
      Specified by:
        `setDefaultConfiguration` in class `AdministeredObject`

Copyright (c) 2010, 2017 Oracle and/or its affiliates. All rights reserved.