Class ActiveMQClientProtocolManager
java.lang.Object
org.apache.activemq.artemis.core.protocol.core.impl.ActiveMQClientProtocolManager
- All Implemented Interfaces:
ClientProtocolManager
- Direct Known Subclasses:
HornetQClientProtocolManager
This class will return specific packets for different types of actions happening on a messaging protocol.
This is trying to unify the Core client into multiple protocols.
Returning null in certain packets means no action is taken on this specific protocol.
Semantic properties could also be added to this implementation.
Implementations of this class need to be stateless.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected RemotingConnectionImplprotected TopologyResponseHandler -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddChannelHandlers(io.netty.channel.ChannelPipeline pipeline) booleancheckForFailover(String nodeID) booleanconnect(Connection transportConnection, long callTimeout, long callFailoverTimeout, List<Interceptor> incomingInterceptors, List<Interceptor> outgoingInterceptors, TopologyResponseHandler topologyResponseHandler) protected PacketDecodercreateSessionContext(String name, String username, String password, boolean xa, boolean autoCommitSends, boolean autoCommitAcks, boolean preAcknowledge, int minLargeMessageSize, int confirmationWindowSize, String clientID) createSessionContext(Version clientVersion, String name, String username, String password, boolean xa, boolean autoCommitSends, boolean autoCommitAcks, boolean preAcknowledge, int minLargeMessageSize, int confirmationWindowSize, String clientID) getName()booleanisAlive()protected PacketnewCreateSessionPacket(int clientVersion, String name, String username, String password, boolean xa, boolean autoCommitSends, boolean autoCommitAcks, boolean preAcknowledge, int minLargeMessageSize, int confirmationWindowSize, long sessionChannelID, String clientID) protected SessionContextnewSessionContext(String name, int confirmationWindowSize, Channel sessionChannel, CreateSessionResponseMessage response) voidping(long connectionTTL) protected voidsendHandshake(Connection transportConnection) voidsendSubscribeTopology(boolean isServer) setExecutor(Executor executor) voidsetSessionFactory(ClientSessionFactory factory) voidstop()This is to be called when a connection failed and we want to interrupt any communication.protected ClusterTopologyChangeMessagebooleanwaitOnLatch(long milliseconds)
-
Field Details
-
connection
-
topologyResponseHandler
-
-
Constructor Details
-
ActiveMQClientProtocolManager
public ActiveMQClientProtocolManager()
-
-
Method Details
-
getName
- Specified by:
getNamein interfaceClientProtocolManager
-
setSessionFactory
- Specified by:
setSessionFactoryin interfaceClientProtocolManager
-
getSessionFactory
- Specified by:
getSessionFactoryin interfaceClientProtocolManager
-
addChannelHandlers
public void addChannelHandlers(io.netty.channel.ChannelPipeline pipeline) - Specified by:
addChannelHandlersin interfaceClientProtocolManager
-
waitOnLatch
- Specified by:
waitOnLatchin interfaceClientProtocolManager- Throws:
InterruptedException
-
getChannel0
-
getCurrentConnection
- Specified by:
getCurrentConnectionin interfaceClientProtocolManager
-
getChannel1
-
setExecutor
- Specified by:
setExecutorin interfaceClientProtocolManager
-
lockSessionCreation
- Specified by:
lockSessionCreationin interfaceClientProtocolManager
-
stop
public void stop()Description copied from interface:ClientProtocolManagerThis is to be called when a connection failed and we want to interrupt any communication. This used to be called exitLoop at some point o the code.. with a method named causeExit from ClientSessionFactoryImpl- Specified by:
stopin interfaceClientProtocolManager
-
isAlive
public boolean isAlive()- Specified by:
isAlivein interfaceClientProtocolManager
-
ping
public void ping(long connectionTTL) - Specified by:
pingin interfaceClientProtocolManager
-
sendSubscribeTopology
public void sendSubscribeTopology(boolean isServer) - Specified by:
sendSubscribeTopologyin interfaceClientProtocolManager
-
createSessionContext
public SessionContext createSessionContext(String name, String username, String password, boolean xa, boolean autoCommitSends, boolean autoCommitAcks, boolean preAcknowledge, int minLargeMessageSize, int confirmationWindowSize, String clientID) throws ActiveMQException - Specified by:
createSessionContextin interfaceClientProtocolManager- Throws:
ActiveMQException
-
createSessionContext
public SessionContext createSessionContext(Version clientVersion, String name, String username, String password, boolean xa, boolean autoCommitSends, boolean autoCommitAcks, boolean preAcknowledge, int minLargeMessageSize, int confirmationWindowSize, String clientID) throws ActiveMQException - Throws:
ActiveMQException
-
newCreateSessionPacket
-
newSessionContext
protected SessionContext newSessionContext(String name, int confirmationWindowSize, Channel sessionChannel, CreateSessionResponseMessage response) -
cleanupBeforeFailover
- Specified by:
cleanupBeforeFailoverin interfaceClientProtocolManager
-
checkForFailover
- Specified by:
checkForFailoverin interfaceClientProtocolManager- Throws:
ActiveMQException
-
connect
public RemotingConnection connect(Connection transportConnection, long callTimeout, long callFailoverTimeout, List<Interceptor> incomingInterceptors, List<Interceptor> outgoingInterceptors, TopologyResponseHandler topologyResponseHandler) - Specified by:
connectin interfaceClientProtocolManager
-
sendHandshake
-
updateTransportConfiguration
protected ClusterTopologyChangeMessage updateTransportConfiguration(ClusterTopologyChangeMessage topMessage) -
createPacketDecoder
-