public final class ProtocolConnectionManager extends Object
ProtocolConnectionManager.ConnectTask can be used to implement different (re-)connection strategies.| Modifier and Type | Class and Description |
|---|---|
static interface |
ProtocolConnectionManager.ConnectionOpenHandler
Handler for notifications that a connection has been opened
|
static interface |
ProtocolConnectionManager.ConnectTask
Task used to establish the connection.
|
| Modifier and Type | Field and Description |
|---|---|
static ProtocolConnectionManager.ConnectTask |
DISCONNECTED
A
ConnectTask that can be returned from ProtocolConnectionManager.ConnectTask.connectionClosed()
to terminate further attempts to connect. |
| Modifier and Type | Method and Description |
|---|---|
org.jboss.remoting3.Connection |
connect()
Get the connection.
|
static ProtocolConnectionManager |
create(org.jboss.remoting3.Connection connection,
ProtocolConnectionManager.ConnectionOpenHandler openHandler)
Create a new connection manager, based on an existing connection.
|
static ProtocolConnectionManager |
create(ProtocolConnectionConfiguration configuration,
ProtocolConnectionManager.ConnectionOpenHandler openHandler)
Create a new connection manager, which will try to connect using the protocol connection configuration.
|
static ProtocolConnectionManager |
create(ProtocolConnectionConfiguration configuration,
ProtocolConnectionManager.ConnectionOpenHandler openHandler,
ProtocolConnectionManager.ConnectTask next)
Create a new connection manager, which will try to connect using the protocol connection configuration.
|
static ProtocolConnectionManager |
create(ProtocolConnectionManager.ConnectTask connectTask)
Create a new connection manager.
|
org.jboss.remoting3.Connection |
getConnection()
Get the connection.
|
boolean |
isConnected()
Check if connected.
|
void |
shutdown()
Shutdown the connection manager.
|
public static final ProtocolConnectionManager.ConnectTask DISCONNECTED
ConnectTask that can be returned from ProtocolConnectionManager.ConnectTask.connectionClosed()
to terminate further attempts to connect.public boolean isConnected()
true if the connection is open, false otherwisepublic org.jboss.remoting3.Connection connect()
throws IOException
ConnectTask will be used to establish a connection.IOExceptionpublic org.jboss.remoting3.Connection getConnection()
public void shutdown()
public static ProtocolConnectionManager create(org.jboss.remoting3.Connection connection, ProtocolConnectionManager.ConnectionOpenHandler openHandler)
connection - the existing connectionopenHandler - a connection open handlerpublic static ProtocolConnectionManager create(ProtocolConnectionConfiguration configuration, ProtocolConnectionManager.ConnectionOpenHandler openHandler)
configuration - the connection configurationopenHandler - the connection open handlerpublic static ProtocolConnectionManager create(ProtocolConnectionConfiguration configuration, ProtocolConnectionManager.ConnectionOpenHandler openHandler, ProtocolConnectionManager.ConnectTask next)
configuration - the connection configurationopenHandler - the connection open handlernext - the next connect connectTask used once disconnectedpublic static ProtocolConnectionManager create(ProtocolConnectionManager.ConnectTask connectTask)
connectTask - the connect connectTaskCopyright © 2017 JBoss by Red Hat. All rights reserved.