Class ActiveMQClientProtocolManager
- java.lang.Object
-
- org.apache.activemq.artemis.core.protocol.core.impl.ActiveMQClientProtocolManager
-
- All Implemented Interfaces:
ClientProtocolManager
- Direct Known Subclasses:
HornetQClientProtocolManager
public class ActiveMQClientProtocolManager extends Object implements ClientProtocolManager
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
Fields Modifier and Type Field Description protected RemotingConnectionImplconnectionprotected TopologyResponseHandlertopologyResponseHandler
-
Constructor Summary
Constructors Constructor Description ActiveMQClientProtocolManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddChannelHandlers(io.netty.channel.ChannelPipeline pipeline)booleancheckForFailover(String liveNodeID)booleancleanupBeforeFailover(ActiveMQException cause)RemotingConnectionconnect(Connection transportConnection, long callTimeout, long callFailoverTimeout, List<Interceptor> incomingInterceptors, List<Interceptor> outgoingInterceptors, TopologyResponseHandler topologyResponseHandler)protected PacketDecodercreatePacketDecoder()SessionContextcreateSessionContext(String name, String username, String password, boolean xa, boolean autoCommitSends, boolean autoCommitAcks, boolean preAcknowledge, int minLargeMessageSize, int confirmationWindowSize, String clientID)SessionContextcreateSessionContext(Version clientVersion, String name, String username, String password, boolean xa, boolean autoCommitSends, boolean autoCommitAcks, boolean preAcknowledge, int minLargeMessageSize, int confirmationWindowSize, String clientID)ChannelgetChannel0()ChannelgetChannel1()RemotingConnectiongetCurrentConnection()StringgetName()ClientSessionFactorygetSessionFactory()booleanisAlive()LocklockSessionCreation()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)ActiveMQClientProtocolManagersetExecutor(Executor executor)voidsetSessionFactory(ClientSessionFactory factory)voidstop()This is to be called when a connection failed and we want to interrupt any communication.protected ClusterTopologyChangeMessageupdateTransportConfiguration(ClusterTopologyChangeMessage topMessage)booleanwaitOnLatch(long milliseconds)
-
-
-
Field Detail
-
connection
protected volatile RemotingConnectionImpl connection
-
topologyResponseHandler
protected TopologyResponseHandler topologyResponseHandler
-
-
Method Detail
-
getName
public String getName()
- Specified by:
getNamein interfaceClientProtocolManager
-
setSessionFactory
public void setSessionFactory(ClientSessionFactory factory)
- Specified by:
setSessionFactoryin interfaceClientProtocolManager
-
getSessionFactory
public ClientSessionFactory getSessionFactory()
- Specified by:
getSessionFactoryin interfaceClientProtocolManager
-
addChannelHandlers
public void addChannelHandlers(io.netty.channel.ChannelPipeline pipeline)
- Specified by:
addChannelHandlersin interfaceClientProtocolManager
-
waitOnLatch
public boolean waitOnLatch(long milliseconds) throws InterruptedException- Specified by:
waitOnLatchin interfaceClientProtocolManager- Throws:
InterruptedException
-
getChannel0
public Channel getChannel0()
-
getCurrentConnection
public RemotingConnection getCurrentConnection()
- Specified by:
getCurrentConnectionin interfaceClientProtocolManager
-
getChannel1
public Channel getChannel1()
-
setExecutor
public ActiveMQClientProtocolManager setExecutor(Executor executor)
- Specified by:
setExecutorin interfaceClientProtocolManager
-
lockSessionCreation
public Lock 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
protected Packet newCreateSessionPacket(int clientVersion, String name, String username, String password, boolean xa, boolean autoCommitSends, boolean autoCommitAcks, boolean preAcknowledge, int minLargeMessageSize, int confirmationWindowSize, long sessionChannelID, String clientID)
-
newSessionContext
protected SessionContext newSessionContext(String name, int confirmationWindowSize, Channel sessionChannel, CreateSessionResponseMessage response)
-
cleanupBeforeFailover
public boolean cleanupBeforeFailover(ActiveMQException cause)
- Specified by:
cleanupBeforeFailoverin interfaceClientProtocolManager
-
checkForFailover
public boolean checkForFailover(String liveNodeID) throws ActiveMQException
- 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
protected void sendHandshake(Connection transportConnection)
-
updateTransportConfiguration
protected ClusterTopologyChangeMessage updateTransportConfiguration(ClusterTopologyChangeMessage topMessage)
-
createPacketDecoder
protected PacketDecoder createPacketDecoder()
-
-