@ThreadSafe public interface Server
Modifier and Type | Method | Description |
---|---|---|
Connection |
getConnection() |
Gets a connection to this server.
|
void |
getConnectionAsync(SingleResultCallback<AsyncConnection> callback) |
Gets a connection to this server asynchronously.
|
ServerDescription |
getDescription() |
Gets the description of this server.
|
ServerDescription getDescription()
Connection getConnection()
Gets a connection to this server. The connection should be released after the caller is done with it.
Implementations of this method are allowed to block while waiting for a free connection from a pool of available connection.
Implementations of this method will likely pool the underlying connection, so the effect of closing the returned connection will be to return the connection to the pool.
void getConnectionAsync(SingleResultCallback<AsyncConnection> callback)
Gets a connection to this server asynchronously. The connection should be released after the caller is done with it.
Implementations of this method will likely pool the underlying connection, so the effect of closing the returned connection will be to return the connection to the pool.
callback
- the callback to execute when the connection is available or an error occurs