All Libraries | This Library | Package | Class | Use | Tree | Deprecated | Index | Grand Index | Help
|  | Foundation |
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

*** This interface provides Binary Compatibility only, not Source Compatibility ***

## com.sas.services.connection
Interface ConnectionFactoryInterface

All Superinterfaces:
  ConnectionFactoryShellInterface

All Known Subinterfaces:
  PlatformConnectionFactoryInterface

    public interface ConnectionFactoryInterface

extends ConnectionFactoryShellInterface

User interface for connection factories. The factory controls the lifetime of a connection. When a request for a connection arrives, the factory will return an existing pooled connection if one is available, or it will create a new connection if necessary. Users must notify the factory when they are done with the connection so it can be returned to the pool or destroyed. The `connection handle` provides the necessary notification method.

A factory may have a limit on the number of connections it is allowed to create and manage at a time. If a factory allocates all the connections it is allowed to managed to users, and a new request for a connection arrives, the factory will not be able to serve the request immediately. The various `getConnection()` methods provide flags and defaults that allow the caller to specify how long he or she is willing to wait for another user to return a connection to the factory's pool.

Method Summary
`ConnectionFactoryAdminInterface` | `getAdminInterface()` Get the factory administrator's interface.
`ConnectionFactoryAdminInterface` | `getAdminInterface(java.lang.String adminName, java.lang.String password)` This method is provided for compatibility with previous releases, and it is otherwise rarely used.
`ConnectionInterface` | `getConnection()` Get a connection to a server that does not require a user name and password for connections.
`ConnectionInterface` | `getConnection(long waitMilliseconds)` Get a connection to a server that does not require a user name and password for connections.
`ConnectionInterface` | `getConnection(java.lang.String domain)` Get a connection to a server that does not require a user name and password for connections.
`ConnectionInterface` | `getConnection(java.lang.String domain, long waitMilliseconds)` Get a connection to a server that does not require a user name and password for connections.
`ConnectionInterface` | `getConnection(java.lang.String userName, java.lang.String password)` Get a connection to a server.
`ConnectionInterface` | `getConnection(java.lang.String userName, java.lang.String password, long waitMilliseconds)` Get a connection to a server.
`ConnectionInterface` | `getConnection(java.lang.String userName, java.lang.String password, java.lang.String domain)` Get a connection to a server.
`ConnectionInterface` | `getConnection(java.lang.String userName, java.lang.String password, java.lang.String domain, long waitMilliseconds)` Get a connection to a server.

Methods inherited from interface com.sas.services.connection.ConnectionFactoryShellInterface
`addConnectionFactoryEventListener, getAdminInterface, getConnection, getConnection, getDomains, removeConnectionFactoryEventListener`

Method Detail

### getConnection

    ConnectionInterface getConnection()
                                      throws ConnectionFactoryException

  Get a connection to a server that does not require a user name and password for connections. If the factory has allocated all the connections it is allowed to manage to users when this call is made, then this call will block until another user returns a connection to the factory's pool. The server must belong to an authentication domain with name "" (empty string).

  Returns:
    a connection
  Throws:
    `ConnectionFactoryException` - if the factory cannot create a connection to satisfy this request or if the factory has been shutdown

### getConnection

    ConnectionInterface getConnection(java.lang.String domain)
                                      throws ConnectionFactoryException

  Get a connection to a server that does not require a user name and password for connections. If the factory has allocated all the connections it is allowed to manage to users when this call is made, then this call will block until another user returns a connection to the factory's pool. The server must belong to an authentication domain with the given name.

  Parameters:
    `domain` - the authentication domain for the server
  Returns:
    a connection
  Throws:
    `ConnectionFactoryException` - if the factory cannot create a connection to satisfy this request or if the factory has been shutdown

