public class NettyConnector extends AbstractConnector
Modifier and Type | Field and Description |
---|---|
static String |
ACTIVEMQ_KEYSTORE_PASSWORD_PROP_NAME |
static String |
ACTIVEMQ_KEYSTORE_PATH_PROP_NAME |
static String |
ACTIVEMQ_KEYSTORE_PROVIDER_PROP_NAME |
static String |
ACTIVEMQ_REMOTING |
static String |
ACTIVEMQ_TRUSTSTORE_PASSWORD_PROP_NAME |
static String |
ACTIVEMQ_TRUSTSTORE_PATH_PROP_NAME |
static String |
ACTIVEMQ_TRUSTSTORE_PROVIDER_PROP_NAME |
static Map<String,Object> |
DEFAULT_CONFIG |
static String |
EPOLL_CONNECTOR_TYPE |
static String |
JAVAX_KEYSTORE_PASSWORD_PROP_NAME |
static String |
JAVAX_KEYSTORE_PATH_PROP_NAME |
static String |
JAVAX_KEYSTORE_PROVIDER_PROP_NAME |
static String |
JAVAX_TRUSTSTORE_PASSWORD_PROP_NAME |
static String |
JAVAX_TRUSTSTORE_PATH_PROP_NAME |
static String |
JAVAX_TRUSTSTORE_PROVIDER_PROP_NAME |
static String |
KQUEUE_CONNECTOR_TYPE |
static String |
MAGIC_NUMBER |
static String |
NIO_CONNECTOR_TYPE |
static String |
SEC_ACTIVEMQ_REMOTING_ACCEPT |
static String |
SEC_ACTIVEMQ_REMOTING_KEY |
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) |
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.
|
static String |
createExpectedResponse(String magicNumber,
String secretKey) |
void |
finalize() |
io.netty.bootstrap.Bootstrap |
getBootStrap() |
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 |
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_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_PROVIDER_PROP_NAME
public static final String ACTIVEMQ_KEYSTORE_PROVIDER_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_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 void start()
Connector
public void close()
Connector
public boolean isStarted()
Connector
public Connection createConnection()
Connector
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
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 int getConnectTimeoutMillis()
public void setConnectTimeoutMillis(int connectTimeoutMillis)
public boolean isEquivalent(Map<String,Object> configuration)
Connector
public void finalize() throws Throwable
public io.netty.bootstrap.Bootstrap getBootStrap()
public static void clearThreadPools()
public static String createExpectedResponse(String magicNumber, String secretKey) throws IOException
IOException
Copyright © 2019 JBoss by Red Hat. All rights reserved.