Class NettyAcceptor
java.lang.Object
org.apache.activemq.artemis.core.remoting.impl.AbstractAcceptor
org.apache.activemq.artemis.core.remoting.impl.netty.NettyAcceptor
- All Implemented Interfaces:
ActiveMQComponent,Acceptor
A Netty TCP Acceptor that is embedding Netty.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from class org.apache.activemq.artemis.core.remoting.impl.AbstractAcceptor
protocolMap -
Constructor Summary
ConstructorsConstructorDescriptionNettyAcceptor(String name, ClusterConnection clusterConnection, Map<String, Object> configuration, BufferHandler handler, ServerConnectionLifeCycleListener listener, ScheduledExecutorService scheduledThreadPool, Executor failureExecutor, Map<String, ProtocolManager> protocolMap) -
Method Summary
Modifier and TypeMethodDescriptionvoidintThis is a utility method for Socket-based acceptor implementations to get the actual port used.getName()The name of the acceptor used on the configuration. for logging and debug purposes.intintio.netty.handler.ssl.SslHandlergetSslHandler(io.netty.buffer.ByteBufAllocator alloc, String peerHost, int peerPort) intbooleanbooleanbooleanonly InVM acceptors should allow thisvoidvoidpause()Pause the acceptor and stop it from receiving client requests.voidreload()Re-create the acceptor with the existing configuration values.voidsetDefaultActiveMQPrincipal(ActiveMQPrincipal defaultActiveMQPrincipal) not allowedvoidsetKeyStoreParameters(String keyStorePath, String keyStoreAlias) voidsetNotificationService(NotificationService notificationService) Set the notification service for this acceptor to use.setQuietPeriod(int quietPeriod) setShutdownTimeout(int shutdownTimeout) voidstart()voidstop()voidtransfer(io.netty.channel.Channel channel) Transfers the Netty channel that has been created outside of this NettyAcceptor to control it and configure it according to this NettyAcceptor setting.Methods inherited from class org.apache.activemq.artemis.core.remoting.impl.AbstractAcceptor
getProtocolMap, updateInterceptors
-
Field Details
-
INVM_ACCEPTOR_TYPE
- See Also:
-
NIO_ACCEPTOR_TYPE
- See Also:
-
EPOLL_ACCEPTOR_TYPE
- See Also:
-
KQUEUE_ACCEPTOR_TYPE
- See Also:
-
-
Constructor Details
-
NettyAcceptor
public NettyAcceptor(String name, ClusterConnection clusterConnection, Map<String, Object> configuration, BufferHandler handler, ServerConnectionLifeCycleListener listener, ScheduledExecutorService scheduledThreadPool, Executor failureExecutor, Map<String, ProtocolManager> protocolMap)
-
-
Method Details
-
getTcpReceiveBufferSize
public int getTcpReceiveBufferSize() -
start
- Throws:
Exception
-
getName
Description copied from interface:AcceptorThe name of the acceptor used on the configuration. for logging and debug purposes. -
getConnections
-
getProtocolHandler
-
setKeyStoreParameters
-
transfer
public void transfer(io.netty.channel.Channel channel) Transfers the Netty channel that has been created outside of this NettyAcceptor to control it and configure it according to this NettyAcceptor setting.- Parameters:
channel- A Netty channel created outside this NettyAcceptor.
-
reload
public void reload()Description copied from interface:AcceptorRe-create the acceptor with the existing configuration values. Useful, for example, for reloading key/trust stores on acceptors which support SSL. -
getSslHandler
public io.netty.handler.ssl.SslHandler getSslHandler(io.netty.buffer.ByteBufAllocator alloc, String peerHost, int peerPort) throws Exception - Throws:
Exception
-
getConfiguration
-
stop
- Throws:
Exception
-
asyncStop
-
notifyStop
public void notifyStop() -
isStarted
public boolean isStarted() -
pause
public void pause()Description copied from interface:AcceptorPause the acceptor and stop it from receiving client requests. -
setNotificationService
Description copied from interface:AcceptorSet the notification service for this acceptor to use.- Parameters:
notificationService- the notification service
-
setDefaultActiveMQPrincipal
not allowed -
isUnsecurable
public boolean isUnsecurable()only InVM acceptors should allow this -
getClusterConnection
- Returns:
- the cluster connection associated with this Acceptor
-
createConnectionCreator
-
getQuietPeriod
public int getQuietPeriod() -
setQuietPeriod
-
getShutdownTimeout
public int getShutdownTimeout() -
setShutdownTimeout
-
isAutoStart
public boolean isAutoStart() -
getActualPort
public int getActualPort()Description copied from interface:AcceptorThis is a utility method for Socket-based acceptor implementations to get the actual port used. This is useful for configurations which specify a port number of 0 which allows the JVM to select an ephemeral port.- Returns:
- the actual port used if using a Socket-based acceptor implementation; -1 otherwise
-