@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