*** This interface provides Binary Compatibility only, not Source Compatibility ***
Package com.sas.services.connection
Interface ConnectionFactoryInterface
- All Superinterfaces:
ConnectionFactoryShellInterface
- All Known Subinterfaces:
PlatformConnectionFactoryInterface
@SASScope("ALL")
@BinaryCompatibilityOnly
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
Modifier and TypeMethodDescriptionGet the factory administrator's interface.getAdminInterface(String adminName, String password) This method is provided for compatibility with previous releases, and it is otherwise rarely used.Get a connection to a server that does not require a user name and password for connections.getConnection(long waitMilliseconds) Get a connection to a server that does not require a user name and password for connections.getConnection(String domain) Get a connection to a server that does not require a user name and password for connections.getConnection(String domain, long waitMilliseconds) Get a connection to a server that does not require a user name and password for connections.getConnection(String userName, String password) Get a connection to a server.getConnection(String userName, String password, long waitMilliseconds) Get a connection to a server.getConnection(String userName, String password, String domain) Get a connection to a server.getConnection(String userName, String password, 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 Details
-
getConnection
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
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
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(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 serverwaitMilliseconds- 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(String userName, 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 factorypassword- 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(String userName, String password, 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 factorypassword- the password that authenticates userNamedomain- 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(String userName, 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 factorypassword- the password that authenticates userNamewaitMilliseconds- 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(String userName, String password, 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 factorypassword- the password that authenticates userNamedomain- the authentication domain for userName and passwordwaitMilliseconds- 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
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(String adminName, String password) throws ConnectionFactoryException This method is provided for compatibility with previous releases, and it is otherwise rarely used.- Throws:
ConnectionFactoryException
-