Class NettyConnector
java.lang.Object
org.apache.activemq.artemis.spi.core.remoting.AbstractConnector
org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnector
- All Implemented Interfaces:
Connector
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic Stringstatic final Stringstatic Stringstatic final Stringstatic final StringFields inherited from class org.apache.activemq.artemis.spi.core.remoting.AbstractConnector
configuration -
Constructor Summary
ConstructorsConstructorDescriptionNettyConnector(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) -
Method Summary
Modifier and TypeMethodDescriptionstatic voidvoidclose()Create and return a connection from this connector.final ConnectioncreateConnection(Consumer<io.netty.channel.ChannelFuture> onConnect) Create and return a connection from this connector.createConnection(Consumer<io.netty.channel.ChannelFuture> onConnect, String host, int port) static StringcreateExpectedResponse(String magicNumber, String secretKey) io.netty.bootstrap.Bootstrapio.netty.channel.group.ChannelGroupintbooleanisEquivalent(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.booleanbooleanvoidsetConnectTimeoutMillis(int connectTimeoutMillis) voidstart()toString()
-
Field Details
-
NIO_CONNECTOR_TYPE
-
EPOLL_CONNECTOR_TYPE
-
KQUEUE_CONNECTOR_TYPE
-
JAVAX_KEYSTORE_PATH_PROP_NAME
- See Also:
-
JAVAX_KEYSTORE_PASSWORD_PROP_NAME
- See Also:
-
JAVAX_KEYSTORE_TYPE_PROP_NAME
- See Also:
-
JAVAX_KEYSTORE_PROVIDER_PROP_NAME
- See Also:
-
JAVAX_TRUSTSTORE_PATH_PROP_NAME
- See Also:
-
JAVAX_TRUSTSTORE_PASSWORD_PROP_NAME
- See Also:
-
JAVAX_TRUSTSTORE_TYPE_PROP_NAME
- See Also:
-
JAVAX_TRUSTSTORE_PROVIDER_PROP_NAME
- See Also:
-
ACTIVEMQ_KEYSTORE_PROVIDER_PROP_NAME
- See Also:
-
ACTIVEMQ_KEYSTORE_TYPE_PROP_NAME
- See Also:
-
ACTIVEMQ_KEYSTORE_PATH_PROP_NAME
- See Also:
-
ACTIVEMQ_KEYSTORE_PASSWORD_PROP_NAME
- See Also:
-
ACTIVEMQ_TRUSTSTORE_PROVIDER_PROP_NAME
- See Also:
-
ACTIVEMQ_TRUSTSTORE_TYPE_PROP_NAME
- See Also:
-
ACTIVEMQ_TRUSTSTORE_PATH_PROP_NAME
- See Also:
-
ACTIVEMQ_TRUSTSTORE_PASSWORD_PROP_NAME
- See Also:
-
ACTIVEMQ_SSL_PASSWORD_CODEC_CLASS_PROP_NAME
- See Also:
-
MAGIC_NUMBER
- See Also:
-
SEC_ACTIVEMQ_REMOTING_KEY
- See Also:
-
SEC_ACTIVEMQ_REMOTING_ACCEPT
- See Also:
-
ACTIVEMQ_REMOTING
- See Also:
-
DEFAULT_CONFIG
-
-
Constructor Details
-
NettyConnector
public NettyConnector(Map<String, Object> configuration, BufferHandler handler, BaseConnectionLifeCycleListener<?> listener, Executor closeExecutor, Executor threadPool, ScheduledExecutorService scheduledThreadPool) -
NettyConnector
public NettyConnector(Map<String, Object> configuration, BufferHandler handler, BaseConnectionLifeCycleListener<?> listener, Executor closeExecutor, Executor threadPool, ScheduledExecutorService scheduledThreadPool, ClientProtocolManager protocolManager) -
NettyConnector
public NettyConnector(Map<String, Object> configuration, BufferHandler handler, BaseConnectionLifeCycleListener<?> listener, Executor closeExecutor, Executor threadPool, ScheduledExecutorService scheduledThreadPool, ClientProtocolManager protocolManager, boolean serverConnection)
-
-
Method Details
-
toString
-
getChannelGroup
public io.netty.channel.group.ChannelGroup getChannelGroup() -
isServerConnection
public boolean isServerConnection() -
start
public void start() -
close
public void close() -
isStarted
public boolean isStarted() -
createConnection
Description copied from interface:ConnectorCreate and return a connection from this 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
- Returns:
- The connection, or null if unable to create a connection (e.g. network is unavailable)
-
createConnection
Create and return a connection from this 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.
This version can be used for testing purposes.
- Parameters:
onConnect- a callback that would be called right afterBootstrap.connect()- Returns:
- The connection, or
nullif unable to create a connection (e.g. network is unavailable)
-
createConnection
public NettyConnection createConnection(Consumer<io.netty.channel.ChannelFuture> onConnect, String host, int port) -
getConnectTimeoutMillis
public int getConnectTimeoutMillis() -
setConnectTimeoutMillis
public void setConnectTimeoutMillis(int connectTimeoutMillis) -
isEquivalent
Description copied from interface:ConnectorIf 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.- Returns:
- true means the configuration is equivalent to the connector. false otherwise
-
getBootStrap
public io.netty.bootstrap.Bootstrap getBootStrap() -
clearThreadPools
public static void clearThreadPools() -
createExpectedResponse
public static String createExpectedResponse(String magicNumber, String secretKey) throws IOException - Throws:
IOException
-