### getConnection

    ConnectionInterface getConnection(long waitMilliseconds)
                                      throws ConnectionFactoryException

  Get a connection to a server that does not require a user name and password for connections. If the factory has allocated all the connections it is allowed to manage to users when this call is made, then this call will behave as instructed by the value of waitMilliseconds. The server must belong to an authentication domain with name "" (empty string).

  Parameters:
    `waitMilliseconds` - a flag indicating how the call should behave if the factory has allocated all the connections it is allowed to manage to other users.

    `<0`
      throw an exception immediately
    `0`
      wait until another user returns a connection to the factory's pool
    `>0`
      wait up to waitMilliseconds milliseconds for another user to return a connection to the factory's pool and throw an exception if a connection is not returned in the alloted time.
    Returns:
      a connection
    Throws:
      `ConnectionFactoryException` - if the factory cannot create a connection to satisfy this request or if the request times out or if the factory has been shutdown

  ### getConnection

      ConnectionInterface getConnection(java.lang.String domain,
                                        long waitMilliseconds)
                                        throws ConnectionFactoryException

    Get a connection to a server that does not require a user name and password for connections. If the factory has allocated all the connections it is allowed to manage to users when this call is made, then this call will behave as instructed by the value of waitMilliseconds. The server must belong to an authentication domain with the given name.

    Parameters:
      `domain` - the authentication domain for the server
      `waitMilliseconds` - a flag indicating how the call should behave if the factory has allocated all the connections it is allowed to manage to other users.

      `<0`
        throw an exception immediately
      `0`
        wait until another user returns a connection to the factory's pool
      `>0`
        wait up to waitMilliseconds milliseconds for another user to return a connection to the factory's pool and throw an exception if a connection is not returned in the alloted time.
      Returns:
        a connection
      Throws:
        `ConnectionFactoryException` - if the factory cannot create a connection to satisfy this request or if the request times out or if the factory has been shutdown

    ### getConnection

        ConnectionInterface getConnection(java.lang.String userName,
                                          java.lang.String password)
                                          throws ConnectionFactoryException

      Get a connection to a server. If the factory has allocated all the connections it is allowed to manage to users when this call is made, then this call will block until another user returns a connection to the factory's pool. The server must belong to an authentication domain with name "" (empty string).

      Parameters:
        `userName` - the name of someone allowed to use this factory
        `password` - the password that authenticates userName
      Returns:
        a connection
      Throws:
        `ConnectionFactoryException` - if the factory cannot create a connection to satisfy this request or if the factory has been shutdown or

    ### getConnection

        ConnectionInterface getConnection(java.lang.String userName,
                                          java.lang.String password,
                                          java.lang.String domain)
                                          throws ConnectionFactoryException

      Get a connection to a server. If the factory has allocated all the connections it is allowed to manage to users when this call is made, then this call will block until another user returns a connection to the factory's pool. The server must belong to an authentication domain with the given name.

      Parameters:
        `userName` - the name of someone allowed to use this factory
        `password` - the password that authenticates userName
        `domain` - the authentication domain for userName and password
      Returns:
        a connection
      Throws:
        `ConnectionFactoryException` - if the factory cannot create a connection to satisfy this request or if the factory has been shutdown

    ### getConnection

        ConnectionInterface getConnection(java.lang.String userName,
                                          java.lang.String password,
                                          long waitMilliseconds)
                                          throws ConnectionFactoryException

      Get a connection to a server. If the factory has allocated all the connections it is allowed to manage to users when this call is made, then this call will behave as instructed by the value of waitMilliseconds. The server must belong to an authentication domain with name "" (empty string).

      Parameters:
        `userName` - the name of someone allowed to use this factory
        `password` - the password that authenticates userName
        `waitMilliseconds` - a flag indicating how the call should behave if the factory has allocated all the connections it is allowed to manage to other users.

        `<0`
          throw an exception immediately
        `0`
          wait until another user returns a connection to the factory's pool
        `>0`
          wait up to waitMilliseconds milliseconds for another user to return a connection to the factory's pool and throw an exception if a connection is not returned in the alloted time.
        Returns:
          a connection
        Throws:
          `ConnectionFactoryException` - if the factory cannot create a connection to satisfy this request or if the request times out or if the factory has been shutdown

      ### getConnection

          ConnectionInterface getConnection(java.lang.String userName,
                                            java.lang.String password,
                                            java.lang.String domain,
                                            long waitMilliseconds)
                                            throws ConnectionFactoryException

        Get a connection to a server. If the factory has allocated all the connections it is allowed to manage to users when this call is made, then this call will behave as instructed by the value of waitMilliseconds. The server must belong to an authentication domain with the given name.

        Parameters:
          `userName` - the name of someone allowed to use this factory
          `password` - the password that authenticates userName
          `domain` - the authentication domain for userName and password
          `waitMilliseconds` - a flag indicating how the call should behave if the factory has allocated all the connections it is allowed to manage to other users.

          `<0`
            throw an exception immediately
          `0`
            wait until another user returns a connection to the factory's pool
          `>0`
            wait up to waitMilliseconds milliseconds for another user to return a connection to the factory's pool and throw an exception if a connection is not returned in the alloted time.
          Returns:
            a connection
          Throws:
            `ConnectionFactoryException` - if the factory cannot create a connection to satisfy this request or if the request times out or if the factory has been shutdown

        ### getAdminInterface

            ConnectionFactoryAdminInterface getAdminInterface()
                                                              throws ConnectionFactoryException

          Get the factory administrator's interface. The administrator's interface allows you to manipulate factory logging and to shutdown or destroy the factory. Actions performed on the administrator's interface may impact other users of this factory.

          Returns:
            the factory administrator's interface
          Throws:
            `ConnectionFactoryException`

        ### getAdminInterface

            ConnectionFactoryAdminInterface getAdminInterface(java.lang.String adminName,
                                                              java.lang.String password)
                                                              throws ConnectionFactoryException

          This method is provided for compatibility with previous releases, and it is otherwise rarely used.

          Throws:
            `ConnectionFactoryException`

        *** This interface provides Binary Compatibility only, not Source Compatibility ***

        All Libraries | This Library | Package | Class | Use | Tree | Deprecated | Index | Grand Index | Help
        |  | Foundation |
        PREV CLASS NEXT CLASS | FRAMES NO FRAMES
        SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

        Copyright © 2009 SAS Institute Inc. All Rights Reserved.