public class NettyConnector extends AbstractConnector
configuration| Constructor and Description |
|---|
NettyConnector(Map<String,Object> configuration,
BufferHandler handler,
BaseConnectionLifeCycleListener<?> listener,
Executor closeExecutor,
Executor threadPool,
ScheduledExecutorService scheduledThreadPool) |
NettyConnector(Map<String,Object> configuration,
BufferHandler handler,
BaseConnectionLifeCycleListener<?> listener,
Executor closeExecutor,
Executor threadPool,
ScheduledExecutorService scheduledThreadPool,
ClientProtocolManager protocolManager) |
NettyConnector(Map<String,Object> configuration,
BufferHandler handler,
BaseConnectionLifeCycleListener<?> listener,
Executor closeExecutor,
Executor threadPool,
ScheduledExecutorService scheduledThreadPool,
ClientProtocolManager protocolManager,
boolean serverConnection) |
| Modifier and Type | Method and Description |
|---|---|
static void |
clearThreadPools() |
void |
close()
closes the connector
|
Connection |
createConnection()
Create and return a connection from this connector.
|
Connection |
createConnection(Consumer<io.netty.channel.ChannelFuture> onConnect)
Create and return a connection from this connector.
|
NettyConnection |
createConnection(Consumer<io.netty.channel.ChannelFuture> onConnect,
String host,
int port) |
static String |
createExpectedResponse(String magicNumber,
String secretKey) |
void |
finalize() |
io.netty.bootstrap.Bootstrap |
getBootStrap() |
io.netty.channel.group.ChannelGroup |
getChannelGroup() |
int |
getConnectTimeoutMillis() |
boolean |
isEquivalent(Map<String,Object> configuration)
If the configuration is equivalent to this connector, which means
if the parameter configuration is used to create a connection to a target
node, it will be the same node as of the connections made with this connector.
|
boolean |
isServerConnection() |
boolean |
isStarted()
returns true if the connector is started, oterwise false.
|
void |
setConnectTimeoutMillis(int connectTimeoutMillis) |
void |
start()
starts the connector
|
String |
toString() |
public static String NIO_CONNECTOR_TYPE
public static String EPOLL_CONNECTOR_TYPE
public static String KQUEUE_CONNECTOR_TYPE
public static final String JAVAX_KEYSTORE_PATH_PROP_NAME
public static final String JAVAX_KEYSTORE_PASSWORD_PROP_NAME
public static final String JAVAX_KEYSTORE_TYPE_PROP_NAME
public static final String JAVAX_KEYSTORE_PROVIDER_PROP_NAME
public static final String JAVAX_TRUSTSTORE_PATH_PROP_NAME
public static final String JAVAX_TRUSTSTORE_PASSWORD_PROP_NAME
public static final String JAVAX_TRUSTSTORE_TYPE_PROP_NAME
public static final String JAVAX_TRUSTSTORE_PROVIDER_PROP_NAME
public static final String ACTIVEMQ_KEYSTORE_PROVIDER_PROP_NAME
public static final String ACTIVEMQ_KEYSTORE_TYPE_PROP_NAME
public static final String ACTIVEMQ_KEYSTORE_PATH_PROP_NAME
public static final String ACTIVEMQ_KEYSTORE_PASSWORD_PROP_NAME
public static final String ACTIVEMQ_TRUSTSTORE_PROVIDER_PROP_NAME
public static final String ACTIVEMQ_TRUSTSTORE_TYPE_PROP_NAME
public static final String ACTIVEMQ_TRUSTSTORE_PATH_PROP_NAME
public static final String ACTIVEMQ_TRUSTSTORE_PASSWORD_PROP_NAME
public static final String MAGIC_NUMBER
public static final String SEC_ACTIVEMQ_REMOTING_KEY
public static final String SEC_ACTIVEMQ_REMOTING_ACCEPT
public static final String ACTIVEMQ_REMOTING
public NettyConnector(Map<String,Object> configuration, BufferHandler handler, BaseConnectionLifeCycleListener<?> listener, Executor closeExecutor, Executor threadPool, ScheduledExecutorService scheduledThreadPool)
public NettyConnector(Map<String,Object> configuration, BufferHandler handler, BaseConnectionLifeCycleListener<?> listener, Executor closeExecutor, Executor threadPool, ScheduledExecutorService scheduledThreadPool, ClientProtocolManager protocolManager)
public NettyConnector(Map<String,Object> configuration, BufferHandler handler, BaseConnectionLifeCycleListener<?> listener, Executor closeExecutor, Executor threadPool, ScheduledExecutorService scheduledThreadPool, ClientProtocolManager protocolManager, boolean serverConnection)
public io.netty.channel.group.ChannelGroup getChannelGroup()
public boolean isServerConnection()
public void start()
Connectorpublic void close()
Connectorpublic boolean isStarted()
Connectorpublic Connection createConnection()
ConnectorThis method must NOT throw an exception if it fails to create the connection (e.g. network is not available), in this case it MUST return null
public final Connection createConnection(Consumer<io.netty.channel.ChannelFuture> onConnect)
This method must NOT throw an exception if it fails to create the connection
(e.g. network is not available), in this case it MUST return null.
This version can be used for testing purposes.
onConnect - a callback that would be called right after Bootstrap.connect()null if unable to create a connection (e.g. network is unavailable)public NettyConnection createConnection(Consumer<io.netty.channel.ChannelFuture> onConnect, String host, int port)
public int getConnectTimeoutMillis()
public void setConnectTimeoutMillis(int connectTimeoutMillis)
public boolean isEquivalent(Map<String,Object> configuration)
Connectorpublic void finalize()
throws Throwable
public io.netty.bootstrap.Bootstrap getBootStrap()
public static void clearThreadPools()
public static String createExpectedResponse(String magicNumber, String secretKey) throws IOException
IOExceptionCopyright © 2021 JBoss by Red Hat. All rights reserved.