Author: jmesnil
Date: 2010-01-22 05:29:26 -0500 (Fri, 22 Jan 2010)
New Revision: 8836
Added:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/AbstractBufferHandler.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/ChannelImpl.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/CoreProtocolManager.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/CoreProtocolManagerFactory.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/HornetQPacketHandler.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/PacketDecoder.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/PacketImpl.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/RemotingConnectionImpl.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/CreateQueueMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/CreateReplicationSessionMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/CreateSessionMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/CreateSessionResponseMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/HornetQExceptionMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/MessagePacket.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/NullResponseMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/PacketsConfirmedMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/Ping.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReattachSessionMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReattachSessionResponseMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationAddMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationAddTXMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationCommitMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationCompareDataMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationDeleteMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationDeleteTXMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationLargeMessageBeingMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationLargeMessageWriteMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationLargemessageEndMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationPageEventMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationPageWriteMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationPrepareMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationResponseMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/RollbackMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionAcknowledgeMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionBindingQueryMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionBindingQueryResponseMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionCloseMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionCommitMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionConsumerCloseMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionConsumerFlowCreditMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionContinuationMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionCreateConsumerMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionDeleteQueueMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionExpiredMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionForceConsumerDelivery.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionProducerCreditsMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionQueueQueryMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionQueueQueryResponseMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionReceiveContinuationMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionReceiveLargeMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionReceiveMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionRequestProducerCreditsMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionSendContinuationMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionSendLargeMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionSendMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXACommitMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAEndMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAForgetMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAGetInDoubtXidsResponseMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAGetTimeoutResponseMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAJoinMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAPrepareMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAResponseMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAResumeMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXARollbackMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXASetTimeoutMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXASetTimeoutResponseMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAStartMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/spi/core/protocol/
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/spi/core/protocol/ConnectionEntry.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/spi/core/protocol/ProtocolManager.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/spi/core/protocol/ProtocolManagerFactory.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/spi/core/protocol/ProtocolType.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/spi/core/protocol/RemotingConnection.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/spi/core/protocol/SessionCallback.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/utils/XidCodecSupport.java
Removed:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/ChannelImpl.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/CoreProtocolManager.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/HornetQPacketHandler.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/PacketDecoder.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/PacketImpl.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/RemotingConnectionImpl.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/AbstractBufferHandler.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/ChannelImpl.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/CoreProtocolManager.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/CoreProtocolManagerFactory.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/HornetQPacketHandler.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/PacketDecoder.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/PacketImpl.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/RemotingConnectionImpl.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/CreateQueueMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/CreateReplicationSessionMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/CreateSessionMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/CreateSessionResponseMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/HornetQExceptionMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/MessagePacket.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/NullResponseMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/PacketsConfirmedMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/Ping.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReattachSessionMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReattachSessionResponseMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationAddMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationAddTXMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationCommitMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationCompareDataMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationDeleteMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationDeleteTXMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationLargeMessageBeingMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationLargeMessageWriteMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationLargemessageEndMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationPageEventMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationPageWriteMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationPrepareMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationResponseMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/RollbackMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionAcknowledgeMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionBindingQueryMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionBindingQueryResponseMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionCloseMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionCommitMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionConsumerCloseMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionConsumerFlowCreditMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionContinuationMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionCreateConsumerMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionDeleteQueueMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionExpiredMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionForceConsumerDelivery.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionProducerCreditsMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionQueueQueryMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionQueueQueryResponseMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionReceiveContinuationMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionReceiveLargeMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionReceiveMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionRequestProducerCreditsMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionSendContinuationMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionSendLargeMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionSendMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXACommitMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAEndMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAForgetMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAGetInDoubtXidsResponseMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAGetTimeoutResponseMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAJoinMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAPrepareMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAResponseMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAResumeMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXARollbackMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXASetTimeoutMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXASetTimeoutResponseMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAStartMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/ProtocolType.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/RemotingConnection.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/server/ConnectionEntry.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/server/ProtocolManager.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/server/SessionCallback.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/spi/core/protocol/ConnectionEntry.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/spi/core/protocol/ProtocolManager.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/spi/core/protocol/ProtocolManagerFactory.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/spi/core/protocol/ProtocolType.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/spi/core/protocol/RemotingConnection.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/spi/core/protocol/SessionCallback.java
Modified:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/CoreRemotingConnection.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/CoreSessionCallback.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/Packet.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/ServerSessionPacketHandler.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/CloseListener.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/invm/InVMAcceptor.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/invm/InVMConnection.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/invm/InVMConnector.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/invm/TransportConstants.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/server/RemotingService.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/server/impl/RemotingServiceImpl.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/replication/impl/ReplicationEndpointImpl.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/replication/impl/ReplicationManagerImpl.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/server/HornetQServer.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/server/ServerSession.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/server/cluster/Bridge.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/server/cluster/impl/BridgeImpl.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/server/impl/ServerConsumerImpl.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/server/impl/ServerMessageImpl.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/server/impl/ServerSessionImpl.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/integration/protocol/stomp/StompChannelHandler.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/integration/protocol/stomp/StompSessionCallback.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/integration/transports/netty/ChannelPipelineSupport.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/integration/transports/netty/NettyAcceptor.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/integration/transports/netty/NettyAcceptorFactory.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/integration/transports/netty/NettyConnection.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/integration/transports/netty/NettyConnector.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/integration/transports/netty/ServerHolder.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/integration/transports/netty/TransportConstants.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/spi/core/remoting/ConnectionLifeCycleListener.java
Log:
https://jira.jboss.org/jira/browse/HORNETQ-129: Implement STOMP v1.0
* sync with the trunk: svn merge -r 8821:8832
https://svn.jboss.org/repos/hornetq/trunk
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/ChannelImpl.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/ChannelImpl.java 2010-01-22
10:19:02 UTC (rev 8835)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/ChannelImpl.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,508 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.protocol.core;
-
-import java.util.concurrent.ConcurrentLinkedQueue;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.locks.Condition;
-import java.util.concurrent.locks.Lock;
-import java.util.concurrent.locks.ReentrantLock;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.api.core.HornetQException;
-import org.hornetq.core.logging.Logger;
-import org.hornetq.core.protocol.core.wireformat.HornetQExceptionMessage;
-import org.hornetq.core.protocol.core.wireformat.PacketsConfirmedMessage;
-import org.hornetq.core.remoting.RemotingConnection;
-
-/**
- * A ChannelImpl
- *
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- */
-public class ChannelImpl implements Channel
-{
- private static final Logger log = Logger.getLogger(ChannelImpl.class);
-
- private volatile long id;
-
- private ChannelHandler handler;
-
- private Packet response;
-
- private final java.util.Queue<Packet> resendCache;
-
- private volatile int firstStoredCommandID;
-
- private volatile int lastConfirmedCommandID = -1;
-
- private volatile CoreRemotingConnection connection;
-
- private volatile boolean closed;
-
- private final Lock lock = new ReentrantLock();
-
- private final Condition sendCondition = lock.newCondition();
-
- private final Condition failoverCondition = lock.newCondition();
-
- private final Object sendLock = new Object();
-
- private final Object sendBlockingLock = new Object();
-
- private boolean failingOver;
-
- private final int confWindowSize;
-
- private int receivedBytes;
-
- private CommandConfirmationHandler commandConfirmationHandler;
-
- private volatile boolean transferring;
-
- public ChannelImpl(final CoreRemotingConnection connection, final long id, final int
confWindowSize)
- {
- this.connection = connection;
-
- this.id = id;
-
- this.confWindowSize = confWindowSize;
-
- if (confWindowSize != -1)
- {
- resendCache = new ConcurrentLinkedQueue<Packet>();
- }
- else
- {
- resendCache = null;
- }
- }
-
- public long getID()
- {
- return id;
- }
-
- public int getLastConfirmedCommandID()
- {
- return lastConfirmedCommandID;
- }
-
- public Lock getLock()
- {
- return lock;
- }
-
- public int getConfirmationWindowSize()
- {
- return confWindowSize;
- }
-
- public void returnBlocking()
- {
- lock.lock();
-
- try
- {
- response = new HornetQExceptionMessage(new
HornetQException(HornetQException.UNBLOCKED,
- "Connection
failure detected. Unblocking a blocking call that will never get a response"
-
- ));
-
- sendCondition.signal();
- }
- finally
- {
- lock.unlock();
- }
- }
-
- public void sendAndFlush(final Packet packet)
- {
- send(packet, true);
- }
-
- public void send(final Packet packet)
- {
- send(packet, false);
- }
-
- public void setTransferring(boolean transferring)
- {
- this.transferring = transferring;
- }
-
- // This must never called by more than one thread concurrently
- public void send(final Packet packet, final boolean flush)
- {
- synchronized (sendLock)
- {
- packet.setChannelID(id);
-
- final HornetQBuffer buffer = packet.encode(connection);
-
- lock.lock();
-
- try
- {
- while (failingOver)
- {
- // TODO - don't hardcode this timeout
- try
- {
- failoverCondition.await(10000, TimeUnit.MILLISECONDS);
- }
- catch (InterruptedException e)
- {
- }
- }
-
- //Sanity check
- if (transferring)
- {
- throw new IllegalStateException("Cannot send a packet while channel
is doing failover");
- }
-
-
- if (resendCache != null && packet.isRequiresConfirmations())
- {
- resendCache.add(packet);
- }
-
- connection.getTransportConnection().write(buffer, flush);
- }
- finally
- {
- lock.unlock();
- }
- }
- }
-
- public Packet sendBlocking(final Packet packet) throws HornetQException
- {
- if (closed)
- {
- throw new HornetQException(HornetQException.NOT_CONNECTED, "Connection is
destroyed");
- }
-
- if (connection.getBlockingCallTimeout() == -1)
- {
- throw new IllegalStateException("Cannot do a blocking call timeout on a
server side connection");
- }
-
- // Synchronized since can't be called concurrently by more than one thread and
this can occur
- // E.g. blocking acknowledge() from inside a message handler at some time as other
operation on main thread
- synchronized (sendBlockingLock)
- {
- packet.setChannelID(id);
-
- final HornetQBuffer buffer = packet.encode(connection);
-
- lock.lock();
-
- try
- {
- while (failingOver)
- {
- // TODO - don't hardcode this timeout
- try
- {
- failoverCondition.await(10000, TimeUnit.MILLISECONDS);
- }
- catch (InterruptedException e)
- {
- }
- }
-
- response = null;
-
- if (resendCache != null && packet.isRequiresConfirmations())
- {
- resendCache.add(packet);
- }
-
- connection.getTransportConnection().write(buffer);
-
- long toWait = connection.getBlockingCallTimeout();
-
- long start = System.currentTimeMillis();
-
- while (response == null && toWait > 0)
- {
- try
- {
- sendCondition.await(toWait, TimeUnit.MILLISECONDS);
- }
- catch (InterruptedException e)
- {
- }
-
- if (closed)
- {
- break;
- }
-
- final long now = System.currentTimeMillis();
-
- toWait -= now - start;
-
- start = now;
- }
-
- if (response == null)
- {
- throw new HornetQException(HornetQException.CONNECTION_TIMEDOUT,
- "Timed out waiting for response when
sending packet " + packet.getType());
- }
-
- if (response.getType() == PacketImpl.EXCEPTION)
- {
- final HornetQExceptionMessage mem = (HornetQExceptionMessage)response;
-
- HornetQException e = mem.getException();
-
- e.fillInStackTrace();
-
- throw e;
- }
- }
- finally
- {
- lock.unlock();
- }
-
- return response;
- }
- }
-
- public void setCommandConfirmationHandler(final CommandConfirmationHandler handler)
- {
- commandConfirmationHandler = handler;
- }
-
- public void setHandler(final ChannelHandler handler)
- {
- this.handler = handler;
- }
-
- public void close()
- {
- if (closed)
- {
- return;
- }
-
- if (!connection.isDestroyed() && !connection.removeChannel(id))
- {
- throw new IllegalArgumentException("Cannot find channel with id " + id
+ " to close");
- }
-
- closed = true;
- }
-
- public void transferConnection(final CoreRemotingConnection newConnection)
- {
- // Needs to synchronize on the connection to make sure no packets from
- // the old connection get processed after transfer has occurred
- synchronized (connection.getTransferLock())
- {
- connection.removeChannel(id);
-
- // And switch it
-
- final CoreRemotingConnection rnewConnection =
(CoreRemotingConnection)newConnection;
-
- rnewConnection.putChannel(id, this);
-
- connection = rnewConnection;
-
- transferring = true;
- }
- }
-
- public void replayCommands(final int otherLastConfirmedCommandID)
- {
- if (resendCache != null)
- {
- clearUpTo(otherLastConfirmedCommandID);
-
- for (final Packet packet : resendCache)
- {
- doWrite(packet);
- }
- }
- }
-
- public void lock()
- {
- lock.lock();
-
- failingOver = true;
-
- lock.unlock();
- }
-
- public void unlock()
- {
- lock.lock();
-
- failingOver = false;
-
- failoverCondition.signalAll();
-
- lock.unlock();
- }
-
- public CoreRemotingConnection getConnection()
- {
- return connection;
- }
-
- //Needs to be synchronized since can be called by remoting service timer thread too
for timeout flush
- public synchronized void flushConfirmations()
- {
- if (resendCache != null && receivedBytes != 0)
- {
- receivedBytes = 0;
-
- final Packet confirmed = new PacketsConfirmedMessage(lastConfirmedCommandID);
-
- confirmed.setChannelID(id);
-
- doWrite(confirmed);
- }
- }
-
- public void confirm(final Packet packet)
- {
- if (resendCache != null && packet.isRequiresConfirmations())
- {
- lastConfirmedCommandID++;
-
- receivedBytes += packet.getPacketSize();
-
- if (receivedBytes >= confWindowSize)
- {
- receivedBytes = 0;
-
- final Packet confirmed = new
PacketsConfirmedMessage(lastConfirmedCommandID);
-
- confirmed.setChannelID(id);
-
- doWrite(confirmed);
- }
- }
- }
-
- public void clearCommands()
- {
- if (resendCache != null)
- {
- lastConfirmedCommandID = -1;
-
- firstStoredCommandID = 0;
-
- resendCache.clear();
- }
- }
-
- public void handlePacket(final Packet packet)
- {
- if (packet.getType() == PacketImpl.PACKETS_CONFIRMED)
- {
- if (resendCache != null)
- {
- final PacketsConfirmedMessage msg = (PacketsConfirmedMessage)packet;
-
- clearUpTo(msg.getCommandID());
- }
-
- if (!connection.isClient())
- {
- handler.handlePacket(packet);
- }
-
- return;
- }
- else
- {
- if (packet.isResponse())
- {
- confirm(packet);
-
- lock.lock();
-
- response = packet;
-
- try
- {
- sendCondition.signal();
- }
- finally
- {
- lock.unlock();
- }
- }
- else if (handler != null)
- {
- handler.handlePacket(packet);
- }
- }
- }
-
- private void doWrite(final Packet packet)
- {
- final HornetQBuffer buffer = packet.encode(connection);
-
- connection.getTransportConnection().write(buffer);
- }
-
- private void clearUpTo(final int lastReceivedCommandID)
- {
- final int numberToClear = 1 + lastReceivedCommandID - firstStoredCommandID;
-
- if (numberToClear == -1)
- {
- throw new IllegalArgumentException("Invalid lastReceivedCommandID: " +
lastReceivedCommandID);
- }
-
- int sizeToFree = 0;
-
- for (int i = 0; i < numberToClear; i++)
- {
- final Packet packet = resendCache.poll();
-
- if (packet == null)
- {
- ChannelImpl.log.warn("Can't find packet to clear: " + "
last received command id " +
- lastReceivedCommandID +
- " first stored command id " +
- firstStoredCommandID);
- return;
- }
-
- if (packet.getType() != PacketImpl.PACKETS_CONFIRMED)
- {
- sizeToFree += packet.getPacketSize();
- }
-
- if (commandConfirmationHandler != null)
- {
- commandConfirmationHandler.commandConfirmed(packet);
- }
- }
-
- firstStoredCommandID += numberToClear;
- }
-}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/CoreProtocolManager.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/CoreProtocolManager.java 2010-01-22
10:19:02 UTC (rev 8835)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/CoreProtocolManager.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,116 +0,0 @@
-/*
- * Copyright 2010 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.protocol.core;
-
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-import org.hornetq.api.core.Interceptor;
-import org.hornetq.api.core.client.HornetQClient;
-import org.hornetq.core.config.Configuration;
-import org.hornetq.core.protocol.core.wireformat.Ping;
-import org.hornetq.core.remoting.server.ConnectionEntry;
-import org.hornetq.core.remoting.server.ProtocolManager;
-import org.hornetq.core.server.HornetQServer;
-import org.hornetq.spi.core.remoting.Connection;
-
-/**
- * A CoreProtocolManager
- *
- * @author Tim Fox
- *
- *
- */
-public class CoreProtocolManager implements ProtocolManager
-{
- private final HornetQServer server;
-
- private final List<Interceptor> interceptors;
-
- public CoreProtocolManager(final HornetQServer server,
- final List<Interceptor> interceptors)
- {
- this.server = server;
-
- this.interceptors = interceptors;
- }
-
- public ConnectionEntry createConnectionEntry(final Connection connection)
- {
- final Configuration config = server.getConfiguration();
-
- CoreRemotingConnection rc = new RemotingConnectionImpl(connection,
- interceptors,
-
config.isAsyncConnectionExecutionEnabled() ? server.getExecutorFactory().getExecutor()
-
: null);
-
- Channel channel1 = rc.getChannel(1, -1);
-
- ChannelHandler handler = new HornetQPacketHandler(this, server, channel1, rc);
-
- channel1.setHandler(handler);
-
- long ttl = HornetQClient.DEFAULT_CONNECTION_TTL;
-
- if (config.getConnectionTTLOverride() != -1)
- {
- ttl = config.getConnectionTTLOverride();
- }
-
- final ConnectionEntry entry = new ConnectionEntry(rc, System.currentTimeMillis(),
ttl);
-
- final Channel channel0 = rc.getChannel(0, -1);
-
- channel0.setHandler(new ChannelHandler()
- {
- public void handlePacket(final Packet packet)
- {
- if (packet.getType() == PacketImpl.PING)
- {
- Ping ping = (Ping)packet;
-
- if (config.getConnectionTTLOverride() == -1)
- {
- // Allow clients to specify connection ttl
- entry.ttl = ping.getConnectionTTL();
- }
-
- // Just send a ping back
- channel0.send(packet);
- }
- }
- });
-
- return entry;
- }
-
- private Map<String, ServerSessionPacketHandler> sessionHandlers =
- new ConcurrentHashMap<String, ServerSessionPacketHandler>();
-
- public ServerSessionPacketHandler getSessionHandler(final String sessionName)
- {
- return sessionHandlers.get(sessionName);
- }
-
- public void addSessionHandler(final String name, final ServerSessionPacketHandler
handler)
- {
- sessionHandlers.put(name, handler);
- }
-
- public void removeHandler(final String name)
- {
- sessionHandlers.remove(name);
- }
-}
Modified:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/CoreRemotingConnection.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/CoreRemotingConnection.java 2010-01-22
10:19:02 UTC (rev 8835)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/CoreRemotingConnection.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -13,7 +13,7 @@
package org.hornetq.core.protocol.core;
-import org.hornetq.core.remoting.RemotingConnection;
+import org.hornetq.spi.core.protocol.RemotingConnection;
/**
Modified:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/CoreSessionCallback.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/CoreSessionCallback.java 2010-01-22
10:19:02 UTC (rev 8835)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/CoreSessionCallback.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,13 +1,13 @@
package org.hornetq.core.protocol.core;
import org.hornetq.api.core.SimpleString;
-import org.hornetq.core.protocol.core.wireformat.SessionProducerCreditsMessage;
-import org.hornetq.core.protocol.core.wireformat.SessionReceiveContinuationMessage;
-import org.hornetq.core.protocol.core.wireformat.SessionReceiveLargeMessage;
-import org.hornetq.core.protocol.core.wireformat.SessionReceiveMessage;
-import org.hornetq.core.remoting.server.ProtocolManager;
+import org.hornetq.core.protocol.core.impl.wireformat.SessionProducerCreditsMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.SessionReceiveContinuationMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.SessionReceiveLargeMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.SessionReceiveMessage;
import org.hornetq.core.server.ServerMessage;
-import org.hornetq.core.server.SessionCallback;
+import org.hornetq.spi.core.protocol.ProtocolManager;
+import org.hornetq.spi.core.protocol.SessionCallback;
/**
* A CoreSessionCallback
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/HornetQPacketHandler.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/HornetQPacketHandler.java 2010-01-22
10:19:02 UTC (rev 8835)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/HornetQPacketHandler.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,308 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.protocol.core;
-
-import static org.hornetq.core.protocol.core.PacketImpl.CREATESESSION;
-import static org.hornetq.core.protocol.core.PacketImpl.CREATE_QUEUE;
-import static org.hornetq.core.protocol.core.PacketImpl.CREATE_REPLICATION;
-import static org.hornetq.core.protocol.core.PacketImpl.REATTACH_SESSION;
-
-import org.hornetq.api.core.HornetQException;
-import org.hornetq.core.logging.Logger;
-import org.hornetq.core.protocol.core.wireformat.CreateQueueMessage;
-import org.hornetq.core.protocol.core.wireformat.CreateReplicationSessionMessage;
-import org.hornetq.core.protocol.core.wireformat.CreateSessionMessage;
-import org.hornetq.core.protocol.core.wireformat.CreateSessionResponseMessage;
-import org.hornetq.core.protocol.core.wireformat.HornetQExceptionMessage;
-import org.hornetq.core.protocol.core.wireformat.NullResponseMessage;
-import org.hornetq.core.protocol.core.wireformat.ReattachSessionMessage;
-import org.hornetq.core.protocol.core.wireformat.ReattachSessionResponseMessage;
-import org.hornetq.core.replication.ReplicationEndpoint;
-import org.hornetq.core.server.HornetQServer;
-import org.hornetq.core.server.ServerSession;
-import org.hornetq.core.version.Version;
-
-/**
- * A packet handler for all packets that need to be handled at the server level
- *
- * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- * @author <a href="ataylor(a)redhat.com">Andy Taylor</a>
- */
-public class HornetQPacketHandler implements ChannelHandler
-{
- private static final Logger log = Logger.getLogger(HornetQPacketHandler.class);
-
- private final HornetQServer server;
-
- private final Channel channel1;
-
- private final CoreRemotingConnection connection;
-
- private final CoreProtocolManager protocolManager;
-
- public HornetQPacketHandler(final CoreProtocolManager protocolManager,
- final HornetQServer server,
- final Channel channel1,
- final CoreRemotingConnection connection)
- {
- this.protocolManager = protocolManager;
-
- this.server = server;
-
- this.channel1 = channel1;
-
- this.connection = connection;
- }
-
- public void handlePacket(final Packet packet)
- {
- byte type = packet.getType();
-
- switch (type)
- {
- case CREATESESSION:
- {
- CreateSessionMessage request = (CreateSessionMessage)packet;
-
- handleCreateSession(request);
-
- break;
- }
- case REATTACH_SESSION:
- {
- ReattachSessionMessage request = (ReattachSessionMessage)packet;
-
- handleReattachSession(request);
-
- break;
- }
- case CREATE_QUEUE:
- {
- // Create queue can also be fielded here in the case of a replicated store
and forward queue creation
-
- CreateQueueMessage request = (CreateQueueMessage)packet;
-
- handleCreateQueue(request);
-
- break;
- }
- case CREATE_REPLICATION:
- {
- // Create queue can also be fielded here in the case of a replicated store
and forward queue creation
-
- CreateReplicationSessionMessage request =
(CreateReplicationSessionMessage)packet;
-
- handleCreateReplication(request);
-
- break;
- }
- default:
- {
- HornetQPacketHandler.log.error("Invalid packet " + packet);
- }
- }
- }
-
- private void handleCreateSession(final CreateSessionMessage request)
- {
- boolean incompatibleVersion = false;
- Packet response;
- try
- {
- Version version = server.getVersion();
-
- if (version.getIncrementingVersion() != request.getVersion())
- {
- log.warn("Client with version " + request.getVersion() +
- " and address " +
- connection.getRemoteAddress() +
- " is not compatible with server version " +
- version.getFullVersion() +
- ". " +
- "Please ensure all clients and servers are upgraded to the same
version for them to " +
- "interoperate properly");
- throw new
HornetQException(HornetQException.INCOMPATIBLE_CLIENT_SERVER_VERSIONS,
- "Server and client versions
incompatible");
- }
-
- if (!server.isStarted())
- {
- throw new HornetQException(HornetQException.SESSION_CREATION_REJECTED,
"Server not started");
- }
-
- if (!server.checkActivate())
- {
- throw new HornetQException(HornetQException.SESSION_CREATION_REJECTED,
- "Server will not accept create session
requests");
- }
-
- final Channel channel = connection.getChannel(request.getSessionChannelID(),
request.getWindowSize());
-
- ServerSession session = server.createSession(request.getName(),
- request.getUsername(),
- request.getPassword(),
- request.getMinLargeMessageSize(),
- connection,
- request.isAutoCommitSends(),
- request.isAutoCommitAcks(),
- request.isPreAcknowledge(),
- request.isXA(),
- new
CoreSessionCallback(request.getName(), protocolManager, channel));
-
- ServerSessionPacketHandler handler = new ServerSessionPacketHandler(session,
-
server.getStorageManager()
-
.newContext(server.getExecutorFactory()
-
.getExecutor()),
-
server.getStorageManager(),
- channel);
-
- channel.setHandler(handler);
-
- // TODO - where is this removed?
- protocolManager.addSessionHandler(request.getName(), handler);
-
- response = new
CreateSessionResponseMessage(server.getVersion().getIncrementingVersion());
- }
- catch (HornetQException e)
- {
- response = new HornetQExceptionMessage((HornetQException)e);
-
- if (e.getCode() == HornetQException.INCOMPATIBLE_CLIENT_SERVER_VERSIONS)
- {
- incompatibleVersion = true;
- }
- }
- catch (Exception e)
- {
- HornetQPacketHandler.log.error("Failed to create session", e);
-
- response = new HornetQExceptionMessage(new
HornetQException(HornetQException.INTERNAL_ERROR));
- }
-
- // send the exception to the client and destroy
- // the connection if the client and server versions
- // are not compatible
- if (incompatibleVersion)
- {
- channel1.sendAndFlush(response);
- }
- else
- {
- channel1.send(response);
- }
- }
-
- private void handleReattachSession(final ReattachSessionMessage request)
- {
- Packet response = null;
-
- try
- {
-
- if (!server.isStarted())
- {
- response = new ReattachSessionResponseMessage(-1, false);
- }
-
- ServerSessionPacketHandler sessionHandler =
protocolManager.getSessionHandler(request.getName());
-
- if (!server.checkActivate())
- {
- response = new ReattachSessionResponseMessage(-1, false);
- }
-
- if (sessionHandler == null)
- {
- response = new ReattachSessionResponseMessage(-1, false);
- }
- else
- {
- if (sessionHandler.getChannel().getConfirmationWindowSize() == -1)
- {
- // Even though session exists, we can't reattach since confi window
size == -1,
- // i.e. we don't have a resend cache for commands, so we just close
the old session
- // and let the client recreate
-
- sessionHandler.close();
-
- response = new ReattachSessionResponseMessage(-1, false);
- }
- else
- {
- // Reconnect the channel to the new connection
- int serverLastConfirmedCommandID =
sessionHandler.transferConnection(connection,
-
request.getLastConfirmedCommandID());
-
- response = new
ReattachSessionResponseMessage(serverLastConfirmedCommandID, true);
- }
- }
- }
- catch (Exception e)
- {
- HornetQPacketHandler.log.error("Failed to reattach session", e);
-
- response = new HornetQExceptionMessage(new
HornetQException(HornetQException.INTERNAL_ERROR));
- }
-
- channel1.send(response);
- }
-
- private void handleCreateQueue(final CreateQueueMessage request)
- {
- try
- {
- server.createQueue(request.getAddress(),
- request.getQueueName(),
- request.getFilterString(),
- request.isDurable(),
- request.isTemporary());
- }
- catch (Exception e)
- {
- HornetQPacketHandler.log.error("Failed to handle create queue", e);
- }
- }
-
- private void handleCreateReplication(final CreateReplicationSessionMessage request)
- {
- Packet response;
-
- try
- {
- Channel channel = connection.getChannel(request.getSessionChannelID(), -1);
-
- ReplicationEndpoint endpoint = server.connectToReplicationEndpoint(channel);
-
- channel.setHandler(endpoint);
-
- response = new NullResponseMessage();
- }
- catch (Exception e)
- {
- if (e instanceof HornetQException)
- {
- response = new HornetQExceptionMessage((HornetQException)e);
- }
- else
- {
- HornetQPacketHandler.log.warn(e.getMessage(), e);
- response = new HornetQExceptionMessage(new
HornetQException(HornetQException.INTERNAL_ERROR));
- }
- }
-
- channel1.send(response);
- }
-
-}
\ No newline at end of file
Modified:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/Packet.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/Packet.java 2010-01-22
10:19:02 UTC (rev 8835)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/Packet.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -14,7 +14,7 @@
package org.hornetq.core.protocol.core;
import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.remoting.RemotingConnection;
+import org.hornetq.spi.core.protocol.RemotingConnection;
/**
* A Packet represents a pcaket of data transmitted over a connection.
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/PacketDecoder.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/PacketDecoder.java 2010-01-22
10:19:02 UTC (rev 8835)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/PacketDecoder.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,492 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.protocol.core;
-
-import static org.hornetq.core.protocol.core.PacketImpl.CREATESESSION;
-import static org.hornetq.core.protocol.core.PacketImpl.CREATESESSION_RESP;
-import static org.hornetq.core.protocol.core.PacketImpl.CREATE_QUEUE;
-import static org.hornetq.core.protocol.core.PacketImpl.CREATE_REPLICATION;
-import static org.hornetq.core.protocol.core.PacketImpl.DELETE_QUEUE;
-import static org.hornetq.core.protocol.core.PacketImpl.DISCONNECT;
-import static org.hornetq.core.protocol.core.PacketImpl.EXCEPTION;
-import static org.hornetq.core.protocol.core.PacketImpl.NULL_RESPONSE;
-import static org.hornetq.core.protocol.core.PacketImpl.PACKETS_CONFIRMED;
-import static org.hornetq.core.protocol.core.PacketImpl.PING;
-import static org.hornetq.core.protocol.core.PacketImpl.REATTACH_SESSION;
-import static org.hornetq.core.protocol.core.PacketImpl.REATTACH_SESSION_RESP;
-import static org.hornetq.core.protocol.core.PacketImpl.REPLICATION_APPEND;
-import static org.hornetq.core.protocol.core.PacketImpl.REPLICATION_APPEND_TX;
-import static org.hornetq.core.protocol.core.PacketImpl.REPLICATION_COMMIT_ROLLBACK;
-import static org.hornetq.core.protocol.core.PacketImpl.REPLICATION_COMPARE_DATA;
-import static org.hornetq.core.protocol.core.PacketImpl.REPLICATION_DELETE;
-import static org.hornetq.core.protocol.core.PacketImpl.REPLICATION_DELETE_TX;
-import static org.hornetq.core.protocol.core.PacketImpl.REPLICATION_LARGE_MESSAGE_BEGIN;
-import static org.hornetq.core.protocol.core.PacketImpl.REPLICATION_LARGE_MESSAGE_END;
-import static org.hornetq.core.protocol.core.PacketImpl.REPLICATION_LARGE_MESSAGE_WRITE;
-import static org.hornetq.core.protocol.core.PacketImpl.REPLICATION_PAGE_EVENT;
-import static org.hornetq.core.protocol.core.PacketImpl.REPLICATION_PAGE_WRITE;
-import static org.hornetq.core.protocol.core.PacketImpl.REPLICATION_PREPARE;
-import static org.hornetq.core.protocol.core.PacketImpl.REPLICATION_RESPONSE;
-import static org.hornetq.core.protocol.core.PacketImpl.SESS_ACKNOWLEDGE;
-import static org.hornetq.core.protocol.core.PacketImpl.SESS_BINDINGQUERY;
-import static org.hornetq.core.protocol.core.PacketImpl.SESS_BINDINGQUERY_RESP;
-import static org.hornetq.core.protocol.core.PacketImpl.SESS_CLOSE;
-import static org.hornetq.core.protocol.core.PacketImpl.SESS_COMMIT;
-import static org.hornetq.core.protocol.core.PacketImpl.SESS_CONSUMER_CLOSE;
-import static org.hornetq.core.protocol.core.PacketImpl.SESS_CREATECONSUMER;
-import static org.hornetq.core.protocol.core.PacketImpl.SESS_EXPIRED;
-import static org.hornetq.core.protocol.core.PacketImpl.SESS_FLOWTOKEN;
-import static org.hornetq.core.protocol.core.PacketImpl.SESS_FORCE_CONSUMER_DELIVERY;
-import static org.hornetq.core.protocol.core.PacketImpl.SESS_PRODUCER_CREDITS;
-import static org.hornetq.core.protocol.core.PacketImpl.SESS_PRODUCER_REQUEST_CREDITS;
-import static org.hornetq.core.protocol.core.PacketImpl.SESS_QUEUEQUERY;
-import static org.hornetq.core.protocol.core.PacketImpl.SESS_QUEUEQUERY_RESP;
-import static org.hornetq.core.protocol.core.PacketImpl.SESS_RECEIVE_CONTINUATION;
-import static org.hornetq.core.protocol.core.PacketImpl.SESS_RECEIVE_LARGE_MSG;
-import static org.hornetq.core.protocol.core.PacketImpl.SESS_RECEIVE_MSG;
-import static org.hornetq.core.protocol.core.PacketImpl.SESS_ROLLBACK;
-import static org.hornetq.core.protocol.core.PacketImpl.SESS_SEND;
-import static org.hornetq.core.protocol.core.PacketImpl.SESS_SEND_CONTINUATION;
-import static org.hornetq.core.protocol.core.PacketImpl.SESS_SEND_LARGE;
-import static org.hornetq.core.protocol.core.PacketImpl.SESS_START;
-import static org.hornetq.core.protocol.core.PacketImpl.SESS_STOP;
-import static org.hornetq.core.protocol.core.PacketImpl.SESS_XA_COMMIT;
-import static org.hornetq.core.protocol.core.PacketImpl.SESS_XA_END;
-import static org.hornetq.core.protocol.core.PacketImpl.SESS_XA_FORGET;
-import static org.hornetq.core.protocol.core.PacketImpl.SESS_XA_GET_TIMEOUT;
-import static org.hornetq.core.protocol.core.PacketImpl.SESS_XA_GET_TIMEOUT_RESP;
-import static org.hornetq.core.protocol.core.PacketImpl.SESS_XA_INDOUBT_XIDS;
-import static org.hornetq.core.protocol.core.PacketImpl.SESS_XA_INDOUBT_XIDS_RESP;
-import static org.hornetq.core.protocol.core.PacketImpl.SESS_XA_JOIN;
-import static org.hornetq.core.protocol.core.PacketImpl.SESS_XA_PREPARE;
-import static org.hornetq.core.protocol.core.PacketImpl.SESS_XA_RESP;
-import static org.hornetq.core.protocol.core.PacketImpl.SESS_XA_RESUME;
-import static org.hornetq.core.protocol.core.PacketImpl.SESS_XA_ROLLBACK;
-import static org.hornetq.core.protocol.core.PacketImpl.SESS_XA_SET_TIMEOUT;
-import static org.hornetq.core.protocol.core.PacketImpl.SESS_XA_SET_TIMEOUT_RESP;
-import static org.hornetq.core.protocol.core.PacketImpl.SESS_XA_START;
-import static org.hornetq.core.protocol.core.PacketImpl.SESS_XA_SUSPEND;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.logging.Logger;
-import org.hornetq.core.protocol.core.wireformat.CreateQueueMessage;
-import org.hornetq.core.protocol.core.wireformat.CreateReplicationSessionMessage;
-import org.hornetq.core.protocol.core.wireformat.CreateSessionMessage;
-import org.hornetq.core.protocol.core.wireformat.CreateSessionResponseMessage;
-import org.hornetq.core.protocol.core.wireformat.HornetQExceptionMessage;
-import org.hornetq.core.protocol.core.wireformat.NullResponseMessage;
-import org.hornetq.core.protocol.core.wireformat.PacketsConfirmedMessage;
-import org.hornetq.core.protocol.core.wireformat.Ping;
-import org.hornetq.core.protocol.core.wireformat.ReattachSessionMessage;
-import org.hornetq.core.protocol.core.wireformat.ReattachSessionResponseMessage;
-import org.hornetq.core.protocol.core.wireformat.ReplicationAddMessage;
-import org.hornetq.core.protocol.core.wireformat.ReplicationAddTXMessage;
-import org.hornetq.core.protocol.core.wireformat.ReplicationCommitMessage;
-import org.hornetq.core.protocol.core.wireformat.ReplicationCompareDataMessage;
-import org.hornetq.core.protocol.core.wireformat.ReplicationDeleteMessage;
-import org.hornetq.core.protocol.core.wireformat.ReplicationDeleteTXMessage;
-import org.hornetq.core.protocol.core.wireformat.ReplicationLargeMessageBeingMessage;
-import org.hornetq.core.protocol.core.wireformat.ReplicationLargeMessageWriteMessage;
-import org.hornetq.core.protocol.core.wireformat.ReplicationLargemessageEndMessage;
-import org.hornetq.core.protocol.core.wireformat.ReplicationPageEventMessage;
-import org.hornetq.core.protocol.core.wireformat.ReplicationPageWriteMessage;
-import org.hornetq.core.protocol.core.wireformat.ReplicationPrepareMessage;
-import org.hornetq.core.protocol.core.wireformat.ReplicationResponseMessage;
-import org.hornetq.core.protocol.core.wireformat.RollbackMessage;
-import org.hornetq.core.protocol.core.wireformat.SessionAcknowledgeMessage;
-import org.hornetq.core.protocol.core.wireformat.SessionBindingQueryMessage;
-import org.hornetq.core.protocol.core.wireformat.SessionBindingQueryResponseMessage;
-import org.hornetq.core.protocol.core.wireformat.SessionCloseMessage;
-import org.hornetq.core.protocol.core.wireformat.SessionCommitMessage;
-import org.hornetq.core.protocol.core.wireformat.SessionConsumerCloseMessage;
-import org.hornetq.core.protocol.core.wireformat.SessionConsumerFlowCreditMessage;
-import org.hornetq.core.protocol.core.wireformat.SessionCreateConsumerMessage;
-import org.hornetq.core.protocol.core.wireformat.SessionDeleteQueueMessage;
-import org.hornetq.core.protocol.core.wireformat.SessionExpiredMessage;
-import org.hornetq.core.protocol.core.wireformat.SessionForceConsumerDelivery;
-import org.hornetq.core.protocol.core.wireformat.SessionProducerCreditsMessage;
-import org.hornetq.core.protocol.core.wireformat.SessionQueueQueryMessage;
-import org.hornetq.core.protocol.core.wireformat.SessionQueueQueryResponseMessage;
-import org.hornetq.core.protocol.core.wireformat.SessionReceiveContinuationMessage;
-import org.hornetq.core.protocol.core.wireformat.SessionReceiveLargeMessage;
-import org.hornetq.core.protocol.core.wireformat.SessionReceiveMessage;
-import org.hornetq.core.protocol.core.wireformat.SessionRequestProducerCreditsMessage;
-import org.hornetq.core.protocol.core.wireformat.SessionSendContinuationMessage;
-import org.hornetq.core.protocol.core.wireformat.SessionSendLargeMessage;
-import org.hornetq.core.protocol.core.wireformat.SessionSendMessage;
-import org.hornetq.core.protocol.core.wireformat.SessionXACommitMessage;
-import org.hornetq.core.protocol.core.wireformat.SessionXAEndMessage;
-import org.hornetq.core.protocol.core.wireformat.SessionXAForgetMessage;
-import org.hornetq.core.protocol.core.wireformat.SessionXAGetInDoubtXidsResponseMessage;
-import org.hornetq.core.protocol.core.wireformat.SessionXAGetTimeoutResponseMessage;
-import org.hornetq.core.protocol.core.wireformat.SessionXAJoinMessage;
-import org.hornetq.core.protocol.core.wireformat.SessionXAPrepareMessage;
-import org.hornetq.core.protocol.core.wireformat.SessionXAResponseMessage;
-import org.hornetq.core.protocol.core.wireformat.SessionXAResumeMessage;
-import org.hornetq.core.protocol.core.wireformat.SessionXARollbackMessage;
-import org.hornetq.core.protocol.core.wireformat.SessionXASetTimeoutMessage;
-import org.hornetq.core.protocol.core.wireformat.SessionXASetTimeoutResponseMessage;
-import org.hornetq.core.protocol.core.wireformat.SessionXAStartMessage;
-
-/**
- * A PacketDecoder
- *
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- *
- *
- */
-public class PacketDecoder
-{
- private static final Logger log = Logger.getLogger(PacketDecoder.class);
-
- public Packet decode(final HornetQBuffer in)
- {
- final byte packetType = in.readByte();
-
- Packet packet;
-
- switch (packetType)
- {
- case PING:
- {
- packet = new Ping();
- break;
- }
- case DISCONNECT:
- {
- packet = new PacketImpl(PacketImpl.DISCONNECT);
- break;
- }
- case EXCEPTION:
- {
- packet = new HornetQExceptionMessage();
- break;
- }
- case PACKETS_CONFIRMED:
- {
- packet = new PacketsConfirmedMessage();
- break;
- }
- case CREATESESSION:
- {
- packet = new CreateSessionMessage();
- break;
- }
- case CREATESESSION_RESP:
- {
- packet = new CreateSessionResponseMessage();
- break;
- }
- case REATTACH_SESSION:
- {
- packet = new ReattachSessionMessage();
- break;
- }
- case REATTACH_SESSION_RESP:
- {
- packet = new ReattachSessionResponseMessage();
- break;
- }
- case SESS_CLOSE:
- {
- packet = new SessionCloseMessage();
- break;
- }
- case SESS_CREATECONSUMER:
- {
- packet = new SessionCreateConsumerMessage();
- break;
- }
- case SESS_ACKNOWLEDGE:
- {
- packet = new SessionAcknowledgeMessage();
- break;
- }
- case SESS_EXPIRED:
- {
- packet = new SessionExpiredMessage();
- break;
- }
- case SESS_COMMIT:
- {
- packet = new SessionCommitMessage();
- break;
- }
- case SESS_ROLLBACK:
- {
- packet = new RollbackMessage();
- break;
- }
- case SESS_QUEUEQUERY:
- {
- packet = new SessionQueueQueryMessage();
- break;
- }
- case SESS_QUEUEQUERY_RESP:
- {
- packet = new SessionQueueQueryResponseMessage();
- break;
- }
- case CREATE_QUEUE:
- {
- packet = new CreateQueueMessage();
- break;
- }
- case DELETE_QUEUE:
- {
- packet = new SessionDeleteQueueMessage();
- break;
- }
- case SESS_BINDINGQUERY:
- {
- packet = new SessionBindingQueryMessage();
- break;
- }
- case SESS_BINDINGQUERY_RESP:
- {
- packet = new SessionBindingQueryResponseMessage();
- break;
- }
- case SESS_XA_START:
- {
- packet = new SessionXAStartMessage();
- break;
- }
- case SESS_XA_END:
- {
- packet = new SessionXAEndMessage();
- break;
- }
- case SESS_XA_COMMIT:
- {
- packet = new SessionXACommitMessage();
- break;
- }
- case SESS_XA_PREPARE:
- {
- packet = new SessionXAPrepareMessage();
- break;
- }
- case SESS_XA_RESP:
- {
- packet = new SessionXAResponseMessage();
- break;
- }
- case SESS_XA_ROLLBACK:
- {
- packet = new SessionXARollbackMessage();
- break;
- }
- case SESS_XA_JOIN:
- {
- packet = new SessionXAJoinMessage();
- break;
- }
- case SESS_XA_SUSPEND:
- {
- packet = new PacketImpl(PacketImpl.SESS_XA_SUSPEND);
- break;
- }
- case SESS_XA_RESUME:
- {
- packet = new SessionXAResumeMessage();
- break;
- }
- case SESS_XA_FORGET:
- {
- packet = new SessionXAForgetMessage();
- break;
- }
- case SESS_XA_INDOUBT_XIDS:
- {
- packet = new PacketImpl(PacketImpl.SESS_XA_INDOUBT_XIDS);
- break;
- }
- case SESS_XA_INDOUBT_XIDS_RESP:
- {
- packet = new SessionXAGetInDoubtXidsResponseMessage();
- break;
- }
- case SESS_XA_SET_TIMEOUT:
- {
- packet = new SessionXASetTimeoutMessage();
- break;
- }
- case SESS_XA_SET_TIMEOUT_RESP:
- {
- packet = new SessionXASetTimeoutResponseMessage();
- break;
- }
- case SESS_XA_GET_TIMEOUT:
- {
- packet = new PacketImpl(PacketImpl.SESS_XA_GET_TIMEOUT);
- break;
- }
- case SESS_XA_GET_TIMEOUT_RESP:
- {
- packet = new SessionXAGetTimeoutResponseMessage();
- break;
- }
- case SESS_START:
- {
- packet = new PacketImpl(PacketImpl.SESS_START);
- break;
- }
- case SESS_STOP:
- {
- packet = new PacketImpl(PacketImpl.SESS_STOP);
- break;
- }
- case SESS_FLOWTOKEN:
- {
- packet = new SessionConsumerFlowCreditMessage();
- break;
- }
- case SESS_SEND:
- {
- packet = new SessionSendMessage();
- break;
- }
- case SESS_SEND_LARGE:
- {
- packet = new SessionSendLargeMessage();
- break;
- }
- case SESS_RECEIVE_MSG:
- {
- packet = new SessionReceiveMessage();
- break;
- }
- case SESS_RECEIVE_LARGE_MSG:
- {
- packet = new SessionReceiveLargeMessage();
- break;
- }
- case SESS_CONSUMER_CLOSE:
- {
- packet = new SessionConsumerCloseMessage();
- break;
- }
- case NULL_RESPONSE:
- {
- packet = new NullResponseMessage();
- break;
- }
- case SESS_RECEIVE_CONTINUATION:
- {
- packet = new SessionReceiveContinuationMessage();
- break;
- }
- case SESS_SEND_CONTINUATION:
- {
- packet = new SessionSendContinuationMessage();
- break;
- }
- case SESS_PRODUCER_REQUEST_CREDITS:
- {
- packet = new SessionRequestProducerCreditsMessage();
- break;
- }
- case SESS_PRODUCER_CREDITS:
- {
- packet = new SessionProducerCreditsMessage();
- break;
- }
- case CREATE_REPLICATION:
- {
- packet = new CreateReplicationSessionMessage();
- break;
- }
- case REPLICATION_APPEND:
- {
- packet = new ReplicationAddMessage();
- break;
- }
- case REPLICATION_APPEND_TX:
- {
- packet = new ReplicationAddTXMessage();
- break;
- }
- case REPLICATION_DELETE:
- {
- packet = new ReplicationDeleteMessage();
- break;
- }
- case REPLICATION_DELETE_TX:
- {
- packet = new ReplicationDeleteTXMessage();
- break;
- }
- case REPLICATION_PREPARE:
- {
- packet = new ReplicationPrepareMessage();
- break;
- }
- case REPLICATION_COMMIT_ROLLBACK:
- {
- packet = new ReplicationCommitMessage();
- break;
- }
- case REPLICATION_RESPONSE:
- {
- packet = new ReplicationResponseMessage();
- break;
- }
- case REPLICATION_PAGE_WRITE:
- {
- packet = new ReplicationPageWriteMessage();
- break;
- }
- case REPLICATION_PAGE_EVENT:
- {
- packet = new ReplicationPageEventMessage();
- break;
- }
- case REPLICATION_LARGE_MESSAGE_BEGIN:
- {
- packet = new ReplicationLargeMessageBeingMessage();
- break;
- }
- case REPLICATION_LARGE_MESSAGE_END:
- {
- packet = new ReplicationLargemessageEndMessage();
- break;
- }
- case REPLICATION_LARGE_MESSAGE_WRITE:
- {
- packet = new ReplicationLargeMessageWriteMessage();
- break;
- }
- case REPLICATION_COMPARE_DATA:
- {
- packet = new ReplicationCompareDataMessage();
- break;
- }
- case SESS_FORCE_CONSUMER_DELIVERY:
- {
- packet = new SessionForceConsumerDelivery();
- break;
- }
- default:
- {
- throw new IllegalArgumentException("Invalid type: " + packetType);
- }
- }
-
- packet.decode(in);
-
- return packet;
- }
-
-}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/PacketImpl.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/PacketImpl.java 2010-01-22
10:19:02 UTC (rev 8835)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/PacketImpl.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,310 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.protocol.core;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.logging.Logger;
-import org.hornetq.core.remoting.RemotingConnection;
-import org.hornetq.utils.DataConstants;
-
-/**
- * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- * @version <tt>$Revision$</tt>
- */
-public class PacketImpl implements Packet
-{
- // Constants
-------------------------------------------------------------------------
-
- private static final Logger log = Logger.getLogger(PacketImpl.class);
-
- // The minimal size for all the packets, Common data for all the packets (look at
PacketImpl.encode)
- public static final int PACKET_HEADERS_SIZE = DataConstants.SIZE_INT +
DataConstants.SIZE_BYTE +
- DataConstants.SIZE_LONG;
-
- private static final int INITIAL_PACKET_SIZE = 1500;
-
- protected long channelID;
-
- protected final byte type;
-
- protected int size = -1;
-
- // The packet types
- //
-----------------------------------------------------------------------------------
-
- public static final byte PING = 10;
-
- public static final byte DISCONNECT = 11;
-
- // Miscellaneous
- public static final byte EXCEPTION = 20;
-
- public static final byte NULL_RESPONSE = 21;
-
- public static final byte PACKETS_CONFIRMED = 22;
-
- // Server
- public static final byte CREATESESSION = 30;
-
- public static final byte CREATESESSION_RESP = 31;
-
- public static final byte REATTACH_SESSION = 32;
-
- public static final byte REATTACH_SESSION_RESP = 33;
-
- public static final byte CREATE_QUEUE = 34;
-
- public static final byte DELETE_QUEUE = 35;
-
- public static final byte CREATE_REPLICATION = 36;
-
- // Session
- public static final byte SESS_CREATECONSUMER = 40;
-
- public static final byte SESS_ACKNOWLEDGE = 41;
-
- public static final byte SESS_EXPIRED = 42;
-
- public static final byte SESS_COMMIT = 43;
-
- public static final byte SESS_ROLLBACK = 44;
-
- public static final byte SESS_QUEUEQUERY = 45;
-
- public static final byte SESS_QUEUEQUERY_RESP = 46;
-
- public static final byte SESS_BINDINGQUERY = 49;
-
- public static final byte SESS_BINDINGQUERY_RESP = 50;
-
- public static final byte SESS_XA_START = 51;
-
- public static final byte SESS_XA_END = 52;
-
- public static final byte SESS_XA_COMMIT = 53;
-
- public static final byte SESS_XA_PREPARE = 54;
-
- public static final byte SESS_XA_RESP = 55;
-
- public static final byte SESS_XA_ROLLBACK = 56;
-
- public static final byte SESS_XA_JOIN = 57;
-
- public static final byte SESS_XA_SUSPEND = 58;
-
- public static final byte SESS_XA_RESUME = 59;
-
- public static final byte SESS_XA_FORGET = 60;
-
- public static final byte SESS_XA_INDOUBT_XIDS = 61;
-
- public static final byte SESS_XA_INDOUBT_XIDS_RESP = 62;
-
- public static final byte SESS_XA_SET_TIMEOUT = 63;
-
- public static final byte SESS_XA_SET_TIMEOUT_RESP = 64;
-
- public static final byte SESS_XA_GET_TIMEOUT = 65;
-
- public static final byte SESS_XA_GET_TIMEOUT_RESP = 66;
-
- public static final byte SESS_START = 67;
-
- public static final byte SESS_STOP = 68;
-
- public static final byte SESS_CLOSE = 69;
-
- public static final byte SESS_FLOWTOKEN = 70;
-
- public static final byte SESS_SEND = 71;
-
- public static final byte SESS_SEND_LARGE = 72;
-
- public static final byte SESS_SEND_CONTINUATION = 73;
-
- public static final byte SESS_CONSUMER_CLOSE = 74;
-
- public static final byte SESS_RECEIVE_MSG = 75;
-
- public static final byte SESS_RECEIVE_LARGE_MSG = 76;
-
- public static final byte SESS_RECEIVE_CONTINUATION = 77;
-
- public static final byte SESS_FORCE_CONSUMER_DELIVERY = 78;
-
- public static final byte SESS_PRODUCER_REQUEST_CREDITS = 79;
-
- public static final byte SESS_PRODUCER_CREDITS = 80;
-
- // Replication
-
- public static final byte REPLICATION_RESPONSE = 90;
-
- public static final byte REPLICATION_APPEND = 91;
-
- public static final byte REPLICATION_APPEND_TX = 92;
-
- public static final byte REPLICATION_DELETE = 93;
-
- public static final byte REPLICATION_DELETE_TX = 94;
-
- public static final byte REPLICATION_PREPARE = 95;
-
- public static final byte REPLICATION_COMMIT_ROLLBACK = 96;
-
- public static final byte REPLICATION_PAGE_WRITE = 97;
-
- public static final byte REPLICATION_PAGE_EVENT = 98;
-
- public static final byte REPLICATION_LARGE_MESSAGE_BEGIN = 99;
-
- public static final byte REPLICATION_LARGE_MESSAGE_END = 100;
-
- public static final byte REPLICATION_LARGE_MESSAGE_WRITE = 101;
-
- public static final byte REPLICATION_COMPARE_DATA = 102;
-
- public static final byte REPLICATION_SYNC = 103;
-
- // Static --------------------------------------------------------
-
- public PacketImpl(final byte type)
- {
- this.type = type;
- }
-
- // Public --------------------------------------------------------
-
- public byte getType()
- {
- return type;
- }
-
- public long getChannelID()
- {
- return channelID;
- }
-
- public void setChannelID(final long channelID)
- {
- this.channelID = channelID;
- }
-
- public HornetQBuffer encode(final RemotingConnection connection)
- {
- HornetQBuffer buffer = connection.createBuffer(PacketImpl.INITIAL_PACKET_SIZE);
-
- // The standard header fields
-
- buffer.writeInt(0); // The length gets filled in at the end
- buffer.writeByte(type);
- buffer.writeLong(channelID);
-
- encodeRest(buffer);
-
- size = buffer.writerIndex();
-
- // The length doesn't include the actual length byte
- int len = size - DataConstants.SIZE_INT;
-
- buffer.setInt(0, len);
-
- return buffer;
- }
-
- public void decode(final HornetQBuffer buffer)
- {
- channelID = buffer.readLong();
-
- decodeRest(buffer);
-
- size = buffer.readerIndex();
- }
-
- public int getPacketSize()
- {
- if (size == -1)
- {
- throw new IllegalStateException("Packet hasn't been encoded/decoded
yet");
- }
-
- return size;
- }
-
- public boolean isResponse()
- {
- return false;
- }
-
- public void encodeRest(final HornetQBuffer buffer)
- {
- }
-
- public void decodeRest(final HornetQBuffer buffer)
- {
- }
-
- public boolean isRequiresConfirmations()
- {
- return true;
- }
-
- public boolean isAsyncExec()
- {
- return false;
- }
-
- @Override
- public String toString()
- {
- return getParentString() + "]";
- }
-
- @Override
- public boolean equals(final Object other)
- {
- if (other instanceof PacketImpl == false)
- {
- return false;
- }
-
- PacketImpl r = (PacketImpl)other;
-
- return r.type == type && r.channelID == channelID;
- }
-
- // Package protected ---------------------------------------------
-
- protected String getParentString()
- {
- return "PACKET[type=" + type + ", channelID=" + channelID +
"]";
- }
-
- // Protected -----------------------------------------------------
-
- protected int stringEncodeSize(final String str)
- {
- return DataConstants.SIZE_INT + str.length() * 2;
- }
-
- protected int nullableStringEncodeSize(final String str)
- {
- return DataConstants.SIZE_BOOLEAN + (str != null ? stringEncodeSize(str) : 0);
- }
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/RemotingConnectionImpl.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/RemotingConnectionImpl.java 2010-01-22
10:19:02 UTC (rev 8835)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/RemotingConnectionImpl.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,509 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.protocol.core;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.CopyOnWriteArrayList;
-import java.util.concurrent.Executor;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.api.core.HornetQException;
-import org.hornetq.api.core.Interceptor;
-import org.hornetq.core.logging.Logger;
-import org.hornetq.core.remoting.CloseListener;
-import org.hornetq.core.remoting.FailureListener;
-import org.hornetq.spi.core.remoting.BufferHandler;
-import org.hornetq.spi.core.remoting.Connection;
-import org.hornetq.utils.SimpleIDGenerator;
-
-/**
- * @author <a href="tim.fox(a)jboss.com">Tim Fox</a>
- * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
- * @version <tt>$Revision$</tt> $Id$
- */
-public class RemotingConnectionImpl implements CoreRemotingConnection, BufferHandler
-{
- // Constants
- //
------------------------------------------------------------------------------------
-
- private static final Logger log = Logger.getLogger(RemotingConnectionImpl.class);
-
- // Static
- //
---------------------------------------------------------------------------------------
-
- // Attributes
- //
-----------------------------------------------------------------------------------
-
- private final Connection transportConnection;
-
- private final Map<Long, Channel> channels = new ConcurrentHashMap<Long,
Channel>();
-
- private final List<FailureListener> failureListeners = new
CopyOnWriteArrayList<FailureListener>();
-
- private final List<CloseListener> closeListeners = new
CopyOnWriteArrayList<CloseListener>();
-
- private final long blockingCallTimeout;
-
- private final List<Interceptor> interceptors;
-
- private volatile boolean destroyed;
-
- private final boolean client;
-
- // Channels 0-9 are reserved for the system
- // 0 is for pinging
- // 1 is for session creation and attachment
- // 2 is for replication
- private volatile SimpleIDGenerator idGenerator = new SimpleIDGenerator(10);
-
- private boolean idGeneratorSynced = false;
-
- private final Object transferLock = new Object();
-
- private final Object failLock = new Object();
-
- private volatile boolean dataReceived;
-
- private final Executor executor;
-
- private volatile boolean executing;
-
- private final PacketDecoder decoder = new PacketDecoder();
-
- // Constructors
- // ---------------------------------------------------------------------------------
-
- /*
- * Create a client side connection
- */
- public RemotingConnectionImpl(final Connection transportConnection,
- final long blockingCallTimeout,
- final List<Interceptor> interceptors)
- {
- this(transportConnection, blockingCallTimeout, interceptors, true, null);
- }
-
- /*
- * Create a server side connection
- */
- public RemotingConnectionImpl(final Connection transportConnection,
- final List<Interceptor> interceptors,
- final Executor executor)
-
- {
- this(transportConnection, -1, interceptors, false, executor);
- }
-
- private RemotingConnectionImpl(final Connection transportConnection,
- final long blockingCallTimeout,
- final List<Interceptor> interceptors,
- final boolean client,
- final Executor executor)
-
- {
- this.transportConnection = transportConnection;
-
- this.blockingCallTimeout = blockingCallTimeout;
-
- this.interceptors = interceptors;
-
- this.client = client;
-
- this.executor = executor;
- }
-
- // RemotingConnection implementation
- // ------------------------------------------------------------
-
- public Connection getTransportConnection()
- {
- return transportConnection;
- }
-
- public List<FailureListener> getFailureListeners()
- {
- return new ArrayList<FailureListener>(failureListeners);
- }
-
- public void setFailureListeners(final List<FailureListener> listeners)
- {
- failureListeners.clear();
-
- failureListeners.addAll(listeners);
- }
-
- public Object getID()
- {
- return transportConnection.getID();
- }
-
- public String getRemoteAddress()
- {
- return transportConnection.getRemoteAddress();
- }
-
- public synchronized Channel getChannel(final long channelID, final int
confWindowSize)
- {
- Channel channel = channels.get(channelID);
-
- if (channel == null)
- {
- channel = new ChannelImpl(this, channelID, confWindowSize);
-
- channels.put(channelID, channel);
- }
-
- return channel;
- }
-
- public synchronized boolean removeChannel(final long channelID)
- {
- return channels.remove(channelID) != null;
- }
-
- public synchronized void putChannel(final long channelID, final Channel channel)
- {
- channels.put(channelID, channel);
- }
-
- public void addFailureListener(final FailureListener listener)
- {
- if (listener == null)
- {
- throw new IllegalStateException("FailureListener cannot be null");
- }
-
- failureListeners.add(listener);
- }
-
- public boolean removeFailureListener(final FailureListener listener)
- {
- if (listener == null)
- {
- throw new IllegalStateException("FailureListener cannot be null");
- }
-
- return failureListeners.remove(listener);
- }
-
- public void addCloseListener(final CloseListener listener)
- {
- if (listener == null)
- {
- throw new IllegalStateException("CloseListener cannot be null");
- }
-
- closeListeners.add(listener);
- }
-
- public boolean removeCloseListener(final CloseListener listener)
- {
- if (listener == null)
- {
- throw new IllegalStateException("CloseListener cannot be null");
- }
-
- return closeListeners.remove(listener);
- }
-
- public HornetQBuffer createBuffer(final int size)
- {
- return transportConnection.createBuffer(size);
- }
-
- /*
- * This can be called concurrently by more than one thread so needs to be locked
- */
- public void fail(final HornetQException me)
- {
- synchronized (failLock)
- {
- if (destroyed)
- {
- return;
- }
-
- destroyed = true;
- }
-
- RemotingConnectionImpl.log.warn("Connection failure has been detected: "
+ me.getMessage() +
- " [code=" +
- me.getCode() +
- "]");
-
- // Then call the listeners
- callFailureListeners(me);
-
- callClosingListeners();
-
- internalClose();
-
- for (Channel channel : channels.values())
- {
- channel.returnBlocking();
- }
- }
-
- public void destroy()
- {
- synchronized (failLock)
- {
- if (destroyed)
- {
- return;
- }
-
- destroyed = true;
- }
-
- internalClose();
-
- callClosingListeners();
- }
-
- public void disconnect()
- {
- Channel channel0 = getChannel(0, -1);
-
- // And we remove all channels from the connection, this ensures no more packets
will be processed after this
- // method is
- // complete
-
- Set<Channel> allChannels = new HashSet<Channel>(channels.values());
-
- removeAllChannels();
-
- // Now we are 100% sure that no more packets will be processed we can flush then
send the disconnect
-
- for (Channel channel: allChannels)
- {
- channel.flushConfirmations();
- }
-
- channel0.sendAndFlush(new PacketImpl(PacketImpl.DISCONNECT));
- }
-
- public long generateChannelID()
- {
- return idGenerator.generateID();
- }
-
- public synchronized void syncIDGeneratorSequence(final long id)
- {
- if (!idGeneratorSynced)
- {
- idGenerator = new SimpleIDGenerator(id);
-
- idGeneratorSynced = true;
- }
- }
-
- public long getIDGeneratorSequence()
- {
- return idGenerator.getCurrentID();
- }
-
- public Object getTransferLock()
- {
- return transferLock;
- }
-
- public boolean isClient()
- {
- return client;
- }
-
- public boolean isDestroyed()
- {
- return destroyed;
- }
-
- public long getBlockingCallTimeout()
- {
- return blockingCallTimeout;
- }
-
- public boolean checkDataReceived()
- {
- boolean res = dataReceived;
-
- dataReceived = false;
-
- return res;
- }
-
- //We flush any confirmations on the connection - this prevents idle bridges for
example
- //sitting there with many unacked messages
- public void flush()
- {
- synchronized (transferLock)
- {
- for (Channel channel : channels.values())
- {
- channel.flushConfirmations();
- }
- }
- }
-
- // Buffer Handler implementation
- // ----------------------------------------------------
-
- public void bufferReceived(Object connectionID, HornetQBuffer buffer)
- {
- final Packet packet = decoder.decode(buffer);
-
- if (packet.isAsyncExec() && executor != null)
- {
- executing = true;
-
- executor.execute(new Runnable()
- {
- public void run()
- {
- try
- {
- doBufferReceived(packet);
- }
- catch (Throwable t)
- {
- RemotingConnectionImpl.log.error("Unexpected error", t);
- }
-
- executing = false;
- }
- });
- }
- else
- {
- //To prevent out of order execution if interleaving sync and async operations on
same connection
- while (executing)
- {
- Thread.yield();
- }
-
- // Pings must always be handled out of band so we can send pings back to the
client quickly
- // otherwise they would get in the queue with everything else which might give
an intolerable delay
- doBufferReceived(packet);
- }
-
- dataReceived = true;
- }
-
- private void doBufferReceived(final Packet packet)
- {
- if (interceptors != null)
- {
- for (final Interceptor interceptor : interceptors)
- {
- try
- {
- boolean callNext = interceptor.intercept(packet, this);
-
- if (!callNext)
- {
- return;
- }
- }
- catch (final Throwable e)
- {
- RemotingConnectionImpl.log.warn("Failure in calling interceptor:
" + interceptor, e);
- }
- }
- }
-
- synchronized (transferLock)
- {
- final Channel channel = channels.get(packet.getChannelID());
-
- if (channel != null)
- {
- channel.handlePacket(packet);
- }
- }
- }
-
- // Package protected
- // ----------------------------------------------------------------------------
-
- // Protected
- //
------------------------------------------------------------------------------------
-
- // Private
- //
--------------------------------------------------------------------------------------
-
- private void removeAllChannels()
- {
- // We get the transfer lock first - this ensures no packets are being processed
AND
- // it's guaranteed no more packets will be processed once this method is
complete
- synchronized (transferLock)
- {
- channels.clear();
- }
- }
- private void callFailureListeners(final HornetQException me)
- {
- final List<FailureListener> listenersClone = new
ArrayList<FailureListener>(failureListeners);
-
- for (final FailureListener listener : listenersClone)
- {
- try
- {
- listener.connectionFailed(me);
- }
- catch (final Throwable t)
- {
- // Failure of one listener to execute shouldn't prevent others
- // from
- // executing
- RemotingConnectionImpl.log.error("Failed to execute failure
listener", t);
- }
- }
- }
-
- private void callClosingListeners()
- {
- final List<CloseListener> listenersClone = new
ArrayList<CloseListener>(closeListeners);
-
- for (final CloseListener listener : listenersClone)
- {
- try
- {
- listener.connectionClosed();
- }
- catch (final Throwable t)
- {
- // Failure of one listener to execute shouldn't prevent others
- // from
- // executing
- RemotingConnectionImpl.log.error("Failed to execute failure
listener", t);
- }
- }
- }
-
- private void internalClose()
- {
- // We close the underlying transport connection
- transportConnection.close();
-
- for (Channel channel : channels.values())
- {
- channel.close();
- }
- }
-}
Modified:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/ServerSessionPacketHandler.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/ServerSessionPacketHandler.java 2010-01-22
10:19:02 UTC (rev 8835)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/ServerSessionPacketHandler.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -13,36 +13,36 @@
package org.hornetq.core.protocol.core;
-import static org.hornetq.core.protocol.core.PacketImpl.CREATE_QUEUE;
-import static org.hornetq.core.protocol.core.PacketImpl.DELETE_QUEUE;
-import static org.hornetq.core.protocol.core.PacketImpl.SESS_ACKNOWLEDGE;
-import static org.hornetq.core.protocol.core.PacketImpl.SESS_BINDINGQUERY;
-import static org.hornetq.core.protocol.core.PacketImpl.SESS_CLOSE;
-import static org.hornetq.core.protocol.core.PacketImpl.SESS_COMMIT;
-import static org.hornetq.core.protocol.core.PacketImpl.SESS_CONSUMER_CLOSE;
-import static org.hornetq.core.protocol.core.PacketImpl.SESS_CREATECONSUMER;
-import static org.hornetq.core.protocol.core.PacketImpl.SESS_EXPIRED;
-import static org.hornetq.core.protocol.core.PacketImpl.SESS_FLOWTOKEN;
-import static org.hornetq.core.protocol.core.PacketImpl.SESS_FORCE_CONSUMER_DELIVERY;
-import static org.hornetq.core.protocol.core.PacketImpl.SESS_QUEUEQUERY;
-import static org.hornetq.core.protocol.core.PacketImpl.SESS_ROLLBACK;
-import static org.hornetq.core.protocol.core.PacketImpl.SESS_SEND;
-import static org.hornetq.core.protocol.core.PacketImpl.SESS_SEND_CONTINUATION;
-import static org.hornetq.core.protocol.core.PacketImpl.SESS_SEND_LARGE;
-import static org.hornetq.core.protocol.core.PacketImpl.SESS_START;
-import static org.hornetq.core.protocol.core.PacketImpl.SESS_STOP;
-import static org.hornetq.core.protocol.core.PacketImpl.SESS_XA_COMMIT;
-import static org.hornetq.core.protocol.core.PacketImpl.SESS_XA_END;
-import static org.hornetq.core.protocol.core.PacketImpl.SESS_XA_FORGET;
-import static org.hornetq.core.protocol.core.PacketImpl.SESS_XA_GET_TIMEOUT;
-import static org.hornetq.core.protocol.core.PacketImpl.SESS_XA_INDOUBT_XIDS;
-import static org.hornetq.core.protocol.core.PacketImpl.SESS_XA_JOIN;
-import static org.hornetq.core.protocol.core.PacketImpl.SESS_XA_PREPARE;
-import static org.hornetq.core.protocol.core.PacketImpl.SESS_XA_RESUME;
-import static org.hornetq.core.protocol.core.PacketImpl.SESS_XA_ROLLBACK;
-import static org.hornetq.core.protocol.core.PacketImpl.SESS_XA_SET_TIMEOUT;
-import static org.hornetq.core.protocol.core.PacketImpl.SESS_XA_START;
-import static org.hornetq.core.protocol.core.PacketImpl.SESS_XA_SUSPEND;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.CREATE_QUEUE;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.DELETE_QUEUE;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_ACKNOWLEDGE;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_BINDINGQUERY;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_CLOSE;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_COMMIT;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_CONSUMER_CLOSE;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_CREATECONSUMER;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_EXPIRED;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_FLOWTOKEN;
+import static
org.hornetq.core.protocol.core.impl.PacketImpl.SESS_FORCE_CONSUMER_DELIVERY;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_QUEUEQUERY;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_ROLLBACK;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_SEND;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_SEND_CONTINUATION;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_SEND_LARGE;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_START;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_STOP;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_XA_COMMIT;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_XA_END;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_XA_FORGET;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_XA_GET_TIMEOUT;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_XA_INDOUBT_XIDS;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_XA_JOIN;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_XA_PREPARE;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_XA_RESUME;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_XA_ROLLBACK;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_XA_SET_TIMEOUT;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_XA_START;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_XA_SUSPEND;
import java.util.List;
@@ -55,38 +55,39 @@
import org.hornetq.core.logging.Logger;
import org.hornetq.core.persistence.OperationContext;
import org.hornetq.core.persistence.StorageManager;
-import org.hornetq.core.protocol.core.wireformat.CreateQueueMessage;
-import org.hornetq.core.protocol.core.wireformat.HornetQExceptionMessage;
-import org.hornetq.core.protocol.core.wireformat.NullResponseMessage;
-import org.hornetq.core.protocol.core.wireformat.RollbackMessage;
-import org.hornetq.core.protocol.core.wireformat.SessionAcknowledgeMessage;
-import org.hornetq.core.protocol.core.wireformat.SessionBindingQueryMessage;
-import org.hornetq.core.protocol.core.wireformat.SessionBindingQueryResponseMessage;
-import org.hornetq.core.protocol.core.wireformat.SessionConsumerCloseMessage;
-import org.hornetq.core.protocol.core.wireformat.SessionConsumerFlowCreditMessage;
-import org.hornetq.core.protocol.core.wireformat.SessionCreateConsumerMessage;
-import org.hornetq.core.protocol.core.wireformat.SessionDeleteQueueMessage;
-import org.hornetq.core.protocol.core.wireformat.SessionExpiredMessage;
-import org.hornetq.core.protocol.core.wireformat.SessionForceConsumerDelivery;
-import org.hornetq.core.protocol.core.wireformat.SessionQueueQueryMessage;
-import org.hornetq.core.protocol.core.wireformat.SessionQueueQueryResponseMessage;
-import org.hornetq.core.protocol.core.wireformat.SessionRequestProducerCreditsMessage;
-import org.hornetq.core.protocol.core.wireformat.SessionSendContinuationMessage;
-import org.hornetq.core.protocol.core.wireformat.SessionSendLargeMessage;
-import org.hornetq.core.protocol.core.wireformat.SessionSendMessage;
-import org.hornetq.core.protocol.core.wireformat.SessionXACommitMessage;
-import org.hornetq.core.protocol.core.wireformat.SessionXAEndMessage;
-import org.hornetq.core.protocol.core.wireformat.SessionXAForgetMessage;
-import org.hornetq.core.protocol.core.wireformat.SessionXAGetInDoubtXidsResponseMessage;
-import org.hornetq.core.protocol.core.wireformat.SessionXAGetTimeoutResponseMessage;
-import org.hornetq.core.protocol.core.wireformat.SessionXAJoinMessage;
-import org.hornetq.core.protocol.core.wireformat.SessionXAPrepareMessage;
-import org.hornetq.core.protocol.core.wireformat.SessionXAResponseMessage;
-import org.hornetq.core.protocol.core.wireformat.SessionXAResumeMessage;
-import org.hornetq.core.protocol.core.wireformat.SessionXARollbackMessage;
-import org.hornetq.core.protocol.core.wireformat.SessionXASetTimeoutMessage;
-import org.hornetq.core.protocol.core.wireformat.SessionXASetTimeoutResponseMessage;
-import org.hornetq.core.protocol.core.wireformat.SessionXAStartMessage;
+import org.hornetq.core.protocol.core.impl.PacketImpl;
+import org.hornetq.core.protocol.core.impl.wireformat.CreateQueueMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.HornetQExceptionMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.NullResponseMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.RollbackMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.SessionAcknowledgeMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.SessionBindingQueryMessage;
+import
org.hornetq.core.protocol.core.impl.wireformat.SessionBindingQueryResponseMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.SessionConsumerCloseMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.SessionConsumerFlowCreditMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.SessionCreateConsumerMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.SessionDeleteQueueMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.SessionExpiredMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.SessionForceConsumerDelivery;
+import org.hornetq.core.protocol.core.impl.wireformat.SessionQueueQueryMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.SessionQueueQueryResponseMessage;
+import
org.hornetq.core.protocol.core.impl.wireformat.SessionRequestProducerCreditsMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.SessionSendContinuationMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.SessionSendLargeMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.SessionSendMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.SessionXACommitMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.SessionXAEndMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.SessionXAForgetMessage;
+import
org.hornetq.core.protocol.core.impl.wireformat.SessionXAGetInDoubtXidsResponseMessage;
+import
org.hornetq.core.protocol.core.impl.wireformat.SessionXAGetTimeoutResponseMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.SessionXAJoinMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.SessionXAPrepareMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.SessionXAResponseMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.SessionXAResumeMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.SessionXARollbackMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.SessionXASetTimeoutMessage;
+import
org.hornetq.core.protocol.core.impl.wireformat.SessionXASetTimeoutResponseMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.SessionXAStartMessage;
import org.hornetq.core.remoting.CloseListener;
import org.hornetq.core.remoting.FailureListener;
import org.hornetq.core.server.BindingQueryResult;
Copied: branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl
(from rev 8832, trunk/src/main/org/hornetq/core/protocol/core/impl)
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/AbstractBufferHandler.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/impl/AbstractBufferHandler.java 2010-01-21
20:09:23 UTC (rev 8832)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/AbstractBufferHandler.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,46 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.hornetq.core.protocol.core.impl;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.logging.Logger;
-import org.hornetq.spi.core.remoting.BufferHandler;
-import org.hornetq.utils.DataConstants;
-
-/**
- * A AbstractBufferHandler
- *
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- *
- */
-public abstract class AbstractBufferHandler implements BufferHandler
-{
- private static final Logger log = Logger.getLogger(AbstractBufferHandler.class);
-
- public int isReadyToHandle(final HornetQBuffer buffer)
- {
- if (buffer.readableBytes() < DataConstants.SIZE_INT)
- {
- return -1;
- }
-
- int length = buffer.readInt();
-
- if (buffer.readableBytes() < length)
- {
- return -1;
- }
-
- return length;
- }
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/AbstractBufferHandler.java
(from rev 8832,
trunk/src/main/org/hornetq/core/protocol/core/impl/AbstractBufferHandler.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/AbstractBufferHandler.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/AbstractBufferHandler.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.hornetq.core.protocol.core.impl;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.logging.Logger;
+import org.hornetq.spi.core.remoting.BufferHandler;
+import org.hornetq.utils.DataConstants;
+
+/**
+ * A AbstractBufferHandler
+ *
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ *
+ */
+public abstract class AbstractBufferHandler implements BufferHandler
+{
+ private static final Logger log = Logger.getLogger(AbstractBufferHandler.class);
+
+ public int isReadyToHandle(final HornetQBuffer buffer)
+ {
+ if (buffer.readableBytes() < DataConstants.SIZE_INT)
+ {
+ return -1;
+ }
+
+ int length = buffer.readInt();
+
+ if (buffer.readableBytes() < length)
+ {
+ return -1;
+ }
+
+ return length;
+ }
+}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/ChannelImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/protocol/core/impl/ChannelImpl.java 2010-01-21
20:09:23 UTC (rev 8832)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/ChannelImpl.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,513 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.protocol.core.impl;
-
-import java.util.concurrent.ConcurrentLinkedQueue;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.locks.Condition;
-import java.util.concurrent.locks.Lock;
-import java.util.concurrent.locks.ReentrantLock;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.api.core.HornetQException;
-import org.hornetq.core.logging.Logger;
-import org.hornetq.core.protocol.core.Channel;
-import org.hornetq.core.protocol.core.ChannelHandler;
-import org.hornetq.core.protocol.core.CommandConfirmationHandler;
-import org.hornetq.core.protocol.core.CoreRemotingConnection;
-import org.hornetq.core.protocol.core.Packet;
-import org.hornetq.core.protocol.core.impl.wireformat.HornetQExceptionMessage;
-import org.hornetq.core.protocol.core.impl.wireformat.PacketsConfirmedMessage;
-import org.hornetq.spi.core.protocol.RemotingConnection;
-
-/**
- * A ChannelImpl
- *
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- */
-public class ChannelImpl implements Channel
-{
- private static final Logger log = Logger.getLogger(ChannelImpl.class);
-
- private volatile long id;
-
- private ChannelHandler handler;
-
- private Packet response;
-
- private final java.util.Queue<Packet> resendCache;
-
- private volatile int firstStoredCommandID;
-
- private volatile int lastConfirmedCommandID = -1;
-
- private volatile CoreRemotingConnection connection;
-
- private volatile boolean closed;
-
- private final Lock lock = new ReentrantLock();
-
- private final Condition sendCondition = lock.newCondition();
-
- private final Condition failoverCondition = lock.newCondition();
-
- private final Object sendLock = new Object();
-
- private final Object sendBlockingLock = new Object();
-
- private boolean failingOver;
-
- private final int confWindowSize;
-
- private int receivedBytes;
-
- private CommandConfirmationHandler commandConfirmationHandler;
-
- private volatile boolean transferring;
-
- public ChannelImpl(final CoreRemotingConnection connection, final long id, final int
confWindowSize)
- {
- this.connection = connection;
-
- this.id = id;
-
- this.confWindowSize = confWindowSize;
-
- if (confWindowSize != -1)
- {
- resendCache = new ConcurrentLinkedQueue<Packet>();
- }
- else
- {
- resendCache = null;
- }
- }
-
- public long getID()
- {
- return id;
- }
-
- public int getLastConfirmedCommandID()
- {
- return lastConfirmedCommandID;
- }
-
- public Lock getLock()
- {
- return lock;
- }
-
- public int getConfirmationWindowSize()
- {
- return confWindowSize;
- }
-
- public void returnBlocking()
- {
- lock.lock();
-
- try
- {
- response = new HornetQExceptionMessage(new
HornetQException(HornetQException.UNBLOCKED,
- "Connection
failure detected. Unblocking a blocking call that will never get a response"
-
- ));
-
- sendCondition.signal();
- }
- finally
- {
- lock.unlock();
- }
- }
-
- public void sendAndFlush(final Packet packet)
- {
- send(packet, true);
- }
-
- public void send(final Packet packet)
- {
- send(packet, false);
- }
-
- public void setTransferring(boolean transferring)
- {
- this.transferring = transferring;
- }
-
- // This must never called by more than one thread concurrently
- public void send(final Packet packet, final boolean flush)
- {
- synchronized (sendLock)
- {
- packet.setChannelID(id);
-
- final HornetQBuffer buffer = packet.encode(connection);
-
- lock.lock();
-
- try
- {
- while (failingOver)
- {
- // TODO - don't hardcode this timeout
- try
- {
- failoverCondition.await(10000, TimeUnit.MILLISECONDS);
- }
- catch (InterruptedException e)
- {
- }
- }
-
- //Sanity check
- if (transferring)
- {
- throw new IllegalStateException("Cannot send a packet while channel
is doing failover");
- }
-
-
- if (resendCache != null && packet.isRequiresConfirmations())
- {
- resendCache.add(packet);
- }
-
- connection.getTransportConnection().write(buffer, flush);
- }
- finally
- {
- lock.unlock();
- }
- }
- }
-
- public Packet sendBlocking(final Packet packet) throws HornetQException
- {
- if (closed)
- {
- throw new HornetQException(HornetQException.NOT_CONNECTED, "Connection is
destroyed");
- }
-
- if (connection.getBlockingCallTimeout() == -1)
- {
- throw new IllegalStateException("Cannot do a blocking call timeout on a
server side connection");
- }
-
- // Synchronized since can't be called concurrently by more than one thread and
this can occur
- // E.g. blocking acknowledge() from inside a message handler at some time as other
operation on main thread
- synchronized (sendBlockingLock)
- {
- packet.setChannelID(id);
-
- final HornetQBuffer buffer = packet.encode(connection);
-
- lock.lock();
-
- try
- {
- while (failingOver)
- {
- // TODO - don't hardcode this timeout
- try
- {
- failoverCondition.await(10000, TimeUnit.MILLISECONDS);
- }
- catch (InterruptedException e)
- {
- }
- }
-
- response = null;
-
- if (resendCache != null && packet.isRequiresConfirmations())
- {
- resendCache.add(packet);
- }
-
- connection.getTransportConnection().write(buffer);
-
- long toWait = connection.getBlockingCallTimeout();
-
- long start = System.currentTimeMillis();
-
- while (response == null && toWait > 0)
- {
- try
- {
- sendCondition.await(toWait, TimeUnit.MILLISECONDS);
- }
- catch (InterruptedException e)
- {
- }
-
- if (closed)
- {
- break;
- }
-
- final long now = System.currentTimeMillis();
-
- toWait -= now - start;
-
- start = now;
- }
-
- if (response == null)
- {
- throw new HornetQException(HornetQException.CONNECTION_TIMEDOUT,
- "Timed out waiting for response when
sending packet " + packet.getType());
- }
-
- if (response.getType() == PacketImpl.EXCEPTION)
- {
- final HornetQExceptionMessage mem = (HornetQExceptionMessage)response;
-
- HornetQException e = mem.getException();
-
- e.fillInStackTrace();
-
- throw e;
- }
- }
- finally
- {
- lock.unlock();
- }
-
- return response;
- }
- }
-
- public void setCommandConfirmationHandler(final CommandConfirmationHandler handler)
- {
- commandConfirmationHandler = handler;
- }
-
- public void setHandler(final ChannelHandler handler)
- {
- this.handler = handler;
- }
-
- public void close()
- {
- if (closed)
- {
- return;
- }
-
- if (!connection.isDestroyed() && !connection.removeChannel(id))
- {
- throw new IllegalArgumentException("Cannot find channel with id " + id
+ " to close");
- }
-
- closed = true;
- }
-
- public void transferConnection(final CoreRemotingConnection newConnection)
- {
- // Needs to synchronize on the connection to make sure no packets from
- // the old connection get processed after transfer has occurred
- synchronized (connection.getTransferLock())
- {
- connection.removeChannel(id);
-
- // And switch it
-
- final CoreRemotingConnection rnewConnection =
(CoreRemotingConnection)newConnection;
-
- rnewConnection.putChannel(id, this);
-
- connection = rnewConnection;
-
- transferring = true;
- }
- }
-
- public void replayCommands(final int otherLastConfirmedCommandID)
- {
- if (resendCache != null)
- {
- clearUpTo(otherLastConfirmedCommandID);
-
- for (final Packet packet : resendCache)
- {
- doWrite(packet);
- }
- }
- }
-
- public void lock()
- {
- lock.lock();
-
- failingOver = true;
-
- lock.unlock();
- }
-
- public void unlock()
- {
- lock.lock();
-
- failingOver = false;
-
- failoverCondition.signalAll();
-
- lock.unlock();
- }
-
- public CoreRemotingConnection getConnection()
- {
- return connection;
- }
-
- //Needs to be synchronized since can be called by remoting service timer thread too
for timeout flush
- public synchronized void flushConfirmations()
- {
- if (resendCache != null && receivedBytes != 0)
- {
- receivedBytes = 0;
-
- final Packet confirmed = new PacketsConfirmedMessage(lastConfirmedCommandID);
-
- confirmed.setChannelID(id);
-
- doWrite(confirmed);
- }
- }
-
- public void confirm(final Packet packet)
- {
- if (resendCache != null && packet.isRequiresConfirmations())
- {
- lastConfirmedCommandID++;
-
- receivedBytes += packet.getPacketSize();
-
- if (receivedBytes >= confWindowSize)
- {
- receivedBytes = 0;
-
- final Packet confirmed = new
PacketsConfirmedMessage(lastConfirmedCommandID);
-
- confirmed.setChannelID(id);
-
- doWrite(confirmed);
- }
- }
- }
-
- public void clearCommands()
- {
- if (resendCache != null)
- {
- lastConfirmedCommandID = -1;
-
- firstStoredCommandID = 0;
-
- resendCache.clear();
- }
- }
-
- public void handlePacket(final Packet packet)
- {
- if (packet.getType() == PacketImpl.PACKETS_CONFIRMED)
- {
- if (resendCache != null)
- {
- final PacketsConfirmedMessage msg = (PacketsConfirmedMessage)packet;
-
- clearUpTo(msg.getCommandID());
- }
-
- if (!connection.isClient())
- {
- handler.handlePacket(packet);
- }
-
- return;
- }
- else
- {
- if (packet.isResponse())
- {
- confirm(packet);
-
- lock.lock();
-
- response = packet;
-
- try
- {
- sendCondition.signal();
- }
- finally
- {
- lock.unlock();
- }
- }
- else if (handler != null)
- {
- handler.handlePacket(packet);
- }
- }
- }
-
- private void doWrite(final Packet packet)
- {
- final HornetQBuffer buffer = packet.encode(connection);
-
- connection.getTransportConnection().write(buffer);
- }
-
- private void clearUpTo(final int lastReceivedCommandID)
- {
- final int numberToClear = 1 + lastReceivedCommandID - firstStoredCommandID;
-
- if (numberToClear == -1)
- {
- throw new IllegalArgumentException("Invalid lastReceivedCommandID: " +
lastReceivedCommandID);
- }
-
- int sizeToFree = 0;
-
- for (int i = 0; i < numberToClear; i++)
- {
- final Packet packet = resendCache.poll();
-
- if (packet == null)
- {
- ChannelImpl.log.warn("Can't find packet to clear: " + "
last received command id " +
- lastReceivedCommandID +
- " first stored command id " +
- firstStoredCommandID);
- return;
- }
-
- if (packet.getType() != PacketImpl.PACKETS_CONFIRMED)
- {
- sizeToFree += packet.getPacketSize();
- }
-
- if (commandConfirmationHandler != null)
- {
- commandConfirmationHandler.commandConfirmed(packet);
- }
- }
-
- firstStoredCommandID += numberToClear;
- }
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/ChannelImpl.java
(from rev 8832, trunk/src/main/org/hornetq/core/protocol/core/impl/ChannelImpl.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/ChannelImpl.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/ChannelImpl.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -0,0 +1,513 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.core.protocol.core.impl;
+
+import java.util.concurrent.ConcurrentLinkedQueue;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.locks.Condition;
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReentrantLock;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.api.core.HornetQException;
+import org.hornetq.core.logging.Logger;
+import org.hornetq.core.protocol.core.Channel;
+import org.hornetq.core.protocol.core.ChannelHandler;
+import org.hornetq.core.protocol.core.CommandConfirmationHandler;
+import org.hornetq.core.protocol.core.CoreRemotingConnection;
+import org.hornetq.core.protocol.core.Packet;
+import org.hornetq.core.protocol.core.impl.wireformat.HornetQExceptionMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.PacketsConfirmedMessage;
+import org.hornetq.spi.core.protocol.RemotingConnection;
+
+/**
+ * A ChannelImpl
+ *
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ */
+public class ChannelImpl implements Channel
+{
+ private static final Logger log = Logger.getLogger(ChannelImpl.class);
+
+ private volatile long id;
+
+ private ChannelHandler handler;
+
+ private Packet response;
+
+ private final java.util.Queue<Packet> resendCache;
+
+ private volatile int firstStoredCommandID;
+
+ private volatile int lastConfirmedCommandID = -1;
+
+ private volatile CoreRemotingConnection connection;
+
+ private volatile boolean closed;
+
+ private final Lock lock = new ReentrantLock();
+
+ private final Condition sendCondition = lock.newCondition();
+
+ private final Condition failoverCondition = lock.newCondition();
+
+ private final Object sendLock = new Object();
+
+ private final Object sendBlockingLock = new Object();
+
+ private boolean failingOver;
+
+ private final int confWindowSize;
+
+ private int receivedBytes;
+
+ private CommandConfirmationHandler commandConfirmationHandler;
+
+ private volatile boolean transferring;
+
+ public ChannelImpl(final CoreRemotingConnection connection, final long id, final int
confWindowSize)
+ {
+ this.connection = connection;
+
+ this.id = id;
+
+ this.confWindowSize = confWindowSize;
+
+ if (confWindowSize != -1)
+ {
+ resendCache = new ConcurrentLinkedQueue<Packet>();
+ }
+ else
+ {
+ resendCache = null;
+ }
+ }
+
+ public long getID()
+ {
+ return id;
+ }
+
+ public int getLastConfirmedCommandID()
+ {
+ return lastConfirmedCommandID;
+ }
+
+ public Lock getLock()
+ {
+ return lock;
+ }
+
+ public int getConfirmationWindowSize()
+ {
+ return confWindowSize;
+ }
+
+ public void returnBlocking()
+ {
+ lock.lock();
+
+ try
+ {
+ response = new HornetQExceptionMessage(new
HornetQException(HornetQException.UNBLOCKED,
+ "Connection
failure detected. Unblocking a blocking call that will never get a response"
+
+ ));
+
+ sendCondition.signal();
+ }
+ finally
+ {
+ lock.unlock();
+ }
+ }
+
+ public void sendAndFlush(final Packet packet)
+ {
+ send(packet, true);
+ }
+
+ public void send(final Packet packet)
+ {
+ send(packet, false);
+ }
+
+ public void setTransferring(boolean transferring)
+ {
+ this.transferring = transferring;
+ }
+
+ // This must never called by more than one thread concurrently
+ public void send(final Packet packet, final boolean flush)
+ {
+ synchronized (sendLock)
+ {
+ packet.setChannelID(id);
+
+ final HornetQBuffer buffer = packet.encode(connection);
+
+ lock.lock();
+
+ try
+ {
+ while (failingOver)
+ {
+ // TODO - don't hardcode this timeout
+ try
+ {
+ failoverCondition.await(10000, TimeUnit.MILLISECONDS);
+ }
+ catch (InterruptedException e)
+ {
+ }
+ }
+
+ //Sanity check
+ if (transferring)
+ {
+ throw new IllegalStateException("Cannot send a packet while channel
is doing failover");
+ }
+
+
+ if (resendCache != null && packet.isRequiresConfirmations())
+ {
+ resendCache.add(packet);
+ }
+
+ connection.getTransportConnection().write(buffer, flush);
+ }
+ finally
+ {
+ lock.unlock();
+ }
+ }
+ }
+
+ public Packet sendBlocking(final Packet packet) throws HornetQException
+ {
+ if (closed)
+ {
+ throw new HornetQException(HornetQException.NOT_CONNECTED, "Connection is
destroyed");
+ }
+
+ if (connection.getBlockingCallTimeout() == -1)
+ {
+ throw new IllegalStateException("Cannot do a blocking call timeout on a
server side connection");
+ }
+
+ // Synchronized since can't be called concurrently by more than one thread and
this can occur
+ // E.g. blocking acknowledge() from inside a message handler at some time as other
operation on main thread
+ synchronized (sendBlockingLock)
+ {
+ packet.setChannelID(id);
+
+ final HornetQBuffer buffer = packet.encode(connection);
+
+ lock.lock();
+
+ try
+ {
+ while (failingOver)
+ {
+ // TODO - don't hardcode this timeout
+ try
+ {
+ failoverCondition.await(10000, TimeUnit.MILLISECONDS);
+ }
+ catch (InterruptedException e)
+ {
+ }
+ }
+
+ response = null;
+
+ if (resendCache != null && packet.isRequiresConfirmations())
+ {
+ resendCache.add(packet);
+ }
+
+ connection.getTransportConnection().write(buffer);
+
+ long toWait = connection.getBlockingCallTimeout();
+
+ long start = System.currentTimeMillis();
+
+ while (response == null && toWait > 0)
+ {
+ try
+ {
+ sendCondition.await(toWait, TimeUnit.MILLISECONDS);
+ }
+ catch (InterruptedException e)
+ {
+ }
+
+ if (closed)
+ {
+ break;
+ }
+
+ final long now = System.currentTimeMillis();
+
+ toWait -= now - start;
+
+ start = now;
+ }
+
+ if (response == null)
+ {
+ throw new HornetQException(HornetQException.CONNECTION_TIMEDOUT,
+ "Timed out waiting for response when
sending packet " + packet.getType());
+ }
+
+ if (response.getType() == PacketImpl.EXCEPTION)
+ {
+ final HornetQExceptionMessage mem = (HornetQExceptionMessage)response;
+
+ HornetQException e = mem.getException();
+
+ e.fillInStackTrace();
+
+ throw e;
+ }
+ }
+ finally
+ {
+ lock.unlock();
+ }
+
+ return response;
+ }
+ }
+
+ public void setCommandConfirmationHandler(final CommandConfirmationHandler handler)
+ {
+ commandConfirmationHandler = handler;
+ }
+
+ public void setHandler(final ChannelHandler handler)
+ {
+ this.handler = handler;
+ }
+
+ public void close()
+ {
+ if (closed)
+ {
+ return;
+ }
+
+ if (!connection.isDestroyed() && !connection.removeChannel(id))
+ {
+ throw new IllegalArgumentException("Cannot find channel with id " + id
+ " to close");
+ }
+
+ closed = true;
+ }
+
+ public void transferConnection(final CoreRemotingConnection newConnection)
+ {
+ // Needs to synchronize on the connection to make sure no packets from
+ // the old connection get processed after transfer has occurred
+ synchronized (connection.getTransferLock())
+ {
+ connection.removeChannel(id);
+
+ // And switch it
+
+ final CoreRemotingConnection rnewConnection =
(CoreRemotingConnection)newConnection;
+
+ rnewConnection.putChannel(id, this);
+
+ connection = rnewConnection;
+
+ transferring = true;
+ }
+ }
+
+ public void replayCommands(final int otherLastConfirmedCommandID)
+ {
+ if (resendCache != null)
+ {
+ clearUpTo(otherLastConfirmedCommandID);
+
+ for (final Packet packet : resendCache)
+ {
+ doWrite(packet);
+ }
+ }
+ }
+
+ public void lock()
+ {
+ lock.lock();
+
+ failingOver = true;
+
+ lock.unlock();
+ }
+
+ public void unlock()
+ {
+ lock.lock();
+
+ failingOver = false;
+
+ failoverCondition.signalAll();
+
+ lock.unlock();
+ }
+
+ public CoreRemotingConnection getConnection()
+ {
+ return connection;
+ }
+
+ //Needs to be synchronized since can be called by remoting service timer thread too
for timeout flush
+ public synchronized void flushConfirmations()
+ {
+ if (resendCache != null && receivedBytes != 0)
+ {
+ receivedBytes = 0;
+
+ final Packet confirmed = new PacketsConfirmedMessage(lastConfirmedCommandID);
+
+ confirmed.setChannelID(id);
+
+ doWrite(confirmed);
+ }
+ }
+
+ public void confirm(final Packet packet)
+ {
+ if (resendCache != null && packet.isRequiresConfirmations())
+ {
+ lastConfirmedCommandID++;
+
+ receivedBytes += packet.getPacketSize();
+
+ if (receivedBytes >= confWindowSize)
+ {
+ receivedBytes = 0;
+
+ final Packet confirmed = new
PacketsConfirmedMessage(lastConfirmedCommandID);
+
+ confirmed.setChannelID(id);
+
+ doWrite(confirmed);
+ }
+ }
+ }
+
+ public void clearCommands()
+ {
+ if (resendCache != null)
+ {
+ lastConfirmedCommandID = -1;
+
+ firstStoredCommandID = 0;
+
+ resendCache.clear();
+ }
+ }
+
+ public void handlePacket(final Packet packet)
+ {
+ if (packet.getType() == PacketImpl.PACKETS_CONFIRMED)
+ {
+ if (resendCache != null)
+ {
+ final PacketsConfirmedMessage msg = (PacketsConfirmedMessage)packet;
+
+ clearUpTo(msg.getCommandID());
+ }
+
+ if (!connection.isClient())
+ {
+ handler.handlePacket(packet);
+ }
+
+ return;
+ }
+ else
+ {
+ if (packet.isResponse())
+ {
+ confirm(packet);
+
+ lock.lock();
+
+ response = packet;
+
+ try
+ {
+ sendCondition.signal();
+ }
+ finally
+ {
+ lock.unlock();
+ }
+ }
+ else if (handler != null)
+ {
+ handler.handlePacket(packet);
+ }
+ }
+ }
+
+ private void doWrite(final Packet packet)
+ {
+ final HornetQBuffer buffer = packet.encode(connection);
+
+ connection.getTransportConnection().write(buffer);
+ }
+
+ private void clearUpTo(final int lastReceivedCommandID)
+ {
+ final int numberToClear = 1 + lastReceivedCommandID - firstStoredCommandID;
+
+ if (numberToClear == -1)
+ {
+ throw new IllegalArgumentException("Invalid lastReceivedCommandID: " +
lastReceivedCommandID);
+ }
+
+ int sizeToFree = 0;
+
+ for (int i = 0; i < numberToClear; i++)
+ {
+ final Packet packet = resendCache.poll();
+
+ if (packet == null)
+ {
+ ChannelImpl.log.warn("Can't find packet to clear: " + "
last received command id " +
+ lastReceivedCommandID +
+ " first stored command id " +
+ firstStoredCommandID);
+ return;
+ }
+
+ if (packet.getType() != PacketImpl.PACKETS_CONFIRMED)
+ {
+ sizeToFree += packet.getPacketSize();
+ }
+
+ if (commandConfirmationHandler != null)
+ {
+ commandConfirmationHandler.commandConfirmed(packet);
+ }
+ }
+
+ firstStoredCommandID += numberToClear;
+ }
+}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/CoreProtocolManager.java
===================================================================
--- trunk/src/main/org/hornetq/core/protocol/core/impl/CoreProtocolManager.java 2010-01-21
20:09:23 UTC (rev 8832)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/CoreProtocolManager.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,131 +0,0 @@
-/*
- * Copyright 2010 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.protocol.core.impl;
-
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.api.core.Interceptor;
-import org.hornetq.api.core.client.HornetQClient;
-import org.hornetq.core.config.Configuration;
-import org.hornetq.core.protocol.core.Channel;
-import org.hornetq.core.protocol.core.ChannelHandler;
-import org.hornetq.core.protocol.core.CoreRemotingConnection;
-import org.hornetq.core.protocol.core.Packet;
-import org.hornetq.core.protocol.core.ServerSessionPacketHandler;
-import org.hornetq.core.protocol.core.impl.wireformat.Ping;
-import org.hornetq.core.server.HornetQServer;
-import org.hornetq.spi.core.protocol.ConnectionEntry;
-import org.hornetq.spi.core.protocol.ProtocolManager;
-import org.hornetq.spi.core.remoting.Connection;
-
-/**
- * A CoreProtocolManager
- *
- * @author Tim Fox
- *
- *
- */
-public class CoreProtocolManager implements ProtocolManager
-{
- private final HornetQServer server;
-
- private final List<Interceptor> interceptors;
-
- public CoreProtocolManager(final HornetQServer server,
- final List<Interceptor> interceptors)
- {
- this.server = server;
-
- this.interceptors = interceptors;
- }
-
- public ConnectionEntry createConnectionEntry(final Connection connection)
- {
- final Configuration config = server.getConfiguration();
-
- CoreRemotingConnection rc = new RemotingConnectionImpl(connection,
- interceptors,
-
config.isAsyncConnectionExecutionEnabled() ? server.getExecutorFactory().getExecutor()
-
: null);
-
- Channel channel1 = rc.getChannel(1, -1);
-
- ChannelHandler handler = new HornetQPacketHandler(this, server, channel1, rc);
-
- channel1.setHandler(handler);
-
- long ttl = HornetQClient.DEFAULT_CONNECTION_TTL;
-
- if (config.getConnectionTTLOverride() != -1)
- {
- ttl = config.getConnectionTTLOverride();
- }
-
- final ConnectionEntry entry = new ConnectionEntry(rc, System.currentTimeMillis(),
ttl);
-
- final Channel channel0 = rc.getChannel(0, -1);
-
- channel0.setHandler(new ChannelHandler()
- {
- public void handlePacket(final Packet packet)
- {
- if (packet.getType() == PacketImpl.PING)
- {
- Ping ping = (Ping)packet;
-
- if (config.getConnectionTTLOverride() == -1)
- {
- // Allow clients to specify connection ttl
- entry.ttl = ping.getConnectionTTL();
- }
-
- // Just send a ping back
- channel0.send(packet);
- }
- }
- });
-
- return entry;
- }
-
- private Map<String, ServerSessionPacketHandler> sessionHandlers =
- new ConcurrentHashMap<String, ServerSessionPacketHandler>();
-
- public ServerSessionPacketHandler getSessionHandler(final String sessionName)
- {
- return sessionHandlers.get(sessionName);
- }
-
- public void addSessionHandler(final String name, final ServerSessionPacketHandler
handler)
- {
- sessionHandlers.put(name, handler);
- }
-
- public void removeHandler(final String name)
- {
- sessionHandlers.remove(name);
- }
-
- public void bufferReceived(Object connectionID, HornetQBuffer buffer)
- {
- }
-
- public int isReadyToHandle(HornetQBuffer buffer)
- {
- return -1;
- }
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/CoreProtocolManager.java
(from rev 8832,
trunk/src/main/org/hornetq/core/protocol/core/impl/CoreProtocolManager.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/CoreProtocolManager.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/CoreProtocolManager.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -0,0 +1,131 @@
+/*
+ * Copyright 2010 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.core.protocol.core.impl;
+
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.api.core.Interceptor;
+import org.hornetq.api.core.client.HornetQClient;
+import org.hornetq.core.config.Configuration;
+import org.hornetq.core.protocol.core.Channel;
+import org.hornetq.core.protocol.core.ChannelHandler;
+import org.hornetq.core.protocol.core.CoreRemotingConnection;
+import org.hornetq.core.protocol.core.Packet;
+import org.hornetq.core.protocol.core.ServerSessionPacketHandler;
+import org.hornetq.core.protocol.core.impl.wireformat.Ping;
+import org.hornetq.core.server.HornetQServer;
+import org.hornetq.spi.core.protocol.ConnectionEntry;
+import org.hornetq.spi.core.protocol.ProtocolManager;
+import org.hornetq.spi.core.remoting.Connection;
+
+/**
+ * A CoreProtocolManager
+ *
+ * @author Tim Fox
+ *
+ *
+ */
+public class CoreProtocolManager implements ProtocolManager
+{
+ private final HornetQServer server;
+
+ private final List<Interceptor> interceptors;
+
+ public CoreProtocolManager(final HornetQServer server,
+ final List<Interceptor> interceptors)
+ {
+ this.server = server;
+
+ this.interceptors = interceptors;
+ }
+
+ public ConnectionEntry createConnectionEntry(final Connection connection)
+ {
+ final Configuration config = server.getConfiguration();
+
+ CoreRemotingConnection rc = new RemotingConnectionImpl(connection,
+ interceptors,
+
config.isAsyncConnectionExecutionEnabled() ? server.getExecutorFactory().getExecutor()
+
: null);
+
+ Channel channel1 = rc.getChannel(1, -1);
+
+ ChannelHandler handler = new HornetQPacketHandler(this, server, channel1, rc);
+
+ channel1.setHandler(handler);
+
+ long ttl = HornetQClient.DEFAULT_CONNECTION_TTL;
+
+ if (config.getConnectionTTLOverride() != -1)
+ {
+ ttl = config.getConnectionTTLOverride();
+ }
+
+ final ConnectionEntry entry = new ConnectionEntry(rc, System.currentTimeMillis(),
ttl);
+
+ final Channel channel0 = rc.getChannel(0, -1);
+
+ channel0.setHandler(new ChannelHandler()
+ {
+ public void handlePacket(final Packet packet)
+ {
+ if (packet.getType() == PacketImpl.PING)
+ {
+ Ping ping = (Ping)packet;
+
+ if (config.getConnectionTTLOverride() == -1)
+ {
+ // Allow clients to specify connection ttl
+ entry.ttl = ping.getConnectionTTL();
+ }
+
+ // Just send a ping back
+ channel0.send(packet);
+ }
+ }
+ });
+
+ return entry;
+ }
+
+ private Map<String, ServerSessionPacketHandler> sessionHandlers =
+ new ConcurrentHashMap<String, ServerSessionPacketHandler>();
+
+ public ServerSessionPacketHandler getSessionHandler(final String sessionName)
+ {
+ return sessionHandlers.get(sessionName);
+ }
+
+ public void addSessionHandler(final String name, final ServerSessionPacketHandler
handler)
+ {
+ sessionHandlers.put(name, handler);
+ }
+
+ public void removeHandler(final String name)
+ {
+ sessionHandlers.remove(name);
+ }
+
+ public void bufferReceived(Object connectionID, HornetQBuffer buffer)
+ {
+ }
+
+ public int isReadyToHandle(HornetQBuffer buffer)
+ {
+ return -1;
+ }
+}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/CoreProtocolManagerFactory.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/impl/CoreProtocolManagerFactory.java 2010-01-21
20:09:23 UTC (rev 8832)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/CoreProtocolManagerFactory.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,36 +0,0 @@
-/*
- * Copyright 2010 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.protocol.core.impl;
-
-import java.util.List;
-
-import org.hornetq.api.core.Interceptor;
-import org.hornetq.core.server.HornetQServer;
-import org.hornetq.spi.core.protocol.ProtocolManager;
-import org.hornetq.spi.core.protocol.ProtocolManagerFactory;
-
-/**
- * A CoreProtocolManagerFactory
- *
- * @author Tim Fox
- *
- *
- */
-public class CoreProtocolManagerFactory implements ProtocolManagerFactory
-{
- public ProtocolManager createProtocolManager(final HornetQServer server, final
List<Interceptor> interceptors)
- {
- return new CoreProtocolManager(server, interceptors);
- }
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/CoreProtocolManagerFactory.java
(from rev 8832,
trunk/src/main/org/hornetq/core/protocol/core/impl/CoreProtocolManagerFactory.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/CoreProtocolManagerFactory.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/CoreProtocolManagerFactory.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2010 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.core.protocol.core.impl;
+
+import java.util.List;
+
+import org.hornetq.api.core.Interceptor;
+import org.hornetq.core.server.HornetQServer;
+import org.hornetq.spi.core.protocol.ProtocolManager;
+import org.hornetq.spi.core.protocol.ProtocolManagerFactory;
+
+/**
+ * A CoreProtocolManagerFactory
+ *
+ * @author Tim Fox
+ *
+ *
+ */
+public class CoreProtocolManagerFactory implements ProtocolManagerFactory
+{
+ public ProtocolManager createProtocolManager(final HornetQServer server, final
List<Interceptor> interceptors)
+ {
+ return new CoreProtocolManager(server, interceptors);
+ }
+}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/HornetQPacketHandler.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/impl/HornetQPacketHandler.java 2010-01-21
20:09:23 UTC (rev 8832)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/HornetQPacketHandler.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,315 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.protocol.core.impl;
-
-import static org.hornetq.core.protocol.core.impl.PacketImpl.CREATESESSION;
-import static org.hornetq.core.protocol.core.impl.PacketImpl.CREATE_QUEUE;
-import static org.hornetq.core.protocol.core.impl.PacketImpl.CREATE_REPLICATION;
-import static org.hornetq.core.protocol.core.impl.PacketImpl.REATTACH_SESSION;
-
-import org.hornetq.api.core.HornetQException;
-import org.hornetq.core.logging.Logger;
-import org.hornetq.core.protocol.core.Channel;
-import org.hornetq.core.protocol.core.ChannelHandler;
-import org.hornetq.core.protocol.core.CoreRemotingConnection;
-import org.hornetq.core.protocol.core.Packet;
-import org.hornetq.core.protocol.core.ServerSessionPacketHandler;
-import org.hornetq.core.protocol.core.impl.wireformat.CreateQueueMessage;
-import org.hornetq.core.protocol.core.impl.wireformat.CreateReplicationSessionMessage;
-import org.hornetq.core.protocol.core.impl.wireformat.CreateSessionMessage;
-import org.hornetq.core.protocol.core.impl.wireformat.CreateSessionResponseMessage;
-import org.hornetq.core.protocol.core.impl.wireformat.HornetQExceptionMessage;
-import org.hornetq.core.protocol.core.impl.wireformat.NullResponseMessage;
-import org.hornetq.core.protocol.core.impl.wireformat.ReattachSessionMessage;
-import org.hornetq.core.protocol.core.impl.wireformat.ReattachSessionResponseMessage;
-import org.hornetq.core.replication.ReplicationEndpoint;
-import org.hornetq.core.server.HornetQServer;
-import org.hornetq.core.server.ServerSession;
-import org.hornetq.core.version.Version;
-
-/**
- * A packet handler for all packets that need to be handled at the server level
- *
- * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- * @author <a href="ataylor(a)redhat.com">Andy Taylor</a>
- */
-public class HornetQPacketHandler implements ChannelHandler
-{
- private static final Logger log = Logger.getLogger(HornetQPacketHandler.class);
-
- private final HornetQServer server;
-
- private final Channel channel1;
-
- private final CoreRemotingConnection connection;
-
- private final CoreProtocolManager protocolManager;
-
- public HornetQPacketHandler(final CoreProtocolManager protocolManager,
- final HornetQServer server,
- final Channel channel1,
- final CoreRemotingConnection connection)
- {
- this.protocolManager = protocolManager;
-
- this.server = server;
-
- this.channel1 = channel1;
-
- this.connection = connection;
- }
-
- public void handlePacket(final Packet packet)
- {
- byte type = packet.getType();
-
- switch (type)
- {
- case CREATESESSION:
- {
- CreateSessionMessage request = (CreateSessionMessage)packet;
-
- handleCreateSession(request);
-
- break;
- }
- case REATTACH_SESSION:
- {
- ReattachSessionMessage request = (ReattachSessionMessage)packet;
-
- handleReattachSession(request);
-
- break;
- }
- case CREATE_QUEUE:
- {
- // Create queue can also be fielded here in the case of a replicated store
and forward queue creation
-
- CreateQueueMessage request = (CreateQueueMessage)packet;
-
- handleCreateQueue(request);
-
- break;
- }
- case CREATE_REPLICATION:
- {
- // Create queue can also be fielded here in the case of a replicated store
and forward queue creation
-
- CreateReplicationSessionMessage request =
(CreateReplicationSessionMessage)packet;
-
- handleCreateReplication(request);
-
- break;
- }
- default:
- {
- HornetQPacketHandler.log.error("Invalid packet " + packet);
- }
- }
- }
-
- private void handleCreateSession(final CreateSessionMessage request)
- {
- boolean incompatibleVersion = false;
- Packet response;
- try
- {
- Version version = server.getVersion();
-
- if (version.getIncrementingVersion() != request.getVersion())
- {
- log.warn("Client with version " + request.getVersion() +
- " and address " +
- connection.getRemoteAddress() +
- " is not compatible with server version " +
- version.getFullVersion() +
- ". " +
- "Please ensure all clients and servers are upgraded to the same
version for them to " +
- "interoperate properly");
- throw new
HornetQException(HornetQException.INCOMPATIBLE_CLIENT_SERVER_VERSIONS,
- "Server and client versions
incompatible");
- }
-
- if (!server.isStarted())
- {
- throw new HornetQException(HornetQException.SESSION_CREATION_REJECTED,
"Server not started");
- }
-
- if (!server.checkActivate())
- {
- throw new HornetQException(HornetQException.SESSION_CREATION_REJECTED,
- "Server will not accept create session
requests");
- }
-
- Channel channel = connection.getChannel(request.getSessionChannelID(),
request.getWindowSize());
-
- ServerSession session = server.createSession(request.getName(),
- request.getUsername(),
- request.getPassword(),
- request.getMinLargeMessageSize(),
- connection,
- request.isAutoCommitSends(),
- request.isAutoCommitAcks(),
- request.isPreAcknowledge(),
- request.isXA());
-
- ServerSessionPacketHandler handler = new
ServerSessionPacketHandler(protocolManager,
- session,
-
server.getStorageManager()
-
.newContext(server.getExecutorFactory()
-
.getExecutor()),
-
server.getStorageManager(),
- channel);
-
- session.setCallback(handler);
-
- channel.setHandler(handler);
-
- // TODO - where is this removed?
- protocolManager.addSessionHandler(request.getName(), handler);
-
- response = new
CreateSessionResponseMessage(server.getVersion().getIncrementingVersion());
- }
- catch (HornetQException e)
- {
- response = new HornetQExceptionMessage((HornetQException)e);
-
- if (e.getCode() == HornetQException.INCOMPATIBLE_CLIENT_SERVER_VERSIONS)
- {
- incompatibleVersion = true;
- }
- }
- catch (Exception e)
- {
- HornetQPacketHandler.log.error("Failed to create session", e);
-
- response = new HornetQExceptionMessage(new
HornetQException(HornetQException.INTERNAL_ERROR));
- }
-
- // send the exception to the client and destroy
- // the connection if the client and server versions
- // are not compatible
- if (incompatibleVersion)
- {
- channel1.sendAndFlush(response);
- }
- else
- {
- channel1.send(response);
- }
- }
-
- private void handleReattachSession(final ReattachSessionMessage request)
- {
- Packet response = null;
-
- try
- {
-
- if (!server.isStarted())
- {
- response = new ReattachSessionResponseMessage(-1, false);
- }
-
- ServerSessionPacketHandler sessionHandler =
protocolManager.getSessionHandler(request.getName());
-
- if (!server.checkActivate())
- {
- response = new ReattachSessionResponseMessage(-1, false);
- }
-
- if (sessionHandler == null)
- {
- response = new ReattachSessionResponseMessage(-1, false);
- }
- else
- {
- if (sessionHandler.getChannel().getConfirmationWindowSize() == -1)
- {
- // Even though session exists, we can't reattach since confi window
size == -1,
- // i.e. we don't have a resend cache for commands, so we just close
the old session
- // and let the client recreate
-
- sessionHandler.close();
-
- response = new ReattachSessionResponseMessage(-1, false);
- }
- else
- {
- // Reconnect the channel to the new connection
- int serverLastConfirmedCommandID =
sessionHandler.transferConnection(connection,
-
request.getLastConfirmedCommandID());
-
- response = new
ReattachSessionResponseMessage(serverLastConfirmedCommandID, true);
- }
- }
- }
- catch (Exception e)
- {
- HornetQPacketHandler.log.error("Failed to reattach session", e);
-
- response = new HornetQExceptionMessage(new
HornetQException(HornetQException.INTERNAL_ERROR));
- }
-
- channel1.send(response);
- }
-
- private void handleCreateQueue(final CreateQueueMessage request)
- {
- try
- {
- server.createQueue(request.getAddress(),
- request.getQueueName(),
- request.getFilterString(),
- request.isDurable(),
- request.isTemporary());
- }
- catch (Exception e)
- {
- HornetQPacketHandler.log.error("Failed to handle create queue", e);
- }
- }
-
- private void handleCreateReplication(final CreateReplicationSessionMessage request)
- {
- Packet response;
-
- try
- {
- Channel channel = connection.getChannel(request.getSessionChannelID(), -1);
-
- ReplicationEndpoint endpoint = server.connectToReplicationEndpoint(channel);
-
- channel.setHandler(endpoint);
-
- response = new NullResponseMessage();
- }
- catch (Exception e)
- {
- if (e instanceof HornetQException)
- {
- response = new HornetQExceptionMessage((HornetQException)e);
- }
- else
- {
- HornetQPacketHandler.log.warn(e.getMessage(), e);
- response = new HornetQExceptionMessage(new
HornetQException(HornetQException.INTERNAL_ERROR));
- }
- }
-
- channel1.send(response);
- }
-
-}
\ No newline at end of file
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/HornetQPacketHandler.java
(from rev 8832,
trunk/src/main/org/hornetq/core/protocol/core/impl/HornetQPacketHandler.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/HornetQPacketHandler.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/HornetQPacketHandler.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -0,0 +1,313 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.core.protocol.core.impl;
+
+import static org.hornetq.core.protocol.core.impl.PacketImpl.CREATESESSION;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.CREATE_QUEUE;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.CREATE_REPLICATION;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.REATTACH_SESSION;
+
+import org.hornetq.api.core.HornetQException;
+import org.hornetq.core.logging.Logger;
+import org.hornetq.core.protocol.core.Channel;
+import org.hornetq.core.protocol.core.ChannelHandler;
+import org.hornetq.core.protocol.core.CoreRemotingConnection;
+import org.hornetq.core.protocol.core.CoreSessionCallback;
+import org.hornetq.core.protocol.core.Packet;
+import org.hornetq.core.protocol.core.ServerSessionPacketHandler;
+import org.hornetq.core.protocol.core.impl.wireformat.CreateQueueMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.CreateReplicationSessionMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.CreateSessionMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.CreateSessionResponseMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.HornetQExceptionMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.NullResponseMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.ReattachSessionMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.ReattachSessionResponseMessage;
+import org.hornetq.core.replication.ReplicationEndpoint;
+import org.hornetq.core.server.HornetQServer;
+import org.hornetq.core.server.ServerSession;
+import org.hornetq.core.version.Version;
+
+/**
+ * A packet handler for all packets that need to be handled at the server level
+ *
+ * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ * @author <a href="ataylor(a)redhat.com">Andy Taylor</a>
+ */
+public class HornetQPacketHandler implements ChannelHandler
+{
+ private static final Logger log = Logger.getLogger(HornetQPacketHandler.class);
+
+ private final HornetQServer server;
+
+ private final Channel channel1;
+
+ private final CoreRemotingConnection connection;
+
+ private final CoreProtocolManager protocolManager;
+
+ public HornetQPacketHandler(final CoreProtocolManager protocolManager,
+ final HornetQServer server,
+ final Channel channel1,
+ final CoreRemotingConnection connection)
+ {
+ this.protocolManager = protocolManager;
+
+ this.server = server;
+
+ this.channel1 = channel1;
+
+ this.connection = connection;
+ }
+
+ public void handlePacket(final Packet packet)
+ {
+ byte type = packet.getType();
+
+ switch (type)
+ {
+ case CREATESESSION:
+ {
+ CreateSessionMessage request = (CreateSessionMessage)packet;
+
+ handleCreateSession(request);
+
+ break;
+ }
+ case REATTACH_SESSION:
+ {
+ ReattachSessionMessage request = (ReattachSessionMessage)packet;
+
+ handleReattachSession(request);
+
+ break;
+ }
+ case CREATE_QUEUE:
+ {
+ // Create queue can also be fielded here in the case of a replicated store
and forward queue creation
+
+ CreateQueueMessage request = (CreateQueueMessage)packet;
+
+ handleCreateQueue(request);
+
+ break;
+ }
+ case CREATE_REPLICATION:
+ {
+ // Create queue can also be fielded here in the case of a replicated store
and forward queue creation
+
+ CreateReplicationSessionMessage request =
(CreateReplicationSessionMessage)packet;
+
+ handleCreateReplication(request);
+
+ break;
+ }
+ default:
+ {
+ HornetQPacketHandler.log.error("Invalid packet " + packet);
+ }
+ }
+ }
+
+ private void handleCreateSession(final CreateSessionMessage request)
+ {
+ boolean incompatibleVersion = false;
+ Packet response;
+ try
+ {
+ Version version = server.getVersion();
+
+ if (version.getIncrementingVersion() != request.getVersion())
+ {
+ log.warn("Client with version " + request.getVersion() +
+ " and address " +
+ connection.getRemoteAddress() +
+ " is not compatible with server version " +
+ version.getFullVersion() +
+ ". " +
+ "Please ensure all clients and servers are upgraded to the same
version for them to " +
+ "interoperate properly");
+ throw new
HornetQException(HornetQException.INCOMPATIBLE_CLIENT_SERVER_VERSIONS,
+ "Server and client versions
incompatible");
+ }
+
+ if (!server.isStarted())
+ {
+ throw new HornetQException(HornetQException.SESSION_CREATION_REJECTED,
"Server not started");
+ }
+
+ if (!server.checkActivate())
+ {
+ throw new HornetQException(HornetQException.SESSION_CREATION_REJECTED,
+ "Server will not accept create session
requests");
+ }
+
+ Channel channel = connection.getChannel(request.getSessionChannelID(),
request.getWindowSize());
+
+ ServerSession session = server.createSession(request.getName(),
+ request.getUsername(),
+ request.getPassword(),
+ request.getMinLargeMessageSize(),
+ connection,
+ request.isAutoCommitSends(),
+ request.isAutoCommitAcks(),
+ request.isPreAcknowledge(),
+ request.isXA(),
+ new
CoreSessionCallback(request.getName(), protocolManager, channel));
+
+ ServerSessionPacketHandler handler = new ServerSessionPacketHandler(session,
+
server.getStorageManager()
+
.newContext(server.getExecutorFactory()
+
.getExecutor()),
+
server.getStorageManager(),
+ channel);
+ channel.setHandler(handler);
+
+ // TODO - where is this removed?
+ protocolManager.addSessionHandler(request.getName(), handler);
+
+ response = new
CreateSessionResponseMessage(server.getVersion().getIncrementingVersion());
+ }
+ catch (HornetQException e)
+ {
+ response = new HornetQExceptionMessage((HornetQException)e);
+
+ if (e.getCode() == HornetQException.INCOMPATIBLE_CLIENT_SERVER_VERSIONS)
+ {
+ incompatibleVersion = true;
+ }
+ }
+ catch (Exception e)
+ {
+ HornetQPacketHandler.log.error("Failed to create session", e);
+
+ response = new HornetQExceptionMessage(new
HornetQException(HornetQException.INTERNAL_ERROR));
+ }
+
+ // send the exception to the client and destroy
+ // the connection if the client and server versions
+ // are not compatible
+ if (incompatibleVersion)
+ {
+ channel1.sendAndFlush(response);
+ }
+ else
+ {
+ channel1.send(response);
+ }
+ }
+
+ private void handleReattachSession(final ReattachSessionMessage request)
+ {
+ Packet response = null;
+
+ try
+ {
+
+ if (!server.isStarted())
+ {
+ response = new ReattachSessionResponseMessage(-1, false);
+ }
+
+ ServerSessionPacketHandler sessionHandler =
protocolManager.getSessionHandler(request.getName());
+
+ if (!server.checkActivate())
+ {
+ response = new ReattachSessionResponseMessage(-1, false);
+ }
+
+ if (sessionHandler == null)
+ {
+ response = new ReattachSessionResponseMessage(-1, false);
+ }
+ else
+ {
+ if (sessionHandler.getChannel().getConfirmationWindowSize() == -1)
+ {
+ // Even though session exists, we can't reattach since confi window
size == -1,
+ // i.e. we don't have a resend cache for commands, so we just close
the old session
+ // and let the client recreate
+
+ sessionHandler.close();
+
+ response = new ReattachSessionResponseMessage(-1, false);
+ }
+ else
+ {
+ // Reconnect the channel to the new connection
+ int serverLastConfirmedCommandID =
sessionHandler.transferConnection(connection,
+
request.getLastConfirmedCommandID());
+
+ response = new
ReattachSessionResponseMessage(serverLastConfirmedCommandID, true);
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ HornetQPacketHandler.log.error("Failed to reattach session", e);
+
+ response = new HornetQExceptionMessage(new
HornetQException(HornetQException.INTERNAL_ERROR));
+ }
+
+ channel1.send(response);
+ }
+
+ private void handleCreateQueue(final CreateQueueMessage request)
+ {
+ try
+ {
+ server.createQueue(request.getAddress(),
+ request.getQueueName(),
+ request.getFilterString(),
+ request.isDurable(),
+ request.isTemporary());
+ }
+ catch (Exception e)
+ {
+ HornetQPacketHandler.log.error("Failed to handle create queue", e);
+ }
+ }
+
+ private void handleCreateReplication(final CreateReplicationSessionMessage request)
+ {
+ Packet response;
+
+ try
+ {
+ Channel channel = connection.getChannel(request.getSessionChannelID(), -1);
+
+ ReplicationEndpoint endpoint = server.connectToReplicationEndpoint(channel);
+
+ channel.setHandler(endpoint);
+
+ response = new NullResponseMessage();
+ }
+ catch (Exception e)
+ {
+ if (e instanceof HornetQException)
+ {
+ response = new HornetQExceptionMessage((HornetQException)e);
+ }
+ else
+ {
+ HornetQPacketHandler.log.warn(e.getMessage(), e);
+ response = new HornetQExceptionMessage(new
HornetQException(HornetQException.INTERNAL_ERROR));
+ }
+ }
+
+ channel1.send(response);
+ }
+
+}
\ No newline at end of file
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/PacketDecoder.java
===================================================================
--- trunk/src/main/org/hornetq/core/protocol/core/impl/PacketDecoder.java 2010-01-21
20:09:23 UTC (rev 8832)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/PacketDecoder.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,493 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.protocol.core.impl;
-
-import static org.hornetq.core.protocol.core.impl.PacketImpl.CREATESESSION;
-import static org.hornetq.core.protocol.core.impl.PacketImpl.CREATESESSION_RESP;
-import static org.hornetq.core.protocol.core.impl.PacketImpl.CREATE_QUEUE;
-import static org.hornetq.core.protocol.core.impl.PacketImpl.CREATE_REPLICATION;
-import static org.hornetq.core.protocol.core.impl.PacketImpl.DELETE_QUEUE;
-import static org.hornetq.core.protocol.core.impl.PacketImpl.DISCONNECT;
-import static org.hornetq.core.protocol.core.impl.PacketImpl.EXCEPTION;
-import static org.hornetq.core.protocol.core.impl.PacketImpl.NULL_RESPONSE;
-import static org.hornetq.core.protocol.core.impl.PacketImpl.PACKETS_CONFIRMED;
-import static org.hornetq.core.protocol.core.impl.PacketImpl.PING;
-import static org.hornetq.core.protocol.core.impl.PacketImpl.REATTACH_SESSION;
-import static org.hornetq.core.protocol.core.impl.PacketImpl.REATTACH_SESSION_RESP;
-import static org.hornetq.core.protocol.core.impl.PacketImpl.REPLICATION_APPEND;
-import static org.hornetq.core.protocol.core.impl.PacketImpl.REPLICATION_APPEND_TX;
-import static
org.hornetq.core.protocol.core.impl.PacketImpl.REPLICATION_COMMIT_ROLLBACK;
-import static org.hornetq.core.protocol.core.impl.PacketImpl.REPLICATION_COMPARE_DATA;
-import static org.hornetq.core.protocol.core.impl.PacketImpl.REPLICATION_DELETE;
-import static org.hornetq.core.protocol.core.impl.PacketImpl.REPLICATION_DELETE_TX;
-import static
org.hornetq.core.protocol.core.impl.PacketImpl.REPLICATION_LARGE_MESSAGE_BEGIN;
-import static
org.hornetq.core.protocol.core.impl.PacketImpl.REPLICATION_LARGE_MESSAGE_END;
-import static
org.hornetq.core.protocol.core.impl.PacketImpl.REPLICATION_LARGE_MESSAGE_WRITE;
-import static org.hornetq.core.protocol.core.impl.PacketImpl.REPLICATION_PAGE_EVENT;
-import static org.hornetq.core.protocol.core.impl.PacketImpl.REPLICATION_PAGE_WRITE;
-import static org.hornetq.core.protocol.core.impl.PacketImpl.REPLICATION_PREPARE;
-import static org.hornetq.core.protocol.core.impl.PacketImpl.REPLICATION_RESPONSE;
-import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_ACKNOWLEDGE;
-import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_BINDINGQUERY;
-import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_BINDINGQUERY_RESP;
-import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_CLOSE;
-import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_COMMIT;
-import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_CONSUMER_CLOSE;
-import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_CREATECONSUMER;
-import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_EXPIRED;
-import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_FLOWTOKEN;
-import static
org.hornetq.core.protocol.core.impl.PacketImpl.SESS_FORCE_CONSUMER_DELIVERY;
-import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_PRODUCER_CREDITS;
-import static
org.hornetq.core.protocol.core.impl.PacketImpl.SESS_PRODUCER_REQUEST_CREDITS;
-import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_QUEUEQUERY;
-import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_QUEUEQUERY_RESP;
-import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_RECEIVE_CONTINUATION;
-import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_RECEIVE_LARGE_MSG;
-import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_RECEIVE_MSG;
-import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_ROLLBACK;
-import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_SEND;
-import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_SEND_CONTINUATION;
-import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_SEND_LARGE;
-import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_START;
-import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_STOP;
-import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_XA_COMMIT;
-import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_XA_END;
-import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_XA_FORGET;
-import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_XA_GET_TIMEOUT;
-import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_XA_GET_TIMEOUT_RESP;
-import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_XA_INDOUBT_XIDS;
-import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_XA_INDOUBT_XIDS_RESP;
-import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_XA_JOIN;
-import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_XA_PREPARE;
-import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_XA_RESP;
-import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_XA_RESUME;
-import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_XA_ROLLBACK;
-import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_XA_SET_TIMEOUT;
-import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_XA_SET_TIMEOUT_RESP;
-import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_XA_START;
-import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_XA_SUSPEND;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.logging.Logger;
-import org.hornetq.core.protocol.core.Packet;
-import org.hornetq.core.protocol.core.impl.wireformat.CreateQueueMessage;
-import org.hornetq.core.protocol.core.impl.wireformat.CreateReplicationSessionMessage;
-import org.hornetq.core.protocol.core.impl.wireformat.CreateSessionMessage;
-import org.hornetq.core.protocol.core.impl.wireformat.CreateSessionResponseMessage;
-import org.hornetq.core.protocol.core.impl.wireformat.HornetQExceptionMessage;
-import org.hornetq.core.protocol.core.impl.wireformat.NullResponseMessage;
-import org.hornetq.core.protocol.core.impl.wireformat.PacketsConfirmedMessage;
-import org.hornetq.core.protocol.core.impl.wireformat.Ping;
-import org.hornetq.core.protocol.core.impl.wireformat.ReattachSessionMessage;
-import org.hornetq.core.protocol.core.impl.wireformat.ReattachSessionResponseMessage;
-import org.hornetq.core.protocol.core.impl.wireformat.ReplicationAddMessage;
-import org.hornetq.core.protocol.core.impl.wireformat.ReplicationAddTXMessage;
-import org.hornetq.core.protocol.core.impl.wireformat.ReplicationCommitMessage;
-import org.hornetq.core.protocol.core.impl.wireformat.ReplicationCompareDataMessage;
-import org.hornetq.core.protocol.core.impl.wireformat.ReplicationDeleteMessage;
-import org.hornetq.core.protocol.core.impl.wireformat.ReplicationDeleteTXMessage;
-import
org.hornetq.core.protocol.core.impl.wireformat.ReplicationLargeMessageBeingMessage;
-import
org.hornetq.core.protocol.core.impl.wireformat.ReplicationLargeMessageWriteMessage;
-import org.hornetq.core.protocol.core.impl.wireformat.ReplicationLargemessageEndMessage;
-import org.hornetq.core.protocol.core.impl.wireformat.ReplicationPageEventMessage;
-import org.hornetq.core.protocol.core.impl.wireformat.ReplicationPageWriteMessage;
-import org.hornetq.core.protocol.core.impl.wireformat.ReplicationPrepareMessage;
-import org.hornetq.core.protocol.core.impl.wireformat.ReplicationResponseMessage;
-import org.hornetq.core.protocol.core.impl.wireformat.RollbackMessage;
-import org.hornetq.core.protocol.core.impl.wireformat.SessionAcknowledgeMessage;
-import org.hornetq.core.protocol.core.impl.wireformat.SessionBindingQueryMessage;
-import
org.hornetq.core.protocol.core.impl.wireformat.SessionBindingQueryResponseMessage;
-import org.hornetq.core.protocol.core.impl.wireformat.SessionCloseMessage;
-import org.hornetq.core.protocol.core.impl.wireformat.SessionCommitMessage;
-import org.hornetq.core.protocol.core.impl.wireformat.SessionConsumerCloseMessage;
-import org.hornetq.core.protocol.core.impl.wireformat.SessionConsumerFlowCreditMessage;
-import org.hornetq.core.protocol.core.impl.wireformat.SessionCreateConsumerMessage;
-import org.hornetq.core.protocol.core.impl.wireformat.SessionDeleteQueueMessage;
-import org.hornetq.core.protocol.core.impl.wireformat.SessionExpiredMessage;
-import org.hornetq.core.protocol.core.impl.wireformat.SessionForceConsumerDelivery;
-import org.hornetq.core.protocol.core.impl.wireformat.SessionProducerCreditsMessage;
-import org.hornetq.core.protocol.core.impl.wireformat.SessionQueueQueryMessage;
-import org.hornetq.core.protocol.core.impl.wireformat.SessionQueueQueryResponseMessage;
-import org.hornetq.core.protocol.core.impl.wireformat.SessionReceiveContinuationMessage;
-import org.hornetq.core.protocol.core.impl.wireformat.SessionReceiveLargeMessage;
-import org.hornetq.core.protocol.core.impl.wireformat.SessionReceiveMessage;
-import
org.hornetq.core.protocol.core.impl.wireformat.SessionRequestProducerCreditsMessage;
-import org.hornetq.core.protocol.core.impl.wireformat.SessionSendContinuationMessage;
-import org.hornetq.core.protocol.core.impl.wireformat.SessionSendLargeMessage;
-import org.hornetq.core.protocol.core.impl.wireformat.SessionSendMessage;
-import org.hornetq.core.protocol.core.impl.wireformat.SessionXACommitMessage;
-import org.hornetq.core.protocol.core.impl.wireformat.SessionXAEndMessage;
-import org.hornetq.core.protocol.core.impl.wireformat.SessionXAForgetMessage;
-import
org.hornetq.core.protocol.core.impl.wireformat.SessionXAGetInDoubtXidsResponseMessage;
-import
org.hornetq.core.protocol.core.impl.wireformat.SessionXAGetTimeoutResponseMessage;
-import org.hornetq.core.protocol.core.impl.wireformat.SessionXAJoinMessage;
-import org.hornetq.core.protocol.core.impl.wireformat.SessionXAPrepareMessage;
-import org.hornetq.core.protocol.core.impl.wireformat.SessionXAResponseMessage;
-import org.hornetq.core.protocol.core.impl.wireformat.SessionXAResumeMessage;
-import org.hornetq.core.protocol.core.impl.wireformat.SessionXARollbackMessage;
-import org.hornetq.core.protocol.core.impl.wireformat.SessionXASetTimeoutMessage;
-import
org.hornetq.core.protocol.core.impl.wireformat.SessionXASetTimeoutResponseMessage;
-import org.hornetq.core.protocol.core.impl.wireformat.SessionXAStartMessage;
-
-/**
- * A PacketDecoder
- *
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- *
- *
- */
-public class PacketDecoder
-{
- private static final Logger log = Logger.getLogger(PacketDecoder.class);
-
- public Packet decode(final HornetQBuffer in)
- {
- final byte packetType = in.readByte();
-
- Packet packet;
-
- switch (packetType)
- {
- case PING:
- {
- packet = new Ping();
- break;
- }
- case DISCONNECT:
- {
- packet = new PacketImpl(PacketImpl.DISCONNECT);
- break;
- }
- case EXCEPTION:
- {
- packet = new HornetQExceptionMessage();
- break;
- }
- case PACKETS_CONFIRMED:
- {
- packet = new PacketsConfirmedMessage();
- break;
- }
- case CREATESESSION:
- {
- packet = new CreateSessionMessage();
- break;
- }
- case CREATESESSION_RESP:
- {
- packet = new CreateSessionResponseMessage();
- break;
- }
- case REATTACH_SESSION:
- {
- packet = new ReattachSessionMessage();
- break;
- }
- case REATTACH_SESSION_RESP:
- {
- packet = new ReattachSessionResponseMessage();
- break;
- }
- case SESS_CLOSE:
- {
- packet = new SessionCloseMessage();
- break;
- }
- case SESS_CREATECONSUMER:
- {
- packet = new SessionCreateConsumerMessage();
- break;
- }
- case SESS_ACKNOWLEDGE:
- {
- packet = new SessionAcknowledgeMessage();
- break;
- }
- case SESS_EXPIRED:
- {
- packet = new SessionExpiredMessage();
- break;
- }
- case SESS_COMMIT:
- {
- packet = new SessionCommitMessage();
- break;
- }
- case SESS_ROLLBACK:
- {
- packet = new RollbackMessage();
- break;
- }
- case SESS_QUEUEQUERY:
- {
- packet = new SessionQueueQueryMessage();
- break;
- }
- case SESS_QUEUEQUERY_RESP:
- {
- packet = new SessionQueueQueryResponseMessage();
- break;
- }
- case CREATE_QUEUE:
- {
- packet = new CreateQueueMessage();
- break;
- }
- case DELETE_QUEUE:
- {
- packet = new SessionDeleteQueueMessage();
- break;
- }
- case SESS_BINDINGQUERY:
- {
- packet = new SessionBindingQueryMessage();
- break;
- }
- case SESS_BINDINGQUERY_RESP:
- {
- packet = new SessionBindingQueryResponseMessage();
- break;
- }
- case SESS_XA_START:
- {
- packet = new SessionXAStartMessage();
- break;
- }
- case SESS_XA_END:
- {
- packet = new SessionXAEndMessage();
- break;
- }
- case SESS_XA_COMMIT:
- {
- packet = new SessionXACommitMessage();
- break;
- }
- case SESS_XA_PREPARE:
- {
- packet = new SessionXAPrepareMessage();
- break;
- }
- case SESS_XA_RESP:
- {
- packet = new SessionXAResponseMessage();
- break;
- }
- case SESS_XA_ROLLBACK:
- {
- packet = new SessionXARollbackMessage();
- break;
- }
- case SESS_XA_JOIN:
- {
- packet = new SessionXAJoinMessage();
- break;
- }
- case SESS_XA_SUSPEND:
- {
- packet = new PacketImpl(PacketImpl.SESS_XA_SUSPEND);
- break;
- }
- case SESS_XA_RESUME:
- {
- packet = new SessionXAResumeMessage();
- break;
- }
- case SESS_XA_FORGET:
- {
- packet = new SessionXAForgetMessage();
- break;
- }
- case SESS_XA_INDOUBT_XIDS:
- {
- packet = new PacketImpl(PacketImpl.SESS_XA_INDOUBT_XIDS);
- break;
- }
- case SESS_XA_INDOUBT_XIDS_RESP:
- {
- packet = new SessionXAGetInDoubtXidsResponseMessage();
- break;
- }
- case SESS_XA_SET_TIMEOUT:
- {
- packet = new SessionXASetTimeoutMessage();
- break;
- }
- case SESS_XA_SET_TIMEOUT_RESP:
- {
- packet = new SessionXASetTimeoutResponseMessage();
- break;
- }
- case SESS_XA_GET_TIMEOUT:
- {
- packet = new PacketImpl(PacketImpl.SESS_XA_GET_TIMEOUT);
- break;
- }
- case SESS_XA_GET_TIMEOUT_RESP:
- {
- packet = new SessionXAGetTimeoutResponseMessage();
- break;
- }
- case SESS_START:
- {
- packet = new PacketImpl(PacketImpl.SESS_START);
- break;
- }
- case SESS_STOP:
- {
- packet = new PacketImpl(PacketImpl.SESS_STOP);
- break;
- }
- case SESS_FLOWTOKEN:
- {
- packet = new SessionConsumerFlowCreditMessage();
- break;
- }
- case SESS_SEND:
- {
- packet = new SessionSendMessage();
- break;
- }
- case SESS_SEND_LARGE:
- {
- packet = new SessionSendLargeMessage();
- break;
- }
- case SESS_RECEIVE_MSG:
- {
- packet = new SessionReceiveMessage();
- break;
- }
- case SESS_RECEIVE_LARGE_MSG:
- {
- packet = new SessionReceiveLargeMessage();
- break;
- }
- case SESS_CONSUMER_CLOSE:
- {
- packet = new SessionConsumerCloseMessage();
- break;
- }
- case NULL_RESPONSE:
- {
- packet = new NullResponseMessage();
- break;
- }
- case SESS_RECEIVE_CONTINUATION:
- {
- packet = new SessionReceiveContinuationMessage();
- break;
- }
- case SESS_SEND_CONTINUATION:
- {
- packet = new SessionSendContinuationMessage();
- break;
- }
- case SESS_PRODUCER_REQUEST_CREDITS:
- {
- packet = new SessionRequestProducerCreditsMessage();
- break;
- }
- case SESS_PRODUCER_CREDITS:
- {
- packet = new SessionProducerCreditsMessage();
- break;
- }
- case CREATE_REPLICATION:
- {
- packet = new CreateReplicationSessionMessage();
- break;
- }
- case REPLICATION_APPEND:
- {
- packet = new ReplicationAddMessage();
- break;
- }
- case REPLICATION_APPEND_TX:
- {
- packet = new ReplicationAddTXMessage();
- break;
- }
- case REPLICATION_DELETE:
- {
- packet = new ReplicationDeleteMessage();
- break;
- }
- case REPLICATION_DELETE_TX:
- {
- packet = new ReplicationDeleteTXMessage();
- break;
- }
- case REPLICATION_PREPARE:
- {
- packet = new ReplicationPrepareMessage();
- break;
- }
- case REPLICATION_COMMIT_ROLLBACK:
- {
- packet = new ReplicationCommitMessage();
- break;
- }
- case REPLICATION_RESPONSE:
- {
- packet = new ReplicationResponseMessage();
- break;
- }
- case REPLICATION_PAGE_WRITE:
- {
- packet = new ReplicationPageWriteMessage();
- break;
- }
- case REPLICATION_PAGE_EVENT:
- {
- packet = new ReplicationPageEventMessage();
- break;
- }
- case REPLICATION_LARGE_MESSAGE_BEGIN:
- {
- packet = new ReplicationLargeMessageBeingMessage();
- break;
- }
- case REPLICATION_LARGE_MESSAGE_END:
- {
- packet = new ReplicationLargemessageEndMessage();
- break;
- }
- case REPLICATION_LARGE_MESSAGE_WRITE:
- {
- packet = new ReplicationLargeMessageWriteMessage();
- break;
- }
- case REPLICATION_COMPARE_DATA:
- {
- packet = new ReplicationCompareDataMessage();
- break;
- }
- case SESS_FORCE_CONSUMER_DELIVERY:
- {
- packet = new SessionForceConsumerDelivery();
- break;
- }
- default:
- {
- throw new IllegalArgumentException("Invalid type: " + packetType);
- }
- }
-
- packet.decode(in);
-
- return packet;
- }
-
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/PacketDecoder.java
(from rev 8832, trunk/src/main/org/hornetq/core/protocol/core/impl/PacketDecoder.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/PacketDecoder.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/PacketDecoder.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -0,0 +1,493 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.core.protocol.core.impl;
+
+import static org.hornetq.core.protocol.core.impl.PacketImpl.CREATESESSION;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.CREATESESSION_RESP;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.CREATE_QUEUE;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.CREATE_REPLICATION;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.DELETE_QUEUE;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.DISCONNECT;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.EXCEPTION;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.NULL_RESPONSE;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.PACKETS_CONFIRMED;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.PING;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.REATTACH_SESSION;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.REATTACH_SESSION_RESP;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.REPLICATION_APPEND;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.REPLICATION_APPEND_TX;
+import static
org.hornetq.core.protocol.core.impl.PacketImpl.REPLICATION_COMMIT_ROLLBACK;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.REPLICATION_COMPARE_DATA;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.REPLICATION_DELETE;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.REPLICATION_DELETE_TX;
+import static
org.hornetq.core.protocol.core.impl.PacketImpl.REPLICATION_LARGE_MESSAGE_BEGIN;
+import static
org.hornetq.core.protocol.core.impl.PacketImpl.REPLICATION_LARGE_MESSAGE_END;
+import static
org.hornetq.core.protocol.core.impl.PacketImpl.REPLICATION_LARGE_MESSAGE_WRITE;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.REPLICATION_PAGE_EVENT;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.REPLICATION_PAGE_WRITE;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.REPLICATION_PREPARE;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.REPLICATION_RESPONSE;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_ACKNOWLEDGE;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_BINDINGQUERY;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_BINDINGQUERY_RESP;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_CLOSE;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_COMMIT;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_CONSUMER_CLOSE;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_CREATECONSUMER;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_EXPIRED;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_FLOWTOKEN;
+import static
org.hornetq.core.protocol.core.impl.PacketImpl.SESS_FORCE_CONSUMER_DELIVERY;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_PRODUCER_CREDITS;
+import static
org.hornetq.core.protocol.core.impl.PacketImpl.SESS_PRODUCER_REQUEST_CREDITS;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_QUEUEQUERY;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_QUEUEQUERY_RESP;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_RECEIVE_CONTINUATION;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_RECEIVE_LARGE_MSG;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_RECEIVE_MSG;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_ROLLBACK;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_SEND;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_SEND_CONTINUATION;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_SEND_LARGE;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_START;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_STOP;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_XA_COMMIT;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_XA_END;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_XA_FORGET;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_XA_GET_TIMEOUT;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_XA_GET_TIMEOUT_RESP;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_XA_INDOUBT_XIDS;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_XA_INDOUBT_XIDS_RESP;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_XA_JOIN;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_XA_PREPARE;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_XA_RESP;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_XA_RESUME;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_XA_ROLLBACK;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_XA_SET_TIMEOUT;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_XA_SET_TIMEOUT_RESP;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_XA_START;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_XA_SUSPEND;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.logging.Logger;
+import org.hornetq.core.protocol.core.Packet;
+import org.hornetq.core.protocol.core.impl.wireformat.CreateQueueMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.CreateReplicationSessionMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.CreateSessionMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.CreateSessionResponseMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.HornetQExceptionMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.NullResponseMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.PacketsConfirmedMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.Ping;
+import org.hornetq.core.protocol.core.impl.wireformat.ReattachSessionMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.ReattachSessionResponseMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.ReplicationAddMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.ReplicationAddTXMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.ReplicationCommitMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.ReplicationCompareDataMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.ReplicationDeleteMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.ReplicationDeleteTXMessage;
+import
org.hornetq.core.protocol.core.impl.wireformat.ReplicationLargeMessageBeingMessage;
+import
org.hornetq.core.protocol.core.impl.wireformat.ReplicationLargeMessageWriteMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.ReplicationLargemessageEndMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.ReplicationPageEventMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.ReplicationPageWriteMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.ReplicationPrepareMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.ReplicationResponseMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.RollbackMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.SessionAcknowledgeMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.SessionBindingQueryMessage;
+import
org.hornetq.core.protocol.core.impl.wireformat.SessionBindingQueryResponseMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.SessionCloseMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.SessionCommitMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.SessionConsumerCloseMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.SessionConsumerFlowCreditMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.SessionCreateConsumerMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.SessionDeleteQueueMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.SessionExpiredMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.SessionForceConsumerDelivery;
+import org.hornetq.core.protocol.core.impl.wireformat.SessionProducerCreditsMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.SessionQueueQueryMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.SessionQueueQueryResponseMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.SessionReceiveContinuationMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.SessionReceiveLargeMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.SessionReceiveMessage;
+import
org.hornetq.core.protocol.core.impl.wireformat.SessionRequestProducerCreditsMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.SessionSendContinuationMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.SessionSendLargeMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.SessionSendMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.SessionXACommitMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.SessionXAEndMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.SessionXAForgetMessage;
+import
org.hornetq.core.protocol.core.impl.wireformat.SessionXAGetInDoubtXidsResponseMessage;
+import
org.hornetq.core.protocol.core.impl.wireformat.SessionXAGetTimeoutResponseMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.SessionXAJoinMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.SessionXAPrepareMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.SessionXAResponseMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.SessionXAResumeMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.SessionXARollbackMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.SessionXASetTimeoutMessage;
+import
org.hornetq.core.protocol.core.impl.wireformat.SessionXASetTimeoutResponseMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.SessionXAStartMessage;
+
+/**
+ * A PacketDecoder
+ *
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ *
+ *
+ */
+public class PacketDecoder
+{
+ private static final Logger log = Logger.getLogger(PacketDecoder.class);
+
+ public Packet decode(final HornetQBuffer in)
+ {
+ final byte packetType = in.readByte();
+
+ Packet packet;
+
+ switch (packetType)
+ {
+ case PING:
+ {
+ packet = new Ping();
+ break;
+ }
+ case DISCONNECT:
+ {
+ packet = new PacketImpl(PacketImpl.DISCONNECT);
+ break;
+ }
+ case EXCEPTION:
+ {
+ packet = new HornetQExceptionMessage();
+ break;
+ }
+ case PACKETS_CONFIRMED:
+ {
+ packet = new PacketsConfirmedMessage();
+ break;
+ }
+ case CREATESESSION:
+ {
+ packet = new CreateSessionMessage();
+ break;
+ }
+ case CREATESESSION_RESP:
+ {
+ packet = new CreateSessionResponseMessage();
+ break;
+ }
+ case REATTACH_SESSION:
+ {
+ packet = new ReattachSessionMessage();
+ break;
+ }
+ case REATTACH_SESSION_RESP:
+ {
+ packet = new ReattachSessionResponseMessage();
+ break;
+ }
+ case SESS_CLOSE:
+ {
+ packet = new SessionCloseMessage();
+ break;
+ }
+ case SESS_CREATECONSUMER:
+ {
+ packet = new SessionCreateConsumerMessage();
+ break;
+ }
+ case SESS_ACKNOWLEDGE:
+ {
+ packet = new SessionAcknowledgeMessage();
+ break;
+ }
+ case SESS_EXPIRED:
+ {
+ packet = new SessionExpiredMessage();
+ break;
+ }
+ case SESS_COMMIT:
+ {
+ packet = new SessionCommitMessage();
+ break;
+ }
+ case SESS_ROLLBACK:
+ {
+ packet = new RollbackMessage();
+ break;
+ }
+ case SESS_QUEUEQUERY:
+ {
+ packet = new SessionQueueQueryMessage();
+ break;
+ }
+ case SESS_QUEUEQUERY_RESP:
+ {
+ packet = new SessionQueueQueryResponseMessage();
+ break;
+ }
+ case CREATE_QUEUE:
+ {
+ packet = new CreateQueueMessage();
+ break;
+ }
+ case DELETE_QUEUE:
+ {
+ packet = new SessionDeleteQueueMessage();
+ break;
+ }
+ case SESS_BINDINGQUERY:
+ {
+ packet = new SessionBindingQueryMessage();
+ break;
+ }
+ case SESS_BINDINGQUERY_RESP:
+ {
+ packet = new SessionBindingQueryResponseMessage();
+ break;
+ }
+ case SESS_XA_START:
+ {
+ packet = new SessionXAStartMessage();
+ break;
+ }
+ case SESS_XA_END:
+ {
+ packet = new SessionXAEndMessage();
+ break;
+ }
+ case SESS_XA_COMMIT:
+ {
+ packet = new SessionXACommitMessage();
+ break;
+ }
+ case SESS_XA_PREPARE:
+ {
+ packet = new SessionXAPrepareMessage();
+ break;
+ }
+ case SESS_XA_RESP:
+ {
+ packet = new SessionXAResponseMessage();
+ break;
+ }
+ case SESS_XA_ROLLBACK:
+ {
+ packet = new SessionXARollbackMessage();
+ break;
+ }
+ case SESS_XA_JOIN:
+ {
+ packet = new SessionXAJoinMessage();
+ break;
+ }
+ case SESS_XA_SUSPEND:
+ {
+ packet = new PacketImpl(PacketImpl.SESS_XA_SUSPEND);
+ break;
+ }
+ case SESS_XA_RESUME:
+ {
+ packet = new SessionXAResumeMessage();
+ break;
+ }
+ case SESS_XA_FORGET:
+ {
+ packet = new SessionXAForgetMessage();
+ break;
+ }
+ case SESS_XA_INDOUBT_XIDS:
+ {
+ packet = new PacketImpl(PacketImpl.SESS_XA_INDOUBT_XIDS);
+ break;
+ }
+ case SESS_XA_INDOUBT_XIDS_RESP:
+ {
+ packet = new SessionXAGetInDoubtXidsResponseMessage();
+ break;
+ }
+ case SESS_XA_SET_TIMEOUT:
+ {
+ packet = new SessionXASetTimeoutMessage();
+ break;
+ }
+ case SESS_XA_SET_TIMEOUT_RESP:
+ {
+ packet = new SessionXASetTimeoutResponseMessage();
+ break;
+ }
+ case SESS_XA_GET_TIMEOUT:
+ {
+ packet = new PacketImpl(PacketImpl.SESS_XA_GET_TIMEOUT);
+ break;
+ }
+ case SESS_XA_GET_TIMEOUT_RESP:
+ {
+ packet = new SessionXAGetTimeoutResponseMessage();
+ break;
+ }
+ case SESS_START:
+ {
+ packet = new PacketImpl(PacketImpl.SESS_START);
+ break;
+ }
+ case SESS_STOP:
+ {
+ packet = new PacketImpl(PacketImpl.SESS_STOP);
+ break;
+ }
+ case SESS_FLOWTOKEN:
+ {
+ packet = new SessionConsumerFlowCreditMessage();
+ break;
+ }
+ case SESS_SEND:
+ {
+ packet = new SessionSendMessage();
+ break;
+ }
+ case SESS_SEND_LARGE:
+ {
+ packet = new SessionSendLargeMessage();
+ break;
+ }
+ case SESS_RECEIVE_MSG:
+ {
+ packet = new SessionReceiveMessage();
+ break;
+ }
+ case SESS_RECEIVE_LARGE_MSG:
+ {
+ packet = new SessionReceiveLargeMessage();
+ break;
+ }
+ case SESS_CONSUMER_CLOSE:
+ {
+ packet = new SessionConsumerCloseMessage();
+ break;
+ }
+ case NULL_RESPONSE:
+ {
+ packet = new NullResponseMessage();
+ break;
+ }
+ case SESS_RECEIVE_CONTINUATION:
+ {
+ packet = new SessionReceiveContinuationMessage();
+ break;
+ }
+ case SESS_SEND_CONTINUATION:
+ {
+ packet = new SessionSendContinuationMessage();
+ break;
+ }
+ case SESS_PRODUCER_REQUEST_CREDITS:
+ {
+ packet = new SessionRequestProducerCreditsMessage();
+ break;
+ }
+ case SESS_PRODUCER_CREDITS:
+ {
+ packet = new SessionProducerCreditsMessage();
+ break;
+ }
+ case CREATE_REPLICATION:
+ {
+ packet = new CreateReplicationSessionMessage();
+ break;
+ }
+ case REPLICATION_APPEND:
+ {
+ packet = new ReplicationAddMessage();
+ break;
+ }
+ case REPLICATION_APPEND_TX:
+ {
+ packet = new ReplicationAddTXMessage();
+ break;
+ }
+ case REPLICATION_DELETE:
+ {
+ packet = new ReplicationDeleteMessage();
+ break;
+ }
+ case REPLICATION_DELETE_TX:
+ {
+ packet = new ReplicationDeleteTXMessage();
+ break;
+ }
+ case REPLICATION_PREPARE:
+ {
+ packet = new ReplicationPrepareMessage();
+ break;
+ }
+ case REPLICATION_COMMIT_ROLLBACK:
+ {
+ packet = new ReplicationCommitMessage();
+ break;
+ }
+ case REPLICATION_RESPONSE:
+ {
+ packet = new ReplicationResponseMessage();
+ break;
+ }
+ case REPLICATION_PAGE_WRITE:
+ {
+ packet = new ReplicationPageWriteMessage();
+ break;
+ }
+ case REPLICATION_PAGE_EVENT:
+ {
+ packet = new ReplicationPageEventMessage();
+ break;
+ }
+ case REPLICATION_LARGE_MESSAGE_BEGIN:
+ {
+ packet = new ReplicationLargeMessageBeingMessage();
+ break;
+ }
+ case REPLICATION_LARGE_MESSAGE_END:
+ {
+ packet = new ReplicationLargemessageEndMessage();
+ break;
+ }
+ case REPLICATION_LARGE_MESSAGE_WRITE:
+ {
+ packet = new ReplicationLargeMessageWriteMessage();
+ break;
+ }
+ case REPLICATION_COMPARE_DATA:
+ {
+ packet = new ReplicationCompareDataMessage();
+ break;
+ }
+ case SESS_FORCE_CONSUMER_DELIVERY:
+ {
+ packet = new SessionForceConsumerDelivery();
+ break;
+ }
+ default:
+ {
+ throw new IllegalArgumentException("Invalid type: " + packetType);
+ }
+ }
+
+ packet.decode(in);
+
+ return packet;
+ }
+
+}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/PacketImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/protocol/core/impl/PacketImpl.java 2010-01-21 20:09:23
UTC (rev 8832)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/PacketImpl.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,311 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.protocol.core.impl;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.logging.Logger;
-import org.hornetq.core.protocol.core.Packet;
-import org.hornetq.spi.core.protocol.RemotingConnection;
-import org.hornetq.utils.DataConstants;
-
-/**
- * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- * @version <tt>$Revision$</tt>
- */
-public class PacketImpl implements Packet
-{
- // Constants
-------------------------------------------------------------------------
-
- private static final Logger log = Logger.getLogger(PacketImpl.class);
-
- // The minimal size for all the packets, Common data for all the packets (look at
PacketImpl.encode)
- public static final int PACKET_HEADERS_SIZE = DataConstants.SIZE_INT +
DataConstants.SIZE_BYTE +
- DataConstants.SIZE_LONG;
-
- private static final int INITIAL_PACKET_SIZE = 1500;
-
- protected long channelID;
-
- protected final byte type;
-
- protected int size = -1;
-
- // The packet types
- //
-----------------------------------------------------------------------------------
-
- public static final byte PING = 10;
-
- public static final byte DISCONNECT = 11;
-
- // Miscellaneous
- public static final byte EXCEPTION = 20;
-
- public static final byte NULL_RESPONSE = 21;
-
- public static final byte PACKETS_CONFIRMED = 22;
-
- // Server
- public static final byte CREATESESSION = 30;
-
- public static final byte CREATESESSION_RESP = 31;
-
- public static final byte REATTACH_SESSION = 32;
-
- public static final byte REATTACH_SESSION_RESP = 33;
-
- public static final byte CREATE_QUEUE = 34;
-
- public static final byte DELETE_QUEUE = 35;
-
- public static final byte CREATE_REPLICATION = 36;
-
- // Session
- public static final byte SESS_CREATECONSUMER = 40;
-
- public static final byte SESS_ACKNOWLEDGE = 41;
-
- public static final byte SESS_EXPIRED = 42;
-
- public static final byte SESS_COMMIT = 43;
-
- public static final byte SESS_ROLLBACK = 44;
-
- public static final byte SESS_QUEUEQUERY = 45;
-
- public static final byte SESS_QUEUEQUERY_RESP = 46;
-
- public static final byte SESS_BINDINGQUERY = 49;
-
- public static final byte SESS_BINDINGQUERY_RESP = 50;
-
- public static final byte SESS_XA_START = 51;
-
- public static final byte SESS_XA_END = 52;
-
- public static final byte SESS_XA_COMMIT = 53;
-
- public static final byte SESS_XA_PREPARE = 54;
-
- public static final byte SESS_XA_RESP = 55;
-
- public static final byte SESS_XA_ROLLBACK = 56;
-
- public static final byte SESS_XA_JOIN = 57;
-
- public static final byte SESS_XA_SUSPEND = 58;
-
- public static final byte SESS_XA_RESUME = 59;
-
- public static final byte SESS_XA_FORGET = 60;
-
- public static final byte SESS_XA_INDOUBT_XIDS = 61;
-
- public static final byte SESS_XA_INDOUBT_XIDS_RESP = 62;
-
- public static final byte SESS_XA_SET_TIMEOUT = 63;
-
- public static final byte SESS_XA_SET_TIMEOUT_RESP = 64;
-
- public static final byte SESS_XA_GET_TIMEOUT = 65;
-
- public static final byte SESS_XA_GET_TIMEOUT_RESP = 66;
-
- public static final byte SESS_START = 67;
-
- public static final byte SESS_STOP = 68;
-
- public static final byte SESS_CLOSE = 69;
-
- public static final byte SESS_FLOWTOKEN = 70;
-
- public static final byte SESS_SEND = 71;
-
- public static final byte SESS_SEND_LARGE = 72;
-
- public static final byte SESS_SEND_CONTINUATION = 73;
-
- public static final byte SESS_CONSUMER_CLOSE = 74;
-
- public static final byte SESS_RECEIVE_MSG = 75;
-
- public static final byte SESS_RECEIVE_LARGE_MSG = 76;
-
- public static final byte SESS_RECEIVE_CONTINUATION = 77;
-
- public static final byte SESS_FORCE_CONSUMER_DELIVERY = 78;
-
- public static final byte SESS_PRODUCER_REQUEST_CREDITS = 79;
-
- public static final byte SESS_PRODUCER_CREDITS = 80;
-
- // Replication
-
- public static final byte REPLICATION_RESPONSE = 90;
-
- public static final byte REPLICATION_APPEND = 91;
-
- public static final byte REPLICATION_APPEND_TX = 92;
-
- public static final byte REPLICATION_DELETE = 93;
-
- public static final byte REPLICATION_DELETE_TX = 94;
-
- public static final byte REPLICATION_PREPARE = 95;
-
- public static final byte REPLICATION_COMMIT_ROLLBACK = 96;
-
- public static final byte REPLICATION_PAGE_WRITE = 97;
-
- public static final byte REPLICATION_PAGE_EVENT = 98;
-
- public static final byte REPLICATION_LARGE_MESSAGE_BEGIN = 99;
-
- public static final byte REPLICATION_LARGE_MESSAGE_END = 100;
-
- public static final byte REPLICATION_LARGE_MESSAGE_WRITE = 101;
-
- public static final byte REPLICATION_COMPARE_DATA = 102;
-
- public static final byte REPLICATION_SYNC = 103;
-
- // Static --------------------------------------------------------
-
- public PacketImpl(final byte type)
- {
- this.type = type;
- }
-
- // Public --------------------------------------------------------
-
- public byte getType()
- {
- return type;
- }
-
- public long getChannelID()
- {
- return channelID;
- }
-
- public void setChannelID(final long channelID)
- {
- this.channelID = channelID;
- }
-
- public HornetQBuffer encode(final RemotingConnection connection)
- {
- HornetQBuffer buffer = connection.createBuffer(PacketImpl.INITIAL_PACKET_SIZE);
-
- // The standard header fields
-
- buffer.writeInt(0); // The length gets filled in at the end
- buffer.writeByte(type);
- buffer.writeLong(channelID);
-
- encodeRest(buffer);
-
- size = buffer.writerIndex();
-
- // The length doesn't include the actual length byte
- int len = size - DataConstants.SIZE_INT;
-
- buffer.setInt(0, len);
-
- return buffer;
- }
-
- public void decode(final HornetQBuffer buffer)
- {
- channelID = buffer.readLong();
-
- decodeRest(buffer);
-
- size = buffer.readerIndex();
- }
-
- public int getPacketSize()
- {
- if (size == -1)
- {
- throw new IllegalStateException("Packet hasn't been encoded/decoded
yet");
- }
-
- return size;
- }
-
- public boolean isResponse()
- {
- return false;
- }
-
- public void encodeRest(final HornetQBuffer buffer)
- {
- }
-
- public void decodeRest(final HornetQBuffer buffer)
- {
- }
-
- public boolean isRequiresConfirmations()
- {
- return true;
- }
-
- public boolean isAsyncExec()
- {
- return false;
- }
-
- @Override
- public String toString()
- {
- return getParentString() + "]";
- }
-
- @Override
- public boolean equals(final Object other)
- {
- if (other instanceof PacketImpl == false)
- {
- return false;
- }
-
- PacketImpl r = (PacketImpl)other;
-
- return r.type == type && r.channelID == channelID;
- }
-
- // Package protected ---------------------------------------------
-
- protected String getParentString()
- {
- return "PACKET[type=" + type + ", channelID=" + channelID +
"]";
- }
-
- // Protected -----------------------------------------------------
-
- protected int stringEncodeSize(final String str)
- {
- return DataConstants.SIZE_INT + str.length() * 2;
- }
-
- protected int nullableStringEncodeSize(final String str)
- {
- return DataConstants.SIZE_BOOLEAN + (str != null ? stringEncodeSize(str) : 0);
- }
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/PacketImpl.java
(from rev 8832, trunk/src/main/org/hornetq/core/protocol/core/impl/PacketImpl.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/PacketImpl.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/PacketImpl.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -0,0 +1,311 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.core.protocol.core.impl;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.logging.Logger;
+import org.hornetq.core.protocol.core.Packet;
+import org.hornetq.spi.core.protocol.RemotingConnection;
+import org.hornetq.utils.DataConstants;
+
+/**
+ * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ * @version <tt>$Revision$</tt>
+ */
+public class PacketImpl implements Packet
+{
+ // Constants
-------------------------------------------------------------------------
+
+ private static final Logger log = Logger.getLogger(PacketImpl.class);
+
+ // The minimal size for all the packets, Common data for all the packets (look at
PacketImpl.encode)
+ public static final int PACKET_HEADERS_SIZE = DataConstants.SIZE_INT +
DataConstants.SIZE_BYTE +
+ DataConstants.SIZE_LONG;
+
+ private static final int INITIAL_PACKET_SIZE = 1500;
+
+ protected long channelID;
+
+ protected final byte type;
+
+ protected int size = -1;
+
+ // The packet types
+ //
-----------------------------------------------------------------------------------
+
+ public static final byte PING = 10;
+
+ public static final byte DISCONNECT = 11;
+
+ // Miscellaneous
+ public static final byte EXCEPTION = 20;
+
+ public static final byte NULL_RESPONSE = 21;
+
+ public static final byte PACKETS_CONFIRMED = 22;
+
+ // Server
+ public static final byte CREATESESSION = 30;
+
+ public static final byte CREATESESSION_RESP = 31;
+
+ public static final byte REATTACH_SESSION = 32;
+
+ public static final byte REATTACH_SESSION_RESP = 33;
+
+ public static final byte CREATE_QUEUE = 34;
+
+ public static final byte DELETE_QUEUE = 35;
+
+ public static final byte CREATE_REPLICATION = 36;
+
+ // Session
+ public static final byte SESS_CREATECONSUMER = 40;
+
+ public static final byte SESS_ACKNOWLEDGE = 41;
+
+ public static final byte SESS_EXPIRED = 42;
+
+ public static final byte SESS_COMMIT = 43;
+
+ public static final byte SESS_ROLLBACK = 44;
+
+ public static final byte SESS_QUEUEQUERY = 45;
+
+ public static final byte SESS_QUEUEQUERY_RESP = 46;
+
+ public static final byte SESS_BINDINGQUERY = 49;
+
+ public static final byte SESS_BINDINGQUERY_RESP = 50;
+
+ public static final byte SESS_XA_START = 51;
+
+ public static final byte SESS_XA_END = 52;
+
+ public static final byte SESS_XA_COMMIT = 53;
+
+ public static final byte SESS_XA_PREPARE = 54;
+
+ public static final byte SESS_XA_RESP = 55;
+
+ public static final byte SESS_XA_ROLLBACK = 56;
+
+ public static final byte SESS_XA_JOIN = 57;
+
+ public static final byte SESS_XA_SUSPEND = 58;
+
+ public static final byte SESS_XA_RESUME = 59;
+
+ public static final byte SESS_XA_FORGET = 60;
+
+ public static final byte SESS_XA_INDOUBT_XIDS = 61;
+
+ public static final byte SESS_XA_INDOUBT_XIDS_RESP = 62;
+
+ public static final byte SESS_XA_SET_TIMEOUT = 63;
+
+ public static final byte SESS_XA_SET_TIMEOUT_RESP = 64;
+
+ public static final byte SESS_XA_GET_TIMEOUT = 65;
+
+ public static final byte SESS_XA_GET_TIMEOUT_RESP = 66;
+
+ public static final byte SESS_START = 67;
+
+ public static final byte SESS_STOP = 68;
+
+ public static final byte SESS_CLOSE = 69;
+
+ public static final byte SESS_FLOWTOKEN = 70;
+
+ public static final byte SESS_SEND = 71;
+
+ public static final byte SESS_SEND_LARGE = 72;
+
+ public static final byte SESS_SEND_CONTINUATION = 73;
+
+ public static final byte SESS_CONSUMER_CLOSE = 74;
+
+ public static final byte SESS_RECEIVE_MSG = 75;
+
+ public static final byte SESS_RECEIVE_LARGE_MSG = 76;
+
+ public static final byte SESS_RECEIVE_CONTINUATION = 77;
+
+ public static final byte SESS_FORCE_CONSUMER_DELIVERY = 78;
+
+ public static final byte SESS_PRODUCER_REQUEST_CREDITS = 79;
+
+ public static final byte SESS_PRODUCER_CREDITS = 80;
+
+ // Replication
+
+ public static final byte REPLICATION_RESPONSE = 90;
+
+ public static final byte REPLICATION_APPEND = 91;
+
+ public static final byte REPLICATION_APPEND_TX = 92;
+
+ public static final byte REPLICATION_DELETE = 93;
+
+ public static final byte REPLICATION_DELETE_TX = 94;
+
+ public static final byte REPLICATION_PREPARE = 95;
+
+ public static final byte REPLICATION_COMMIT_ROLLBACK = 96;
+
+ public static final byte REPLICATION_PAGE_WRITE = 97;
+
+ public static final byte REPLICATION_PAGE_EVENT = 98;
+
+ public static final byte REPLICATION_LARGE_MESSAGE_BEGIN = 99;
+
+ public static final byte REPLICATION_LARGE_MESSAGE_END = 100;
+
+ public static final byte REPLICATION_LARGE_MESSAGE_WRITE = 101;
+
+ public static final byte REPLICATION_COMPARE_DATA = 102;
+
+ public static final byte REPLICATION_SYNC = 103;
+
+ // Static --------------------------------------------------------
+
+ public PacketImpl(final byte type)
+ {
+ this.type = type;
+ }
+
+ // Public --------------------------------------------------------
+
+ public byte getType()
+ {
+ return type;
+ }
+
+ public long getChannelID()
+ {
+ return channelID;
+ }
+
+ public void setChannelID(final long channelID)
+ {
+ this.channelID = channelID;
+ }
+
+ public HornetQBuffer encode(final RemotingConnection connection)
+ {
+ HornetQBuffer buffer = connection.createBuffer(PacketImpl.INITIAL_PACKET_SIZE);
+
+ // The standard header fields
+
+ buffer.writeInt(0); // The length gets filled in at the end
+ buffer.writeByte(type);
+ buffer.writeLong(channelID);
+
+ encodeRest(buffer);
+
+ size = buffer.writerIndex();
+
+ // The length doesn't include the actual length byte
+ int len = size - DataConstants.SIZE_INT;
+
+ buffer.setInt(0, len);
+
+ return buffer;
+ }
+
+ public void decode(final HornetQBuffer buffer)
+ {
+ channelID = buffer.readLong();
+
+ decodeRest(buffer);
+
+ size = buffer.readerIndex();
+ }
+
+ public int getPacketSize()
+ {
+ if (size == -1)
+ {
+ throw new IllegalStateException("Packet hasn't been encoded/decoded
yet");
+ }
+
+ return size;
+ }
+
+ public boolean isResponse()
+ {
+ return false;
+ }
+
+ public void encodeRest(final HornetQBuffer buffer)
+ {
+ }
+
+ public void decodeRest(final HornetQBuffer buffer)
+ {
+ }
+
+ public boolean isRequiresConfirmations()
+ {
+ return true;
+ }
+
+ public boolean isAsyncExec()
+ {
+ return false;
+ }
+
+ @Override
+ public String toString()
+ {
+ return getParentString() + "]";
+ }
+
+ @Override
+ public boolean equals(final Object other)
+ {
+ if (other instanceof PacketImpl == false)
+ {
+ return false;
+ }
+
+ PacketImpl r = (PacketImpl)other;
+
+ return r.type == type && r.channelID == channelID;
+ }
+
+ // Package protected ---------------------------------------------
+
+ protected String getParentString()
+ {
+ return "PACKET[type=" + type + ", channelID=" + channelID +
"]";
+ }
+
+ // Protected -----------------------------------------------------
+
+ protected int stringEncodeSize(final String str)
+ {
+ return DataConstants.SIZE_INT + str.length() * 2;
+ }
+
+ protected int nullableStringEncodeSize(final String str)
+ {
+ return DataConstants.SIZE_BOOLEAN + (str != null ? stringEncodeSize(str) : 0);
+ }
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/RemotingConnectionImpl.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/impl/RemotingConnectionImpl.java 2010-01-21
20:09:23 UTC (rev 8832)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/RemotingConnectionImpl.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,511 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.protocol.core.impl;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.CopyOnWriteArrayList;
-import java.util.concurrent.Executor;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.api.core.HornetQException;
-import org.hornetq.api.core.Interceptor;
-import org.hornetq.core.logging.Logger;
-import org.hornetq.core.protocol.core.Channel;
-import org.hornetq.core.protocol.core.CoreRemotingConnection;
-import org.hornetq.core.protocol.core.Packet;
-import org.hornetq.core.remoting.CloseListener;
-import org.hornetq.core.remoting.FailureListener;
-import org.hornetq.spi.core.remoting.Connection;
-import org.hornetq.utils.SimpleIDGenerator;
-
-/**
- * @author <a href="tim.fox(a)jboss.com">Tim Fox</a>
- * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
- * @version <tt>$Revision$</tt> $Id$
- */
-public class RemotingConnectionImpl extends AbstractBufferHandler implements
CoreRemotingConnection
-{
- // Constants
- //
------------------------------------------------------------------------------------
-
- private static final Logger log = Logger.getLogger(RemotingConnectionImpl.class);
-
- // Static
- //
---------------------------------------------------------------------------------------
-
- // Attributes
- //
-----------------------------------------------------------------------------------
-
- private final Connection transportConnection;
-
- private final Map<Long, Channel> channels = new ConcurrentHashMap<Long,
Channel>();
-
- private final List<FailureListener> failureListeners = new
CopyOnWriteArrayList<FailureListener>();
-
- private final List<CloseListener> closeListeners = new
CopyOnWriteArrayList<CloseListener>();
-
- private final long blockingCallTimeout;
-
- private final List<Interceptor> interceptors;
-
- private volatile boolean destroyed;
-
- private final boolean client;
-
- // Channels 0-9 are reserved for the system
- // 0 is for pinging
- // 1 is for session creation and attachment
- // 2 is for replication
- private volatile SimpleIDGenerator idGenerator = new SimpleIDGenerator(10);
-
- private boolean idGeneratorSynced = false;
-
- private final Object transferLock = new Object();
-
- private final Object failLock = new Object();
-
- private final PacketDecoder decoder = new PacketDecoder();
-
- private volatile boolean dataReceived;
-
- private final Executor executor;
-
- private volatile boolean executing;
-
- // Constructors
- // ---------------------------------------------------------------------------------
-
- /*
- * Create a client side connection
- */
- public RemotingConnectionImpl(final Connection transportConnection,
- final long blockingCallTimeout,
- final List<Interceptor> interceptors)
- {
- this(transportConnection, blockingCallTimeout, interceptors, true, null);
- }
-
- /*
- * Create a server side connection
- */
- public RemotingConnectionImpl(final Connection transportConnection,
- final List<Interceptor> interceptors,
- final Executor executor)
-
- {
- this(transportConnection, -1, interceptors, false, executor);
- }
-
- private RemotingConnectionImpl(final Connection transportConnection,
- final long blockingCallTimeout,
- final List<Interceptor> interceptors,
- final boolean client,
- final Executor executor)
-
- {
- this.transportConnection = transportConnection;
-
- this.blockingCallTimeout = blockingCallTimeout;
-
- this.interceptors = interceptors;
-
- this.client = client;
-
- this.executor = executor;
- }
-
- // RemotingConnection implementation
- // ------------------------------------------------------------
-
- public Connection getTransportConnection()
- {
- return transportConnection;
- }
-
- public List<FailureListener> getFailureListeners()
- {
- return new ArrayList<FailureListener>(failureListeners);
- }
-
- public void setFailureListeners(final List<FailureListener> listeners)
- {
- failureListeners.clear();
-
- failureListeners.addAll(listeners);
- }
-
- public Object getID()
- {
- return transportConnection.getID();
- }
-
- public String getRemoteAddress()
- {
- return transportConnection.getRemoteAddress();
- }
-
- public synchronized Channel getChannel(final long channelID, final int
confWindowSize)
- {
- Channel channel = channels.get(channelID);
-
- if (channel == null)
- {
- channel = new ChannelImpl(this, channelID, confWindowSize);
-
- channels.put(channelID, channel);
- }
-
- return channel;
- }
-
- public synchronized boolean removeChannel(final long channelID)
- {
- return channels.remove(channelID) != null;
- }
-
- public synchronized void putChannel(final long channelID, final Channel channel)
- {
- channels.put(channelID, channel);
- }
-
- public void addFailureListener(final FailureListener listener)
- {
- if (listener == null)
- {
- throw new IllegalStateException("FailureListener cannot be null");
- }
-
- failureListeners.add(listener);
- }
-
- public boolean removeFailureListener(final FailureListener listener)
- {
- if (listener == null)
- {
- throw new IllegalStateException("FailureListener cannot be null");
- }
-
- return failureListeners.remove(listener);
- }
-
- public void addCloseListener(final CloseListener listener)
- {
- if (listener == null)
- {
- throw new IllegalStateException("CloseListener cannot be null");
- }
-
- closeListeners.add(listener);
- }
-
- public boolean removeCloseListener(final CloseListener listener)
- {
- if (listener == null)
- {
- throw new IllegalStateException("CloseListener cannot be null");
- }
-
- return closeListeners.remove(listener);
- }
-
- public HornetQBuffer createBuffer(final int size)
- {
- return transportConnection.createBuffer(size);
- }
-
- /*
- * This can be called concurrently by more than one thread so needs to be locked
- */
- public void fail(final HornetQException me)
- {
- synchronized (failLock)
- {
- if (destroyed)
- {
- return;
- }
-
- destroyed = true;
- }
-
- RemotingConnectionImpl.log.warn("Connection failure has been detected: "
+ me.getMessage() +
- " [code=" +
- me.getCode() +
- "]");
-
- // Then call the listeners
- callFailureListeners(me);
-
- callClosingListeners();
-
- internalClose();
-
- for (Channel channel : channels.values())
- {
- channel.returnBlocking();
- }
- }
-
- public void destroy()
- {
- synchronized (failLock)
- {
- if (destroyed)
- {
- return;
- }
-
- destroyed = true;
- }
-
- internalClose();
-
- callClosingListeners();
- }
-
- public void disconnect()
- {
- Channel channel0 = getChannel(0, -1);
-
- // And we remove all channels from the connection, this ensures no more packets
will be processed after this
- // method is
- // complete
-
- Set<Channel> allChannels = new HashSet<Channel>(channels.values());
-
- removeAllChannels();
-
- // Now we are 100% sure that no more packets will be processed we can flush then
send the disconnect
-
- for (Channel channel: allChannels)
- {
- channel.flushConfirmations();
- }
-
- channel0.sendAndFlush(new PacketImpl(PacketImpl.DISCONNECT));
- }
-
- public long generateChannelID()
- {
- return idGenerator.generateID();
- }
-
- public synchronized void syncIDGeneratorSequence(final long id)
- {
- if (!idGeneratorSynced)
- {
- idGenerator = new SimpleIDGenerator(id);
-
- idGeneratorSynced = true;
- }
- }
-
- public long getIDGeneratorSequence()
- {
- return idGenerator.getCurrentID();
- }
-
- public Object getTransferLock()
- {
- return transferLock;
- }
-
- public boolean isClient()
- {
- return client;
- }
-
- public boolean isDestroyed()
- {
- return destroyed;
- }
-
- public long getBlockingCallTimeout()
- {
- return blockingCallTimeout;
- }
-
- public boolean checkDataReceived()
- {
- boolean res = dataReceived;
-
- dataReceived = false;
-
- return res;
- }
-
- //We flush any confirmations on the connection - this prevents idle bridges for
example
- //sitting there with many unacked messages
- public void flush()
- {
- synchronized (transferLock)
- {
- for (Channel channel : channels.values())
- {
- channel.flushConfirmations();
- }
- }
- }
-
- // Buffer Handler implementation
- // ----------------------------------------------------
-
- public void bufferReceived(final Object connectionID, final HornetQBuffer buffer)
- {
- final Packet packet = decoder.decode(buffer);
-
- if (packet.isAsyncExec() && executor != null)
- {
- executing = true;
-
- executor.execute(new Runnable()
- {
- public void run()
- {
- try
- {
- doBufferReceived(packet);
- }
- catch (Throwable t)
- {
- RemotingConnectionImpl.log.error("Unexpected error", t);
- }
-
- executing = false;
- }
- });
- }
- else
- {
- //To prevent out of order execution if interleaving sync and async operations on
same connection
- while (executing)
- {
- Thread.yield();
- }
-
- // Pings must always be handled out of band so we can send pings back to the
client quickly
- // otherwise they would get in the queue with everything else which might give
an intolerable delay
- doBufferReceived(packet);
- }
-
- dataReceived = true;
- }
-
- private void doBufferReceived(final Packet packet)
- {
- if (interceptors != null)
- {
- for (final Interceptor interceptor : interceptors)
- {
- try
- {
- boolean callNext = interceptor.intercept(packet, this);
-
- if (!callNext)
- {
- return;
- }
- }
- catch (final Throwable e)
- {
- RemotingConnectionImpl.log.warn("Failure in calling interceptor:
" + interceptor, e);
- }
- }
- }
-
- synchronized (transferLock)
- {
- final Channel channel = channels.get(packet.getChannelID());
-
- if (channel != null)
- {
- channel.handlePacket(packet);
- }
- }
- }
-
- // Package protected
- // ----------------------------------------------------------------------------
-
- // Protected
- //
------------------------------------------------------------------------------------
-
- // Private
- //
--------------------------------------------------------------------------------------
-
- private void removeAllChannels()
- {
- // We get the transfer lock first - this ensures no packets are being processed
AND
- // it's guaranteed no more packets will be processed once this method is
complete
- synchronized (transferLock)
- {
- channels.clear();
- }
- }
- private void callFailureListeners(final HornetQException me)
- {
- final List<FailureListener> listenersClone = new
ArrayList<FailureListener>(failureListeners);
-
- for (final FailureListener listener : listenersClone)
- {
- try
- {
- listener.connectionFailed(me);
- }
- catch (final Throwable t)
- {
- // Failure of one listener to execute shouldn't prevent others
- // from
- // executing
- RemotingConnectionImpl.log.error("Failed to execute failure
listener", t);
- }
- }
- }
-
- private void callClosingListeners()
- {
- final List<CloseListener> listenersClone = new
ArrayList<CloseListener>(closeListeners);
-
- for (final CloseListener listener : listenersClone)
- {
- try
- {
- listener.connectionClosed();
- }
- catch (final Throwable t)
- {
- // Failure of one listener to execute shouldn't prevent others
- // from
- // executing
- RemotingConnectionImpl.log.error("Failed to execute failure
listener", t);
- }
- }
- }
-
- private void internalClose()
- {
- // We close the underlying transport connection
- transportConnection.close();
-
- for (Channel channel : channels.values())
- {
- channel.close();
- }
- }
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/RemotingConnectionImpl.java
(from rev 8832,
trunk/src/main/org/hornetq/core/protocol/core/impl/RemotingConnectionImpl.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/RemotingConnectionImpl.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/RemotingConnectionImpl.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -0,0 +1,511 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.core.protocol.core.impl;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.concurrent.Executor;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.api.core.HornetQException;
+import org.hornetq.api.core.Interceptor;
+import org.hornetq.core.logging.Logger;
+import org.hornetq.core.protocol.core.Channel;
+import org.hornetq.core.protocol.core.CoreRemotingConnection;
+import org.hornetq.core.protocol.core.Packet;
+import org.hornetq.core.remoting.CloseListener;
+import org.hornetq.core.remoting.FailureListener;
+import org.hornetq.spi.core.remoting.Connection;
+import org.hornetq.utils.SimpleIDGenerator;
+
+/**
+ * @author <a href="tim.fox(a)jboss.com">Tim Fox</a>
+ * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
+ * @version <tt>$Revision$</tt> $Id$
+ */
+public class RemotingConnectionImpl extends AbstractBufferHandler implements
CoreRemotingConnection
+{
+ // Constants
+ //
------------------------------------------------------------------------------------
+
+ private static final Logger log = Logger.getLogger(RemotingConnectionImpl.class);
+
+ // Static
+ //
---------------------------------------------------------------------------------------
+
+ // Attributes
+ //
-----------------------------------------------------------------------------------
+
+ private final Connection transportConnection;
+
+ private final Map<Long, Channel> channels = new ConcurrentHashMap<Long,
Channel>();
+
+ private final List<FailureListener> failureListeners = new
CopyOnWriteArrayList<FailureListener>();
+
+ private final List<CloseListener> closeListeners = new
CopyOnWriteArrayList<CloseListener>();
+
+ private final long blockingCallTimeout;
+
+ private final List<Interceptor> interceptors;
+
+ private volatile boolean destroyed;
+
+ private final boolean client;
+
+ // Channels 0-9 are reserved for the system
+ // 0 is for pinging
+ // 1 is for session creation and attachment
+ // 2 is for replication
+ private volatile SimpleIDGenerator idGenerator = new SimpleIDGenerator(10);
+
+ private boolean idGeneratorSynced = false;
+
+ private final Object transferLock = new Object();
+
+ private final Object failLock = new Object();
+
+ private final PacketDecoder decoder = new PacketDecoder();
+
+ private volatile boolean dataReceived;
+
+ private final Executor executor;
+
+ private volatile boolean executing;
+
+ // Constructors
+ // ---------------------------------------------------------------------------------
+
+ /*
+ * Create a client side connection
+ */
+ public RemotingConnectionImpl(final Connection transportConnection,
+ final long blockingCallTimeout,
+ final List<Interceptor> interceptors)
+ {
+ this(transportConnection, blockingCallTimeout, interceptors, true, null);
+ }
+
+ /*
+ * Create a server side connection
+ */
+ public RemotingConnectionImpl(final Connection transportConnection,
+ final List<Interceptor> interceptors,
+ final Executor executor)
+
+ {
+ this(transportConnection, -1, interceptors, false, executor);
+ }
+
+ private RemotingConnectionImpl(final Connection transportConnection,
+ final long blockingCallTimeout,
+ final List<Interceptor> interceptors,
+ final boolean client,
+ final Executor executor)
+
+ {
+ this.transportConnection = transportConnection;
+
+ this.blockingCallTimeout = blockingCallTimeout;
+
+ this.interceptors = interceptors;
+
+ this.client = client;
+
+ this.executor = executor;
+ }
+
+ // RemotingConnection implementation
+ // ------------------------------------------------------------
+
+ public Connection getTransportConnection()
+ {
+ return transportConnection;
+ }
+
+ public List<FailureListener> getFailureListeners()
+ {
+ return new ArrayList<FailureListener>(failureListeners);
+ }
+
+ public void setFailureListeners(final List<FailureListener> listeners)
+ {
+ failureListeners.clear();
+
+ failureListeners.addAll(listeners);
+ }
+
+ public Object getID()
+ {
+ return transportConnection.getID();
+ }
+
+ public String getRemoteAddress()
+ {
+ return transportConnection.getRemoteAddress();
+ }
+
+ public synchronized Channel getChannel(final long channelID, final int
confWindowSize)
+ {
+ Channel channel = channels.get(channelID);
+
+ if (channel == null)
+ {
+ channel = new ChannelImpl(this, channelID, confWindowSize);
+
+ channels.put(channelID, channel);
+ }
+
+ return channel;
+ }
+
+ public synchronized boolean removeChannel(final long channelID)
+ {
+ return channels.remove(channelID) != null;
+ }
+
+ public synchronized void putChannel(final long channelID, final Channel channel)
+ {
+ channels.put(channelID, channel);
+ }
+
+ public void addFailureListener(final FailureListener listener)
+ {
+ if (listener == null)
+ {
+ throw new IllegalStateException("FailureListener cannot be null");
+ }
+
+ failureListeners.add(listener);
+ }
+
+ public boolean removeFailureListener(final FailureListener listener)
+ {
+ if (listener == null)
+ {
+ throw new IllegalStateException("FailureListener cannot be null");
+ }
+
+ return failureListeners.remove(listener);
+ }
+
+ public void addCloseListener(final CloseListener listener)
+ {
+ if (listener == null)
+ {
+ throw new IllegalStateException("CloseListener cannot be null");
+ }
+
+ closeListeners.add(listener);
+ }
+
+ public boolean removeCloseListener(final CloseListener listener)
+ {
+ if (listener == null)
+ {
+ throw new IllegalStateException("CloseListener cannot be null");
+ }
+
+ return closeListeners.remove(listener);
+ }
+
+ public HornetQBuffer createBuffer(final int size)
+ {
+ return transportConnection.createBuffer(size);
+ }
+
+ /*
+ * This can be called concurrently by more than one thread so needs to be locked
+ */
+ public void fail(final HornetQException me)
+ {
+ synchronized (failLock)
+ {
+ if (destroyed)
+ {
+ return;
+ }
+
+ destroyed = true;
+ }
+
+ RemotingConnectionImpl.log.warn("Connection failure has been detected: "
+ me.getMessage() +
+ " [code=" +
+ me.getCode() +
+ "]");
+
+ // Then call the listeners
+ callFailureListeners(me);
+
+ callClosingListeners();
+
+ internalClose();
+
+ for (Channel channel : channels.values())
+ {
+ channel.returnBlocking();
+ }
+ }
+
+ public void destroy()
+ {
+ synchronized (failLock)
+ {
+ if (destroyed)
+ {
+ return;
+ }
+
+ destroyed = true;
+ }
+
+ internalClose();
+
+ callClosingListeners();
+ }
+
+ public void disconnect()
+ {
+ Channel channel0 = getChannel(0, -1);
+
+ // And we remove all channels from the connection, this ensures no more packets
will be processed after this
+ // method is
+ // complete
+
+ Set<Channel> allChannels = new HashSet<Channel>(channels.values());
+
+ removeAllChannels();
+
+ // Now we are 100% sure that no more packets will be processed we can flush then
send the disconnect
+
+ for (Channel channel: allChannels)
+ {
+ channel.flushConfirmations();
+ }
+
+ channel0.sendAndFlush(new PacketImpl(PacketImpl.DISCONNECT));
+ }
+
+ public long generateChannelID()
+ {
+ return idGenerator.generateID();
+ }
+
+ public synchronized void syncIDGeneratorSequence(final long id)
+ {
+ if (!idGeneratorSynced)
+ {
+ idGenerator = new SimpleIDGenerator(id);
+
+ idGeneratorSynced = true;
+ }
+ }
+
+ public long getIDGeneratorSequence()
+ {
+ return idGenerator.getCurrentID();
+ }
+
+ public Object getTransferLock()
+ {
+ return transferLock;
+ }
+
+ public boolean isClient()
+ {
+ return client;
+ }
+
+ public boolean isDestroyed()
+ {
+ return destroyed;
+ }
+
+ public long getBlockingCallTimeout()
+ {
+ return blockingCallTimeout;
+ }
+
+ public boolean checkDataReceived()
+ {
+ boolean res = dataReceived;
+
+ dataReceived = false;
+
+ return res;
+ }
+
+ //We flush any confirmations on the connection - this prevents idle bridges for
example
+ //sitting there with many unacked messages
+ public void flush()
+ {
+ synchronized (transferLock)
+ {
+ for (Channel channel : channels.values())
+ {
+ channel.flushConfirmations();
+ }
+ }
+ }
+
+ // Buffer Handler implementation
+ // ----------------------------------------------------
+
+ public void bufferReceived(final Object connectionID, final HornetQBuffer buffer)
+ {
+ final Packet packet = decoder.decode(buffer);
+
+ if (packet.isAsyncExec() && executor != null)
+ {
+ executing = true;
+
+ executor.execute(new Runnable()
+ {
+ public void run()
+ {
+ try
+ {
+ doBufferReceived(packet);
+ }
+ catch (Throwable t)
+ {
+ RemotingConnectionImpl.log.error("Unexpected error", t);
+ }
+
+ executing = false;
+ }
+ });
+ }
+ else
+ {
+ //To prevent out of order execution if interleaving sync and async operations on
same connection
+ while (executing)
+ {
+ Thread.yield();
+ }
+
+ // Pings must always be handled out of band so we can send pings back to the
client quickly
+ // otherwise they would get in the queue with everything else which might give
an intolerable delay
+ doBufferReceived(packet);
+ }
+
+ dataReceived = true;
+ }
+
+ private void doBufferReceived(final Packet packet)
+ {
+ if (interceptors != null)
+ {
+ for (final Interceptor interceptor : interceptors)
+ {
+ try
+ {
+ boolean callNext = interceptor.intercept(packet, this);
+
+ if (!callNext)
+ {
+ return;
+ }
+ }
+ catch (final Throwable e)
+ {
+ RemotingConnectionImpl.log.warn("Failure in calling interceptor:
" + interceptor, e);
+ }
+ }
+ }
+
+ synchronized (transferLock)
+ {
+ final Channel channel = channels.get(packet.getChannelID());
+
+ if (channel != null)
+ {
+ channel.handlePacket(packet);
+ }
+ }
+ }
+
+ // Package protected
+ // ----------------------------------------------------------------------------
+
+ // Protected
+ //
------------------------------------------------------------------------------------
+
+ // Private
+ //
--------------------------------------------------------------------------------------
+
+ private void removeAllChannels()
+ {
+ // We get the transfer lock first - this ensures no packets are being processed
AND
+ // it's guaranteed no more packets will be processed once this method is
complete
+ synchronized (transferLock)
+ {
+ channels.clear();
+ }
+ }
+ private void callFailureListeners(final HornetQException me)
+ {
+ final List<FailureListener> listenersClone = new
ArrayList<FailureListener>(failureListeners);
+
+ for (final FailureListener listener : listenersClone)
+ {
+ try
+ {
+ listener.connectionFailed(me);
+ }
+ catch (final Throwable t)
+ {
+ // Failure of one listener to execute shouldn't prevent others
+ // from
+ // executing
+ RemotingConnectionImpl.log.error("Failed to execute failure
listener", t);
+ }
+ }
+ }
+
+ private void callClosingListeners()
+ {
+ final List<CloseListener> listenersClone = new
ArrayList<CloseListener>(closeListeners);
+
+ for (final CloseListener listener : listenersClone)
+ {
+ try
+ {
+ listener.connectionClosed();
+ }
+ catch (final Throwable t)
+ {
+ // Failure of one listener to execute shouldn't prevent others
+ // from
+ // executing
+ RemotingConnectionImpl.log.error("Failed to execute failure
listener", t);
+ }
+ }
+ }
+
+ private void internalClose()
+ {
+ // We close the underlying transport connection
+ transportConnection.close();
+
+ for (Channel channel : channels.values())
+ {
+ channel.close();
+ }
+ }
+}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat
(from rev 8832, trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat)
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/CreateQueueMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/CreateQueueMessage.java 2010-01-21
20:09:23 UTC (rev 8832)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/CreateQueueMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,163 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.protocol.core.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.api.core.SimpleString;
-import org.hornetq.core.logging.Logger;
-import org.hornetq.core.protocol.core.impl.PacketImpl;
-
-/**
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
-
- * @version <tt>$Revision$</tt>
- */
-public class CreateQueueMessage extends PacketImpl
-{
- // Constants -----------------------------------------------------
-
- private static final Logger log = Logger.getLogger(CreateQueueMessage.class);
-
- // Attributes ----------------------------------------------------
-
- private SimpleString address;
-
- private SimpleString queueName;
-
- private SimpleString filterString;
-
- private boolean durable;
-
- private boolean temporary;
-
- private boolean requiresResponse;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public CreateQueueMessage(final SimpleString address,
- final SimpleString queueName,
- final SimpleString filterString,
- final boolean durable,
- final boolean temporary,
- final boolean requiresResponse)
- {
- super(PacketImpl.CREATE_QUEUE);
-
- this.address = address;
- this.queueName = queueName;
- this.filterString = filterString;
- this.durable = durable;
- this.temporary = temporary;
- this.requiresResponse = requiresResponse;
- }
-
- public CreateQueueMessage()
- {
- super(PacketImpl.CREATE_QUEUE);
- }
-
- // Public --------------------------------------------------------
-
- @Override
- public String toString()
- {
- StringBuffer buff = new StringBuffer(getParentString());
- buff.append(", address=" + address);
- buff.append(", queueName=" + queueName);
- buff.append(", filterString=" + filterString);
- buff.append(", durable=" + durable);
- buff.append(", temporary=" + temporary);
- buff.append("]");
- return buff.toString();
- }
-
- public SimpleString getAddress()
- {
- return address;
- }
-
- public SimpleString getQueueName()
- {
- return queueName;
- }
-
- public SimpleString getFilterString()
- {
- return filterString;
- }
-
- public boolean isDurable()
- {
- return durable;
- }
-
- public boolean isTemporary()
- {
- return temporary;
- }
-
- public boolean isRequiresResponse()
- {
- return requiresResponse;
- }
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeSimpleString(address);
- buffer.writeSimpleString(queueName);
- buffer.writeNullableSimpleString(filterString);
- buffer.writeBoolean(durable);
- buffer.writeBoolean(temporary);
- buffer.writeBoolean(requiresResponse);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- address = buffer.readSimpleString();
- queueName = buffer.readSimpleString();
- filterString = buffer.readNullableSimpleString();
- durable = buffer.readBoolean();
- temporary = buffer.readBoolean();
- requiresResponse = buffer.readBoolean();
- }
-
- @Override
- public boolean equals(final Object other)
- {
- if (other instanceof CreateQueueMessage == false)
- {
- return false;
- }
-
- CreateQueueMessage r = (CreateQueueMessage)other;
-
- return super.equals(other) && r.address.equals(address) &&
- r.queueName.equals(queueName) &&
- (r.filterString == null ? filterString == null :
r.filterString.equals(filterString)) &&
- r.durable == durable &&
- r.temporary == temporary;
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/CreateQueueMessage.java
(from rev 8832,
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/CreateQueueMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/CreateQueueMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/CreateQueueMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -0,0 +1,163 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.core.protocol.core.impl.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.api.core.SimpleString;
+import org.hornetq.core.logging.Logger;
+import org.hornetq.core.protocol.core.impl.PacketImpl;
+
+/**
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+
+ * @version <tt>$Revision$</tt>
+ */
+public class CreateQueueMessage extends PacketImpl
+{
+ // Constants -----------------------------------------------------
+
+ private static final Logger log = Logger.getLogger(CreateQueueMessage.class);
+
+ // Attributes ----------------------------------------------------
+
+ private SimpleString address;
+
+ private SimpleString queueName;
+
+ private SimpleString filterString;
+
+ private boolean durable;
+
+ private boolean temporary;
+
+ private boolean requiresResponse;
+
+ // Static --------------------------------------------------------
+
+ // Constructors --------------------------------------------------
+
+ public CreateQueueMessage(final SimpleString address,
+ final SimpleString queueName,
+ final SimpleString filterString,
+ final boolean durable,
+ final boolean temporary,
+ final boolean requiresResponse)
+ {
+ super(PacketImpl.CREATE_QUEUE);
+
+ this.address = address;
+ this.queueName = queueName;
+ this.filterString = filterString;
+ this.durable = durable;
+ this.temporary = temporary;
+ this.requiresResponse = requiresResponse;
+ }
+
+ public CreateQueueMessage()
+ {
+ super(PacketImpl.CREATE_QUEUE);
+ }
+
+ // Public --------------------------------------------------------
+
+ @Override
+ public String toString()
+ {
+ StringBuffer buff = new StringBuffer(getParentString());
+ buff.append(", address=" + address);
+ buff.append(", queueName=" + queueName);
+ buff.append(", filterString=" + filterString);
+ buff.append(", durable=" + durable);
+ buff.append(", temporary=" + temporary);
+ buff.append("]");
+ return buff.toString();
+ }
+
+ public SimpleString getAddress()
+ {
+ return address;
+ }
+
+ public SimpleString getQueueName()
+ {
+ return queueName;
+ }
+
+ public SimpleString getFilterString()
+ {
+ return filterString;
+ }
+
+ public boolean isDurable()
+ {
+ return durable;
+ }
+
+ public boolean isTemporary()
+ {
+ return temporary;
+ }
+
+ public boolean isRequiresResponse()
+ {
+ return requiresResponse;
+ }
+
+ @Override
+ public void encodeRest(final HornetQBuffer buffer)
+ {
+ buffer.writeSimpleString(address);
+ buffer.writeSimpleString(queueName);
+ buffer.writeNullableSimpleString(filterString);
+ buffer.writeBoolean(durable);
+ buffer.writeBoolean(temporary);
+ buffer.writeBoolean(requiresResponse);
+ }
+
+ @Override
+ public void decodeRest(final HornetQBuffer buffer)
+ {
+ address = buffer.readSimpleString();
+ queueName = buffer.readSimpleString();
+ filterString = buffer.readNullableSimpleString();
+ durable = buffer.readBoolean();
+ temporary = buffer.readBoolean();
+ requiresResponse = buffer.readBoolean();
+ }
+
+ @Override
+ public boolean equals(final Object other)
+ {
+ if (other instanceof CreateQueueMessage == false)
+ {
+ return false;
+ }
+
+ CreateQueueMessage r = (CreateQueueMessage)other;
+
+ return super.equals(other) && r.address.equals(address) &&
+ r.queueName.equals(queueName) &&
+ (r.filterString == null ? filterString == null :
r.filterString.equals(filterString)) &&
+ r.durable == durable &&
+ r.temporary == temporary;
+ }
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/CreateReplicationSessionMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/CreateReplicationSessionMessage.java 2010-01-21
20:09:23 UTC (rev 8832)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/CreateReplicationSessionMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,75 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.protocol.core.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.protocol.core.impl.PacketImpl;
-
-/**
- * @author <a href="mailto:tim.fox@jboss.com">Clebert Suconic</a>
- */
-public class CreateReplicationSessionMessage extends PacketImpl
-{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private long sessionChannelID;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public CreateReplicationSessionMessage(final long sessionChannelID)
- {
- super(PacketImpl.CREATE_REPLICATION);
-
- this.sessionChannelID = sessionChannelID;
- }
-
- public CreateReplicationSessionMessage()
- {
- super(PacketImpl.CREATE_REPLICATION);
- }
-
- // Public --------------------------------------------------------
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeLong(sessionChannelID);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- sessionChannelID = buffer.readLong();
- }
-
- /**
- * @return the sessionChannelID
- */
- public long getSessionChannelID()
- {
- return sessionChannelID;
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/CreateReplicationSessionMessage.java
(from rev 8832,
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/CreateReplicationSessionMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/CreateReplicationSessionMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/CreateReplicationSessionMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -0,0 +1,75 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.core.protocol.core.impl.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.protocol.core.impl.PacketImpl;
+
+/**
+ * @author <a href="mailto:tim.fox@jboss.com">Clebert Suconic</a>
+ */
+public class CreateReplicationSessionMessage extends PacketImpl
+{
+ // Constants -----------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
+ private long sessionChannelID;
+
+ // Static --------------------------------------------------------
+
+ // Constructors --------------------------------------------------
+
+ public CreateReplicationSessionMessage(final long sessionChannelID)
+ {
+ super(PacketImpl.CREATE_REPLICATION);
+
+ this.sessionChannelID = sessionChannelID;
+ }
+
+ public CreateReplicationSessionMessage()
+ {
+ super(PacketImpl.CREATE_REPLICATION);
+ }
+
+ // Public --------------------------------------------------------
+
+ @Override
+ public void encodeRest(final HornetQBuffer buffer)
+ {
+ buffer.writeLong(sessionChannelID);
+ }
+
+ @Override
+ public void decodeRest(final HornetQBuffer buffer)
+ {
+ sessionChannelID = buffer.readLong();
+ }
+
+ /**
+ * @return the sessionChannelID
+ */
+ public long getSessionChannelID()
+ {
+ return sessionChannelID;
+ }
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/CreateSessionMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/CreateSessionMessage.java 2010-01-21
20:09:23 UTC (rev 8832)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/CreateSessionMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,223 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.protocol.core.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.protocol.core.impl.PacketImpl;
-
-/**
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>.
- *
- * @version <tt>$Revision$</tt>
- */
-public class CreateSessionMessage extends PacketImpl
-{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private String name;
-
- private long sessionChannelID;
-
- private int version;
-
- private String username;
-
- private String password;
-
- private int minLargeMessageSize;
-
- private boolean xa;
-
- private boolean autoCommitSends;
-
- private boolean autoCommitAcks;
-
- private boolean preAcknowledge;
-
- private int windowSize;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public CreateSessionMessage(final String name,
- final long sessionChannelID,
- final int version,
- final String username,
- final String password,
- final int minLargeMessageSize,
- final boolean xa,
- final boolean autoCommitSends,
- final boolean autoCommitAcks,
- final boolean preAcknowledge,
- final int windowSize)
- {
- super(PacketImpl.CREATESESSION);
-
- this.name = name;
-
- this.sessionChannelID = sessionChannelID;
-
- this.version = version;
-
- this.username = username;
-
- this.password = password;
-
- this.minLargeMessageSize = minLargeMessageSize;
-
- this.xa = xa;
-
- this.autoCommitSends = autoCommitSends;
-
- this.autoCommitAcks = autoCommitAcks;
-
- this.windowSize = windowSize;
-
- this.preAcknowledge = preAcknowledge;
- }
-
- public CreateSessionMessage()
- {
- super(PacketImpl.CREATESESSION);
- }
-
- // Public --------------------------------------------------------
-
- public String getName()
- {
- return name;
- }
-
- public long getSessionChannelID()
- {
- return sessionChannelID;
- }
-
- public int getVersion()
- {
- return version;
- }
-
- public String getUsername()
- {
- return username;
- }
-
- public String getPassword()
- {
- return password;
- }
-
- public boolean isXA()
- {
- return xa;
- }
-
- public boolean isAutoCommitSends()
- {
- return autoCommitSends;
- }
-
- public boolean isAutoCommitAcks()
- {
- return autoCommitAcks;
- }
-
- public boolean isPreAcknowledge()
- {
- return preAcknowledge;
- }
-
- public int getWindowSize()
- {
- return windowSize;
- }
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeString(name);
- buffer.writeLong(sessionChannelID);
- buffer.writeInt(version);
- buffer.writeNullableString(username);
- buffer.writeNullableString(password);
- buffer.writeInt(minLargeMessageSize);
- buffer.writeBoolean(xa);
- buffer.writeBoolean(autoCommitSends);
- buffer.writeBoolean(autoCommitAcks);
- buffer.writeInt(windowSize);
- buffer.writeBoolean(preAcknowledge);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- name = buffer.readString();
- sessionChannelID = buffer.readLong();
- version = buffer.readInt();
- username = buffer.readNullableString();
- password = buffer.readNullableString();
- minLargeMessageSize = buffer.readInt();
- xa = buffer.readBoolean();
- autoCommitSends = buffer.readBoolean();
- autoCommitAcks = buffer.readBoolean();
- windowSize = buffer.readInt();
- preAcknowledge = buffer.readBoolean();
- }
-
- @Override
- public boolean equals(final Object other)
- {
- if (other instanceof CreateSessionMessage == false)
- {
- return false;
- }
-
- CreateSessionMessage r = (CreateSessionMessage)other;
-
- boolean matches = super.equals(other) && name.equals(r.name) &&
- sessionChannelID == r.sessionChannelID &&
- version == r.version &&
- xa == r.xa &&
- autoCommitSends == r.autoCommitSends &&
- autoCommitAcks == r.autoCommitAcks &&
- (username == null ? r.username == null :
username.equals(r.username)) &&
- (password == null ? r.password == null :
password.equals(r.password));
-
- return matches;
- }
-
- @Override
- public final boolean isRequiresConfirmations()
- {
- return false;
- }
-
- public int getMinLargeMessageSize()
- {
- return minLargeMessageSize;
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/CreateSessionMessage.java
(from rev 8832,
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/CreateSessionMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/CreateSessionMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/CreateSessionMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -0,0 +1,223 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.core.protocol.core.impl.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.protocol.core.impl.PacketImpl;
+
+/**
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>.
+ *
+ * @version <tt>$Revision$</tt>
+ */
+public class CreateSessionMessage extends PacketImpl
+{
+ // Constants -----------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
+ private String name;
+
+ private long sessionChannelID;
+
+ private int version;
+
+ private String username;
+
+ private String password;
+
+ private int minLargeMessageSize;
+
+ private boolean xa;
+
+ private boolean autoCommitSends;
+
+ private boolean autoCommitAcks;
+
+ private boolean preAcknowledge;
+
+ private int windowSize;
+
+ // Static --------------------------------------------------------
+
+ // Constructors --------------------------------------------------
+
+ public CreateSessionMessage(final String name,
+ final long sessionChannelID,
+ final int version,
+ final String username,
+ final String password,
+ final int minLargeMessageSize,
+ final boolean xa,
+ final boolean autoCommitSends,
+ final boolean autoCommitAcks,
+ final boolean preAcknowledge,
+ final int windowSize)
+ {
+ super(PacketImpl.CREATESESSION);
+
+ this.name = name;
+
+ this.sessionChannelID = sessionChannelID;
+
+ this.version = version;
+
+ this.username = username;
+
+ this.password = password;
+
+ this.minLargeMessageSize = minLargeMessageSize;
+
+ this.xa = xa;
+
+ this.autoCommitSends = autoCommitSends;
+
+ this.autoCommitAcks = autoCommitAcks;
+
+ this.windowSize = windowSize;
+
+ this.preAcknowledge = preAcknowledge;
+ }
+
+ public CreateSessionMessage()
+ {
+ super(PacketImpl.CREATESESSION);
+ }
+
+ // Public --------------------------------------------------------
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public long getSessionChannelID()
+ {
+ return sessionChannelID;
+ }
+
+ public int getVersion()
+ {
+ return version;
+ }
+
+ public String getUsername()
+ {
+ return username;
+ }
+
+ public String getPassword()
+ {
+ return password;
+ }
+
+ public boolean isXA()
+ {
+ return xa;
+ }
+
+ public boolean isAutoCommitSends()
+ {
+ return autoCommitSends;
+ }
+
+ public boolean isAutoCommitAcks()
+ {
+ return autoCommitAcks;
+ }
+
+ public boolean isPreAcknowledge()
+ {
+ return preAcknowledge;
+ }
+
+ public int getWindowSize()
+ {
+ return windowSize;
+ }
+
+ @Override
+ public void encodeRest(final HornetQBuffer buffer)
+ {
+ buffer.writeString(name);
+ buffer.writeLong(sessionChannelID);
+ buffer.writeInt(version);
+ buffer.writeNullableString(username);
+ buffer.writeNullableString(password);
+ buffer.writeInt(minLargeMessageSize);
+ buffer.writeBoolean(xa);
+ buffer.writeBoolean(autoCommitSends);
+ buffer.writeBoolean(autoCommitAcks);
+ buffer.writeInt(windowSize);
+ buffer.writeBoolean(preAcknowledge);
+ }
+
+ @Override
+ public void decodeRest(final HornetQBuffer buffer)
+ {
+ name = buffer.readString();
+ sessionChannelID = buffer.readLong();
+ version = buffer.readInt();
+ username = buffer.readNullableString();
+ password = buffer.readNullableString();
+ minLargeMessageSize = buffer.readInt();
+ xa = buffer.readBoolean();
+ autoCommitSends = buffer.readBoolean();
+ autoCommitAcks = buffer.readBoolean();
+ windowSize = buffer.readInt();
+ preAcknowledge = buffer.readBoolean();
+ }
+
+ @Override
+ public boolean equals(final Object other)
+ {
+ if (other instanceof CreateSessionMessage == false)
+ {
+ return false;
+ }
+
+ CreateSessionMessage r = (CreateSessionMessage)other;
+
+ boolean matches = super.equals(other) && name.equals(r.name) &&
+ sessionChannelID == r.sessionChannelID &&
+ version == r.version &&
+ xa == r.xa &&
+ autoCommitSends == r.autoCommitSends &&
+ autoCommitAcks == r.autoCommitAcks &&
+ (username == null ? r.username == null :
username.equals(r.username)) &&
+ (password == null ? r.password == null :
password.equals(r.password));
+
+ return matches;
+ }
+
+ @Override
+ public final boolean isRequiresConfirmations()
+ {
+ return false;
+ }
+
+ public int getMinLargeMessageSize()
+ {
+ return minLargeMessageSize;
+ }
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/CreateSessionResponseMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/CreateSessionResponseMessage.java 2010-01-21
20:09:23 UTC (rev 8832)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/CreateSessionResponseMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,102 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.protocol.core.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.protocol.core.impl.PacketImpl;
-
-/**
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>.
- *
- * @version <tt>$Revision$</tt>
- */
-public class CreateSessionResponseMessage extends PacketImpl
-{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private int serverVersion;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public CreateSessionResponseMessage(final int serverVersion)
- {
- super(PacketImpl.CREATESESSION_RESP);
-
- this.serverVersion = serverVersion;
- }
-
- public CreateSessionResponseMessage()
- {
- super(PacketImpl.CREATESESSION_RESP);
- }
-
- // Public --------------------------------------------------------
-
- @Override
- public boolean isResponse()
- {
- return true;
- }
-
- public int getServerVersion()
- {
- return serverVersion;
- }
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeInt(serverVersion);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- serverVersion = buffer.readInt();
- }
-
- @Override
- public boolean equals(final Object other)
- {
- if (other instanceof CreateSessionResponseMessage == false)
- {
- return false;
- }
-
- CreateSessionResponseMessage r = (CreateSessionResponseMessage)other;
-
- boolean matches = super.equals(other) && serverVersion == r.serverVersion;
-
- return matches;
- }
-
- @Override
- public final boolean isRequiresConfirmations()
- {
- return false;
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/CreateSessionResponseMessage.java
(from rev 8832,
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/CreateSessionResponseMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/CreateSessionResponseMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/CreateSessionResponseMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -0,0 +1,102 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.core.protocol.core.impl.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.protocol.core.impl.PacketImpl;
+
+/**
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>.
+ *
+ * @version <tt>$Revision$</tt>
+ */
+public class CreateSessionResponseMessage extends PacketImpl
+{
+ // Constants -----------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
+ private int serverVersion;
+
+ // Static --------------------------------------------------------
+
+ // Constructors --------------------------------------------------
+
+ public CreateSessionResponseMessage(final int serverVersion)
+ {
+ super(PacketImpl.CREATESESSION_RESP);
+
+ this.serverVersion = serverVersion;
+ }
+
+ public CreateSessionResponseMessage()
+ {
+ super(PacketImpl.CREATESESSION_RESP);
+ }
+
+ // Public --------------------------------------------------------
+
+ @Override
+ public boolean isResponse()
+ {
+ return true;
+ }
+
+ public int getServerVersion()
+ {
+ return serverVersion;
+ }
+
+ @Override
+ public void encodeRest(final HornetQBuffer buffer)
+ {
+ buffer.writeInt(serverVersion);
+ }
+
+ @Override
+ public void decodeRest(final HornetQBuffer buffer)
+ {
+ serverVersion = buffer.readInt();
+ }
+
+ @Override
+ public boolean equals(final Object other)
+ {
+ if (other instanceof CreateSessionResponseMessage == false)
+ {
+ return false;
+ }
+
+ CreateSessionResponseMessage r = (CreateSessionResponseMessage)other;
+
+ boolean matches = super.equals(other) && serverVersion == r.serverVersion;
+
+ return matches;
+ }
+
+ @Override
+ public final boolean isRequiresConfirmations()
+ {
+ return false;
+ }
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/HornetQExceptionMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/HornetQExceptionMessage.java 2010-01-21
20:09:23 UTC (rev 8832)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/HornetQExceptionMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,109 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.protocol.core.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.api.core.HornetQException;
-import org.hornetq.core.logging.Logger;
-import org.hornetq.core.protocol.core.impl.PacketImpl;
-
-/**
- * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- *
- * @version <tt>$Revision$</tt>
- *
- */
-public class HornetQExceptionMessage extends PacketImpl
-{
- // Constants -----------------------------------------------------
-
- private static final Logger log = Logger.getLogger(HornetQExceptionMessage.class);
-
- // Attributes ----------------------------------------------------
-
- private HornetQException exception;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public HornetQExceptionMessage(final HornetQException exception)
- {
- super(PacketImpl.EXCEPTION);
-
- this.exception = exception;
- }
-
- public HornetQExceptionMessage()
- {
- super(PacketImpl.EXCEPTION);
- }
-
- // Public --------------------------------------------------------
-
- @Override
- public boolean isResponse()
- {
- return true;
- }
-
- public HornetQException getException()
- {
- return exception;
- }
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeInt(exception.getCode());
- buffer.writeNullableString(exception.getMessage());
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- int code = buffer.readInt();
- String msg = buffer.readNullableString();
-
- exception = new HornetQException(code, msg);
- }
-
- @Override
- public String toString()
- {
- return getParentString() + ", exception= " + exception + "]";
- }
-
- @Override
- public boolean equals(final Object other)
- {
- if (other instanceof HornetQExceptionMessage == false)
- {
- return false;
- }
-
- HornetQExceptionMessage r = (HornetQExceptionMessage)other;
-
- return super.equals(other) && exception.equals(r.exception);
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/HornetQExceptionMessage.java
(from rev 8832,
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/HornetQExceptionMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/HornetQExceptionMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/HornetQExceptionMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -0,0 +1,109 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.core.protocol.core.impl.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.api.core.HornetQException;
+import org.hornetq.core.logging.Logger;
+import org.hornetq.core.protocol.core.impl.PacketImpl;
+
+/**
+ * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ *
+ * @version <tt>$Revision$</tt>
+ *
+ */
+public class HornetQExceptionMessage extends PacketImpl
+{
+ // Constants -----------------------------------------------------
+
+ private static final Logger log = Logger.getLogger(HornetQExceptionMessage.class);
+
+ // Attributes ----------------------------------------------------
+
+ private HornetQException exception;
+
+ // Static --------------------------------------------------------
+
+ // Constructors --------------------------------------------------
+
+ public HornetQExceptionMessage(final HornetQException exception)
+ {
+ super(PacketImpl.EXCEPTION);
+
+ this.exception = exception;
+ }
+
+ public HornetQExceptionMessage()
+ {
+ super(PacketImpl.EXCEPTION);
+ }
+
+ // Public --------------------------------------------------------
+
+ @Override
+ public boolean isResponse()
+ {
+ return true;
+ }
+
+ public HornetQException getException()
+ {
+ return exception;
+ }
+
+ @Override
+ public void encodeRest(final HornetQBuffer buffer)
+ {
+ buffer.writeInt(exception.getCode());
+ buffer.writeNullableString(exception.getMessage());
+ }
+
+ @Override
+ public void decodeRest(final HornetQBuffer buffer)
+ {
+ int code = buffer.readInt();
+ String msg = buffer.readNullableString();
+
+ exception = new HornetQException(code, msg);
+ }
+
+ @Override
+ public String toString()
+ {
+ return getParentString() + ", exception= " + exception + "]";
+ }
+
+ @Override
+ public boolean equals(final Object other)
+ {
+ if (other instanceof HornetQExceptionMessage == false)
+ {
+ return false;
+ }
+
+ HornetQExceptionMessage r = (HornetQExceptionMessage)other;
+
+ return super.equals(other) && exception.equals(r.exception);
+ }
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/MessagePacket.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/MessagePacket.java 2010-01-21
20:09:23 UTC (rev 8832)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/MessagePacket.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,46 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.protocol.core.impl.wireformat;
-
-import org.hornetq.api.core.Message;
-import org.hornetq.core.logging.Logger;
-import org.hornetq.core.message.impl.MessageInternal;
-import org.hornetq.core.protocol.core.impl.PacketImpl;
-
-/**
- * A MessagePacket
- *
- * @author Tim Fox
- *
- *
- */
-public abstract class MessagePacket extends PacketImpl
-{
- private static final Logger log = Logger.getLogger(MessagePacket.class);
-
- protected MessageInternal message;
-
- public MessagePacket(final byte type, final MessageInternal message)
- {
- super(type);
-
- this.message = message;
- }
-
- public Message getMessage()
- {
- return message;
- }
-
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/MessagePacket.java
(from rev 8832,
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/MessagePacket.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/MessagePacket.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/MessagePacket.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.core.protocol.core.impl.wireformat;
+
+import org.hornetq.api.core.Message;
+import org.hornetq.core.logging.Logger;
+import org.hornetq.core.message.impl.MessageInternal;
+import org.hornetq.core.protocol.core.impl.PacketImpl;
+
+/**
+ * A MessagePacket
+ *
+ * @author Tim Fox
+ *
+ *
+ */
+public abstract class MessagePacket extends PacketImpl
+{
+ private static final Logger log = Logger.getLogger(MessagePacket.class);
+
+ protected MessageInternal message;
+
+ public MessagePacket(final byte type, final MessageInternal message)
+ {
+ super(type);
+
+ this.message = message;
+ }
+
+ public Message getMessage()
+ {
+ return message;
+ }
+
+}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/NullResponseMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/NullResponseMessage.java 2010-01-21
20:09:23 UTC (rev 8832)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/NullResponseMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,52 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.protocol.core.impl.wireformat;
-
-import org.hornetq.core.protocol.core.impl.PacketImpl;
-
-/**
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- * @version <tt>$Revision$</tt>
- */
-public class NullResponseMessage extends PacketImpl
-{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public NullResponseMessage()
- {
- super(PacketImpl.NULL_RESPONSE);
- }
-
- // Public --------------------------------------------------------
-
- @Override
- public boolean isResponse()
- {
- return true;
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/NullResponseMessage.java
(from rev 8832,
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/NullResponseMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/NullResponseMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/NullResponseMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.core.protocol.core.impl.wireformat;
+
+import org.hornetq.core.protocol.core.impl.PacketImpl;
+
+/**
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ * @version <tt>$Revision$</tt>
+ */
+public class NullResponseMessage extends PacketImpl
+{
+ // Constants -----------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
+ // Static --------------------------------------------------------
+
+ // Constructors --------------------------------------------------
+
+ public NullResponseMessage()
+ {
+ super(PacketImpl.NULL_RESPONSE);
+ }
+
+ // Public --------------------------------------------------------
+
+ @Override
+ public boolean isResponse()
+ {
+ return true;
+ }
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/PacketsConfirmedMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/PacketsConfirmedMessage.java 2010-01-21
20:09:23 UTC (rev 8832)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/PacketsConfirmedMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,101 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.protocol.core.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.protocol.core.impl.PacketImpl;
-
-/**
- *
- * A PacketsConfirmedMessage
- *
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- *
- */
-public class PacketsConfirmedMessage extends PacketImpl
-{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private int commandID;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public PacketsConfirmedMessage(final int commandID)
- {
- super(PacketImpl.PACKETS_CONFIRMED);
-
- this.commandID = commandID;
- }
-
- public PacketsConfirmedMessage()
- {
- super(PacketImpl.PACKETS_CONFIRMED);
- }
-
- // Public --------------------------------------------------------
-
- public int getCommandID()
- {
- return commandID;
- }
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeInt(commandID);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- commandID = buffer.readInt();
- }
-
- @Override
- public String toString()
- {
- return getParentString() + ", commandID=" + commandID + "]";
- }
-
- @Override
- public boolean equals(final Object other)
- {
- if (other instanceof PacketsConfirmedMessage == false)
- {
- return false;
- }
-
- PacketsConfirmedMessage r = (PacketsConfirmedMessage)other;
-
- return super.equals(other) && commandID == r.commandID;
- }
-
- @Override
- public final boolean isRequiresConfirmations()
- {
- return false;
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/PacketsConfirmedMessage.java
(from rev 8832,
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/PacketsConfirmedMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/PacketsConfirmedMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/PacketsConfirmedMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -0,0 +1,101 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.core.protocol.core.impl.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.protocol.core.impl.PacketImpl;
+
+/**
+ *
+ * A PacketsConfirmedMessage
+ *
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ *
+ */
+public class PacketsConfirmedMessage extends PacketImpl
+{
+ // Constants -----------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
+ private int commandID;
+
+ // Static --------------------------------------------------------
+
+ // Constructors --------------------------------------------------
+
+ public PacketsConfirmedMessage(final int commandID)
+ {
+ super(PacketImpl.PACKETS_CONFIRMED);
+
+ this.commandID = commandID;
+ }
+
+ public PacketsConfirmedMessage()
+ {
+ super(PacketImpl.PACKETS_CONFIRMED);
+ }
+
+ // Public --------------------------------------------------------
+
+ public int getCommandID()
+ {
+ return commandID;
+ }
+
+ @Override
+ public void encodeRest(final HornetQBuffer buffer)
+ {
+ buffer.writeInt(commandID);
+ }
+
+ @Override
+ public void decodeRest(final HornetQBuffer buffer)
+ {
+ commandID = buffer.readInt();
+ }
+
+ @Override
+ public String toString()
+ {
+ return getParentString() + ", commandID=" + commandID + "]";
+ }
+
+ @Override
+ public boolean equals(final Object other)
+ {
+ if (other instanceof PacketsConfirmedMessage == false)
+ {
+ return false;
+ }
+
+ PacketsConfirmedMessage r = (PacketsConfirmedMessage)other;
+
+ return super.equals(other) && commandID == r.commandID;
+ }
+
+ @Override
+ public final boolean isRequiresConfirmations()
+ {
+ return false;
+ }
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/Ping.java
===================================================================
--- trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/Ping.java 2010-01-21
20:09:23 UTC (rev 8832)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/Ping.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,104 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.protocol.core.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.protocol.core.impl.PacketImpl;
-
-/**
- *
- * A Ping
- *
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- *
- */
-public class Ping extends PacketImpl
-{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private long connectionTTL;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public Ping(final long connectionTTL)
- {
- super(PacketImpl.PING);
-
- this.connectionTTL = connectionTTL;
- }
-
- public Ping()
- {
- super(PacketImpl.PING);
- }
-
- // Public --------------------------------------------------------
-
- public long getConnectionTTL()
- {
- return connectionTTL;
- }
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeLong(connectionTTL);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- connectionTTL = buffer.readLong();
- }
-
- @Override
- public String toString()
- {
- StringBuffer buf = new StringBuffer(getParentString());
- buf.append(", connectionTTL=" + connectionTTL);
- buf.append("]");
- return buf.toString();
- }
-
- @Override
- public boolean equals(final Object other)
- {
- if (other instanceof Ping == false)
- {
- return false;
- }
-
- Ping r = (Ping)other;
-
- return super.equals(other) && connectionTTL == r.connectionTTL;
- }
-
- @Override
- public final boolean isRequiresConfirmations()
- {
- return false;
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/Ping.java
(from rev 8832, trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/Ping.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/Ping.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/Ping.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -0,0 +1,104 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.core.protocol.core.impl.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.protocol.core.impl.PacketImpl;
+
+/**
+ *
+ * A Ping
+ *
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ *
+ */
+public class Ping extends PacketImpl
+{
+ // Constants -----------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
+ private long connectionTTL;
+
+ // Static --------------------------------------------------------
+
+ // Constructors --------------------------------------------------
+
+ public Ping(final long connectionTTL)
+ {
+ super(PacketImpl.PING);
+
+ this.connectionTTL = connectionTTL;
+ }
+
+ public Ping()
+ {
+ super(PacketImpl.PING);
+ }
+
+ // Public --------------------------------------------------------
+
+ public long getConnectionTTL()
+ {
+ return connectionTTL;
+ }
+
+ @Override
+ public void encodeRest(final HornetQBuffer buffer)
+ {
+ buffer.writeLong(connectionTTL);
+ }
+
+ @Override
+ public void decodeRest(final HornetQBuffer buffer)
+ {
+ connectionTTL = buffer.readLong();
+ }
+
+ @Override
+ public String toString()
+ {
+ StringBuffer buf = new StringBuffer(getParentString());
+ buf.append(", connectionTTL=" + connectionTTL);
+ buf.append("]");
+ return buf.toString();
+ }
+
+ @Override
+ public boolean equals(final Object other)
+ {
+ if (other instanceof Ping == false)
+ {
+ return false;
+ }
+
+ Ping r = (Ping)other;
+
+ return super.equals(other) && connectionTTL == r.connectionTTL;
+ }
+
+ @Override
+ public final boolean isRequiresConfirmations()
+ {
+ return false;
+ }
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReattachSessionMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReattachSessionMessage.java 2010-01-21
20:09:23 UTC (rev 8832)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReattachSessionMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,106 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.protocol.core.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.protocol.core.impl.PacketImpl;
-
-/**
- *
- * A ReattachSessionMessage
- *
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- *
- */
-public class ReattachSessionMessage extends PacketImpl
-{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private String name;
-
- private int lastConfirmedCommandID;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public ReattachSessionMessage(final String name, final int lastConfirmedCommandID)
- {
- super(PacketImpl.REATTACH_SESSION);
-
- this.name = name;
-
- this.lastConfirmedCommandID = lastConfirmedCommandID;
- }
-
- public ReattachSessionMessage()
- {
- super(PacketImpl.REATTACH_SESSION);
- }
-
- // Public --------------------------------------------------------
-
- public String getName()
- {
- return name;
- }
-
- public int getLastConfirmedCommandID()
- {
- return lastConfirmedCommandID;
- }
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeString(name);
- buffer.writeInt(lastConfirmedCommandID);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- name = buffer.readString();
- lastConfirmedCommandID = buffer.readInt();
- }
-
- @Override
- public boolean equals(final Object other)
- {
- if (other instanceof ReattachSessionMessage == false)
- {
- return false;
- }
-
- ReattachSessionMessage r = (ReattachSessionMessage)other;
-
- return super.equals(other) && name.equals(r.name);
- }
-
- @Override
- public final boolean isRequiresConfirmations()
- {
- return false;
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReattachSessionMessage.java
(from rev 8832,
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReattachSessionMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReattachSessionMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReattachSessionMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -0,0 +1,106 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.core.protocol.core.impl.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.protocol.core.impl.PacketImpl;
+
+/**
+ *
+ * A ReattachSessionMessage
+ *
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ *
+ */
+public class ReattachSessionMessage extends PacketImpl
+{
+ // Constants -----------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
+ private String name;
+
+ private int lastConfirmedCommandID;
+
+ // Static --------------------------------------------------------
+
+ // Constructors --------------------------------------------------
+
+ public ReattachSessionMessage(final String name, final int lastConfirmedCommandID)
+ {
+ super(PacketImpl.REATTACH_SESSION);
+
+ this.name = name;
+
+ this.lastConfirmedCommandID = lastConfirmedCommandID;
+ }
+
+ public ReattachSessionMessage()
+ {
+ super(PacketImpl.REATTACH_SESSION);
+ }
+
+ // Public --------------------------------------------------------
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public int getLastConfirmedCommandID()
+ {
+ return lastConfirmedCommandID;
+ }
+
+ @Override
+ public void encodeRest(final HornetQBuffer buffer)
+ {
+ buffer.writeString(name);
+ buffer.writeInt(lastConfirmedCommandID);
+ }
+
+ @Override
+ public void decodeRest(final HornetQBuffer buffer)
+ {
+ name = buffer.readString();
+ lastConfirmedCommandID = buffer.readInt();
+ }
+
+ @Override
+ public boolean equals(final Object other)
+ {
+ if (other instanceof ReattachSessionMessage == false)
+ {
+ return false;
+ }
+
+ ReattachSessionMessage r = (ReattachSessionMessage)other;
+
+ return super.equals(other) && name.equals(r.name);
+ }
+
+ @Override
+ public final boolean isRequiresConfirmations()
+ {
+ return false;
+ }
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReattachSessionResponseMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReattachSessionResponseMessage.java 2010-01-21
20:09:23 UTC (rev 8832)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReattachSessionResponseMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,112 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.protocol.core.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.protocol.core.impl.PacketImpl;
-
-/**
- *
- * A ReattachSessionResponseMessage
- *
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- *
- */
-public class ReattachSessionResponseMessage extends PacketImpl
-{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private int lastConfirmedCommandID;
-
- private boolean reattached;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public ReattachSessionResponseMessage(final int lastConfirmedCommandID, final boolean
reattached)
- {
- super(PacketImpl.REATTACH_SESSION_RESP);
-
- this.lastConfirmedCommandID = lastConfirmedCommandID;
-
- this.reattached = reattached;
- }
-
- public ReattachSessionResponseMessage()
- {
- super(PacketImpl.REATTACH_SESSION_RESP);
- }
-
- // Public --------------------------------------------------------
-
- public int getLastConfirmedCommandID()
- {
- return lastConfirmedCommandID;
- }
-
- public boolean isReattached()
- {
- return reattached;
- }
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeInt(lastConfirmedCommandID);
- buffer.writeBoolean(reattached);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- lastConfirmedCommandID = buffer.readInt();
- reattached = buffer.readBoolean();
- }
-
- @Override
- public boolean isResponse()
- {
- return true;
- }
-
- @Override
- public boolean equals(final Object other)
- {
- if (other instanceof ReattachSessionResponseMessage == false)
- {
- return false;
- }
-
- ReattachSessionResponseMessage r = (ReattachSessionResponseMessage)other;
-
- return super.equals(other) && lastConfirmedCommandID ==
r.lastConfirmedCommandID;
- }
-
- @Override
- public final boolean isRequiresConfirmations()
- {
- return false;
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReattachSessionResponseMessage.java
(from rev 8832,
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReattachSessionResponseMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReattachSessionResponseMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReattachSessionResponseMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -0,0 +1,112 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.core.protocol.core.impl.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.protocol.core.impl.PacketImpl;
+
+/**
+ *
+ * A ReattachSessionResponseMessage
+ *
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ *
+ */
+public class ReattachSessionResponseMessage extends PacketImpl
+{
+ // Constants -----------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
+ private int lastConfirmedCommandID;
+
+ private boolean reattached;
+
+ // Static --------------------------------------------------------
+
+ // Constructors --------------------------------------------------
+
+ public ReattachSessionResponseMessage(final int lastConfirmedCommandID, final boolean
reattached)
+ {
+ super(PacketImpl.REATTACH_SESSION_RESP);
+
+ this.lastConfirmedCommandID = lastConfirmedCommandID;
+
+ this.reattached = reattached;
+ }
+
+ public ReattachSessionResponseMessage()
+ {
+ super(PacketImpl.REATTACH_SESSION_RESP);
+ }
+
+ // Public --------------------------------------------------------
+
+ public int getLastConfirmedCommandID()
+ {
+ return lastConfirmedCommandID;
+ }
+
+ public boolean isReattached()
+ {
+ return reattached;
+ }
+
+ @Override
+ public void encodeRest(final HornetQBuffer buffer)
+ {
+ buffer.writeInt(lastConfirmedCommandID);
+ buffer.writeBoolean(reattached);
+ }
+
+ @Override
+ public void decodeRest(final HornetQBuffer buffer)
+ {
+ lastConfirmedCommandID = buffer.readInt();
+ reattached = buffer.readBoolean();
+ }
+
+ @Override
+ public boolean isResponse()
+ {
+ return true;
+ }
+
+ @Override
+ public boolean equals(final Object other)
+ {
+ if (other instanceof ReattachSessionResponseMessage == false)
+ {
+ return false;
+ }
+
+ ReattachSessionResponseMessage r = (ReattachSessionResponseMessage)other;
+
+ return super.equals(other) && lastConfirmedCommandID ==
r.lastConfirmedCommandID;
+ }
+
+ @Override
+ public final boolean isRequiresConfirmations()
+ {
+ return false;
+ }
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationAddMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationAddMessage.java 2010-01-21
20:09:23 UTC (rev 8832)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationAddMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,143 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.protocol.core.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.journal.EncodingSupport;
-import org.hornetq.core.logging.Logger;
-import org.hornetq.core.protocol.core.impl.PacketImpl;
-
-/**
- * A ReplicationAddMessage
- *
- * @author <mailto:clebert.suconic@jboss.org">Clebert Suconic</a>
- *
- *
- */
-public class ReplicationAddMessage extends PacketImpl
-{
-
- // Constants -----------------------------------------------------
-
- private static final Logger log = Logger.getLogger(ReplicationAddMessage.class);
-
- // Attributes ----------------------------------------------------
-
- private long id;
-
- /** 0 - Bindings, 1 - MessagesJournal */
- private byte journalID;
-
- private boolean isUpdate;
-
- private byte recordType;
-
- private EncodingSupport encodingData;
-
- private byte[] recordData;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public ReplicationAddMessage()
- {
- super(PacketImpl.REPLICATION_APPEND);
- }
-
- public ReplicationAddMessage(final byte journalID,
- final boolean isUpdate,
- final long id,
- final byte recordType,
- final EncodingSupport encodingData)
- {
- this();
- this.journalID = journalID;
- this.isUpdate = isUpdate;
- this.id = id;
- this.recordType = recordType;
- this.encodingData = encodingData;
- }
-
- // Public --------------------------------------------------------
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeByte(journalID);
- buffer.writeBoolean(isUpdate);
- buffer.writeLong(id);
- buffer.writeByte(recordType);
- buffer.writeInt(encodingData.getEncodeSize());
- encodingData.encode(buffer);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- journalID = buffer.readByte();
- isUpdate = buffer.readBoolean();
- id = buffer.readLong();
- recordType = buffer.readByte();
- int size = buffer.readInt();
- recordData = new byte[size];
- buffer.readBytes(recordData);
- }
-
- /**
- * @return the id
- */
- public long getId()
- {
- return id;
- }
-
- /**
- * @return the journalID
- */
- public byte getJournalID()
- {
- return journalID;
- }
-
- public boolean isUpdate()
- {
- return isUpdate;
- }
-
- /**
- * @return the recordType
- */
- public byte getRecordType()
- {
- return recordType;
- }
-
- /**
- * @return the recordData
- */
- public byte[] getRecordData()
- {
- return recordData;
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationAddMessage.java
(from rev 8832,
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationAddMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationAddMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationAddMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -0,0 +1,143 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.core.protocol.core.impl.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.journal.EncodingSupport;
+import org.hornetq.core.logging.Logger;
+import org.hornetq.core.protocol.core.impl.PacketImpl;
+
+/**
+ * A ReplicationAddMessage
+ *
+ * @author <mailto:clebert.suconic@jboss.org">Clebert Suconic</a>
+ *
+ *
+ */
+public class ReplicationAddMessage extends PacketImpl
+{
+
+ // Constants -----------------------------------------------------
+
+ private static final Logger log = Logger.getLogger(ReplicationAddMessage.class);
+
+ // Attributes ----------------------------------------------------
+
+ private long id;
+
+ /** 0 - Bindings, 1 - MessagesJournal */
+ private byte journalID;
+
+ private boolean isUpdate;
+
+ private byte recordType;
+
+ private EncodingSupport encodingData;
+
+ private byte[] recordData;
+
+ // Static --------------------------------------------------------
+
+ // Constructors --------------------------------------------------
+
+ public ReplicationAddMessage()
+ {
+ super(PacketImpl.REPLICATION_APPEND);
+ }
+
+ public ReplicationAddMessage(final byte journalID,
+ final boolean isUpdate,
+ final long id,
+ final byte recordType,
+ final EncodingSupport encodingData)
+ {
+ this();
+ this.journalID = journalID;
+ this.isUpdate = isUpdate;
+ this.id = id;
+ this.recordType = recordType;
+ this.encodingData = encodingData;
+ }
+
+ // Public --------------------------------------------------------
+
+ @Override
+ public void encodeRest(final HornetQBuffer buffer)
+ {
+ buffer.writeByte(journalID);
+ buffer.writeBoolean(isUpdate);
+ buffer.writeLong(id);
+ buffer.writeByte(recordType);
+ buffer.writeInt(encodingData.getEncodeSize());
+ encodingData.encode(buffer);
+ }
+
+ @Override
+ public void decodeRest(final HornetQBuffer buffer)
+ {
+ journalID = buffer.readByte();
+ isUpdate = buffer.readBoolean();
+ id = buffer.readLong();
+ recordType = buffer.readByte();
+ int size = buffer.readInt();
+ recordData = new byte[size];
+ buffer.readBytes(recordData);
+ }
+
+ /**
+ * @return the id
+ */
+ public long getId()
+ {
+ return id;
+ }
+
+ /**
+ * @return the journalID
+ */
+ public byte getJournalID()
+ {
+ return journalID;
+ }
+
+ public boolean isUpdate()
+ {
+ return isUpdate;
+ }
+
+ /**
+ * @return the recordType
+ */
+ public byte getRecordType()
+ {
+ return recordType;
+ }
+
+ /**
+ * @return the recordData
+ */
+ public byte[] getRecordData()
+ {
+ return recordData;
+ }
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+
+}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationAddTXMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationAddTXMessage.java 2010-01-21
20:09:23 UTC (rev 8832)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationAddTXMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,151 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.protocol.core.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.journal.EncodingSupport;
-import org.hornetq.core.protocol.core.impl.PacketImpl;
-
-/**
- * A ReplicationAddMessage
- *
- * @author <mailto:clebert.suconic@jboss.org">Clebert Suconic</a>
- *
- *
- */
-public class ReplicationAddTXMessage extends PacketImpl
-{
-
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private long txId;
-
- private long id;
-
- /** 0 - Bindings, 1 - MessagesJournal */
- private byte journalID;
-
- private boolean isUpdate;
-
- private byte recordType;
-
- private EncodingSupport encodingData;
-
- private byte[] recordData;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public ReplicationAddTXMessage()
- {
- super(PacketImpl.REPLICATION_APPEND_TX);
- }
-
- public ReplicationAddTXMessage(final byte journalID,
- final boolean isUpdate,
- final long txId,
- final long id,
- final byte recordType,
- final EncodingSupport encodingData)
- {
- this();
- this.journalID = journalID;
- this.isUpdate = isUpdate;
- this.txId = txId;
- this.id = id;
- this.recordType = recordType;
- this.encodingData = encodingData;
- }
-
- // Public --------------------------------------------------------
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeByte(journalID);
- buffer.writeBoolean(isUpdate);
- buffer.writeLong(txId);
- buffer.writeLong(id);
- buffer.writeByte(recordType);
- buffer.writeInt(encodingData.getEncodeSize());
- encodingData.encode(buffer);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- journalID = buffer.readByte();
- isUpdate = buffer.readBoolean();
- txId = buffer.readLong();
- id = buffer.readLong();
- recordType = buffer.readByte();
- int size = buffer.readInt();
- recordData = new byte[size];
- buffer.readBytes(recordData);
- }
-
- /**
- * @return the id
- */
- public long getId()
- {
- return id;
- }
-
- public long getTxId()
- {
- return txId;
- }
-
- /**
- * @return the journalID
- */
- public byte getJournalID()
- {
- return journalID;
- }
-
- public boolean isUpdate()
- {
- return isUpdate;
- }
-
- /**
- * @return the recordType
- */
- public byte getRecordType()
- {
- return recordType;
- }
-
- /**
- * @return the recordData
- */
- public byte[] getRecordData()
- {
- return recordData;
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationAddTXMessage.java
(from rev 8832,
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationAddTXMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationAddTXMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationAddTXMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -0,0 +1,151 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.core.protocol.core.impl.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.journal.EncodingSupport;
+import org.hornetq.core.protocol.core.impl.PacketImpl;
+
+/**
+ * A ReplicationAddMessage
+ *
+ * @author <mailto:clebert.suconic@jboss.org">Clebert Suconic</a>
+ *
+ *
+ */
+public class ReplicationAddTXMessage extends PacketImpl
+{
+
+ // Constants -----------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
+ private long txId;
+
+ private long id;
+
+ /** 0 - Bindings, 1 - MessagesJournal */
+ private byte journalID;
+
+ private boolean isUpdate;
+
+ private byte recordType;
+
+ private EncodingSupport encodingData;
+
+ private byte[] recordData;
+
+ // Static --------------------------------------------------------
+
+ // Constructors --------------------------------------------------
+
+ public ReplicationAddTXMessage()
+ {
+ super(PacketImpl.REPLICATION_APPEND_TX);
+ }
+
+ public ReplicationAddTXMessage(final byte journalID,
+ final boolean isUpdate,
+ final long txId,
+ final long id,
+ final byte recordType,
+ final EncodingSupport encodingData)
+ {
+ this();
+ this.journalID = journalID;
+ this.isUpdate = isUpdate;
+ this.txId = txId;
+ this.id = id;
+ this.recordType = recordType;
+ this.encodingData = encodingData;
+ }
+
+ // Public --------------------------------------------------------
+
+ @Override
+ public void encodeRest(final HornetQBuffer buffer)
+ {
+ buffer.writeByte(journalID);
+ buffer.writeBoolean(isUpdate);
+ buffer.writeLong(txId);
+ buffer.writeLong(id);
+ buffer.writeByte(recordType);
+ buffer.writeInt(encodingData.getEncodeSize());
+ encodingData.encode(buffer);
+ }
+
+ @Override
+ public void decodeRest(final HornetQBuffer buffer)
+ {
+ journalID = buffer.readByte();
+ isUpdate = buffer.readBoolean();
+ txId = buffer.readLong();
+ id = buffer.readLong();
+ recordType = buffer.readByte();
+ int size = buffer.readInt();
+ recordData = new byte[size];
+ buffer.readBytes(recordData);
+ }
+
+ /**
+ * @return the id
+ */
+ public long getId()
+ {
+ return id;
+ }
+
+ public long getTxId()
+ {
+ return txId;
+ }
+
+ /**
+ * @return the journalID
+ */
+ public byte getJournalID()
+ {
+ return journalID;
+ }
+
+ public boolean isUpdate()
+ {
+ return isUpdate;
+ }
+
+ /**
+ * @return the recordType
+ */
+ public byte getRecordType()
+ {
+ return recordType;
+ }
+
+ /**
+ * @return the recordData
+ */
+ public byte[] getRecordData()
+ {
+ return recordData;
+ }
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+
+}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationCommitMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationCommitMessage.java 2010-01-21
20:09:23 UTC (rev 8832)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationCommitMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,101 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.protocol.core.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.protocol.core.impl.PacketImpl;
-
-/**
- * A ReplicationAddMessage
- *
- * @author <mailto:clebert.suconic@jboss.org">Clebert Suconic</a>
- *
- *
- */
-public class ReplicationCommitMessage extends PacketImpl
-{
-
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- /** 0 - Bindings, 1 - MessagesJournal */
- private byte journalID;
-
- private boolean rollback;
-
- private long txId;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public ReplicationCommitMessage()
- {
- super(PacketImpl.REPLICATION_COMMIT_ROLLBACK);
- }
-
- public ReplicationCommitMessage(final byte journalID, final boolean rollback, final
long txId)
- {
- this();
- this.journalID = journalID;
- this.rollback = rollback;
- this.txId = txId;
- }
-
- // Public --------------------------------------------------------
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeByte(journalID);
- buffer.writeBoolean(rollback);
- buffer.writeLong(txId);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- journalID = buffer.readByte();
- rollback = buffer.readBoolean();
- txId = buffer.readLong();
- }
-
- public boolean isRollback()
- {
- return rollback;
- }
-
- public long getTxId()
- {
- return txId;
- }
-
- /**
- * @return the journalID
- */
- public byte getJournalID()
- {
- return journalID;
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationCommitMessage.java
(from rev 8832,
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationCommitMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationCommitMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationCommitMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -0,0 +1,101 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.core.protocol.core.impl.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.protocol.core.impl.PacketImpl;
+
+/**
+ * A ReplicationAddMessage
+ *
+ * @author <mailto:clebert.suconic@jboss.org">Clebert Suconic</a>
+ *
+ *
+ */
+public class ReplicationCommitMessage extends PacketImpl
+{
+
+ // Constants -----------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
+ /** 0 - Bindings, 1 - MessagesJournal */
+ private byte journalID;
+
+ private boolean rollback;
+
+ private long txId;
+
+ // Static --------------------------------------------------------
+
+ // Constructors --------------------------------------------------
+
+ public ReplicationCommitMessage()
+ {
+ super(PacketImpl.REPLICATION_COMMIT_ROLLBACK);
+ }
+
+ public ReplicationCommitMessage(final byte journalID, final boolean rollback, final
long txId)
+ {
+ this();
+ this.journalID = journalID;
+ this.rollback = rollback;
+ this.txId = txId;
+ }
+
+ // Public --------------------------------------------------------
+
+ @Override
+ public void encodeRest(final HornetQBuffer buffer)
+ {
+ buffer.writeByte(journalID);
+ buffer.writeBoolean(rollback);
+ buffer.writeLong(txId);
+ }
+
+ @Override
+ public void decodeRest(final HornetQBuffer buffer)
+ {
+ journalID = buffer.readByte();
+ rollback = buffer.readBoolean();
+ txId = buffer.readLong();
+ }
+
+ public boolean isRollback()
+ {
+ return rollback;
+ }
+
+ public long getTxId()
+ {
+ return txId;
+ }
+
+ /**
+ * @return the journalID
+ */
+ public byte getJournalID()
+ {
+ return journalID;
+ }
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+
+}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationCompareDataMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationCompareDataMessage.java 2010-01-21
20:09:23 UTC (rev 8832)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationCompareDataMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,93 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.protocol.core.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.journal.JournalLoadInformation;
-import org.hornetq.core.protocol.core.impl.PacketImpl;
-
-/**
- * Message used to compare if the Journals between the live and
- * backup nodes are equivalent and can be used over replication.
- * The backup journal needs to be an exact copy of the live node before it starts.
- * @author <a href="mailto:tim.fox@jboss.com">Clebert Suconic</a>
- */
-public class ReplicationCompareDataMessage extends PacketImpl
-{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private JournalLoadInformation[] journalInformation;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public ReplicationCompareDataMessage(final JournalLoadInformation[]
journalInformation)
- {
- super(PacketImpl.REPLICATION_COMPARE_DATA);
-
- this.journalInformation = journalInformation;
- }
-
- public ReplicationCompareDataMessage()
- {
- super(PacketImpl.REPLICATION_COMPARE_DATA);
- }
-
- // Public --------------------------------------------------------
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeInt(journalInformation.length);
- for (JournalLoadInformation info : journalInformation)
- {
- buffer.writeInt(info.getNumberOfRecords());
- buffer.writeLong(info.getMaxID());
- }
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- int numberOfJournals = buffer.readInt();
-
- journalInformation = new JournalLoadInformation[numberOfJournals];
-
- for (int i = 0; i < numberOfJournals; i++)
- {
- journalInformation[i] = new JournalLoadInformation();
- journalInformation[i].setNumberOfRecords(buffer.readInt());
- journalInformation[i].setMaxID(buffer.readLong());
- }
- }
-
- /**
- * @return the journalInformation
- */
- public JournalLoadInformation[] getJournalInformation()
- {
- return journalInformation;
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationCompareDataMessage.java
(from rev 8832,
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationCompareDataMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationCompareDataMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationCompareDataMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -0,0 +1,93 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.core.protocol.core.impl.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.journal.JournalLoadInformation;
+import org.hornetq.core.protocol.core.impl.PacketImpl;
+
+/**
+ * Message used to compare if the Journals between the live and
+ * backup nodes are equivalent and can be used over replication.
+ * The backup journal needs to be an exact copy of the live node before it starts.
+ * @author <a href="mailto:tim.fox@jboss.com">Clebert Suconic</a>
+ */
+public class ReplicationCompareDataMessage extends PacketImpl
+{
+ // Constants -----------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
+ private JournalLoadInformation[] journalInformation;
+
+ // Static --------------------------------------------------------
+
+ // Constructors --------------------------------------------------
+
+ public ReplicationCompareDataMessage(final JournalLoadInformation[]
journalInformation)
+ {
+ super(PacketImpl.REPLICATION_COMPARE_DATA);
+
+ this.journalInformation = journalInformation;
+ }
+
+ public ReplicationCompareDataMessage()
+ {
+ super(PacketImpl.REPLICATION_COMPARE_DATA);
+ }
+
+ // Public --------------------------------------------------------
+
+ @Override
+ public void encodeRest(final HornetQBuffer buffer)
+ {
+ buffer.writeInt(journalInformation.length);
+ for (JournalLoadInformation info : journalInformation)
+ {
+ buffer.writeInt(info.getNumberOfRecords());
+ buffer.writeLong(info.getMaxID());
+ }
+ }
+
+ @Override
+ public void decodeRest(final HornetQBuffer buffer)
+ {
+ int numberOfJournals = buffer.readInt();
+
+ journalInformation = new JournalLoadInformation[numberOfJournals];
+
+ for (int i = 0; i < numberOfJournals; i++)
+ {
+ journalInformation[i] = new JournalLoadInformation();
+ journalInformation[i].setNumberOfRecords(buffer.readInt());
+ journalInformation[i].setMaxID(buffer.readLong());
+ }
+ }
+
+ /**
+ * @return the journalInformation
+ */
+ public JournalLoadInformation[] getJournalInformation()
+ {
+ return journalInformation;
+ }
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationDeleteMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationDeleteMessage.java 2010-01-21
20:09:23 UTC (rev 8832)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationDeleteMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,94 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.protocol.core.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.protocol.core.impl.PacketImpl;
-
-/**
- * A ReplicationAddMessage
- *
- * @author <mailto:clebert.suconic@jboss.org">Clebert Suconic</a>
- *
- *
- */
-public class ReplicationDeleteMessage extends PacketImpl
-{
-
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private long id;
-
- /** 0 - Bindings, 1 - MessagesJournal */
- private byte journalID;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public ReplicationDeleteMessage()
- {
- super(PacketImpl.REPLICATION_DELETE);
- }
-
- public ReplicationDeleteMessage(final byte journalID, final long id)
- {
- this();
- this.journalID = journalID;
- this.id = id;
- }
-
- // Public --------------------------------------------------------
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeByte(journalID);
- buffer.writeLong(id);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- journalID = buffer.readByte();
- id = buffer.readLong();
- }
-
- /**
- * @return the id
- */
- public long getId()
- {
- return id;
- }
-
- /**
- * @return the journalID
- */
- public byte getJournalID()
- {
- return journalID;
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationDeleteMessage.java
(from rev 8832,
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationDeleteMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationDeleteMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationDeleteMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -0,0 +1,94 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.core.protocol.core.impl.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.protocol.core.impl.PacketImpl;
+
+/**
+ * A ReplicationAddMessage
+ *
+ * @author <mailto:clebert.suconic@jboss.org">Clebert Suconic</a>
+ *
+ *
+ */
+public class ReplicationDeleteMessage extends PacketImpl
+{
+
+ // Constants -----------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
+ private long id;
+
+ /** 0 - Bindings, 1 - MessagesJournal */
+ private byte journalID;
+
+ // Static --------------------------------------------------------
+
+ // Constructors --------------------------------------------------
+
+ public ReplicationDeleteMessage()
+ {
+ super(PacketImpl.REPLICATION_DELETE);
+ }
+
+ public ReplicationDeleteMessage(final byte journalID, final long id)
+ {
+ this();
+ this.journalID = journalID;
+ this.id = id;
+ }
+
+ // Public --------------------------------------------------------
+
+ @Override
+ public void encodeRest(final HornetQBuffer buffer)
+ {
+ buffer.writeByte(journalID);
+ buffer.writeLong(id);
+ }
+
+ @Override
+ public void decodeRest(final HornetQBuffer buffer)
+ {
+ journalID = buffer.readByte();
+ id = buffer.readLong();
+ }
+
+ /**
+ * @return the id
+ */
+ public long getId()
+ {
+ return id;
+ }
+
+ /**
+ * @return the journalID
+ */
+ public byte getJournalID()
+ {
+ return journalID;
+ }
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+
+}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationDeleteTXMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationDeleteTXMessage.java 2010-01-21
20:09:23 UTC (rev 8832)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationDeleteTXMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,126 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.protocol.core.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.journal.EncodingSupport;
-import org.hornetq.core.protocol.core.impl.PacketImpl;
-
-/**
- * A ReplicationAddMessage
- *
- * @author <mailto:clebert.suconic@jboss.org">Clebert Suconic</a>
- *
- *
- */
-public class ReplicationDeleteTXMessage extends PacketImpl
-{
-
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private long txId;
-
- private long id;
-
- /** 0 - Bindings, 1 - MessagesJournal */
- private byte journalID;
-
- private EncodingSupport encodingData;
-
- private byte[] recordData;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public ReplicationDeleteTXMessage()
- {
- super(PacketImpl.REPLICATION_DELETE_TX);
- }
-
- public ReplicationDeleteTXMessage(final byte journalID,
- final long txId,
- final long id,
- final EncodingSupport encodingData)
- {
- this();
- this.journalID = journalID;
- this.txId = txId;
- this.id = id;
- this.encodingData = encodingData;
- }
-
- // Public --------------------------------------------------------
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeByte(journalID);
- buffer.writeLong(txId);
- buffer.writeLong(id);
- buffer.writeInt(encodingData.getEncodeSize());
- encodingData.encode(buffer);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- journalID = buffer.readByte();
- txId = buffer.readLong();
- id = buffer.readLong();
- int size = buffer.readInt();
- recordData = new byte[size];
- buffer.readBytes(recordData);
- }
-
- /**
- * @return the id
- */
- public long getId()
- {
- return id;
- }
-
- public long getTxId()
- {
- return txId;
- }
-
- /**
- * @return the journalID
- */
- public byte getJournalID()
- {
- return journalID;
- }
-
- /**
- * @return the recordData
- */
- public byte[] getRecordData()
- {
- return recordData;
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationDeleteTXMessage.java
(from rev 8832,
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationDeleteTXMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationDeleteTXMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationDeleteTXMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -0,0 +1,126 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.core.protocol.core.impl.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.journal.EncodingSupport;
+import org.hornetq.core.protocol.core.impl.PacketImpl;
+
+/**
+ * A ReplicationAddMessage
+ *
+ * @author <mailto:clebert.suconic@jboss.org">Clebert Suconic</a>
+ *
+ *
+ */
+public class ReplicationDeleteTXMessage extends PacketImpl
+{
+
+ // Constants -----------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
+ private long txId;
+
+ private long id;
+
+ /** 0 - Bindings, 1 - MessagesJournal */
+ private byte journalID;
+
+ private EncodingSupport encodingData;
+
+ private byte[] recordData;
+
+ // Static --------------------------------------------------------
+
+ // Constructors --------------------------------------------------
+
+ public ReplicationDeleteTXMessage()
+ {
+ super(PacketImpl.REPLICATION_DELETE_TX);
+ }
+
+ public ReplicationDeleteTXMessage(final byte journalID,
+ final long txId,
+ final long id,
+ final EncodingSupport encodingData)
+ {
+ this();
+ this.journalID = journalID;
+ this.txId = txId;
+ this.id = id;
+ this.encodingData = encodingData;
+ }
+
+ // Public --------------------------------------------------------
+
+ @Override
+ public void encodeRest(final HornetQBuffer buffer)
+ {
+ buffer.writeByte(journalID);
+ buffer.writeLong(txId);
+ buffer.writeLong(id);
+ buffer.writeInt(encodingData.getEncodeSize());
+ encodingData.encode(buffer);
+ }
+
+ @Override
+ public void decodeRest(final HornetQBuffer buffer)
+ {
+ journalID = buffer.readByte();
+ txId = buffer.readLong();
+ id = buffer.readLong();
+ int size = buffer.readInt();
+ recordData = new byte[size];
+ buffer.readBytes(recordData);
+ }
+
+ /**
+ * @return the id
+ */
+ public long getId()
+ {
+ return id;
+ }
+
+ public long getTxId()
+ {
+ return txId;
+ }
+
+ /**
+ * @return the journalID
+ */
+ public byte getJournalID()
+ {
+ return journalID;
+ }
+
+ /**
+ * @return the recordData
+ */
+ public byte[] getRecordData()
+ {
+ return recordData;
+ }
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+
+}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationLargeMessageBeingMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationLargeMessageBeingMessage.java 2010-01-21
20:09:23 UTC (rev 8832)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationLargeMessageBeingMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,80 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.protocol.core.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.protocol.core.impl.PacketImpl;
-
-/**
- * A ReplicationLargeMessageBeingMessage
- *
- * @author <mailto:clebert.suconic@jboss.org">Clebert Suconic</a>
- *
- *
- */
-public class ReplicationLargeMessageBeingMessage extends PacketImpl
-{
-
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- long messageId;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public ReplicationLargeMessageBeingMessage(final long messageId)
- {
- this();
- this.messageId = messageId;
- }
-
- public ReplicationLargeMessageBeingMessage()
- {
- super(PacketImpl.REPLICATION_LARGE_MESSAGE_BEGIN);
- }
-
- // Public --------------------------------------------------------
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeLong(messageId);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- messageId = buffer.readLong();
- }
-
- /**
- * @return the messageId
- */
- public long getMessageId()
- {
- return messageId;
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationLargeMessageBeingMessage.java
(from rev 8832,
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationLargeMessageBeingMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationLargeMessageBeingMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationLargeMessageBeingMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -0,0 +1,80 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.core.protocol.core.impl.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.protocol.core.impl.PacketImpl;
+
+/**
+ * A ReplicationLargeMessageBeingMessage
+ *
+ * @author <mailto:clebert.suconic@jboss.org">Clebert Suconic</a>
+ *
+ *
+ */
+public class ReplicationLargeMessageBeingMessage extends PacketImpl
+{
+
+ // Constants -----------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
+ long messageId;
+
+ // Static --------------------------------------------------------
+
+ // Constructors --------------------------------------------------
+
+ public ReplicationLargeMessageBeingMessage(final long messageId)
+ {
+ this();
+ this.messageId = messageId;
+ }
+
+ public ReplicationLargeMessageBeingMessage()
+ {
+ super(PacketImpl.REPLICATION_LARGE_MESSAGE_BEGIN);
+ }
+
+ // Public --------------------------------------------------------
+
+ @Override
+ public void encodeRest(final HornetQBuffer buffer)
+ {
+ buffer.writeLong(messageId);
+ }
+
+ @Override
+ public void decodeRest(final HornetQBuffer buffer)
+ {
+ messageId = buffer.readLong();
+ }
+
+ /**
+ * @return the messageId
+ */
+ public long getMessageId()
+ {
+ return messageId;
+ }
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+
+}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationLargeMessageWriteMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationLargeMessageWriteMessage.java 2010-01-21
20:09:23 UTC (rev 8832)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationLargeMessageWriteMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,100 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.protocol.core.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.protocol.core.impl.PacketImpl;
-
-/**
- * A ReplicationLargeMessageWriteMessage
- *
- * @author <mailto:clebert.suconic@jboss.org">Clebert Suconic</a>
- *
- *
- */
-public class ReplicationLargeMessageWriteMessage extends PacketImpl
-{
-
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private long messageId;
-
- private byte body[];
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
- public ReplicationLargeMessageWriteMessage()
- {
- super(PacketImpl.REPLICATION_LARGE_MESSAGE_WRITE);
- }
-
- /**
- * @param messageId
- * @param body
- */
- public ReplicationLargeMessageWriteMessage(final long messageId, final byte[] body)
- {
- this();
-
- this.messageId = messageId;
- this.body = body;
- }
-
- // Public --------------------------------------------------------
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeLong(messageId);
- buffer.writeInt(body.length);
- buffer.writeBytes(body);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- messageId = buffer.readLong();
- int size = buffer.readInt();
- body = new byte[size];
- buffer.readBytes(body);
- }
-
- /**
- * @return the messageId
- */
- public long getMessageId()
- {
- return messageId;
- }
-
- /**
- * @return the body
- */
- public byte[] getBody()
- {
- return body;
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationLargeMessageWriteMessage.java
(from rev 8832,
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationLargeMessageWriteMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationLargeMessageWriteMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationLargeMessageWriteMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -0,0 +1,100 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.core.protocol.core.impl.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.protocol.core.impl.PacketImpl;
+
+/**
+ * A ReplicationLargeMessageWriteMessage
+ *
+ * @author <mailto:clebert.suconic@jboss.org">Clebert Suconic</a>
+ *
+ *
+ */
+public class ReplicationLargeMessageWriteMessage extends PacketImpl
+{
+
+ // Constants -----------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
+ private long messageId;
+
+ private byte body[];
+
+ // Static --------------------------------------------------------
+
+ // Constructors --------------------------------------------------
+ public ReplicationLargeMessageWriteMessage()
+ {
+ super(PacketImpl.REPLICATION_LARGE_MESSAGE_WRITE);
+ }
+
+ /**
+ * @param messageId
+ * @param body
+ */
+ public ReplicationLargeMessageWriteMessage(final long messageId, final byte[] body)
+ {
+ this();
+
+ this.messageId = messageId;
+ this.body = body;
+ }
+
+ // Public --------------------------------------------------------
+
+ @Override
+ public void encodeRest(final HornetQBuffer buffer)
+ {
+ buffer.writeLong(messageId);
+ buffer.writeInt(body.length);
+ buffer.writeBytes(body);
+ }
+
+ @Override
+ public void decodeRest(final HornetQBuffer buffer)
+ {
+ messageId = buffer.readLong();
+ int size = buffer.readInt();
+ body = new byte[size];
+ buffer.readBytes(body);
+ }
+
+ /**
+ * @return the messageId
+ */
+ public long getMessageId()
+ {
+ return messageId;
+ }
+
+ /**
+ * @return the body
+ */
+ public byte[] getBody()
+ {
+ return body;
+ }
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+
+}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationLargemessageEndMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationLargemessageEndMessage.java 2010-01-21
20:09:23 UTC (rev 8832)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationLargemessageEndMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,79 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.protocol.core.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.protocol.core.impl.PacketImpl;
-
-/**
- * A ReplicationLargemessageEndMessage
- *
- * @author <mailto:clebert.suconic@jboss.org">Clebert Suconic</a>
- *
- *
- */
-public class ReplicationLargemessageEndMessage extends PacketImpl
-{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- long messageId;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public ReplicationLargemessageEndMessage()
- {
- super(PacketImpl.REPLICATION_LARGE_MESSAGE_END);
- }
-
- public ReplicationLargemessageEndMessage(final long messageId)
- {
- this();
- this.messageId = messageId;
- }
-
- // Public --------------------------------------------------------
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeLong(messageId);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- messageId = buffer.readLong();
- }
-
- /**
- * @return the messageId
- */
- public long getMessageId()
- {
- return messageId;
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationLargemessageEndMessage.java
(from rev 8832,
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationLargemessageEndMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationLargemessageEndMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationLargemessageEndMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -0,0 +1,79 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.core.protocol.core.impl.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.protocol.core.impl.PacketImpl;
+
+/**
+ * A ReplicationLargemessageEndMessage
+ *
+ * @author <mailto:clebert.suconic@jboss.org">Clebert Suconic</a>
+ *
+ *
+ */
+public class ReplicationLargemessageEndMessage extends PacketImpl
+{
+ // Constants -----------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
+ long messageId;
+
+ // Static --------------------------------------------------------
+
+ // Constructors --------------------------------------------------
+
+ public ReplicationLargemessageEndMessage()
+ {
+ super(PacketImpl.REPLICATION_LARGE_MESSAGE_END);
+ }
+
+ public ReplicationLargemessageEndMessage(final long messageId)
+ {
+ this();
+ this.messageId = messageId;
+ }
+
+ // Public --------------------------------------------------------
+
+ @Override
+ public void encodeRest(final HornetQBuffer buffer)
+ {
+ buffer.writeLong(messageId);
+ }
+
+ @Override
+ public void decodeRest(final HornetQBuffer buffer)
+ {
+ messageId = buffer.readLong();
+ }
+
+ /**
+ * @return the messageId
+ */
+ public long getMessageId()
+ {
+ return messageId;
+ }
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+
+}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationPageEventMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationPageEventMessage.java 2010-01-21
20:09:23 UTC (rev 8832)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationPageEventMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,110 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.protocol.core.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.api.core.SimpleString;
-import org.hornetq.core.protocol.core.impl.PacketImpl;
-
-/**
- * A ReplicationPageWrite
- *
- * @author <mailto:clebert.suconic@jboss.org">Clebert Suconic</a>
- *
- *
- */
-public class ReplicationPageEventMessage extends PacketImpl
-{
-
- private int pageNumber;
-
- private SimpleString storeName;
-
- /**
- * True = delete page, False = close page
- */
- private boolean isDelete;
-
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public ReplicationPageEventMessage()
- {
- super(PacketImpl.REPLICATION_PAGE_EVENT);
- }
-
- public ReplicationPageEventMessage(final SimpleString storeName, final int pageNumber,
final boolean isDelete)
- {
- this();
- this.pageNumber = pageNumber;
- this.isDelete = isDelete;
- this.storeName = storeName;
- }
-
- // Public --------------------------------------------------------
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeSimpleString(storeName);
- buffer.writeInt(pageNumber);
- buffer.writeBoolean(isDelete);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- storeName = buffer.readSimpleString();
- pageNumber = buffer.readInt();
- isDelete = buffer.readBoolean();
- }
-
- /**
- * @return the pageNumber
- */
- public int getPageNumber()
- {
- return pageNumber;
- }
-
- /**
- * @return the storeName
- */
- public SimpleString getStoreName()
- {
- return storeName;
- }
-
- /**
- * @return the isDelete
- */
- public boolean isDelete()
- {
- return isDelete;
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationPageEventMessage.java
(from rev 8832,
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationPageEventMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationPageEventMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationPageEventMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -0,0 +1,110 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.core.protocol.core.impl.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.api.core.SimpleString;
+import org.hornetq.core.protocol.core.impl.PacketImpl;
+
+/**
+ * A ReplicationPageWrite
+ *
+ * @author <mailto:clebert.suconic@jboss.org">Clebert Suconic</a>
+ *
+ *
+ */
+public class ReplicationPageEventMessage extends PacketImpl
+{
+
+ private int pageNumber;
+
+ private SimpleString storeName;
+
+ /**
+ * True = delete page, False = close page
+ */
+ private boolean isDelete;
+
+ // Constants -----------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
+ // Static --------------------------------------------------------
+
+ // Constructors --------------------------------------------------
+
+ public ReplicationPageEventMessage()
+ {
+ super(PacketImpl.REPLICATION_PAGE_EVENT);
+ }
+
+ public ReplicationPageEventMessage(final SimpleString storeName, final int pageNumber,
final boolean isDelete)
+ {
+ this();
+ this.pageNumber = pageNumber;
+ this.isDelete = isDelete;
+ this.storeName = storeName;
+ }
+
+ // Public --------------------------------------------------------
+
+ @Override
+ public void encodeRest(final HornetQBuffer buffer)
+ {
+ buffer.writeSimpleString(storeName);
+ buffer.writeInt(pageNumber);
+ buffer.writeBoolean(isDelete);
+ }
+
+ @Override
+ public void decodeRest(final HornetQBuffer buffer)
+ {
+ storeName = buffer.readSimpleString();
+ pageNumber = buffer.readInt();
+ isDelete = buffer.readBoolean();
+ }
+
+ /**
+ * @return the pageNumber
+ */
+ public int getPageNumber()
+ {
+ return pageNumber;
+ }
+
+ /**
+ * @return the storeName
+ */
+ public SimpleString getStoreName()
+ {
+ return storeName;
+ }
+
+ /**
+ * @return the isDelete
+ */
+ public boolean isDelete()
+ {
+ return isDelete;
+ }
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+
+}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationPageWriteMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationPageWriteMessage.java 2010-01-21
20:09:23 UTC (rev 8832)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationPageWriteMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,96 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.protocol.core.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.paging.PagedMessage;
-import org.hornetq.core.paging.impl.PagedMessageImpl;
-import org.hornetq.core.protocol.core.impl.PacketImpl;
-
-/**
- * A ReplicationPageWrite
- *
- * @author <mailto:clebert.suconic@jboss.org">Clebert Suconic</a>
- *
- *
- */
-public class ReplicationPageWriteMessage extends PacketImpl
-{
-
- int pageNumber;
-
- PagedMessage pagedMessage;
-
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public ReplicationPageWriteMessage()
- {
- super(PacketImpl.REPLICATION_PAGE_WRITE);
- }
-
- public ReplicationPageWriteMessage(final PagedMessage pagedMessage, final int
pageNumber)
- {
- this();
- this.pageNumber = pageNumber;
- this.pagedMessage = pagedMessage;
- }
-
- // Public --------------------------------------------------------
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeInt(pageNumber);
- pagedMessage.encode(buffer);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- pageNumber = buffer.readInt();
- pagedMessage = new PagedMessageImpl();
- pagedMessage.decode(buffer);
- }
-
- /**
- * @return the pageNumber
- */
- public int getPageNumber()
- {
- return pageNumber;
- }
-
- /**
- * @return the pagedMessage
- */
- public PagedMessage getPagedMessage()
- {
- return pagedMessage;
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationPageWriteMessage.java
(from rev 8832,
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationPageWriteMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationPageWriteMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationPageWriteMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -0,0 +1,96 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.core.protocol.core.impl.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.paging.PagedMessage;
+import org.hornetq.core.paging.impl.PagedMessageImpl;
+import org.hornetq.core.protocol.core.impl.PacketImpl;
+
+/**
+ * A ReplicationPageWrite
+ *
+ * @author <mailto:clebert.suconic@jboss.org">Clebert Suconic</a>
+ *
+ *
+ */
+public class ReplicationPageWriteMessage extends PacketImpl
+{
+
+ int pageNumber;
+
+ PagedMessage pagedMessage;
+
+ // Constants -----------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
+ // Static --------------------------------------------------------
+
+ // Constructors --------------------------------------------------
+
+ public ReplicationPageWriteMessage()
+ {
+ super(PacketImpl.REPLICATION_PAGE_WRITE);
+ }
+
+ public ReplicationPageWriteMessage(final PagedMessage pagedMessage, final int
pageNumber)
+ {
+ this();
+ this.pageNumber = pageNumber;
+ this.pagedMessage = pagedMessage;
+ }
+
+ // Public --------------------------------------------------------
+
+ @Override
+ public void encodeRest(final HornetQBuffer buffer)
+ {
+ buffer.writeInt(pageNumber);
+ pagedMessage.encode(buffer);
+ }
+
+ @Override
+ public void decodeRest(final HornetQBuffer buffer)
+ {
+ pageNumber = buffer.readInt();
+ pagedMessage = new PagedMessageImpl();
+ pagedMessage.decode(buffer);
+ }
+
+ /**
+ * @return the pageNumber
+ */
+ public int getPageNumber()
+ {
+ return pageNumber;
+ }
+
+ /**
+ * @return the pagedMessage
+ */
+ public PagedMessage getPagedMessage()
+ {
+ return pagedMessage;
+ }
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+
+}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationPrepareMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationPrepareMessage.java 2010-01-21
20:09:23 UTC (rev 8832)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationPrepareMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,110 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.protocol.core.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.journal.EncodingSupport;
-import org.hornetq.core.protocol.core.impl.PacketImpl;
-
-/**
- * A ReplicationAddMessage
- *
- * @author <mailto:clebert.suconic@jboss.org">Clebert Suconic</a>
- *
- *
- */
-public class ReplicationPrepareMessage extends PacketImpl
-{
-
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private long txId;
-
- /** 0 - Bindings, 1 - MessagesJournal */
- private byte journalID;
-
- private EncodingSupport encodingData;
-
- private byte[] recordData;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public ReplicationPrepareMessage()
- {
- super(PacketImpl.REPLICATION_PREPARE);
- }
-
- public ReplicationPrepareMessage(final byte journalID, final long txId, final
EncodingSupport encodingData)
- {
- this();
- this.journalID = journalID;
- this.txId = txId;
- this.encodingData = encodingData;
- }
-
- // Public --------------------------------------------------------
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeByte(journalID);
- buffer.writeLong(txId);
- buffer.writeInt(encodingData.getEncodeSize());
- encodingData.encode(buffer);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- journalID = buffer.readByte();
- txId = buffer.readLong();
- int size = buffer.readInt();
- recordData = new byte[size];
- buffer.readBytes(recordData);
- }
-
- public long getTxId()
- {
- return txId;
- }
-
- /**
- * @return the journalID
- */
- public byte getJournalID()
- {
- return journalID;
- }
-
- /**
- * @return the recordData
- */
- public byte[] getRecordData()
- {
- return recordData;
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationPrepareMessage.java
(from rev 8832,
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationPrepareMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationPrepareMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationPrepareMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -0,0 +1,110 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.core.protocol.core.impl.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.journal.EncodingSupport;
+import org.hornetq.core.protocol.core.impl.PacketImpl;
+
+/**
+ * A ReplicationAddMessage
+ *
+ * @author <mailto:clebert.suconic@jboss.org">Clebert Suconic</a>
+ *
+ *
+ */
+public class ReplicationPrepareMessage extends PacketImpl
+{
+
+ // Constants -----------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
+ private long txId;
+
+ /** 0 - Bindings, 1 - MessagesJournal */
+ private byte journalID;
+
+ private EncodingSupport encodingData;
+
+ private byte[] recordData;
+
+ // Static --------------------------------------------------------
+
+ // Constructors --------------------------------------------------
+
+ public ReplicationPrepareMessage()
+ {
+ super(PacketImpl.REPLICATION_PREPARE);
+ }
+
+ public ReplicationPrepareMessage(final byte journalID, final long txId, final
EncodingSupport encodingData)
+ {
+ this();
+ this.journalID = journalID;
+ this.txId = txId;
+ this.encodingData = encodingData;
+ }
+
+ // Public --------------------------------------------------------
+
+ @Override
+ public void encodeRest(final HornetQBuffer buffer)
+ {
+ buffer.writeByte(journalID);
+ buffer.writeLong(txId);
+ buffer.writeInt(encodingData.getEncodeSize());
+ encodingData.encode(buffer);
+ }
+
+ @Override
+ public void decodeRest(final HornetQBuffer buffer)
+ {
+ journalID = buffer.readByte();
+ txId = buffer.readLong();
+ int size = buffer.readInt();
+ recordData = new byte[size];
+ buffer.readBytes(recordData);
+ }
+
+ public long getTxId()
+ {
+ return txId;
+ }
+
+ /**
+ * @return the journalID
+ */
+ public byte getJournalID()
+ {
+ return journalID;
+ }
+
+ /**
+ * @return the recordData
+ */
+ public byte[] getRecordData()
+ {
+ return recordData;
+ }
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+
+}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationResponseMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationResponseMessage.java 2010-01-21
20:09:23 UTC (rev 8832)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationResponseMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,46 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.protocol.core.impl.wireformat;
-
-import org.hornetq.core.protocol.core.impl.PacketImpl;
-
-/**
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- * @version <tt>$Revision$</tt>
- */
-public class ReplicationResponseMessage extends PacketImpl
-{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public ReplicationResponseMessage()
- {
- super(PacketImpl.REPLICATION_RESPONSE);
- }
-
- // Public --------------------------------------------------------
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationResponseMessage.java
(from rev 8832,
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationResponseMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationResponseMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/ReplicationResponseMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.core.protocol.core.impl.wireformat;
+
+import org.hornetq.core.protocol.core.impl.PacketImpl;
+
+/**
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ * @version <tt>$Revision$</tt>
+ */
+public class ReplicationResponseMessage extends PacketImpl
+{
+ // Constants -----------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
+ // Static --------------------------------------------------------
+
+ // Constructors --------------------------------------------------
+
+ public ReplicationResponseMessage()
+ {
+ super(PacketImpl.REPLICATION_RESPONSE);
+ }
+
+ // Public --------------------------------------------------------
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/RollbackMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/RollbackMessage.java 2010-01-21
20:09:23 UTC (rev 8832)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/RollbackMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,96 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.protocol.core.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.protocol.core.impl.PacketImpl;
-
-/**
- * A RollbackMessage
- *
- * @author <a href="mailto:clebert.suconic@jboss.org">Clebert
Suconic</a>
- *
- * Created Feb 18, 2009 2:11:17 PM
- *
- *
- */
-public class RollbackMessage extends PacketImpl
-{
-
- public RollbackMessage()
- {
- super(PacketImpl.SESS_ROLLBACK);
- }
-
- public RollbackMessage(final boolean considerLastMessageAsDelivered)
- {
- super(PacketImpl.SESS_ROLLBACK);
-
- this.considerLastMessageAsDelivered = considerLastMessageAsDelivered;
- }
-
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private boolean considerLastMessageAsDelivered;
-
- /**
- * @return the considerLastMessageAsDelivered
- */
- public boolean isConsiderLastMessageAsDelivered()
- {
- return considerLastMessageAsDelivered;
- }
-
- /**
- * @param isLastMessageAsDelivered the considerLastMessageAsDelivered to set
- */
- public void setConsiderLastMessageAsDelivered(final boolean isLastMessageAsDelivered)
- {
- considerLastMessageAsDelivered = isLastMessageAsDelivered;
- }
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeBoolean(considerLastMessageAsDelivered);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- considerLastMessageAsDelivered = buffer.readBoolean();
- }
-
- public boolean isAsyncExec()
- {
- return true;
- }
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- // Public --------------------------------------------------------
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/RollbackMessage.java
(from rev 8832,
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/RollbackMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/RollbackMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/RollbackMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -0,0 +1,96 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.core.protocol.core.impl.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.protocol.core.impl.PacketImpl;
+
+/**
+ * A RollbackMessage
+ *
+ * @author <a href="mailto:clebert.suconic@jboss.org">Clebert
Suconic</a>
+ *
+ * Created Feb 18, 2009 2:11:17 PM
+ *
+ *
+ */
+public class RollbackMessage extends PacketImpl
+{
+
+ public RollbackMessage()
+ {
+ super(PacketImpl.SESS_ROLLBACK);
+ }
+
+ public RollbackMessage(final boolean considerLastMessageAsDelivered)
+ {
+ super(PacketImpl.SESS_ROLLBACK);
+
+ this.considerLastMessageAsDelivered = considerLastMessageAsDelivered;
+ }
+
+ // Constants -----------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
+ private boolean considerLastMessageAsDelivered;
+
+ /**
+ * @return the considerLastMessageAsDelivered
+ */
+ public boolean isConsiderLastMessageAsDelivered()
+ {
+ return considerLastMessageAsDelivered;
+ }
+
+ /**
+ * @param isLastMessageAsDelivered the considerLastMessageAsDelivered to set
+ */
+ public void setConsiderLastMessageAsDelivered(final boolean isLastMessageAsDelivered)
+ {
+ considerLastMessageAsDelivered = isLastMessageAsDelivered;
+ }
+
+ @Override
+ public void encodeRest(final HornetQBuffer buffer)
+ {
+ buffer.writeBoolean(considerLastMessageAsDelivered);
+ }
+
+ @Override
+ public void decodeRest(final HornetQBuffer buffer)
+ {
+ considerLastMessageAsDelivered = buffer.readBoolean();
+ }
+
+ public boolean isAsyncExec()
+ {
+ return true;
+ }
+
+ // Static --------------------------------------------------------
+
+ // Constructors --------------------------------------------------
+
+ // Public --------------------------------------------------------
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+
+}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionAcknowledgeMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionAcknowledgeMessage.java 2010-01-21
20:09:23 UTC (rev 8832)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionAcknowledgeMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,113 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.protocol.core.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.protocol.core.impl.PacketImpl;
-
-/**
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- * @version <tt>$Revision$</tt>
- */
-public class SessionAcknowledgeMessage extends PacketImpl
-{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private long consumerID;
-
- private long messageID;
-
- private boolean requiresResponse;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public SessionAcknowledgeMessage(final long consumerID, final long messageID, final
boolean requiresResponse)
- {
- super(PacketImpl.SESS_ACKNOWLEDGE);
-
- this.consumerID = consumerID;
-
- this.messageID = messageID;
-
- this.requiresResponse = requiresResponse;
- }
-
- public SessionAcknowledgeMessage()
- {
- super(PacketImpl.SESS_ACKNOWLEDGE);
- }
-
- // Public --------------------------------------------------------
-
- public long getConsumerID()
- {
- return consumerID;
- }
-
- public long getMessageID()
- {
- return messageID;
- }
-
- public boolean isRequiresResponse()
- {
- return requiresResponse;
- }
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeLong(consumerID);
-
- buffer.writeLong(messageID);
-
- buffer.writeBoolean(requiresResponse);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- consumerID = buffer.readLong();
-
- messageID = buffer.readLong();
-
- requiresResponse = buffer.readBoolean();
- }
-
- @Override
- public boolean equals(final Object other)
- {
- if (other instanceof SessionAcknowledgeMessage == false)
- {
- return false;
- }
-
- SessionAcknowledgeMessage r = (SessionAcknowledgeMessage)other;
-
- return super.equals(other) && consumerID == r.consumerID &&
- messageID == r.messageID &&
- requiresResponse == r.requiresResponse;
- }
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionAcknowledgeMessage.java
(from rev 8832,
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionAcknowledgeMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionAcknowledgeMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionAcknowledgeMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -0,0 +1,113 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.core.protocol.core.impl.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.protocol.core.impl.PacketImpl;
+
+/**
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ * @version <tt>$Revision$</tt>
+ */
+public class SessionAcknowledgeMessage extends PacketImpl
+{
+ // Constants -----------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
+ private long consumerID;
+
+ private long messageID;
+
+ private boolean requiresResponse;
+
+ // Static --------------------------------------------------------
+
+ // Constructors --------------------------------------------------
+
+ public SessionAcknowledgeMessage(final long consumerID, final long messageID, final
boolean requiresResponse)
+ {
+ super(PacketImpl.SESS_ACKNOWLEDGE);
+
+ this.consumerID = consumerID;
+
+ this.messageID = messageID;
+
+ this.requiresResponse = requiresResponse;
+ }
+
+ public SessionAcknowledgeMessage()
+ {
+ super(PacketImpl.SESS_ACKNOWLEDGE);
+ }
+
+ // Public --------------------------------------------------------
+
+ public long getConsumerID()
+ {
+ return consumerID;
+ }
+
+ public long getMessageID()
+ {
+ return messageID;
+ }
+
+ public boolean isRequiresResponse()
+ {
+ return requiresResponse;
+ }
+
+ @Override
+ public void encodeRest(final HornetQBuffer buffer)
+ {
+ buffer.writeLong(consumerID);
+
+ buffer.writeLong(messageID);
+
+ buffer.writeBoolean(requiresResponse);
+ }
+
+ @Override
+ public void decodeRest(final HornetQBuffer buffer)
+ {
+ consumerID = buffer.readLong();
+
+ messageID = buffer.readLong();
+
+ requiresResponse = buffer.readBoolean();
+ }
+
+ @Override
+ public boolean equals(final Object other)
+ {
+ if (other instanceof SessionAcknowledgeMessage == false)
+ {
+ return false;
+ }
+
+ SessionAcknowledgeMessage r = (SessionAcknowledgeMessage)other;
+
+ return super.equals(other) && consumerID == r.consumerID &&
+ messageID == r.messageID &&
+ requiresResponse == r.requiresResponse;
+ }
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionBindingQueryMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionBindingQueryMessage.java 2010-01-21
20:09:23 UTC (rev 8832)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionBindingQueryMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,73 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.protocol.core.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.api.core.SimpleString;
-import org.hornetq.core.protocol.core.impl.PacketImpl;
-
-/**
- *
- * A SessionQueueQueryMessage
- *
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- *
- */
-public class SessionBindingQueryMessage extends PacketImpl
-{
- private SimpleString address;
-
- public SessionBindingQueryMessage(final SimpleString address)
- {
- super(PacketImpl.SESS_BINDINGQUERY);
-
- this.address = address;
- }
-
- public SessionBindingQueryMessage()
- {
- super(PacketImpl.SESS_BINDINGQUERY);
- }
-
- public SimpleString getAddress()
- {
- return address;
- }
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeSimpleString(address);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- address = buffer.readSimpleString();
- }
-
- @Override
- public boolean equals(final Object other)
- {
- if (other instanceof SessionBindingQueryMessage == false)
- {
- return false;
- }
-
- SessionBindingQueryMessage r = (SessionBindingQueryMessage)other;
-
- return super.equals(other) && address.equals(r.address);
- }
-
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionBindingQueryMessage.java
(from rev 8832,
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionBindingQueryMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionBindingQueryMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionBindingQueryMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -0,0 +1,73 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.core.protocol.core.impl.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.api.core.SimpleString;
+import org.hornetq.core.protocol.core.impl.PacketImpl;
+
+/**
+ *
+ * A SessionQueueQueryMessage
+ *
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ *
+ */
+public class SessionBindingQueryMessage extends PacketImpl
+{
+ private SimpleString address;
+
+ public SessionBindingQueryMessage(final SimpleString address)
+ {
+ super(PacketImpl.SESS_BINDINGQUERY);
+
+ this.address = address;
+ }
+
+ public SessionBindingQueryMessage()
+ {
+ super(PacketImpl.SESS_BINDINGQUERY);
+ }
+
+ public SimpleString getAddress()
+ {
+ return address;
+ }
+
+ @Override
+ public void encodeRest(final HornetQBuffer buffer)
+ {
+ buffer.writeSimpleString(address);
+ }
+
+ @Override
+ public void decodeRest(final HornetQBuffer buffer)
+ {
+ address = buffer.readSimpleString();
+ }
+
+ @Override
+ public boolean equals(final Object other)
+ {
+ if (other instanceof SessionBindingQueryMessage == false)
+ {
+ return false;
+ }
+
+ SessionBindingQueryMessage r = (SessionBindingQueryMessage)other;
+
+ return super.equals(other) && address.equals(r.address);
+ }
+
+}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionBindingQueryResponseMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionBindingQueryResponseMessage.java 2010-01-21
20:09:23 UTC (rev 8832)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionBindingQueryResponseMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,124 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.protocol.core.impl.wireformat;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.api.core.SimpleString;
-import org.hornetq.core.protocol.core.impl.PacketImpl;
-
-/**
- *
- * A SessionBindingQueryResponseMessage
- *
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- *
- */
-public class SessionBindingQueryResponseMessage extends PacketImpl
-{
- private boolean exists;
-
- private List<SimpleString> queueNames;
-
- public SessionBindingQueryResponseMessage(final boolean exists, final
List<SimpleString> queueNames)
- {
- super(PacketImpl.SESS_BINDINGQUERY_RESP);
-
- this.exists = exists;
-
- this.queueNames = queueNames;
- }
-
- public SessionBindingQueryResponseMessage()
- {
- super(PacketImpl.SESS_BINDINGQUERY_RESP);
- }
-
- @Override
- public boolean isResponse()
- {
- return true;
- }
-
- public boolean isExists()
- {
- return exists;
- }
-
- public List<SimpleString> getQueueNames()
- {
- return queueNames;
- }
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeBoolean(exists);
- buffer.writeInt(queueNames.size());
- for (SimpleString queueName : queueNames)
- {
- buffer.writeSimpleString(queueName);
- }
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- exists = buffer.readBoolean();
- int numQueues = buffer.readInt();
- queueNames = new ArrayList<SimpleString>(numQueues);
- for (int i = 0; i < numQueues; i++)
- {
- queueNames.add(buffer.readSimpleString());
- }
- }
-
- @Override
- public boolean equals(final Object other)
- {
- if (other instanceof SessionBindingQueryResponseMessage == false)
- {
- return false;
- }
-
- SessionBindingQueryResponseMessage r = (SessionBindingQueryResponseMessage)other;
-
- if (super.equals(other) && exists == r.exists)
- {
- if (queueNames.size() == r.queueNames.size())
- {
- for (int i = 0; i < queueNames.size(); i++)
- {
- if (!queueNames.get(i).equals(r.queueNames.get(i)))
- {
- return false;
- }
- }
- }
- else
- {
- return false;
- }
- }
- else
- {
- return false;
- }
-
- return true;
- }
-
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionBindingQueryResponseMessage.java
(from rev 8832,
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionBindingQueryResponseMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionBindingQueryResponseMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionBindingQueryResponseMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -0,0 +1,124 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.core.protocol.core.impl.wireformat;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.api.core.SimpleString;
+import org.hornetq.core.protocol.core.impl.PacketImpl;
+
+/**
+ *
+ * A SessionBindingQueryResponseMessage
+ *
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ *
+ */
+public class SessionBindingQueryResponseMessage extends PacketImpl
+{
+ private boolean exists;
+
+ private List<SimpleString> queueNames;
+
+ public SessionBindingQueryResponseMessage(final boolean exists, final
List<SimpleString> queueNames)
+ {
+ super(PacketImpl.SESS_BINDINGQUERY_RESP);
+
+ this.exists = exists;
+
+ this.queueNames = queueNames;
+ }
+
+ public SessionBindingQueryResponseMessage()
+ {
+ super(PacketImpl.SESS_BINDINGQUERY_RESP);
+ }
+
+ @Override
+ public boolean isResponse()
+ {
+ return true;
+ }
+
+ public boolean isExists()
+ {
+ return exists;
+ }
+
+ public List<SimpleString> getQueueNames()
+ {
+ return queueNames;
+ }
+
+ @Override
+ public void encodeRest(final HornetQBuffer buffer)
+ {
+ buffer.writeBoolean(exists);
+ buffer.writeInt(queueNames.size());
+ for (SimpleString queueName : queueNames)
+ {
+ buffer.writeSimpleString(queueName);
+ }
+ }
+
+ @Override
+ public void decodeRest(final HornetQBuffer buffer)
+ {
+ exists = buffer.readBoolean();
+ int numQueues = buffer.readInt();
+ queueNames = new ArrayList<SimpleString>(numQueues);
+ for (int i = 0; i < numQueues; i++)
+ {
+ queueNames.add(buffer.readSimpleString());
+ }
+ }
+
+ @Override
+ public boolean equals(final Object other)
+ {
+ if (other instanceof SessionBindingQueryResponseMessage == false)
+ {
+ return false;
+ }
+
+ SessionBindingQueryResponseMessage r = (SessionBindingQueryResponseMessage)other;
+
+ if (super.equals(other) && exists == r.exists)
+ {
+ if (queueNames.size() == r.queueNames.size())
+ {
+ for (int i = 0; i < queueNames.size(); i++)
+ {
+ if (!queueNames.get(i).equals(r.queueNames.get(i)))
+ {
+ return false;
+ }
+ }
+ }
+ else
+ {
+ return false;
+ }
+ }
+ else
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionCloseMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionCloseMessage.java 2010-01-21
20:09:23 UTC (rev 8832)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionCloseMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,63 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.protocol.core.impl.wireformat;
-
-import org.hornetq.core.protocol.core.impl.PacketImpl;
-
-/**
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- * @version <tt>$Revision$</tt>
- */
-public class SessionCloseMessage extends PacketImpl
-{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public SessionCloseMessage()
- {
- super(PacketImpl.SESS_CLOSE);
- }
-
- // Public --------------------------------------------------------
-
- @Override
- public boolean equals(final Object other)
- {
- if (other instanceof SessionCloseMessage == false)
- {
- return false;
- }
-
- return super.equals(other);
- }
-
- @Override
- public boolean isAsyncExec()
- {
- return true;
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionCloseMessage.java
(from rev 8832,
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionCloseMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionCloseMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionCloseMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -0,0 +1,63 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.core.protocol.core.impl.wireformat;
+
+import org.hornetq.core.protocol.core.impl.PacketImpl;
+
+/**
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ * @version <tt>$Revision$</tt>
+ */
+public class SessionCloseMessage extends PacketImpl
+{
+ // Constants -----------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
+ // Static --------------------------------------------------------
+
+ // Constructors --------------------------------------------------
+
+ public SessionCloseMessage()
+ {
+ super(PacketImpl.SESS_CLOSE);
+ }
+
+ // Public --------------------------------------------------------
+
+ @Override
+ public boolean equals(final Object other)
+ {
+ if (other instanceof SessionCloseMessage == false)
+ {
+ return false;
+ }
+
+ return super.equals(other);
+ }
+
+ @Override
+ public boolean isAsyncExec()
+ {
+ return true;
+ }
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionCommitMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionCommitMessage.java 2010-01-21
20:09:23 UTC (rev 8832)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionCommitMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,59 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.protocol.core.impl.wireformat;
-
-import org.hornetq.core.protocol.core.impl.PacketImpl;
-
-/**
- * A SessionCommitMessage
- *
- * @author tim
- *
- *
- */
-public class SessionCommitMessage extends PacketImpl
-{
-
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- // Public --------------------------------------------------------
-
- /**
- * @param type
- */
- public SessionCommitMessage()
- {
- super(PacketImpl.SESS_COMMIT);
- }
-
- public boolean isAsyncExec()
- {
- return true;
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionCommitMessage.java
(from rev 8832,
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionCommitMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionCommitMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionCommitMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -0,0 +1,59 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.core.protocol.core.impl.wireformat;
+
+import org.hornetq.core.protocol.core.impl.PacketImpl;
+
+/**
+ * A SessionCommitMessage
+ *
+ * @author tim
+ *
+ *
+ */
+public class SessionCommitMessage extends PacketImpl
+{
+
+ // Constants -----------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
+ // Static --------------------------------------------------------
+
+ // Constructors --------------------------------------------------
+
+ // Public --------------------------------------------------------
+
+ /**
+ * @param type
+ */
+ public SessionCommitMessage()
+ {
+ super(PacketImpl.SESS_COMMIT);
+ }
+
+ public boolean isAsyncExec()
+ {
+ return true;
+ }
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+
+}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionConsumerCloseMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionConsumerCloseMessage.java 2010-01-21
20:09:23 UTC (rev 8832)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionConsumerCloseMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,92 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.protocol.core.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.protocol.core.impl.PacketImpl;
-
-/**
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- *
- * @version <tt>$Revision$</tt>
- */
-public class SessionConsumerCloseMessage extends PacketImpl
-{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private long consumerID;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public SessionConsumerCloseMessage(final long objectID)
- {
- super(PacketImpl.SESS_CONSUMER_CLOSE);
-
- consumerID = objectID;
- }
-
- public SessionConsumerCloseMessage()
- {
- super(PacketImpl.SESS_CONSUMER_CLOSE);
- }
-
- // Public --------------------------------------------------------
-
- public long getConsumerID()
- {
- return consumerID;
- }
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeLong(consumerID);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- consumerID = buffer.readLong();
- }
-
- @Override
- public String toString()
- {
- return getParentString() + ", consumerID=" + consumerID + "]";
- }
-
- @Override
- public boolean equals(final Object other)
- {
- if (other instanceof SessionConsumerCloseMessage == false)
- {
- return false;
- }
-
- SessionConsumerCloseMessage r = (SessionConsumerCloseMessage)other;
-
- return super.equals(other) && consumerID == r.consumerID;
- }
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionConsumerCloseMessage.java
(from rev 8832,
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionConsumerCloseMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionConsumerCloseMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionConsumerCloseMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -0,0 +1,92 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.core.protocol.core.impl.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.protocol.core.impl.PacketImpl;
+
+/**
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ *
+ * @version <tt>$Revision$</tt>
+ */
+public class SessionConsumerCloseMessage extends PacketImpl
+{
+ // Constants -----------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
+ private long consumerID;
+
+ // Static --------------------------------------------------------
+
+ // Constructors --------------------------------------------------
+
+ public SessionConsumerCloseMessage(final long objectID)
+ {
+ super(PacketImpl.SESS_CONSUMER_CLOSE);
+
+ consumerID = objectID;
+ }
+
+ public SessionConsumerCloseMessage()
+ {
+ super(PacketImpl.SESS_CONSUMER_CLOSE);
+ }
+
+ // Public --------------------------------------------------------
+
+ public long getConsumerID()
+ {
+ return consumerID;
+ }
+
+ @Override
+ public void encodeRest(final HornetQBuffer buffer)
+ {
+ buffer.writeLong(consumerID);
+ }
+
+ @Override
+ public void decodeRest(final HornetQBuffer buffer)
+ {
+ consumerID = buffer.readLong();
+ }
+
+ @Override
+ public String toString()
+ {
+ return getParentString() + ", consumerID=" + consumerID + "]";
+ }
+
+ @Override
+ public boolean equals(final Object other)
+ {
+ if (other instanceof SessionConsumerCloseMessage == false)
+ {
+ return false;
+ }
+
+ SessionConsumerCloseMessage r = (SessionConsumerCloseMessage)other;
+
+ return super.equals(other) && consumerID == r.consumerID;
+ }
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionConsumerFlowCreditMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionConsumerFlowCreditMessage.java 2010-01-21
20:09:23 UTC (rev 8832)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionConsumerFlowCreditMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,104 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.protocol.core.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.protocol.core.impl.PacketImpl;
-
-/**
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>.
- *
- * @version <tt>$Revision$</tt>
- */
-public class SessionConsumerFlowCreditMessage extends PacketImpl
-{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private long consumerID;
-
- private int credits;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public SessionConsumerFlowCreditMessage(final long consumerID, final int credits)
- {
- super(PacketImpl.SESS_FLOWTOKEN);
-
- this.consumerID = consumerID;
-
- this.credits = credits;
- }
-
- public SessionConsumerFlowCreditMessage()
- {
- super(PacketImpl.SESS_FLOWTOKEN);
- }
-
- // Public --------------------------------------------------------
-
- public long getConsumerID()
- {
- return consumerID;
- }
-
- public int getCredits()
- {
- return credits;
- }
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeLong(consumerID);
- buffer.writeInt(credits);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- consumerID = buffer.readLong();
- credits = buffer.readInt();
- }
-
- @Override
- public String toString()
- {
- return getParentString() + ", consumerID=" + consumerID + ",
credits=" + credits + "]";
- }
-
- @Override
- public boolean equals(final Object other)
- {
- if (other instanceof SessionConsumerFlowCreditMessage == false)
- {
- return false;
- }
-
- SessionConsumerFlowCreditMessage r = (SessionConsumerFlowCreditMessage)other;
-
- return super.equals(other) && credits == r.credits && consumerID ==
r.consumerID;
- }
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionConsumerFlowCreditMessage.java
(from rev 8832,
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionConsumerFlowCreditMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionConsumerFlowCreditMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionConsumerFlowCreditMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -0,0 +1,104 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.core.protocol.core.impl.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.protocol.core.impl.PacketImpl;
+
+/**
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>.
+ *
+ * @version <tt>$Revision$</tt>
+ */
+public class SessionConsumerFlowCreditMessage extends PacketImpl
+{
+ // Constants -----------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
+ private long consumerID;
+
+ private int credits;
+
+ // Static --------------------------------------------------------
+
+ // Constructors --------------------------------------------------
+
+ public SessionConsumerFlowCreditMessage(final long consumerID, final int credits)
+ {
+ super(PacketImpl.SESS_FLOWTOKEN);
+
+ this.consumerID = consumerID;
+
+ this.credits = credits;
+ }
+
+ public SessionConsumerFlowCreditMessage()
+ {
+ super(PacketImpl.SESS_FLOWTOKEN);
+ }
+
+ // Public --------------------------------------------------------
+
+ public long getConsumerID()
+ {
+ return consumerID;
+ }
+
+ public int getCredits()
+ {
+ return credits;
+ }
+
+ @Override
+ public void encodeRest(final HornetQBuffer buffer)
+ {
+ buffer.writeLong(consumerID);
+ buffer.writeInt(credits);
+ }
+
+ @Override
+ public void decodeRest(final HornetQBuffer buffer)
+ {
+ consumerID = buffer.readLong();
+ credits = buffer.readInt();
+ }
+
+ @Override
+ public String toString()
+ {
+ return getParentString() + ", consumerID=" + consumerID + ",
credits=" + credits + "]";
+ }
+
+ @Override
+ public boolean equals(final Object other)
+ {
+ if (other instanceof SessionConsumerFlowCreditMessage == false)
+ {
+ return false;
+ }
+
+ SessionConsumerFlowCreditMessage r = (SessionConsumerFlowCreditMessage)other;
+
+ return super.equals(other) && credits == r.credits && consumerID ==
r.consumerID;
+ }
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionContinuationMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionContinuationMessage.java 2010-01-21
20:09:23 UTC (rev 8832)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionContinuationMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,102 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.protocol.core.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.protocol.core.impl.PacketImpl;
-import org.hornetq.utils.DataConstants;
-
-/**
- * A SessionContinuationMessage
- *
- * @author <a href="mailto:clebert.suconic@jboss.org">Clebert
Suconic</a>
- *
- * Created Dec 5, 2008 10:08:40 AM
- *
- *
- */
-public abstract class SessionContinuationMessage extends PacketImpl
-{
-
- // Constants -----------------------------------------------------
-
- public static final int SESSION_CONTINUATION_BASE_SIZE =
PacketImpl.PACKET_HEADERS_SIZE + DataConstants.SIZE_INT +
- DataConstants.SIZE_BOOLEAN;
-
- // Attributes ----------------------------------------------------
-
- protected byte[] body;
-
- protected boolean continues;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public SessionContinuationMessage(final byte type, final byte[] body, final boolean
continues)
- {
- super(type);
- this.body = body;
- this.continues = continues;
- }
-
- public SessionContinuationMessage(final byte type)
- {
- super(type);
- }
-
- // Public --------------------------------------------------------
-
- /**
- * @return the body
- */
- public byte[] getBody()
- {
- return body;
- }
-
- /**
- * @return the continues
- */
- public boolean isContinues()
- {
- return continues;
- }
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeInt(body.length);
- buffer.writeBytes(body);
- buffer.writeBoolean(continues);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- int size = buffer.readInt();
- body = new byte[size];
- buffer.readBytes(body);
- continues = buffer.readBoolean();
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionContinuationMessage.java
(from rev 8832,
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionContinuationMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionContinuationMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionContinuationMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -0,0 +1,102 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.core.protocol.core.impl.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.protocol.core.impl.PacketImpl;
+import org.hornetq.utils.DataConstants;
+
+/**
+ * A SessionContinuationMessage
+ *
+ * @author <a href="mailto:clebert.suconic@jboss.org">Clebert
Suconic</a>
+ *
+ * Created Dec 5, 2008 10:08:40 AM
+ *
+ *
+ */
+public abstract class SessionContinuationMessage extends PacketImpl
+{
+
+ // Constants -----------------------------------------------------
+
+ public static final int SESSION_CONTINUATION_BASE_SIZE =
PacketImpl.PACKET_HEADERS_SIZE + DataConstants.SIZE_INT +
+ DataConstants.SIZE_BOOLEAN;
+
+ // Attributes ----------------------------------------------------
+
+ protected byte[] body;
+
+ protected boolean continues;
+
+ // Static --------------------------------------------------------
+
+ // Constructors --------------------------------------------------
+
+ public SessionContinuationMessage(final byte type, final byte[] body, final boolean
continues)
+ {
+ super(type);
+ this.body = body;
+ this.continues = continues;
+ }
+
+ public SessionContinuationMessage(final byte type)
+ {
+ super(type);
+ }
+
+ // Public --------------------------------------------------------
+
+ /**
+ * @return the body
+ */
+ public byte[] getBody()
+ {
+ return body;
+ }
+
+ /**
+ * @return the continues
+ */
+ public boolean isContinues()
+ {
+ return continues;
+ }
+
+ @Override
+ public void encodeRest(final HornetQBuffer buffer)
+ {
+ buffer.writeInt(body.length);
+ buffer.writeBytes(body);
+ buffer.writeBoolean(continues);
+ }
+
+ @Override
+ public void decodeRest(final HornetQBuffer buffer)
+ {
+ int size = buffer.readInt();
+ body = new byte[size];
+ buffer.readBytes(body);
+ continues = buffer.readBoolean();
+ }
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+
+}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionCreateConsumerMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionCreateConsumerMessage.java 2010-01-21
20:09:23 UTC (rev 8832)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionCreateConsumerMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,143 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.protocol.core.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.api.core.SimpleString;
-import org.hornetq.core.protocol.core.impl.PacketImpl;
-
-/**
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- *
- * @version <tt>$Revision$</tt>
- */
-public class SessionCreateConsumerMessage extends PacketImpl
-{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private long id;
-
- private SimpleString queueName;
-
- private SimpleString filterString;
-
- private boolean browseOnly;
-
- private boolean requiresResponse;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public SessionCreateConsumerMessage(final long id,
- final SimpleString queueName,
- final SimpleString filterString,
- final boolean browseOnly,
- final boolean requiresResponse)
- {
- super(PacketImpl.SESS_CREATECONSUMER);
-
- this.id = id;
- this.queueName = queueName;
- this.filterString = filterString;
- this.browseOnly = browseOnly;
- this.requiresResponse = requiresResponse;
- }
-
- public SessionCreateConsumerMessage()
- {
- super(PacketImpl.SESS_CREATECONSUMER);
- }
-
- // Public --------------------------------------------------------
-
- @Override
- public String toString()
- {
- StringBuffer buff = new StringBuffer(getParentString());
- buff.append(", queueName=" + queueName);
- buff.append(", filterString=" + filterString);
- buff.append("]");
- return buff.toString();
- }
-
- public long getID()
- {
- return id;
- }
-
- public SimpleString getQueueName()
- {
- return queueName;
- }
-
- public SimpleString getFilterString()
- {
- return filterString;
- }
-
- public boolean isBrowseOnly()
- {
- return browseOnly;
- }
-
- public boolean isRequiresResponse()
- {
- return requiresResponse;
- }
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeLong(id);
- buffer.writeSimpleString(queueName);
- buffer.writeNullableSimpleString(filterString);
- buffer.writeBoolean(browseOnly);
- buffer.writeBoolean(requiresResponse);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- id = buffer.readLong();
- queueName = buffer.readSimpleString();
- filterString = buffer.readNullableSimpleString();
- browseOnly = buffer.readBoolean();
- requiresResponse = buffer.readBoolean();
- }
-
- @Override
- public boolean equals(final Object other)
- {
- if (other instanceof SessionCreateConsumerMessage == false)
- {
- return false;
- }
-
- SessionCreateConsumerMessage r = (SessionCreateConsumerMessage)other;
-
- return super.equals(other) && queueName.equals(r.queueName) &&
filterString == null ? r.filterString == null
-
: filterString.equals(r.filterString);
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionCreateConsumerMessage.java
(from rev 8832,
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionCreateConsumerMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionCreateConsumerMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionCreateConsumerMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -0,0 +1,143 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.core.protocol.core.impl.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.api.core.SimpleString;
+import org.hornetq.core.protocol.core.impl.PacketImpl;
+
+/**
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ *
+ * @version <tt>$Revision$</tt>
+ */
+public class SessionCreateConsumerMessage extends PacketImpl
+{
+ // Constants -----------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
+ private long id;
+
+ private SimpleString queueName;
+
+ private SimpleString filterString;
+
+ private boolean browseOnly;
+
+ private boolean requiresResponse;
+
+ // Static --------------------------------------------------------
+
+ // Constructors --------------------------------------------------
+
+ public SessionCreateConsumerMessage(final long id,
+ final SimpleString queueName,
+ final SimpleString filterString,
+ final boolean browseOnly,
+ final boolean requiresResponse)
+ {
+ super(PacketImpl.SESS_CREATECONSUMER);
+
+ this.id = id;
+ this.queueName = queueName;
+ this.filterString = filterString;
+ this.browseOnly = browseOnly;
+ this.requiresResponse = requiresResponse;
+ }
+
+ public SessionCreateConsumerMessage()
+ {
+ super(PacketImpl.SESS_CREATECONSUMER);
+ }
+
+ // Public --------------------------------------------------------
+
+ @Override
+ public String toString()
+ {
+ StringBuffer buff = new StringBuffer(getParentString());
+ buff.append(", queueName=" + queueName);
+ buff.append(", filterString=" + filterString);
+ buff.append("]");
+ return buff.toString();
+ }
+
+ public long getID()
+ {
+ return id;
+ }
+
+ public SimpleString getQueueName()
+ {
+ return queueName;
+ }
+
+ public SimpleString getFilterString()
+ {
+ return filterString;
+ }
+
+ public boolean isBrowseOnly()
+ {
+ return browseOnly;
+ }
+
+ public boolean isRequiresResponse()
+ {
+ return requiresResponse;
+ }
+
+ @Override
+ public void encodeRest(final HornetQBuffer buffer)
+ {
+ buffer.writeLong(id);
+ buffer.writeSimpleString(queueName);
+ buffer.writeNullableSimpleString(filterString);
+ buffer.writeBoolean(browseOnly);
+ buffer.writeBoolean(requiresResponse);
+ }
+
+ @Override
+ public void decodeRest(final HornetQBuffer buffer)
+ {
+ id = buffer.readLong();
+ queueName = buffer.readSimpleString();
+ filterString = buffer.readNullableSimpleString();
+ browseOnly = buffer.readBoolean();
+ requiresResponse = buffer.readBoolean();
+ }
+
+ @Override
+ public boolean equals(final Object other)
+ {
+ if (other instanceof SessionCreateConsumerMessage == false)
+ {
+ return false;
+ }
+
+ SessionCreateConsumerMessage r = (SessionCreateConsumerMessage)other;
+
+ return super.equals(other) && queueName.equals(r.queueName) &&
filterString == null ? r.filterString == null
+
: filterString.equals(r.filterString);
+ }
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionDeleteQueueMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionDeleteQueueMessage.java 2010-01-21
20:09:23 UTC (rev 8832)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionDeleteQueueMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,97 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.protocol.core.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.api.core.SimpleString;
-import org.hornetq.core.protocol.core.impl.PacketImpl;
-
-/**
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
-
- * @version <tt>$Revision$</tt>
- */
-public class SessionDeleteQueueMessage extends PacketImpl
-{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private SimpleString queueName;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public SessionDeleteQueueMessage(final SimpleString queueName)
- {
- super(PacketImpl.DELETE_QUEUE);
-
- this.queueName = queueName;
- }
-
- public SessionDeleteQueueMessage()
- {
- super(PacketImpl.DELETE_QUEUE);
- }
-
- // Public --------------------------------------------------------
-
- @Override
- public String toString()
- {
- StringBuffer buff = new StringBuffer(getParentString());
- buff.append(", queueName=" + queueName);
- buff.append("]");
- return buff.toString();
- }
-
- public SimpleString getQueueName()
- {
- return queueName;
- }
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeSimpleString(queueName);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- queueName = buffer.readSimpleString();
- }
-
- @Override
- public boolean equals(final Object other)
- {
- if (other instanceof SessionDeleteQueueMessage == false)
- {
- return false;
- }
-
- SessionDeleteQueueMessage r = (SessionDeleteQueueMessage)other;
-
- return super.equals(other) && r.queueName.equals(queueName);
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionDeleteQueueMessage.java
(from rev 8832,
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionDeleteQueueMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionDeleteQueueMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionDeleteQueueMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -0,0 +1,97 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.core.protocol.core.impl.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.api.core.SimpleString;
+import org.hornetq.core.protocol.core.impl.PacketImpl;
+
+/**
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+
+ * @version <tt>$Revision$</tt>
+ */
+public class SessionDeleteQueueMessage extends PacketImpl
+{
+ // Constants -----------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
+ private SimpleString queueName;
+
+ // Static --------------------------------------------------------
+
+ // Constructors --------------------------------------------------
+
+ public SessionDeleteQueueMessage(final SimpleString queueName)
+ {
+ super(PacketImpl.DELETE_QUEUE);
+
+ this.queueName = queueName;
+ }
+
+ public SessionDeleteQueueMessage()
+ {
+ super(PacketImpl.DELETE_QUEUE);
+ }
+
+ // Public --------------------------------------------------------
+
+ @Override
+ public String toString()
+ {
+ StringBuffer buff = new StringBuffer(getParentString());
+ buff.append(", queueName=" + queueName);
+ buff.append("]");
+ return buff.toString();
+ }
+
+ public SimpleString getQueueName()
+ {
+ return queueName;
+ }
+
+ @Override
+ public void encodeRest(final HornetQBuffer buffer)
+ {
+ buffer.writeSimpleString(queueName);
+ }
+
+ @Override
+ public void decodeRest(final HornetQBuffer buffer)
+ {
+ queueName = buffer.readSimpleString();
+ }
+
+ @Override
+ public boolean equals(final Object other)
+ {
+ if (other instanceof SessionDeleteQueueMessage == false)
+ {
+ return false;
+ }
+
+ SessionDeleteQueueMessage r = (SessionDeleteQueueMessage)other;
+
+ return super.equals(other) && r.queueName.equals(queueName);
+ }
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionExpiredMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionExpiredMessage.java 2010-01-21
20:09:23 UTC (rev 8832)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionExpiredMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,98 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.protocol.core.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.protocol.core.impl.PacketImpl;
-
-/**
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- * @version <tt>$Revision$</tt>
- */
-public class SessionExpiredMessage extends PacketImpl
-{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private long consumerID;
-
- private long messageID;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public SessionExpiredMessage(final long consumerID, final long messageID)
- {
- super(PacketImpl.SESS_EXPIRED);
-
- this.consumerID = consumerID;
-
- this.messageID = messageID;
- }
-
- public SessionExpiredMessage()
- {
- super(PacketImpl.SESS_EXPIRED);
- }
-
- // Public --------------------------------------------------------
-
- public long getConsumerID()
- {
- return consumerID;
- }
-
- public long getMessageID()
- {
- return messageID;
- }
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeLong(consumerID);
-
- buffer.writeLong(messageID);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- consumerID = buffer.readLong();
-
- messageID = buffer.readLong();
- }
-
- @Override
- public boolean equals(final Object other)
- {
- if (other instanceof SessionExpiredMessage == false)
- {
- return false;
- }
-
- SessionExpiredMessage r = (SessionExpiredMessage)other;
-
- return super.equals(other) && consumerID == r.consumerID &&
messageID == r.messageID;
- }
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionExpiredMessage.java
(from rev 8832,
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionExpiredMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionExpiredMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionExpiredMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -0,0 +1,98 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.core.protocol.core.impl.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.protocol.core.impl.PacketImpl;
+
+/**
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ * @version <tt>$Revision$</tt>
+ */
+public class SessionExpiredMessage extends PacketImpl
+{
+ // Constants -----------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
+ private long consumerID;
+
+ private long messageID;
+
+ // Static --------------------------------------------------------
+
+ // Constructors --------------------------------------------------
+
+ public SessionExpiredMessage(final long consumerID, final long messageID)
+ {
+ super(PacketImpl.SESS_EXPIRED);
+
+ this.consumerID = consumerID;
+
+ this.messageID = messageID;
+ }
+
+ public SessionExpiredMessage()
+ {
+ super(PacketImpl.SESS_EXPIRED);
+ }
+
+ // Public --------------------------------------------------------
+
+ public long getConsumerID()
+ {
+ return consumerID;
+ }
+
+ public long getMessageID()
+ {
+ return messageID;
+ }
+
+ @Override
+ public void encodeRest(final HornetQBuffer buffer)
+ {
+ buffer.writeLong(consumerID);
+
+ buffer.writeLong(messageID);
+ }
+
+ @Override
+ public void decodeRest(final HornetQBuffer buffer)
+ {
+ consumerID = buffer.readLong();
+
+ messageID = buffer.readLong();
+ }
+
+ @Override
+ public boolean equals(final Object other)
+ {
+ if (other instanceof SessionExpiredMessage == false)
+ {
+ return false;
+ }
+
+ SessionExpiredMessage r = (SessionExpiredMessage)other;
+
+ return super.equals(other) && consumerID == r.consumerID &&
messageID == r.messageID;
+ }
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionForceConsumerDelivery.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionForceConsumerDelivery.java 2010-01-21
20:09:23 UTC (rev 8832)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionForceConsumerDelivery.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,109 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.protocol.core.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.protocol.core.impl.PacketImpl;
-
-/**
- *
- * A SessionConsumerForceDelivery
- *
- * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
- *
- */
-public class SessionForceConsumerDelivery extends PacketImpl
-{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private long consumerID;
-
- private long sequence;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public SessionForceConsumerDelivery(final long consumerID, final long sequence)
- {
- super(PacketImpl.SESS_FORCE_CONSUMER_DELIVERY);
-
- this.consumerID = consumerID;
- this.sequence = sequence;
- }
-
- public SessionForceConsumerDelivery()
- {
- super(PacketImpl.SESS_FORCE_CONSUMER_DELIVERY);
- }
-
- // Public --------------------------------------------------------
-
- public long getConsumerID()
- {
- return consumerID;
- }
-
- public long getSequence()
- {
- return sequence;
- }
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeLong(consumerID);
- buffer.writeLong(sequence);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- consumerID = buffer.readLong();
- sequence = buffer.readLong();
- }
-
- @Override
- public String toString()
- {
- StringBuffer buf = new StringBuffer(getParentString());
- buf.append(", consumerID=" + consumerID);
- buf.append(", sequence=" + sequence);
- buf.append("]");
- return buf.toString();
- }
-
- @Override
- public boolean equals(final Object other)
- {
- if (other instanceof SessionForceConsumerDelivery == false)
- {
- return false;
- }
-
- SessionForceConsumerDelivery r = (SessionForceConsumerDelivery)other;
-
- return super.equals(other) && consumerID == r.consumerID &&
sequence == r.sequence;
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionForceConsumerDelivery.java
(from rev 8832,
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionForceConsumerDelivery.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionForceConsumerDelivery.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionForceConsumerDelivery.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -0,0 +1,109 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.core.protocol.core.impl.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.protocol.core.impl.PacketImpl;
+
+/**
+ *
+ * A SessionConsumerForceDelivery
+ *
+ * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
+ *
+ */
+public class SessionForceConsumerDelivery extends PacketImpl
+{
+ // Constants -----------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
+ private long consumerID;
+
+ private long sequence;
+
+ // Static --------------------------------------------------------
+
+ // Constructors --------------------------------------------------
+
+ public SessionForceConsumerDelivery(final long consumerID, final long sequence)
+ {
+ super(PacketImpl.SESS_FORCE_CONSUMER_DELIVERY);
+
+ this.consumerID = consumerID;
+ this.sequence = sequence;
+ }
+
+ public SessionForceConsumerDelivery()
+ {
+ super(PacketImpl.SESS_FORCE_CONSUMER_DELIVERY);
+ }
+
+ // Public --------------------------------------------------------
+
+ public long getConsumerID()
+ {
+ return consumerID;
+ }
+
+ public long getSequence()
+ {
+ return sequence;
+ }
+
+ @Override
+ public void encodeRest(final HornetQBuffer buffer)
+ {
+ buffer.writeLong(consumerID);
+ buffer.writeLong(sequence);
+ }
+
+ @Override
+ public void decodeRest(final HornetQBuffer buffer)
+ {
+ consumerID = buffer.readLong();
+ sequence = buffer.readLong();
+ }
+
+ @Override
+ public String toString()
+ {
+ StringBuffer buf = new StringBuffer(getParentString());
+ buf.append(", consumerID=" + consumerID);
+ buf.append(", sequence=" + sequence);
+ buf.append("]");
+ return buf.toString();
+ }
+
+ @Override
+ public boolean equals(final Object other)
+ {
+ if (other instanceof SessionForceConsumerDelivery == false)
+ {
+ return false;
+ }
+
+ SessionForceConsumerDelivery r = (SessionForceConsumerDelivery)other;
+
+ return super.equals(other) && consumerID == r.consumerID &&
sequence == r.sequence;
+ }
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionProducerCreditsMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionProducerCreditsMessage.java 2010-01-21
20:09:23 UTC (rev 8832)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionProducerCreditsMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,96 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.protocol.core.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.api.core.SimpleString;
-import org.hornetq.core.protocol.core.impl.PacketImpl;
-
-/**
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- *
- */
-public class SessionProducerCreditsMessage extends PacketImpl
-{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private int credits;
-
- private SimpleString address;
-
- private int offset;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public SessionProducerCreditsMessage(final int credits, final SimpleString address,
final int offset)
- {
- super(PacketImpl.SESS_PRODUCER_CREDITS);
-
- this.credits = credits;
-
- this.address = address;
-
- this.offset = offset;
- }
-
- public SessionProducerCreditsMessage()
- {
- super(PacketImpl.SESS_PRODUCER_CREDITS);
- }
-
- // Public --------------------------------------------------------
-
- public int getCredits()
- {
- return credits;
- }
-
- public SimpleString getAddress()
- {
- return address;
- }
-
- public int getOffset()
- {
- return offset;
- }
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeInt(credits);
- buffer.writeSimpleString(address);
- buffer.writeInt(offset);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- credits = buffer.readInt();
- address = buffer.readSimpleString();
- offset = buffer.readInt();
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionProducerCreditsMessage.java
(from rev 8832,
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionProducerCreditsMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionProducerCreditsMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionProducerCreditsMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -0,0 +1,96 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.core.protocol.core.impl.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.api.core.SimpleString;
+import org.hornetq.core.protocol.core.impl.PacketImpl;
+
+/**
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ *
+ */
+public class SessionProducerCreditsMessage extends PacketImpl
+{
+ // Constants -----------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
+ private int credits;
+
+ private SimpleString address;
+
+ private int offset;
+
+ // Static --------------------------------------------------------
+
+ // Constructors --------------------------------------------------
+
+ public SessionProducerCreditsMessage(final int credits, final SimpleString address,
final int offset)
+ {
+ super(PacketImpl.SESS_PRODUCER_CREDITS);
+
+ this.credits = credits;
+
+ this.address = address;
+
+ this.offset = offset;
+ }
+
+ public SessionProducerCreditsMessage()
+ {
+ super(PacketImpl.SESS_PRODUCER_CREDITS);
+ }
+
+ // Public --------------------------------------------------------
+
+ public int getCredits()
+ {
+ return credits;
+ }
+
+ public SimpleString getAddress()
+ {
+ return address;
+ }
+
+ public int getOffset()
+ {
+ return offset;
+ }
+
+ @Override
+ public void encodeRest(final HornetQBuffer buffer)
+ {
+ buffer.writeInt(credits);
+ buffer.writeSimpleString(address);
+ buffer.writeInt(offset);
+ }
+
+ @Override
+ public void decodeRest(final HornetQBuffer buffer)
+ {
+ credits = buffer.readInt();
+ address = buffer.readSimpleString();
+ offset = buffer.readInt();
+ }
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionQueueQueryMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionQueueQueryMessage.java 2010-01-21
20:09:23 UTC (rev 8832)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionQueueQueryMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,73 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.protocol.core.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.api.core.SimpleString;
-import org.hornetq.core.protocol.core.impl.PacketImpl;
-
-/**
- *
- * A SessionQueueQueryMessage
- *
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- *
- */
-public class SessionQueueQueryMessage extends PacketImpl
-{
- private SimpleString queueName;
-
- public SessionQueueQueryMessage(final SimpleString queueName)
- {
- super(PacketImpl.SESS_QUEUEQUERY);
-
- this.queueName = queueName;
- }
-
- public SessionQueueQueryMessage()
- {
- super(PacketImpl.SESS_QUEUEQUERY);
- }
-
- public SimpleString getQueueName()
- {
- return queueName;
- }
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeSimpleString(queueName);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- queueName = buffer.readSimpleString();
- }
-
- @Override
- public boolean equals(final Object other)
- {
- if (other instanceof SessionQueueQueryMessage == false)
- {
- return false;
- }
-
- SessionQueueQueryMessage r = (SessionQueueQueryMessage)other;
-
- return super.equals(other) && r.queueName.equals(queueName);
- }
-
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionQueueQueryMessage.java
(from rev 8832,
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionQueueQueryMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionQueueQueryMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionQueueQueryMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -0,0 +1,73 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.core.protocol.core.impl.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.api.core.SimpleString;
+import org.hornetq.core.protocol.core.impl.PacketImpl;
+
+/**
+ *
+ * A SessionQueueQueryMessage
+ *
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ *
+ */
+public class SessionQueueQueryMessage extends PacketImpl
+{
+ private SimpleString queueName;
+
+ public SessionQueueQueryMessage(final SimpleString queueName)
+ {
+ super(PacketImpl.SESS_QUEUEQUERY);
+
+ this.queueName = queueName;
+ }
+
+ public SessionQueueQueryMessage()
+ {
+ super(PacketImpl.SESS_QUEUEQUERY);
+ }
+
+ public SimpleString getQueueName()
+ {
+ return queueName;
+ }
+
+ @Override
+ public void encodeRest(final HornetQBuffer buffer)
+ {
+ buffer.writeSimpleString(queueName);
+ }
+
+ @Override
+ public void decodeRest(final HornetQBuffer buffer)
+ {
+ queueName = buffer.readSimpleString();
+ }
+
+ @Override
+ public boolean equals(final Object other)
+ {
+ if (other instanceof SessionQueueQueryMessage == false)
+ {
+ return false;
+ }
+
+ SessionQueueQueryMessage r = (SessionQueueQueryMessage)other;
+
+ return super.equals(other) && r.queueName.equals(queueName);
+ }
+
+}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionQueueQueryResponseMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionQueueQueryResponseMessage.java 2010-01-21
20:09:23 UTC (rev 8832)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionQueueQueryResponseMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,176 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.protocol.core.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.api.core.SimpleString;
-import org.hornetq.core.protocol.core.impl.PacketImpl;
-import org.hornetq.core.server.QueueQueryResult;
-
-/**
- *
- * A SessionQueueQueryResponseMessage
- *
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- *
- */
-public class SessionQueueQueryResponseMessage extends PacketImpl
-{
- private SimpleString name;
-
- private boolean exists;
-
- private boolean durable;
-
- private int consumerCount;
-
- private int messageCount;
-
- private SimpleString filterString;
-
- private SimpleString address;
-
- private boolean temporary;
-
- public SessionQueueQueryResponseMessage(final QueueQueryResult result)
- {
- this(result.getName(), result.getAddress(), result.isDurable(),
result.isTemporary(),
- result.getFilterString(), result.getConsumerCount(), result.getMessageCount(),
result.isExists());
- }
-
- public SessionQueueQueryResponseMessage()
- {
- this(null, null, false, false, null, 0, 0, false);
- }
-
- private SessionQueueQueryResponseMessage(final SimpleString name,
- final SimpleString address,
- final boolean durable,
- final boolean temporary,
- final SimpleString filterString,
- final int consumerCount,
- final int messageCount,
- final boolean exists)
- {
- super(PacketImpl.SESS_QUEUEQUERY_RESP);
-
- this.durable = durable;
-
- this.temporary = temporary;
-
- this.consumerCount = consumerCount;
-
- this.messageCount = messageCount;
-
- this.filterString = filterString;
-
- this.address = address;
-
- this.name = name;
-
- this.exists = exists;
- }
-
- @Override
- public boolean isResponse()
- {
- return true;
- }
-
- public boolean isExists()
- {
- return exists;
- }
-
- public boolean isDurable()
- {
- return durable;
- }
-
- public int getConsumerCount()
- {
- return consumerCount;
- }
-
- public int getMessageCount()
- {
- return messageCount;
- }
-
- public SimpleString getFilterString()
- {
- return filterString;
- }
-
- public SimpleString getAddress()
- {
- return address;
- }
-
- public SimpleString getName()
- {
- return name;
- }
-
- public boolean isTemporary()
- {
- return temporary;
- }
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeBoolean(exists);
- buffer.writeBoolean(durable);
- buffer.writeBoolean(temporary);
- buffer.writeInt(consumerCount);
- buffer.writeInt(messageCount);
- buffer.writeNullableSimpleString(filterString);
- buffer.writeNullableSimpleString(address);
- buffer.writeNullableSimpleString(name);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- exists = buffer.readBoolean();
- durable = buffer.readBoolean();
- temporary = buffer.readBoolean();
- consumerCount = buffer.readInt();
- messageCount = buffer.readInt();
- filterString = buffer.readNullableSimpleString();
- address = buffer.readNullableSimpleString();
- name = buffer.readNullableSimpleString();
- }
-
- @Override
- public boolean equals(final Object other)
- {
- if (other instanceof SessionQueueQueryResponseMessage == false)
- {
- return false;
- }
-
- SessionQueueQueryResponseMessage r = (SessionQueueQueryResponseMessage)other;
-
- return super.equals(other) && exists == r.exists &&
- durable == r.durable &&
- consumerCount == r.consumerCount &&
- messageCount == r.messageCount &&
- filterString == null ? r.filterString == null
- : filterString.equals(r.filterString) && address
== null ? r.address == null
-
: address.equals(r.address);
- }
-
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionQueueQueryResponseMessage.java
(from rev 8832,
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionQueueQueryResponseMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionQueueQueryResponseMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionQueueQueryResponseMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -0,0 +1,176 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.core.protocol.core.impl.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.api.core.SimpleString;
+import org.hornetq.core.protocol.core.impl.PacketImpl;
+import org.hornetq.core.server.QueueQueryResult;
+
+/**
+ *
+ * A SessionQueueQueryResponseMessage
+ *
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ *
+ */
+public class SessionQueueQueryResponseMessage extends PacketImpl
+{
+ private SimpleString name;
+
+ private boolean exists;
+
+ private boolean durable;
+
+ private int consumerCount;
+
+ private int messageCount;
+
+ private SimpleString filterString;
+
+ private SimpleString address;
+
+ private boolean temporary;
+
+ public SessionQueueQueryResponseMessage(final QueueQueryResult result)
+ {
+ this(result.getName(), result.getAddress(), result.isDurable(),
result.isTemporary(),
+ result.getFilterString(), result.getConsumerCount(), result.getMessageCount(),
result.isExists());
+ }
+
+ public SessionQueueQueryResponseMessage()
+ {
+ this(null, null, false, false, null, 0, 0, false);
+ }
+
+ private SessionQueueQueryResponseMessage(final SimpleString name,
+ final SimpleString address,
+ final boolean durable,
+ final boolean temporary,
+ final SimpleString filterString,
+ final int consumerCount,
+ final int messageCount,
+ final boolean exists)
+ {
+ super(PacketImpl.SESS_QUEUEQUERY_RESP);
+
+ this.durable = durable;
+
+ this.temporary = temporary;
+
+ this.consumerCount = consumerCount;
+
+ this.messageCount = messageCount;
+
+ this.filterString = filterString;
+
+ this.address = address;
+
+ this.name = name;
+
+ this.exists = exists;
+ }
+
+ @Override
+ public boolean isResponse()
+ {
+ return true;
+ }
+
+ public boolean isExists()
+ {
+ return exists;
+ }
+
+ public boolean isDurable()
+ {
+ return durable;
+ }
+
+ public int getConsumerCount()
+ {
+ return consumerCount;
+ }
+
+ public int getMessageCount()
+ {
+ return messageCount;
+ }
+
+ public SimpleString getFilterString()
+ {
+ return filterString;
+ }
+
+ public SimpleString getAddress()
+ {
+ return address;
+ }
+
+ public SimpleString getName()
+ {
+ return name;
+ }
+
+ public boolean isTemporary()
+ {
+ return temporary;
+ }
+
+ @Override
+ public void encodeRest(final HornetQBuffer buffer)
+ {
+ buffer.writeBoolean(exists);
+ buffer.writeBoolean(durable);
+ buffer.writeBoolean(temporary);
+ buffer.writeInt(consumerCount);
+ buffer.writeInt(messageCount);
+ buffer.writeNullableSimpleString(filterString);
+ buffer.writeNullableSimpleString(address);
+ buffer.writeNullableSimpleString(name);
+ }
+
+ @Override
+ public void decodeRest(final HornetQBuffer buffer)
+ {
+ exists = buffer.readBoolean();
+ durable = buffer.readBoolean();
+ temporary = buffer.readBoolean();
+ consumerCount = buffer.readInt();
+ messageCount = buffer.readInt();
+ filterString = buffer.readNullableSimpleString();
+ address = buffer.readNullableSimpleString();
+ name = buffer.readNullableSimpleString();
+ }
+
+ @Override
+ public boolean equals(final Object other)
+ {
+ if (other instanceof SessionQueueQueryResponseMessage == false)
+ {
+ return false;
+ }
+
+ SessionQueueQueryResponseMessage r = (SessionQueueQueryResponseMessage)other;
+
+ return super.equals(other) && exists == r.exists &&
+ durable == r.durable &&
+ consumerCount == r.consumerCount &&
+ messageCount == r.messageCount &&
+ filterString == null ? r.filterString == null
+ : filterString.equals(r.filterString) && address
== null ? r.address == null
+
: address.equals(r.address);
+ }
+
+}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionReceiveContinuationMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionReceiveContinuationMessage.java 2010-01-21
20:09:23 UTC (rev 8832)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionReceiveContinuationMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,96 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.protocol.core.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.protocol.core.impl.PacketImpl;
-import org.hornetq.utils.DataConstants;
-
-/**
- * A SessionSendContinuationMessage
- *
- * @author <a href="mailto:clebert.suconic@jboss.org">Clebert
Suconic</a>
- *
- * Created Dec 4, 2008 12:25:14 PM
- *
- *
- */
-public class SessionReceiveContinuationMessage extends SessionContinuationMessage
-{
-
- // Constants -----------------------------------------------------
-
- public static final int SESSION_RECEIVE_CONTINUATION_BASE_SIZE =
SessionContinuationMessage.SESSION_CONTINUATION_BASE_SIZE + DataConstants.SIZE_LONG;
-
- // Attributes ----------------------------------------------------
-
- private long consumerID;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public SessionReceiveContinuationMessage()
- {
- super(PacketImpl.SESS_RECEIVE_CONTINUATION);
- }
-
- /**
- * @param consumerID
- * @param body
- * @param continues
- * @param requiresResponse
- */
- public SessionReceiveContinuationMessage(final long consumerID,
- final byte[] body,
- final boolean continues,
- final boolean requiresResponse)
- {
- super(PacketImpl.SESS_RECEIVE_CONTINUATION, body, continues);
- this.consumerID = consumerID;
- }
-
- /**
- * @return the consumerID
- */
- public long getConsumerID()
- {
- return consumerID;
- }
-
- // Public --------------------------------------------------------
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- super.encodeRest(buffer);
- buffer.writeLong(consumerID);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- super.decodeRest(buffer);
- consumerID = buffer.readLong();
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionReceiveContinuationMessage.java
(from rev 8832,
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionReceiveContinuationMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionReceiveContinuationMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionReceiveContinuationMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -0,0 +1,96 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.core.protocol.core.impl.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.protocol.core.impl.PacketImpl;
+import org.hornetq.utils.DataConstants;
+
+/**
+ * A SessionSendContinuationMessage
+ *
+ * @author <a href="mailto:clebert.suconic@jboss.org">Clebert
Suconic</a>
+ *
+ * Created Dec 4, 2008 12:25:14 PM
+ *
+ *
+ */
+public class SessionReceiveContinuationMessage extends SessionContinuationMessage
+{
+
+ // Constants -----------------------------------------------------
+
+ public static final int SESSION_RECEIVE_CONTINUATION_BASE_SIZE =
SessionContinuationMessage.SESSION_CONTINUATION_BASE_SIZE + DataConstants.SIZE_LONG;
+
+ // Attributes ----------------------------------------------------
+
+ private long consumerID;
+
+ // Static --------------------------------------------------------
+
+ // Constructors --------------------------------------------------
+
+ public SessionReceiveContinuationMessage()
+ {
+ super(PacketImpl.SESS_RECEIVE_CONTINUATION);
+ }
+
+ /**
+ * @param consumerID
+ * @param body
+ * @param continues
+ * @param requiresResponse
+ */
+ public SessionReceiveContinuationMessage(final long consumerID,
+ final byte[] body,
+ final boolean continues,
+ final boolean requiresResponse)
+ {
+ super(PacketImpl.SESS_RECEIVE_CONTINUATION, body, continues);
+ this.consumerID = consumerID;
+ }
+
+ /**
+ * @return the consumerID
+ */
+ public long getConsumerID()
+ {
+ return consumerID;
+ }
+
+ // Public --------------------------------------------------------
+
+ @Override
+ public void encodeRest(final HornetQBuffer buffer)
+ {
+ super.encodeRest(buffer);
+ buffer.writeLong(consumerID);
+ }
+
+ @Override
+ public void decodeRest(final HornetQBuffer buffer)
+ {
+ super.decodeRest(buffer);
+ consumerID = buffer.readLong();
+ }
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+
+}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionReceiveLargeMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionReceiveLargeMessage.java 2010-01-21
20:09:23 UTC (rev 8832)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionReceiveLargeMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,102 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.protocol.core.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.protocol.core.impl.PacketImpl;
-
-/**
- * A SessionReceiveLargeMessage
- *
- * @author Clebert Suconic
- *
- *
- */
-public class SessionReceiveLargeMessage extends PacketImpl
-{
- private byte[] largeMessageHeader;
-
- /** Since we receive the message before the entire message was received, */
- private long largeMessageSize;
-
- private long consumerID;
-
- private int deliveryCount;
-
- public SessionReceiveLargeMessage()
- {
- super(PacketImpl.SESS_RECEIVE_LARGE_MSG);
- }
-
- public SessionReceiveLargeMessage(final long consumerID,
- final byte[] largeMessageHeader,
- final long largeMessageSize,
- final int deliveryCount)
- {
- super(PacketImpl.SESS_RECEIVE_LARGE_MSG);
-
- this.consumerID = consumerID;
-
- this.largeMessageHeader = largeMessageHeader;
-
- this.deliveryCount = deliveryCount;
-
- this.largeMessageSize = largeMessageSize;
- }
-
- public byte[] getLargeMessageHeader()
- {
- return largeMessageHeader;
- }
-
- public long getConsumerID()
- {
- return consumerID;
- }
-
- public int getDeliveryCount()
- {
- return deliveryCount;
- }
-
- /**
- * @return the largeMessageSize
- */
- public long getLargeMessageSize()
- {
- return largeMessageSize;
- }
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeLong(consumerID);
- buffer.writeInt(deliveryCount);
- buffer.writeLong(largeMessageSize);
- buffer.writeInt(largeMessageHeader.length);
- buffer.writeBytes(largeMessageHeader);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- consumerID = buffer.readLong();
- deliveryCount = buffer.readInt();
- largeMessageSize = buffer.readLong();
- int size = buffer.readInt();
- largeMessageHeader = new byte[size];
- buffer.readBytes(largeMessageHeader);
- }
-
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionReceiveLargeMessage.java
(from rev 8832,
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionReceiveLargeMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionReceiveLargeMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionReceiveLargeMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -0,0 +1,102 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.core.protocol.core.impl.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.protocol.core.impl.PacketImpl;
+
+/**
+ * A SessionReceiveLargeMessage
+ *
+ * @author Clebert Suconic
+ *
+ *
+ */
+public class SessionReceiveLargeMessage extends PacketImpl
+{
+ private byte[] largeMessageHeader;
+
+ /** Since we receive the message before the entire message was received, */
+ private long largeMessageSize;
+
+ private long consumerID;
+
+ private int deliveryCount;
+
+ public SessionReceiveLargeMessage()
+ {
+ super(PacketImpl.SESS_RECEIVE_LARGE_MSG);
+ }
+
+ public SessionReceiveLargeMessage(final long consumerID,
+ final byte[] largeMessageHeader,
+ final long largeMessageSize,
+ final int deliveryCount)
+ {
+ super(PacketImpl.SESS_RECEIVE_LARGE_MSG);
+
+ this.consumerID = consumerID;
+
+ this.largeMessageHeader = largeMessageHeader;
+
+ this.deliveryCount = deliveryCount;
+
+ this.largeMessageSize = largeMessageSize;
+ }
+
+ public byte[] getLargeMessageHeader()
+ {
+ return largeMessageHeader;
+ }
+
+ public long getConsumerID()
+ {
+ return consumerID;
+ }
+
+ public int getDeliveryCount()
+ {
+ return deliveryCount;
+ }
+
+ /**
+ * @return the largeMessageSize
+ */
+ public long getLargeMessageSize()
+ {
+ return largeMessageSize;
+ }
+
+ @Override
+ public void encodeRest(final HornetQBuffer buffer)
+ {
+ buffer.writeLong(consumerID);
+ buffer.writeInt(deliveryCount);
+ buffer.writeLong(largeMessageSize);
+ buffer.writeInt(largeMessageHeader.length);
+ buffer.writeBytes(largeMessageHeader);
+ }
+
+ @Override
+ public void decodeRest(final HornetQBuffer buffer)
+ {
+ consumerID = buffer.readLong();
+ deliveryCount = buffer.readInt();
+ largeMessageSize = buffer.readLong();
+ int size = buffer.readInt();
+ largeMessageHeader = new byte[size];
+ buffer.readBytes(largeMessageHeader);
+ }
+
+}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionReceiveMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionReceiveMessage.java 2010-01-21
20:09:23 UTC (rev 8832)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionReceiveMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,120 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.protocol.core.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.client.impl.ClientMessageImpl;
-import org.hornetq.core.logging.Logger;
-import org.hornetq.core.message.impl.MessageInternal;
-import org.hornetq.core.protocol.core.impl.PacketImpl;
-import org.hornetq.spi.core.protocol.RemotingConnection;
-import org.hornetq.utils.DataConstants;
-
-/**
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- *
- */
-public class SessionReceiveMessage extends MessagePacket
-{
- // Constants -----------------------------------------------------
-
- private static final Logger log = Logger.getLogger(SessionReceiveMessage.class);
-
- // Attributes ----------------------------------------------------
-
- private long consumerID;
-
- private int deliveryCount;
-
- public SessionReceiveMessage(final long consumerID, final MessageInternal message,
final int deliveryCount)
- {
- super(PacketImpl.SESS_RECEIVE_MSG, message);
-
- this.consumerID = consumerID;
-
- this.deliveryCount = deliveryCount;
- }
-
- public SessionReceiveMessage()
- {
- super(PacketImpl.SESS_RECEIVE_MSG, new ClientMessageImpl());
- }
-
- // Public --------------------------------------------------------
-
- public long getConsumerID()
- {
- return consumerID;
- }
-
- public int getDeliveryCount()
- {
- return deliveryCount;
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- @Override
- public HornetQBuffer encode(final RemotingConnection connection)
- {
- HornetQBuffer buffer = message.getEncodedBuffer();
-
- // Sanity check
- if (buffer.writerIndex() != message.getEndOfMessagePosition())
- {
- throw new IllegalStateException("Wrong encode position");
- }
-
- buffer.writeLong(consumerID);
- buffer.writeInt(deliveryCount);
-
- size = buffer.writerIndex();
-
- // Write standard headers
-
- int len = size - DataConstants.SIZE_INT;
- buffer.setInt(0, len);
- buffer.setByte(DataConstants.SIZE_INT, type);
- buffer.setLong(DataConstants.SIZE_INT + DataConstants.SIZE_BYTE, channelID);
-
- // Position reader for reading by Netty
- buffer.setIndex(0, size);
-
- return buffer;
- }
-
- @Override
- public void decode(final HornetQBuffer buffer)
- {
- channelID = buffer.readLong();
-
- message.decodeFromBuffer(buffer);
-
- consumerID = buffer.readLong();
-
- deliveryCount = buffer.readInt();
-
- size = buffer.readerIndex();
-
- // Need to position buffer for reading
-
- buffer.setIndex(PacketImpl.PACKET_HEADERS_SIZE + DataConstants.SIZE_INT,
message.getEndOfBodyPosition());
- }
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionReceiveMessage.java
(from rev 8832,
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionReceiveMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionReceiveMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionReceiveMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -0,0 +1,120 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.core.protocol.core.impl.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.client.impl.ClientMessageImpl;
+import org.hornetq.core.logging.Logger;
+import org.hornetq.core.message.impl.MessageInternal;
+import org.hornetq.core.protocol.core.impl.PacketImpl;
+import org.hornetq.spi.core.protocol.RemotingConnection;
+import org.hornetq.utils.DataConstants;
+
+/**
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ *
+ */
+public class SessionReceiveMessage extends MessagePacket
+{
+ // Constants -----------------------------------------------------
+
+ private static final Logger log = Logger.getLogger(SessionReceiveMessage.class);
+
+ // Attributes ----------------------------------------------------
+
+ private long consumerID;
+
+ private int deliveryCount;
+
+ public SessionReceiveMessage(final long consumerID, final MessageInternal message,
final int deliveryCount)
+ {
+ super(PacketImpl.SESS_RECEIVE_MSG, message);
+
+ this.consumerID = consumerID;
+
+ this.deliveryCount = deliveryCount;
+ }
+
+ public SessionReceiveMessage()
+ {
+ super(PacketImpl.SESS_RECEIVE_MSG, new ClientMessageImpl());
+ }
+
+ // Public --------------------------------------------------------
+
+ public long getConsumerID()
+ {
+ return consumerID;
+ }
+
+ public int getDeliveryCount()
+ {
+ return deliveryCount;
+ }
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ @Override
+ public HornetQBuffer encode(final RemotingConnection connection)
+ {
+ HornetQBuffer buffer = message.getEncodedBuffer();
+
+ // Sanity check
+ if (buffer.writerIndex() != message.getEndOfMessagePosition())
+ {
+ throw new IllegalStateException("Wrong encode position");
+ }
+
+ buffer.writeLong(consumerID);
+ buffer.writeInt(deliveryCount);
+
+ size = buffer.writerIndex();
+
+ // Write standard headers
+
+ int len = size - DataConstants.SIZE_INT;
+ buffer.setInt(0, len);
+ buffer.setByte(DataConstants.SIZE_INT, type);
+ buffer.setLong(DataConstants.SIZE_INT + DataConstants.SIZE_BYTE, channelID);
+
+ // Position reader for reading by Netty
+ buffer.setIndex(0, size);
+
+ return buffer;
+ }
+
+ @Override
+ public void decode(final HornetQBuffer buffer)
+ {
+ channelID = buffer.readLong();
+
+ message.decodeFromBuffer(buffer);
+
+ consumerID = buffer.readLong();
+
+ deliveryCount = buffer.readInt();
+
+ size = buffer.readerIndex();
+
+ // Need to position buffer for reading
+
+ buffer.setIndex(PacketImpl.PACKET_HEADERS_SIZE + DataConstants.SIZE_INT,
message.getEndOfBodyPosition());
+ }
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionRequestProducerCreditsMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionRequestProducerCreditsMessage.java 2010-01-21
20:09:23 UTC (rev 8832)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionRequestProducerCreditsMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,90 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.protocol.core.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.api.core.SimpleString;
-import org.hornetq.core.protocol.core.impl.PacketImpl;
-
-/**
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- *
- */
-public class SessionRequestProducerCreditsMessage extends PacketImpl
-{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private int credits;
-
- private SimpleString address;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public SessionRequestProducerCreditsMessage(final int credits, final SimpleString
address)
- {
- super(PacketImpl.SESS_PRODUCER_REQUEST_CREDITS);
-
- this.credits = credits;
-
- this.address = address;
- }
-
- public SessionRequestProducerCreditsMessage()
- {
- super(PacketImpl.SESS_PRODUCER_REQUEST_CREDITS);
- }
-
- // Public --------------------------------------------------------
-
- public int getCredits()
- {
- return credits;
- }
-
- public SimpleString getAddress()
- {
- return address;
- }
-
- // public boolean isRequiresConfirmations()
- // {
- // return false;
- // }
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeInt(credits);
- buffer.writeSimpleString(address);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- credits = buffer.readInt();
- address = buffer.readSimpleString();
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionRequestProducerCreditsMessage.java
(from rev 8832,
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionRequestProducerCreditsMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionRequestProducerCreditsMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionRequestProducerCreditsMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -0,0 +1,90 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.core.protocol.core.impl.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.api.core.SimpleString;
+import org.hornetq.core.protocol.core.impl.PacketImpl;
+
+/**
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ *
+ */
+public class SessionRequestProducerCreditsMessage extends PacketImpl
+{
+ // Constants -----------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
+ private int credits;
+
+ private SimpleString address;
+
+ // Static --------------------------------------------------------
+
+ // Constructors --------------------------------------------------
+
+ public SessionRequestProducerCreditsMessage(final int credits, final SimpleString
address)
+ {
+ super(PacketImpl.SESS_PRODUCER_REQUEST_CREDITS);
+
+ this.credits = credits;
+
+ this.address = address;
+ }
+
+ public SessionRequestProducerCreditsMessage()
+ {
+ super(PacketImpl.SESS_PRODUCER_REQUEST_CREDITS);
+ }
+
+ // Public --------------------------------------------------------
+
+ public int getCredits()
+ {
+ return credits;
+ }
+
+ public SimpleString getAddress()
+ {
+ return address;
+ }
+
+ // public boolean isRequiresConfirmations()
+ // {
+ // return false;
+ // }
+
+ @Override
+ public void encodeRest(final HornetQBuffer buffer)
+ {
+ buffer.writeInt(credits);
+ buffer.writeSimpleString(address);
+ }
+
+ @Override
+ public void decodeRest(final HornetQBuffer buffer)
+ {
+ credits = buffer.readInt();
+ address = buffer.readSimpleString();
+ }
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionSendContinuationMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionSendContinuationMessage.java 2010-01-21
20:09:23 UTC (rev 8832)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionSendContinuationMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,89 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.protocol.core.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.protocol.core.impl.PacketImpl;
-
-/**
- * A SessionSendContinuationMessage
- *
- * @author <a href="mailto:clebert.suconic@jboss.org">Clebert
Suconic</a>
- *
- * Created Dec 4, 2008 12:25:14 PM
- *
- *
- */
-public class SessionSendContinuationMessage extends SessionContinuationMessage
-{
-
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private boolean requiresResponse;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public SessionSendContinuationMessage()
- {
- super(PacketImpl.SESS_SEND_CONTINUATION);
- }
-
- /**
- * @param body
- * @param continues
- * @param requiresResponse
- */
- public SessionSendContinuationMessage(final byte[] body, final boolean continues,
final boolean requiresResponse)
- {
- super(PacketImpl.SESS_SEND_CONTINUATION, body, continues);
- this.requiresResponse = requiresResponse;
- }
-
- // Public --------------------------------------------------------
-
- /**
- * @return the requiresResponse
- */
- public boolean isRequiresResponse()
- {
- return requiresResponse;
- }
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- super.encodeRest(buffer);
- buffer.writeBoolean(requiresResponse);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- super.decodeRest(buffer);
- requiresResponse = buffer.readBoolean();
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionSendContinuationMessage.java
(from rev 8832,
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionSendContinuationMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionSendContinuationMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionSendContinuationMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -0,0 +1,89 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.core.protocol.core.impl.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.protocol.core.impl.PacketImpl;
+
+/**
+ * A SessionSendContinuationMessage
+ *
+ * @author <a href="mailto:clebert.suconic@jboss.org">Clebert
Suconic</a>
+ *
+ * Created Dec 4, 2008 12:25:14 PM
+ *
+ *
+ */
+public class SessionSendContinuationMessage extends SessionContinuationMessage
+{
+
+ // Constants -----------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
+ private boolean requiresResponse;
+
+ // Static --------------------------------------------------------
+
+ // Constructors --------------------------------------------------
+
+ public SessionSendContinuationMessage()
+ {
+ super(PacketImpl.SESS_SEND_CONTINUATION);
+ }
+
+ /**
+ * @param body
+ * @param continues
+ * @param requiresResponse
+ */
+ public SessionSendContinuationMessage(final byte[] body, final boolean continues,
final boolean requiresResponse)
+ {
+ super(PacketImpl.SESS_SEND_CONTINUATION, body, continues);
+ this.requiresResponse = requiresResponse;
+ }
+
+ // Public --------------------------------------------------------
+
+ /**
+ * @return the requiresResponse
+ */
+ public boolean isRequiresResponse()
+ {
+ return requiresResponse;
+ }
+
+ @Override
+ public void encodeRest(final HornetQBuffer buffer)
+ {
+ super.encodeRest(buffer);
+ buffer.writeBoolean(requiresResponse);
+ }
+
+ @Override
+ public void decodeRest(final HornetQBuffer buffer)
+ {
+ super.decodeRest(buffer);
+ requiresResponse = buffer.readBoolean();
+ }
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+
+}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionSendLargeMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionSendLargeMessage.java 2010-01-21
20:09:23 UTC (rev 8832)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionSendLargeMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,82 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.protocol.core.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.protocol.core.impl.PacketImpl;
-
-/**
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
- * @author <a href="mailto:csuconic@redhat.com">Clebert
Suconic</a>
- *
- * @version <tt>$Revision$</tt>
- */
-public class SessionSendLargeMessage extends PacketImpl
-{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- /** Used only if largeMessage */
- private byte[] largeMessageHeader;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public SessionSendLargeMessage(final byte[] largeMessageHeader)
- {
- super(PacketImpl.SESS_SEND_LARGE);
-
- this.largeMessageHeader = largeMessageHeader;
- }
-
- public SessionSendLargeMessage()
- {
- super(PacketImpl.SESS_SEND_LARGE);
- }
-
- // Public --------------------------------------------------------
-
- public byte[] getLargeMessageHeader()
- {
- return largeMessageHeader;
- }
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeInt(largeMessageHeader.length);
- buffer.writeBytes(largeMessageHeader);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- int largeMessageLength = buffer.readInt();
-
- largeMessageHeader = new byte[largeMessageLength];
-
- buffer.readBytes(largeMessageHeader);
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionSendLargeMessage.java
(from rev 8832,
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionSendLargeMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionSendLargeMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionSendLargeMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -0,0 +1,82 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.core.protocol.core.impl.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.protocol.core.impl.PacketImpl;
+
+/**
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
+ * @author <a href="mailto:csuconic@redhat.com">Clebert
Suconic</a>
+ *
+ * @version <tt>$Revision$</tt>
+ */
+public class SessionSendLargeMessage extends PacketImpl
+{
+ // Constants -----------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
+ /** Used only if largeMessage */
+ private byte[] largeMessageHeader;
+
+ // Static --------------------------------------------------------
+
+ // Constructors --------------------------------------------------
+
+ public SessionSendLargeMessage(final byte[] largeMessageHeader)
+ {
+ super(PacketImpl.SESS_SEND_LARGE);
+
+ this.largeMessageHeader = largeMessageHeader;
+ }
+
+ public SessionSendLargeMessage()
+ {
+ super(PacketImpl.SESS_SEND_LARGE);
+ }
+
+ // Public --------------------------------------------------------
+
+ public byte[] getLargeMessageHeader()
+ {
+ return largeMessageHeader;
+ }
+
+ @Override
+ public void encodeRest(final HornetQBuffer buffer)
+ {
+ buffer.writeInt(largeMessageHeader.length);
+ buffer.writeBytes(largeMessageHeader);
+ }
+
+ @Override
+ public void decodeRest(final HornetQBuffer buffer)
+ {
+ int largeMessageLength = buffer.readInt();
+
+ largeMessageHeader = new byte[largeMessageLength];
+
+ buffer.readBytes(largeMessageHeader);
+ }
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionSendMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionSendMessage.java 2010-01-21
20:09:23 UTC (rev 8832)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionSendMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,115 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.protocol.core.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.api.core.Message;
-import org.hornetq.core.logging.Logger;
-import org.hornetq.core.message.impl.MessageInternal;
-import org.hornetq.core.protocol.core.impl.PacketImpl;
-import org.hornetq.core.server.impl.ServerMessageImpl;
-import org.hornetq.spi.core.protocol.RemotingConnection;
-import org.hornetq.utils.DataConstants;
-
-/**
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- *
- * @version <tt>$Revision$</tt>
- */
-public class SessionSendMessage extends MessagePacket
-{
- // Constants -----------------------------------------------------
-
- private static final Logger log = Logger.getLogger(SessionSendMessage.class);
-
- // Attributes ----------------------------------------------------
-
- private boolean requiresResponse;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public SessionSendMessage(final MessageInternal message, final boolean
requiresResponse)
- {
- super(PacketImpl.SESS_SEND, message);
-
- this.requiresResponse = requiresResponse;
- }
-
- public SessionSendMessage()
- {
- super(PacketImpl.SESS_SEND, new ServerMessageImpl());
- }
-
- // Public --------------------------------------------------------
-
- public boolean isRequiresResponse()
- {
- return requiresResponse;
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- @Override
- public HornetQBuffer encode(final RemotingConnection connection)
- {
- HornetQBuffer buffer = message.getEncodedBuffer();
-
- // Sanity check
- if (buffer.writerIndex() != message.getEndOfMessagePosition())
- {
- throw new IllegalStateException("Wrong encode position");
- }
-
- buffer.writeBoolean(requiresResponse);
-
- size = buffer.writerIndex();
-
- // Write standard headers
-
- int len = size - DataConstants.SIZE_INT;
- buffer.setInt(0, len);
- buffer.setByte(DataConstants.SIZE_INT, type);
- buffer.setLong(DataConstants.SIZE_INT + DataConstants.SIZE_BYTE, channelID);
-
- // Position reader for reading by Netty
- buffer.readerIndex(0);
-
- message.resetCopied();
-
- return buffer;
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- // Buffer comes in after having read standard headers and positioned at Beginning
of body part
-
- message.decodeFromBuffer(buffer);
-
- int ri = buffer.readerIndex();
-
- requiresResponse = buffer.readBoolean();
-
- buffer.readerIndex(ri);
-
- }
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionSendMessage.java
(from rev 8832,
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionSendMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionSendMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionSendMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -0,0 +1,115 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.core.protocol.core.impl.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.api.core.Message;
+import org.hornetq.core.logging.Logger;
+import org.hornetq.core.message.impl.MessageInternal;
+import org.hornetq.core.protocol.core.impl.PacketImpl;
+import org.hornetq.core.server.impl.ServerMessageImpl;
+import org.hornetq.spi.core.protocol.RemotingConnection;
+import org.hornetq.utils.DataConstants;
+
+/**
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ *
+ * @version <tt>$Revision$</tt>
+ */
+public class SessionSendMessage extends MessagePacket
+{
+ // Constants -----------------------------------------------------
+
+ private static final Logger log = Logger.getLogger(SessionSendMessage.class);
+
+ // Attributes ----------------------------------------------------
+
+ private boolean requiresResponse;
+
+ // Static --------------------------------------------------------
+
+ // Constructors --------------------------------------------------
+
+ public SessionSendMessage(final MessageInternal message, final boolean
requiresResponse)
+ {
+ super(PacketImpl.SESS_SEND, message);
+
+ this.requiresResponse = requiresResponse;
+ }
+
+ public SessionSendMessage()
+ {
+ super(PacketImpl.SESS_SEND, new ServerMessageImpl());
+ }
+
+ // Public --------------------------------------------------------
+
+ public boolean isRequiresResponse()
+ {
+ return requiresResponse;
+ }
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ @Override
+ public HornetQBuffer encode(final RemotingConnection connection)
+ {
+ HornetQBuffer buffer = message.getEncodedBuffer();
+
+ // Sanity check
+ if (buffer.writerIndex() != message.getEndOfMessagePosition())
+ {
+ throw new IllegalStateException("Wrong encode position");
+ }
+
+ buffer.writeBoolean(requiresResponse);
+
+ size = buffer.writerIndex();
+
+ // Write standard headers
+
+ int len = size - DataConstants.SIZE_INT;
+ buffer.setInt(0, len);
+ buffer.setByte(DataConstants.SIZE_INT, type);
+ buffer.setLong(DataConstants.SIZE_INT + DataConstants.SIZE_BYTE, channelID);
+
+ // Position reader for reading by Netty
+ buffer.readerIndex(0);
+
+ message.resetCopied();
+
+ return buffer;
+ }
+
+ @Override
+ public void decodeRest(final HornetQBuffer buffer)
+ {
+ // Buffer comes in after having read standard headers and positioned at Beginning
of body part
+
+ message.decodeFromBuffer(buffer);
+
+ int ri = buffer.readerIndex();
+
+ requiresResponse = buffer.readBoolean();
+
+ buffer.readerIndex(ri);
+
+ }
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXACommitMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXACommitMessage.java 2010-01-21
20:09:23 UTC (rev 8832)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXACommitMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,112 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.protocol.core.impl.wireformat;
-
-import javax.transaction.xa.Xid;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.protocol.core.impl.PacketImpl;
-import org.hornetq.utils.XidCodecSupport;
-
-/**
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- *
- * @version <tt>$Revision$</tt>
- */
-public class SessionXACommitMessage extends PacketImpl
-{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private boolean onePhase;
-
- private Xid xid;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public SessionXACommitMessage(final Xid xid, final boolean onePhase)
- {
- super(PacketImpl.SESS_XA_COMMIT);
-
- this.xid = xid;
- this.onePhase = onePhase;
- }
-
- public SessionXACommitMessage()
- {
- super(PacketImpl.SESS_XA_COMMIT);
- }
-
- // Public --------------------------------------------------------
-
- public Xid getXid()
- {
- return xid;
- }
-
- public boolean isOnePhase()
- {
- return onePhase;
- }
-
- @Override
- public boolean isAsyncExec()
- {
- return true;
- }
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- XidCodecSupport.encodeXid(xid, buffer);
- buffer.writeBoolean(onePhase);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- xid = XidCodecSupport.decodeXid(buffer);
- onePhase = buffer.readBoolean();
- }
-
- @Override
- public String toString()
- {
- return getParentString() + ", xid=" + xid + ", onePhase=" +
onePhase + "]";
- }
-
- @Override
- public boolean equals(final Object other)
- {
- if (other instanceof SessionXACommitMessage == false)
- {
- return false;
- }
-
- SessionXACommitMessage r = (SessionXACommitMessage)other;
-
- return super.equals(other) && xid.equals(r.xid) && onePhase ==
r.onePhase;
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXACommitMessage.java
(from rev 8832,
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXACommitMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXACommitMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXACommitMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -0,0 +1,112 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.core.protocol.core.impl.wireformat;
+
+import javax.transaction.xa.Xid;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.protocol.core.impl.PacketImpl;
+import org.hornetq.utils.XidCodecSupport;
+
+/**
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ *
+ * @version <tt>$Revision$</tt>
+ */
+public class SessionXACommitMessage extends PacketImpl
+{
+ // Constants -----------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
+ private boolean onePhase;
+
+ private Xid xid;
+
+ // Static --------------------------------------------------------
+
+ // Constructors --------------------------------------------------
+
+ public SessionXACommitMessage(final Xid xid, final boolean onePhase)
+ {
+ super(PacketImpl.SESS_XA_COMMIT);
+
+ this.xid = xid;
+ this.onePhase = onePhase;
+ }
+
+ public SessionXACommitMessage()
+ {
+ super(PacketImpl.SESS_XA_COMMIT);
+ }
+
+ // Public --------------------------------------------------------
+
+ public Xid getXid()
+ {
+ return xid;
+ }
+
+ public boolean isOnePhase()
+ {
+ return onePhase;
+ }
+
+ @Override
+ public boolean isAsyncExec()
+ {
+ return true;
+ }
+
+ @Override
+ public void encodeRest(final HornetQBuffer buffer)
+ {
+ XidCodecSupport.encodeXid(xid, buffer);
+ buffer.writeBoolean(onePhase);
+ }
+
+ @Override
+ public void decodeRest(final HornetQBuffer buffer)
+ {
+ xid = XidCodecSupport.decodeXid(buffer);
+ onePhase = buffer.readBoolean();
+ }
+
+ @Override
+ public String toString()
+ {
+ return getParentString() + ", xid=" + xid + ", onePhase=" +
onePhase + "]";
+ }
+
+ @Override
+ public boolean equals(final Object other)
+ {
+ if (other instanceof SessionXACommitMessage == false)
+ {
+ return false;
+ }
+
+ SessionXACommitMessage r = (SessionXACommitMessage)other;
+
+ return super.equals(other) && xid.equals(r.xid) && onePhase ==
r.onePhase;
+ }
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAEndMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAEndMessage.java 2010-01-21
20:09:23 UTC (rev 8832)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAEndMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,107 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.protocol.core.impl.wireformat;
-
-import javax.transaction.xa.Xid;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.protocol.core.impl.PacketImpl;
-import org.hornetq.utils.XidCodecSupport;
-
-/**
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- *
- * @version <tt>$Revision$</tt>
- */
-public class SessionXAEndMessage extends PacketImpl
-{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private Xid xid;
-
- private boolean failed;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public SessionXAEndMessage(final Xid xid, final boolean failed)
- {
- super(PacketImpl.SESS_XA_END);
-
- this.xid = xid;
-
- this.failed = failed;
- }
-
- public SessionXAEndMessage()
- {
- super(PacketImpl.SESS_XA_END);
- }
-
- // Public --------------------------------------------------------
-
- public boolean isFailed()
- {
- return failed;
- }
-
- public Xid getXid()
- {
- return xid;
- }
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- XidCodecSupport.encodeXid(xid, buffer);
- buffer.writeBoolean(failed);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- xid = XidCodecSupport.decodeXid(buffer);
- failed = buffer.readBoolean();
- }
-
- @Override
- public String toString()
- {
- return getParentString() + ", xid=" + xid + ", failed=" +
failed + "]";
- }
-
- @Override
- public boolean equals(final Object other)
- {
- if (other instanceof SessionXAEndMessage == false)
- {
- return false;
- }
-
- SessionXAEndMessage r = (SessionXAEndMessage)other;
-
- return super.equals(other) && xid.equals(r.xid) && failed ==
r.failed;
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAEndMessage.java
(from rev 8832,
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAEndMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAEndMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAEndMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -0,0 +1,107 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.core.protocol.core.impl.wireformat;
+
+import javax.transaction.xa.Xid;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.protocol.core.impl.PacketImpl;
+import org.hornetq.utils.XidCodecSupport;
+
+/**
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ *
+ * @version <tt>$Revision$</tt>
+ */
+public class SessionXAEndMessage extends PacketImpl
+{
+ // Constants -----------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
+ private Xid xid;
+
+ private boolean failed;
+
+ // Static --------------------------------------------------------
+
+ // Constructors --------------------------------------------------
+
+ public SessionXAEndMessage(final Xid xid, final boolean failed)
+ {
+ super(PacketImpl.SESS_XA_END);
+
+ this.xid = xid;
+
+ this.failed = failed;
+ }
+
+ public SessionXAEndMessage()
+ {
+ super(PacketImpl.SESS_XA_END);
+ }
+
+ // Public --------------------------------------------------------
+
+ public boolean isFailed()
+ {
+ return failed;
+ }
+
+ public Xid getXid()
+ {
+ return xid;
+ }
+
+ @Override
+ public void encodeRest(final HornetQBuffer buffer)
+ {
+ XidCodecSupport.encodeXid(xid, buffer);
+ buffer.writeBoolean(failed);
+ }
+
+ @Override
+ public void decodeRest(final HornetQBuffer buffer)
+ {
+ xid = XidCodecSupport.decodeXid(buffer);
+ failed = buffer.readBoolean();
+ }
+
+ @Override
+ public String toString()
+ {
+ return getParentString() + ", xid=" + xid + ", failed=" +
failed + "]";
+ }
+
+ @Override
+ public boolean equals(final Object other)
+ {
+ if (other instanceof SessionXAEndMessage == false)
+ {
+ return false;
+ }
+
+ SessionXAEndMessage r = (SessionXAEndMessage)other;
+
+ return super.equals(other) && xid.equals(r.xid) && failed ==
r.failed;
+ }
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAForgetMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAForgetMessage.java 2010-01-21
20:09:23 UTC (rev 8832)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAForgetMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,90 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.protocol.core.impl.wireformat;
-
-import javax.transaction.xa.Xid;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.protocol.core.impl.PacketImpl;
-import org.hornetq.utils.XidCodecSupport;
-
-/**
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- *
- * @version <tt>$Revision$</tt>
- */
-public class SessionXAForgetMessage extends PacketImpl
-{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private Xid xid;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public SessionXAForgetMessage(final Xid xid)
- {
- super(PacketImpl.SESS_XA_FORGET);
-
- this.xid = xid;
- }
-
- public SessionXAForgetMessage()
- {
- super(PacketImpl.SESS_XA_FORGET);
- }
-
- // Public --------------------------------------------------------
-
- public Xid getXid()
- {
- return xid;
- }
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- XidCodecSupport.encodeXid(xid, buffer);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- xid = XidCodecSupport.decodeXid(buffer);
- }
-
- @Override
- public boolean equals(final Object other)
- {
- if (other instanceof SessionXAForgetMessage == false)
- {
- return false;
- }
-
- SessionXAForgetMessage r = (SessionXAForgetMessage)other;
-
- return super.equals(other) && xid.equals(r.xid);
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAForgetMessage.java
(from rev 8832,
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAForgetMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAForgetMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAForgetMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -0,0 +1,90 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.core.protocol.core.impl.wireformat;
+
+import javax.transaction.xa.Xid;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.protocol.core.impl.PacketImpl;
+import org.hornetq.utils.XidCodecSupport;
+
+/**
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ *
+ * @version <tt>$Revision$</tt>
+ */
+public class SessionXAForgetMessage extends PacketImpl
+{
+ // Constants -----------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
+ private Xid xid;
+
+ // Static --------------------------------------------------------
+
+ // Constructors --------------------------------------------------
+
+ public SessionXAForgetMessage(final Xid xid)
+ {
+ super(PacketImpl.SESS_XA_FORGET);
+
+ this.xid = xid;
+ }
+
+ public SessionXAForgetMessage()
+ {
+ super(PacketImpl.SESS_XA_FORGET);
+ }
+
+ // Public --------------------------------------------------------
+
+ public Xid getXid()
+ {
+ return xid;
+ }
+
+ @Override
+ public void encodeRest(final HornetQBuffer buffer)
+ {
+ XidCodecSupport.encodeXid(xid, buffer);
+ }
+
+ @Override
+ public void decodeRest(final HornetQBuffer buffer)
+ {
+ xid = XidCodecSupport.decodeXid(buffer);
+ }
+
+ @Override
+ public boolean equals(final Object other)
+ {
+ if (other instanceof SessionXAForgetMessage == false)
+ {
+ return false;
+ }
+
+ SessionXAForgetMessage r = (SessionXAForgetMessage)other;
+
+ return super.equals(other) && xid.equals(r.xid);
+ }
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAGetInDoubtXidsResponseMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAGetInDoubtXidsResponseMessage.java 2010-01-21
20:09:23 UTC (rev 8832)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAGetInDoubtXidsResponseMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,128 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.protocol.core.impl.wireformat;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.transaction.xa.Xid;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.protocol.core.impl.PacketImpl;
-import org.hornetq.utils.XidCodecSupport;
-
-/**
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- *
- * @version <tt>$Revision$</tt>
- */
-public class SessionXAGetInDoubtXidsResponseMessage extends PacketImpl
-{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private List<Xid> xids;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public SessionXAGetInDoubtXidsResponseMessage(final List<Xid> xids)
- {
- super(PacketImpl.SESS_XA_INDOUBT_XIDS_RESP);
-
- this.xids = xids;
- }
-
- public SessionXAGetInDoubtXidsResponseMessage()
- {
- super(PacketImpl.SESS_XA_INDOUBT_XIDS_RESP);
- }
-
- // Public --------------------------------------------------------
-
- @Override
- public boolean isResponse()
- {
- return true;
- }
-
- public List<Xid> getXids()
- {
- return xids;
- }
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeInt(xids.size());
-
- for (Xid xid : xids)
- {
- XidCodecSupport.encodeXid(xid, buffer);
- }
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- int len = buffer.readInt();
- xids = new ArrayList<Xid>(len);
- for (int i = 0; i < len; i++)
- {
- Xid xid = XidCodecSupport.decodeXid(buffer);
-
- xids.add(xid);
- }
- }
-
- @Override
- public boolean equals(final Object other)
- {
- if (other instanceof SessionXAGetInDoubtXidsResponseMessage == false)
- {
- return false;
- }
-
- SessionXAGetInDoubtXidsResponseMessage r =
(SessionXAGetInDoubtXidsResponseMessage)other;
-
- if (super.equals(other))
- {
- if (xids.size() == r.xids.size())
- {
- for (int i = 0; i < xids.size(); i++)
- {
- if (!xids.get(i).equals(r.xids.get(i)))
- {
- return false;
- }
- }
- }
- }
- else
- {
- return false;
- }
- return true;
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAGetInDoubtXidsResponseMessage.java
(from rev 8832,
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAGetInDoubtXidsResponseMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAGetInDoubtXidsResponseMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAGetInDoubtXidsResponseMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -0,0 +1,128 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.core.protocol.core.impl.wireformat;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.transaction.xa.Xid;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.protocol.core.impl.PacketImpl;
+import org.hornetq.utils.XidCodecSupport;
+
+/**
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ *
+ * @version <tt>$Revision$</tt>
+ */
+public class SessionXAGetInDoubtXidsResponseMessage extends PacketImpl
+{
+ // Constants -----------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
+ private List<Xid> xids;
+
+ // Static --------------------------------------------------------
+
+ // Constructors --------------------------------------------------
+
+ public SessionXAGetInDoubtXidsResponseMessage(final List<Xid> xids)
+ {
+ super(PacketImpl.SESS_XA_INDOUBT_XIDS_RESP);
+
+ this.xids = xids;
+ }
+
+ public SessionXAGetInDoubtXidsResponseMessage()
+ {
+ super(PacketImpl.SESS_XA_INDOUBT_XIDS_RESP);
+ }
+
+ // Public --------------------------------------------------------
+
+ @Override
+ public boolean isResponse()
+ {
+ return true;
+ }
+
+ public List<Xid> getXids()
+ {
+ return xids;
+ }
+
+ @Override
+ public void encodeRest(final HornetQBuffer buffer)
+ {
+ buffer.writeInt(xids.size());
+
+ for (Xid xid : xids)
+ {
+ XidCodecSupport.encodeXid(xid, buffer);
+ }
+ }
+
+ @Override
+ public void decodeRest(final HornetQBuffer buffer)
+ {
+ int len = buffer.readInt();
+ xids = new ArrayList<Xid>(len);
+ for (int i = 0; i < len; i++)
+ {
+ Xid xid = XidCodecSupport.decodeXid(buffer);
+
+ xids.add(xid);
+ }
+ }
+
+ @Override
+ public boolean equals(final Object other)
+ {
+ if (other instanceof SessionXAGetInDoubtXidsResponseMessage == false)
+ {
+ return false;
+ }
+
+ SessionXAGetInDoubtXidsResponseMessage r =
(SessionXAGetInDoubtXidsResponseMessage)other;
+
+ if (super.equals(other))
+ {
+ if (xids.size() == r.xids.size())
+ {
+ for (int i = 0; i < xids.size(); i++)
+ {
+ if (!xids.get(i).equals(r.xids.get(i)))
+ {
+ return false;
+ }
+ }
+ }
+ }
+ else
+ {
+ return false;
+ }
+ return true;
+ }
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAGetTimeoutResponseMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAGetTimeoutResponseMessage.java 2010-01-21
20:09:23 UTC (rev 8832)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAGetTimeoutResponseMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,93 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.protocol.core.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.protocol.core.impl.PacketImpl;
-
-/**
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- *
- * @version <tt>$Revision$</tt>
- */
-public class SessionXAGetTimeoutResponseMessage extends PacketImpl
-{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private int timeoutSeconds;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public SessionXAGetTimeoutResponseMessage(final int timeoutSeconds)
- {
- super(PacketImpl.SESS_XA_GET_TIMEOUT_RESP);
-
- this.timeoutSeconds = timeoutSeconds;
- }
-
- public SessionXAGetTimeoutResponseMessage()
- {
- super(PacketImpl.SESS_XA_GET_TIMEOUT_RESP);
- }
-
- // Public --------------------------------------------------------
-
- @Override
- public boolean isResponse()
- {
- return true;
- }
-
- public int getTimeoutSeconds()
- {
- return timeoutSeconds;
- }
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeInt(timeoutSeconds);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- timeoutSeconds = buffer.readInt();
- }
-
- @Override
- public boolean equals(final Object other)
- {
- if (other instanceof SessionXAGetTimeoutResponseMessage == false)
- {
- return false;
- }
-
- SessionXAGetTimeoutResponseMessage r = (SessionXAGetTimeoutResponseMessage)other;
-
- return super.equals(other) && timeoutSeconds == r.timeoutSeconds;
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAGetTimeoutResponseMessage.java
(from rev 8832,
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAGetTimeoutResponseMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAGetTimeoutResponseMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAGetTimeoutResponseMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -0,0 +1,93 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.core.protocol.core.impl.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.protocol.core.impl.PacketImpl;
+
+/**
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ *
+ * @version <tt>$Revision$</tt>
+ */
+public class SessionXAGetTimeoutResponseMessage extends PacketImpl
+{
+ // Constants -----------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
+ private int timeoutSeconds;
+
+ // Static --------------------------------------------------------
+
+ // Constructors --------------------------------------------------
+
+ public SessionXAGetTimeoutResponseMessage(final int timeoutSeconds)
+ {
+ super(PacketImpl.SESS_XA_GET_TIMEOUT_RESP);
+
+ this.timeoutSeconds = timeoutSeconds;
+ }
+
+ public SessionXAGetTimeoutResponseMessage()
+ {
+ super(PacketImpl.SESS_XA_GET_TIMEOUT_RESP);
+ }
+
+ // Public --------------------------------------------------------
+
+ @Override
+ public boolean isResponse()
+ {
+ return true;
+ }
+
+ public int getTimeoutSeconds()
+ {
+ return timeoutSeconds;
+ }
+
+ @Override
+ public void encodeRest(final HornetQBuffer buffer)
+ {
+ buffer.writeInt(timeoutSeconds);
+ }
+
+ @Override
+ public void decodeRest(final HornetQBuffer buffer)
+ {
+ timeoutSeconds = buffer.readInt();
+ }
+
+ @Override
+ public boolean equals(final Object other)
+ {
+ if (other instanceof SessionXAGetTimeoutResponseMessage == false)
+ {
+ return false;
+ }
+
+ SessionXAGetTimeoutResponseMessage r = (SessionXAGetTimeoutResponseMessage)other;
+
+ return super.equals(other) && timeoutSeconds == r.timeoutSeconds;
+ }
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAJoinMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAJoinMessage.java 2010-01-21
20:09:23 UTC (rev 8832)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAJoinMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,90 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.protocol.core.impl.wireformat;
-
-import javax.transaction.xa.Xid;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.protocol.core.impl.PacketImpl;
-import org.hornetq.utils.XidCodecSupport;
-
-/**
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- *
- * @version <tt>$Revision$</tt>
- */
-public class SessionXAJoinMessage extends PacketImpl
-{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private Xid xid;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public SessionXAJoinMessage(final Xid xid)
- {
- super(PacketImpl.SESS_XA_JOIN);
-
- this.xid = xid;
- }
-
- public SessionXAJoinMessage()
- {
- super(PacketImpl.SESS_XA_JOIN);
- }
-
- // Public --------------------------------------------------------
-
- public Xid getXid()
- {
- return xid;
- }
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- XidCodecSupport.encodeXid(xid, buffer);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- xid = XidCodecSupport.decodeXid(buffer);
- }
-
- @Override
- public boolean equals(final Object other)
- {
- if (other instanceof SessionXAJoinMessage == false)
- {
- return false;
- }
-
- SessionXAJoinMessage r = (SessionXAJoinMessage)other;
-
- return super.equals(other) && xid.equals(r.xid);
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAJoinMessage.java
(from rev 8832,
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAJoinMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAJoinMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAJoinMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -0,0 +1,90 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.core.protocol.core.impl.wireformat;
+
+import javax.transaction.xa.Xid;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.protocol.core.impl.PacketImpl;
+import org.hornetq.utils.XidCodecSupport;
+
+/**
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ *
+ * @version <tt>$Revision$</tt>
+ */
+public class SessionXAJoinMessage extends PacketImpl
+{
+ // Constants -----------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
+ private Xid xid;
+
+ // Static --------------------------------------------------------
+
+ // Constructors --------------------------------------------------
+
+ public SessionXAJoinMessage(final Xid xid)
+ {
+ super(PacketImpl.SESS_XA_JOIN);
+
+ this.xid = xid;
+ }
+
+ public SessionXAJoinMessage()
+ {
+ super(PacketImpl.SESS_XA_JOIN);
+ }
+
+ // Public --------------------------------------------------------
+
+ public Xid getXid()
+ {
+ return xid;
+ }
+
+ @Override
+ public void encodeRest(final HornetQBuffer buffer)
+ {
+ XidCodecSupport.encodeXid(xid, buffer);
+ }
+
+ @Override
+ public void decodeRest(final HornetQBuffer buffer)
+ {
+ xid = XidCodecSupport.decodeXid(buffer);
+ }
+
+ @Override
+ public boolean equals(final Object other)
+ {
+ if (other instanceof SessionXAJoinMessage == false)
+ {
+ return false;
+ }
+
+ SessionXAJoinMessage r = (SessionXAJoinMessage)other;
+
+ return super.equals(other) && xid.equals(r.xid);
+ }
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAPrepareMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAPrepareMessage.java 2010-01-21
20:09:23 UTC (rev 8832)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAPrepareMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,95 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.protocol.core.impl.wireformat;
-
-import javax.transaction.xa.Xid;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.protocol.core.impl.PacketImpl;
-import org.hornetq.utils.XidCodecSupport;
-
-/**
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- *
- * @version <tt>$Revision$</tt>
- */
-public class SessionXAPrepareMessage extends PacketImpl
-{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private Xid xid;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public SessionXAPrepareMessage(final Xid xid)
- {
- super(PacketImpl.SESS_XA_PREPARE);
-
- this.xid = xid;
- }
-
- public SessionXAPrepareMessage()
- {
- super(PacketImpl.SESS_XA_PREPARE);
- }
-
- // Public --------------------------------------------------------
-
- public Xid getXid()
- {
- return xid;
- }
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- XidCodecSupport.encodeXid(xid, buffer);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- xid = XidCodecSupport.decodeXid(buffer);
- }
-
- public boolean isAsyncExec()
- {
- return true;
- }
-
- @Override
- public boolean equals(final Object other)
- {
- if (other instanceof SessionXAPrepareMessage == false)
- {
- return false;
- }
-
- SessionXAPrepareMessage r = (SessionXAPrepareMessage)other;
-
- return super.equals(other) && xid.equals(r.xid);
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAPrepareMessage.java
(from rev 8832,
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAPrepareMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAPrepareMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAPrepareMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -0,0 +1,95 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.core.protocol.core.impl.wireformat;
+
+import javax.transaction.xa.Xid;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.protocol.core.impl.PacketImpl;
+import org.hornetq.utils.XidCodecSupport;
+
+/**
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ *
+ * @version <tt>$Revision$</tt>
+ */
+public class SessionXAPrepareMessage extends PacketImpl
+{
+ // Constants -----------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
+ private Xid xid;
+
+ // Static --------------------------------------------------------
+
+ // Constructors --------------------------------------------------
+
+ public SessionXAPrepareMessage(final Xid xid)
+ {
+ super(PacketImpl.SESS_XA_PREPARE);
+
+ this.xid = xid;
+ }
+
+ public SessionXAPrepareMessage()
+ {
+ super(PacketImpl.SESS_XA_PREPARE);
+ }
+
+ // Public --------------------------------------------------------
+
+ public Xid getXid()
+ {
+ return xid;
+ }
+
+ @Override
+ public void encodeRest(final HornetQBuffer buffer)
+ {
+ XidCodecSupport.encodeXid(xid, buffer);
+ }
+
+ @Override
+ public void decodeRest(final HornetQBuffer buffer)
+ {
+ xid = XidCodecSupport.decodeXid(buffer);
+ }
+
+ public boolean isAsyncExec()
+ {
+ return true;
+ }
+
+ @Override
+ public boolean equals(final Object other)
+ {
+ if (other instanceof SessionXAPrepareMessage == false)
+ {
+ return false;
+ }
+
+ SessionXAPrepareMessage r = (SessionXAPrepareMessage)other;
+
+ return super.equals(other) && xid.equals(r.xid);
+ }
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAResponseMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAResponseMessage.java 2010-01-21
20:09:23 UTC (rev 8832)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAResponseMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,115 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.protocol.core.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.protocol.core.impl.PacketImpl;
-
-/**
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- *
- * @version <tt>$Revision$</tt>
- */
-public class SessionXAResponseMessage extends PacketImpl
-{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private boolean error;
-
- private int responseCode;
-
- private String message;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public SessionXAResponseMessage(final boolean isError, final int responseCode, final
String message)
- {
- super(PacketImpl.SESS_XA_RESP);
-
- error = isError;
-
- this.responseCode = responseCode;
-
- this.message = message;
- }
-
- public SessionXAResponseMessage()
- {
- super(PacketImpl.SESS_XA_RESP);
- }
-
- // Public --------------------------------------------------------
-
- @Override
- public boolean isResponse()
- {
- return true;
- }
-
- public boolean isError()
- {
- return error;
- }
-
- public int getResponseCode()
- {
- return responseCode;
- }
-
- public String getMessage()
- {
- return message;
- }
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeBoolean(error);
- buffer.writeInt(responseCode);
- buffer.writeNullableString(message);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- error = buffer.readBoolean();
- responseCode = buffer.readInt();
- message = buffer.readNullableString();
- }
-
- @Override
- public boolean equals(final Object other)
- {
- if (other instanceof SessionXAResponseMessage == false)
- {
- return false;
- }
-
- SessionXAResponseMessage r = (SessionXAResponseMessage)other;
-
- return super.equals(other) && error == r.error && responseCode ==
r.responseCode && message.equals(r.message);
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAResponseMessage.java
(from rev 8832,
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAResponseMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAResponseMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAResponseMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -0,0 +1,115 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.core.protocol.core.impl.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.protocol.core.impl.PacketImpl;
+
+/**
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ *
+ * @version <tt>$Revision$</tt>
+ */
+public class SessionXAResponseMessage extends PacketImpl
+{
+ // Constants -----------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
+ private boolean error;
+
+ private int responseCode;
+
+ private String message;
+
+ // Static --------------------------------------------------------
+
+ // Constructors --------------------------------------------------
+
+ public SessionXAResponseMessage(final boolean isError, final int responseCode, final
String message)
+ {
+ super(PacketImpl.SESS_XA_RESP);
+
+ error = isError;
+
+ this.responseCode = responseCode;
+
+ this.message = message;
+ }
+
+ public SessionXAResponseMessage()
+ {
+ super(PacketImpl.SESS_XA_RESP);
+ }
+
+ // Public --------------------------------------------------------
+
+ @Override
+ public boolean isResponse()
+ {
+ return true;
+ }
+
+ public boolean isError()
+ {
+ return error;
+ }
+
+ public int getResponseCode()
+ {
+ return responseCode;
+ }
+
+ public String getMessage()
+ {
+ return message;
+ }
+
+ @Override
+ public void encodeRest(final HornetQBuffer buffer)
+ {
+ buffer.writeBoolean(error);
+ buffer.writeInt(responseCode);
+ buffer.writeNullableString(message);
+ }
+
+ @Override
+ public void decodeRest(final HornetQBuffer buffer)
+ {
+ error = buffer.readBoolean();
+ responseCode = buffer.readInt();
+ message = buffer.readNullableString();
+ }
+
+ @Override
+ public boolean equals(final Object other)
+ {
+ if (other instanceof SessionXAResponseMessage == false)
+ {
+ return false;
+ }
+
+ SessionXAResponseMessage r = (SessionXAResponseMessage)other;
+
+ return super.equals(other) && error == r.error && responseCode ==
r.responseCode && message.equals(r.message);
+ }
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAResumeMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAResumeMessage.java 2010-01-21
20:09:23 UTC (rev 8832)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAResumeMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,90 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.protocol.core.impl.wireformat;
-
-import javax.transaction.xa.Xid;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.protocol.core.impl.PacketImpl;
-import org.hornetq.utils.XidCodecSupport;
-
-/**
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- *
- * @version <tt>$Revision$</tt>
- */
-public class SessionXAResumeMessage extends PacketImpl
-{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private Xid xid;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public SessionXAResumeMessage(final Xid xid)
- {
- super(PacketImpl.SESS_XA_RESUME);
-
- this.xid = xid;
- }
-
- public SessionXAResumeMessage()
- {
- super(PacketImpl.SESS_XA_RESUME);
- }
-
- // Public --------------------------------------------------------
-
- public Xid getXid()
- {
- return xid;
- }
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- XidCodecSupport.encodeXid(xid, buffer);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- xid = XidCodecSupport.decodeXid(buffer);
- }
-
- @Override
- public boolean equals(final Object other)
- {
- if (other instanceof SessionXAResumeMessage == false)
- {
- return false;
- }
-
- SessionXAResumeMessage r = (SessionXAResumeMessage)other;
-
- return super.equals(other) && xid.equals(r.xid);
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAResumeMessage.java
(from rev 8832,
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAResumeMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAResumeMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAResumeMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -0,0 +1,90 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.core.protocol.core.impl.wireformat;
+
+import javax.transaction.xa.Xid;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.protocol.core.impl.PacketImpl;
+import org.hornetq.utils.XidCodecSupport;
+
+/**
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ *
+ * @version <tt>$Revision$</tt>
+ */
+public class SessionXAResumeMessage extends PacketImpl
+{
+ // Constants -----------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
+ private Xid xid;
+
+ // Static --------------------------------------------------------
+
+ // Constructors --------------------------------------------------
+
+ public SessionXAResumeMessage(final Xid xid)
+ {
+ super(PacketImpl.SESS_XA_RESUME);
+
+ this.xid = xid;
+ }
+
+ public SessionXAResumeMessage()
+ {
+ super(PacketImpl.SESS_XA_RESUME);
+ }
+
+ // Public --------------------------------------------------------
+
+ public Xid getXid()
+ {
+ return xid;
+ }
+
+ @Override
+ public void encodeRest(final HornetQBuffer buffer)
+ {
+ XidCodecSupport.encodeXid(xid, buffer);
+ }
+
+ @Override
+ public void decodeRest(final HornetQBuffer buffer)
+ {
+ xid = XidCodecSupport.decodeXid(buffer);
+ }
+
+ @Override
+ public boolean equals(final Object other)
+ {
+ if (other instanceof SessionXAResumeMessage == false)
+ {
+ return false;
+ }
+
+ SessionXAResumeMessage r = (SessionXAResumeMessage)other;
+
+ return super.equals(other) && xid.equals(r.xid);
+ }
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXARollbackMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXARollbackMessage.java 2010-01-21
20:09:23 UTC (rev 8832)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXARollbackMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,96 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.protocol.core.impl.wireformat;
-
-import javax.transaction.xa.Xid;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.protocol.core.impl.PacketImpl;
-import org.hornetq.utils.XidCodecSupport;
-
-/**
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- *
- * @version <tt>$Revision$</tt>
- */
-public class SessionXARollbackMessage extends PacketImpl
-{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private Xid xid;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public SessionXARollbackMessage(final Xid xid)
- {
- super(PacketImpl.SESS_XA_ROLLBACK);
-
- this.xid = xid;
- }
-
- public SessionXARollbackMessage()
- {
- super(PacketImpl.SESS_XA_ROLLBACK);
- }
-
- // Public --------------------------------------------------------
-
- public Xid getXid()
- {
- return xid;
- }
-
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- XidCodecSupport.encodeXid(xid, buffer);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- xid = XidCodecSupport.decodeXid(buffer);
- }
-
- public boolean isAsyncExec()
- {
- return true;
- }
-
- @Override
- public boolean equals(final Object other)
- {
- if (other instanceof SessionXARollbackMessage == false)
- {
- return false;
- }
-
- SessionXARollbackMessage r = (SessionXARollbackMessage)other;
-
- return super.equals(other) && xid.equals(r.xid);
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXARollbackMessage.java
(from rev 8832,
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXARollbackMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXARollbackMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXARollbackMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -0,0 +1,96 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.core.protocol.core.impl.wireformat;
+
+import javax.transaction.xa.Xid;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.protocol.core.impl.PacketImpl;
+import org.hornetq.utils.XidCodecSupport;
+
+/**
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ *
+ * @version <tt>$Revision$</tt>
+ */
+public class SessionXARollbackMessage extends PacketImpl
+{
+ // Constants -----------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
+ private Xid xid;
+
+ // Static --------------------------------------------------------
+
+ // Constructors --------------------------------------------------
+
+ public SessionXARollbackMessage(final Xid xid)
+ {
+ super(PacketImpl.SESS_XA_ROLLBACK);
+
+ this.xid = xid;
+ }
+
+ public SessionXARollbackMessage()
+ {
+ super(PacketImpl.SESS_XA_ROLLBACK);
+ }
+
+ // Public --------------------------------------------------------
+
+ public Xid getXid()
+ {
+ return xid;
+ }
+
+
+ @Override
+ public void encodeRest(final HornetQBuffer buffer)
+ {
+ XidCodecSupport.encodeXid(xid, buffer);
+ }
+
+ @Override
+ public void decodeRest(final HornetQBuffer buffer)
+ {
+ xid = XidCodecSupport.decodeXid(buffer);
+ }
+
+ public boolean isAsyncExec()
+ {
+ return true;
+ }
+
+ @Override
+ public boolean equals(final Object other)
+ {
+ if (other instanceof SessionXARollbackMessage == false)
+ {
+ return false;
+ }
+
+ SessionXARollbackMessage r = (SessionXARollbackMessage)other;
+
+ return super.equals(other) && xid.equals(r.xid);
+ }
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXASetTimeoutMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXASetTimeoutMessage.java 2010-01-21
20:09:23 UTC (rev 8832)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXASetTimeoutMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,87 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.protocol.core.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.protocol.core.impl.PacketImpl;
-
-/**
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- *
- * @version <tt>$Revision$</tt>
- */
-public class SessionXASetTimeoutMessage extends PacketImpl
-{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private int timeoutSeconds;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public SessionXASetTimeoutMessage(final int timeoutSeconds)
- {
- super(PacketImpl.SESS_XA_SET_TIMEOUT);
-
- this.timeoutSeconds = timeoutSeconds;
- }
-
- public SessionXASetTimeoutMessage()
- {
- super(PacketImpl.SESS_XA_SET_TIMEOUT);
- }
-
- // Public --------------------------------------------------------
-
- public int getTimeoutSeconds()
- {
- return timeoutSeconds;
- }
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeInt(timeoutSeconds);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- timeoutSeconds = buffer.readInt();
- }
-
- @Override
- public boolean equals(final Object other)
- {
- if (other instanceof SessionXASetTimeoutMessage == false)
- {
- return false;
- }
-
- SessionXASetTimeoutMessage r = (SessionXASetTimeoutMessage)other;
-
- return super.equals(other) && timeoutSeconds == r.timeoutSeconds;
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXASetTimeoutMessage.java
(from rev 8832,
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXASetTimeoutMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXASetTimeoutMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXASetTimeoutMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -0,0 +1,87 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.core.protocol.core.impl.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.protocol.core.impl.PacketImpl;
+
+/**
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ *
+ * @version <tt>$Revision$</tt>
+ */
+public class SessionXASetTimeoutMessage extends PacketImpl
+{
+ // Constants -----------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
+ private int timeoutSeconds;
+
+ // Static --------------------------------------------------------
+
+ // Constructors --------------------------------------------------
+
+ public SessionXASetTimeoutMessage(final int timeoutSeconds)
+ {
+ super(PacketImpl.SESS_XA_SET_TIMEOUT);
+
+ this.timeoutSeconds = timeoutSeconds;
+ }
+
+ public SessionXASetTimeoutMessage()
+ {
+ super(PacketImpl.SESS_XA_SET_TIMEOUT);
+ }
+
+ // Public --------------------------------------------------------
+
+ public int getTimeoutSeconds()
+ {
+ return timeoutSeconds;
+ }
+
+ @Override
+ public void encodeRest(final HornetQBuffer buffer)
+ {
+ buffer.writeInt(timeoutSeconds);
+ }
+
+ @Override
+ public void decodeRest(final HornetQBuffer buffer)
+ {
+ timeoutSeconds = buffer.readInt();
+ }
+
+ @Override
+ public boolean equals(final Object other)
+ {
+ if (other instanceof SessionXASetTimeoutMessage == false)
+ {
+ return false;
+ }
+
+ SessionXASetTimeoutMessage r = (SessionXASetTimeoutMessage)other;
+
+ return super.equals(other) && timeoutSeconds == r.timeoutSeconds;
+ }
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXASetTimeoutResponseMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXASetTimeoutResponseMessage.java 2010-01-21
20:09:23 UTC (rev 8832)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXASetTimeoutResponseMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,93 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.protocol.core.impl.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.protocol.core.impl.PacketImpl;
-
-/**
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- *
- * @version <tt>$Revision$</tt>
- */
-public class SessionXASetTimeoutResponseMessage extends PacketImpl
-{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private boolean ok;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public SessionXASetTimeoutResponseMessage(final boolean ok)
- {
- super(PacketImpl.SESS_XA_SET_TIMEOUT_RESP);
-
- this.ok = ok;
- }
-
- public SessionXASetTimeoutResponseMessage()
- {
- super(PacketImpl.SESS_XA_SET_TIMEOUT_RESP);
- }
-
- // Public --------------------------------------------------------
-
- @Override
- public boolean isResponse()
- {
- return true;
- }
-
- public boolean isOK()
- {
- return ok;
- }
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- buffer.writeBoolean(ok);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- ok = buffer.readBoolean();
- }
-
- @Override
- public boolean equals(final Object other)
- {
- if (other instanceof SessionXASetTimeoutResponseMessage == false)
- {
- return false;
- }
-
- SessionXASetTimeoutResponseMessage r = (SessionXASetTimeoutResponseMessage)other;
-
- return super.equals(other) && ok == r.ok;
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXASetTimeoutResponseMessage.java
(from rev 8832,
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXASetTimeoutResponseMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXASetTimeoutResponseMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXASetTimeoutResponseMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -0,0 +1,93 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.core.protocol.core.impl.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.protocol.core.impl.PacketImpl;
+
+/**
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ *
+ * @version <tt>$Revision$</tt>
+ */
+public class SessionXASetTimeoutResponseMessage extends PacketImpl
+{
+ // Constants -----------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
+ private boolean ok;
+
+ // Static --------------------------------------------------------
+
+ // Constructors --------------------------------------------------
+
+ public SessionXASetTimeoutResponseMessage(final boolean ok)
+ {
+ super(PacketImpl.SESS_XA_SET_TIMEOUT_RESP);
+
+ this.ok = ok;
+ }
+
+ public SessionXASetTimeoutResponseMessage()
+ {
+ super(PacketImpl.SESS_XA_SET_TIMEOUT_RESP);
+ }
+
+ // Public --------------------------------------------------------
+
+ @Override
+ public boolean isResponse()
+ {
+ return true;
+ }
+
+ public boolean isOK()
+ {
+ return ok;
+ }
+
+ @Override
+ public void encodeRest(final HornetQBuffer buffer)
+ {
+ buffer.writeBoolean(ok);
+ }
+
+ @Override
+ public void decodeRest(final HornetQBuffer buffer)
+ {
+ ok = buffer.readBoolean();
+ }
+
+ @Override
+ public boolean equals(final Object other)
+ {
+ if (other instanceof SessionXASetTimeoutResponseMessage == false)
+ {
+ return false;
+ }
+
+ SessionXASetTimeoutResponseMessage r = (SessionXASetTimeoutResponseMessage)other;
+
+ return super.equals(other) && ok == r.ok;
+ }
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAStartMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAStartMessage.java 2010-01-21
20:09:23 UTC (rev 8832)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAStartMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,90 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.protocol.core.impl.wireformat;
-
-import javax.transaction.xa.Xid;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.protocol.core.impl.PacketImpl;
-import org.hornetq.utils.XidCodecSupport;
-
-/**
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- *
- * @version <tt>$Revision$</tt>
- */
-public class SessionXAStartMessage extends PacketImpl
-{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private Xid xid;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public SessionXAStartMessage(final Xid xid)
- {
- super(PacketImpl.SESS_XA_START);
-
- this.xid = xid;
- }
-
- public SessionXAStartMessage()
- {
- super(PacketImpl.SESS_XA_START);
- }
-
- // Public --------------------------------------------------------
-
- public Xid getXid()
- {
- return xid;
- }
-
- @Override
- public void encodeRest(final HornetQBuffer buffer)
- {
- XidCodecSupport.encodeXid(xid, buffer);
- }
-
- @Override
- public void decodeRest(final HornetQBuffer buffer)
- {
- xid = XidCodecSupport.decodeXid(buffer);
- }
-
- @Override
- public boolean equals(final Object other)
- {
- if (other instanceof SessionXAStartMessage == false)
- {
- return false;
- }
-
- SessionXAStartMessage r = (SessionXAStartMessage)other;
-
- return super.equals(other) && xid.equals(r.xid);
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAStartMessage.java
(from rev 8832,
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAStartMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAStartMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionXAStartMessage.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -0,0 +1,90 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.core.protocol.core.impl.wireformat;
+
+import javax.transaction.xa.Xid;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.protocol.core.impl.PacketImpl;
+import org.hornetq.utils.XidCodecSupport;
+
+/**
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ *
+ * @version <tt>$Revision$</tt>
+ */
+public class SessionXAStartMessage extends PacketImpl
+{
+ // Constants -----------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
+ private Xid xid;
+
+ // Static --------------------------------------------------------
+
+ // Constructors --------------------------------------------------
+
+ public SessionXAStartMessage(final Xid xid)
+ {
+ super(PacketImpl.SESS_XA_START);
+
+ this.xid = xid;
+ }
+
+ public SessionXAStartMessage()
+ {
+ super(PacketImpl.SESS_XA_START);
+ }
+
+ // Public --------------------------------------------------------
+
+ public Xid getXid()
+ {
+ return xid;
+ }
+
+ @Override
+ public void encodeRest(final HornetQBuffer buffer)
+ {
+ XidCodecSupport.encodeXid(xid, buffer);
+ }
+
+ @Override
+ public void decodeRest(final HornetQBuffer buffer)
+ {
+ xid = XidCodecSupport.decodeXid(buffer);
+ }
+
+ @Override
+ public boolean equals(final Object other)
+ {
+ if (other instanceof SessionXAStartMessage == false)
+ {
+ return false;
+ }
+
+ SessionXAStartMessage r = (SessionXAStartMessage)other;
+
+ return super.equals(other) && xid.equals(r.xid);
+ }
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+}
Modified:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/CloseListener.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/CloseListener.java 2010-01-22
10:19:02 UTC (rev 8835)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/CloseListener.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -13,9 +13,9 @@
package org.hornetq.core.remoting;
/**
- * CloseListeners can be registered with a {@link
org.hornetq.core.remoting.RemotingConnection} to get notified when the connection is
closed.
+ * CloseListeners can be registered with a {@link
org.hornetq.spi.core.protocol.RemotingConnection} to get notified when the connection is
closed.
* <p/>
- * {@link org.hornetq.core.remoting.RemotingConnection#addCloseListener(CloseListener)}
+ * {@link
org.hornetq.spi.core.protocol.RemotingConnection#addCloseListener(CloseListener)}
*
* @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
*/
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/ProtocolType.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/ProtocolType.java 2010-01-22
10:19:02 UTC (rev 8835)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/ProtocolType.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,26 +0,0 @@
-/*
- * Copyright 2010 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.remoting;
-
-/**
- * A ProtocolType
- *
- * @author Tim Fox
- *
- *
- */
-public enum ProtocolType
-{
- CORE, STOMP, AMQP;
-}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/RemotingConnection.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/RemotingConnection.java 2010-01-22
10:19:02 UTC (rev 8835)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/RemotingConnection.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,156 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.remoting;
-
-import java.util.List;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.api.core.HornetQException;
-import org.hornetq.spi.core.remoting.BufferHandler;
-import org.hornetq.spi.core.remoting.Connection;
-
-/**
- * A RemotingConnection is a connection between a client and a server.
- * <p/>
- * It allows multiple {@link org.hornetq.core.protocol.core.Channel}'s to be created
and data multiplexed over them. It uses
- * and a {@link Connection} implementation and takes care of failures etc.
- *
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
- */
-public interface RemotingConnection extends BufferHandler
-{
- /**
- * returns the unique id of the Remoting Connection
- *
- * @return the id
- */
- Object getID();
-
- /**
- * returns a string representation of the remote address of this connection
- *
- * @return the remote address
- */
- String getRemoteAddress();
-
- /**
- * add a failure listener.
- * <p/>
- * The listener will be called in the event of connection failure.
- *
- * @param listener the listener
- */
- void addFailureListener(FailureListener listener);
-
- /**
- * remove the failure listener
- *
- * @param listener the lister to remove
- * @return true if removed
- */
- boolean removeFailureListener(FailureListener listener);
-
- /**
- * add a CloseListener.
- * <p/>
- * This will be called in the event of the connection being closed.
- *
- * @param listener the listener to add
- */
- void addCloseListener(CloseListener listener);
-
- /**
- * remove a Close Listener
- *
- * @param listener the listener to remove
- * @return true if removed
- */
- boolean removeCloseListener(CloseListener listener);
-
- /**
- * return all the failure listeners
- *
- * @return the listeners
- */
- List<FailureListener> getFailureListeners();
-
- /**
- * set the failure listeners.
- * <p/>
- * These will be called in the event of the connection being closed. Any previosuly
added listeners will be removed.
- *
- * @param listeners the listeners to add.
- */
- void setFailureListeners(List<FailureListener> listeners);
-
- /**
- * creates a new HornetQBuffer of the specified size.
- *
- * @param size the size of buffer required
- * @return the buffer
- */
- HornetQBuffer createBuffer(int size);
-
- /**
- * called when the underlying connection fails.
- *
- * @param me the exception that caused the failure
- */
- void fail(HornetQException me);
-
- /**
- * destroys this connection.
- */
- void destroy();
-
- /**
- * return the underlying Connection.
- *
- * @return the connection
- */
- Connection getTransportConnection();
-
- /**
- * returns whether or not the Remoting Connection is a client
- *
- * @return true if client, false if a server
- */
- boolean isClient();
-
- /**
- * returns true if this Remoting Connection has been destroyed.
- *
- * @return true if destroyed, otherwise false
- */
- boolean isDestroyed();
-
- /**
- * Disconnect the connection, closing all channels
- */
- void disconnect();
-
- /**
- * returns true if any data has been received since the last time this method was
called.
- *
- * @return true if data has been received.
- */
- boolean checkDataReceived();
-
- /**
- * flush all outstanding data from the connection.
- */
- void flush();
-
-}
Modified:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/invm/InVMAcceptor.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/invm/InVMAcceptor.java 2010-01-22
10:19:02 UTC (rev 8835)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/invm/InVMAcceptor.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -21,10 +21,10 @@
import org.hornetq.api.core.SimpleString;
import org.hornetq.api.core.management.NotificationType;
import org.hornetq.core.logging.Logger;
-import org.hornetq.core.remoting.ProtocolType;
import org.hornetq.core.server.management.Notification;
import org.hornetq.core.server.management.NotificationService;
import org.hornetq.integration.transports.netty.ServerHolder;
+import org.hornetq.spi.core.protocol.ProtocolType;
import org.hornetq.spi.core.remoting.Acceptor;
import org.hornetq.spi.core.remoting.BufferHandler;
import org.hornetq.spi.core.remoting.Connection;
@@ -60,6 +60,8 @@
private NotificationService notificationService;
+ private final ProtocolType protocol;
+
public InVMAcceptor(final Map<String, Object> configuration,
final BufferHandler handler,
final ServerHolder holder,
@@ -72,6 +74,11 @@
id = ConfigurationHelper.getIntProperty(TransportConstants.SERVER_ID_PROP_NAME, 0,
configuration);
+ String protocolStr =
ConfigurationHelper.getStringProperty(TransportConstants.PROTOCOL_PROP_NAME,
+
TransportConstants.DEFAULT_PROTOCOL,
+ configuration);
+ this.protocol = ProtocolType.valueOf(protocolStr);
+
executorFactory = new OrderedExecutorFactory(threadPool);
}
Modified:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/invm/InVMConnection.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/invm/InVMConnection.java 2010-01-22
10:19:02 UTC (rev 8835)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/invm/InVMConnection.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -18,8 +18,8 @@
import org.hornetq.api.core.HornetQBuffer;
import org.hornetq.api.core.HornetQBuffers;
import org.hornetq.core.logging.Logger;
-import org.hornetq.core.protocol.core.PacketDecoder;
-import org.hornetq.core.remoting.ProtocolType;
+import org.hornetq.core.protocol.core.impl.PacketDecoder;
+import org.hornetq.spi.core.protocol.ProtocolType;
import org.hornetq.spi.core.remoting.BufferHandler;
import org.hornetq.spi.core.remoting.Connection;
import org.hornetq.spi.core.remoting.ConnectionLifeCycleListener;
Modified:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/invm/InVMConnector.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/invm/InVMConnector.java 2010-01-22
10:19:02 UTC (rev 8835)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/invm/InVMConnector.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -19,7 +19,7 @@
import org.hornetq.api.core.HornetQException;
import org.hornetq.core.logging.Logger;
-import org.hornetq.core.remoting.ProtocolType;
+import org.hornetq.spi.core.protocol.ProtocolType;
import org.hornetq.spi.core.remoting.Acceptor;
import org.hornetq.spi.core.remoting.BufferHandler;
import org.hornetq.spi.core.remoting.Connection;
Modified:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/invm/TransportConstants.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/invm/TransportConstants.java 2010-01-22
10:19:02 UTC (rev 8835)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/invm/TransportConstants.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -16,6 +16,8 @@
import java.util.HashSet;
import java.util.Set;
+import org.hornetq.spi.core.protocol.ProtocolType;
+
/**
* A TransportConstants
*
@@ -26,6 +28,10 @@
{
public static final String SERVER_ID_PROP_NAME = "server-id";
+ public static final String PROTOCOL_PROP_NAME = "protocol";
+
+ public static final String DEFAULT_PROTOCOL = ProtocolType.CORE.toString();
+
public static final Set<String> ALLOWABLE_CONNECTOR_KEYS;
public static final Set<String> ALLOWABLE_ACCEPTOR_KEYS;
@@ -34,11 +40,13 @@
{
Set<String> allowableAcceptorKeys = new HashSet<String>();
allowableAcceptorKeys.add(TransportConstants.SERVER_ID_PROP_NAME);
+ allowableAcceptorKeys.add(TransportConstants.PROTOCOL_PROP_NAME);
ALLOWABLE_CONNECTOR_KEYS = Collections.unmodifiableSet(allowableAcceptorKeys);
Set<String> allowableConnectorKeys = new HashSet<String>();
allowableConnectorKeys.add(TransportConstants.SERVER_ID_PROP_NAME);
+ allowableConnectorKeys.add(TransportConstants.PROTOCOL_PROP_NAME);
ALLOWABLE_ACCEPTOR_KEYS = Collections.unmodifiableSet(allowableConnectorKeys);
}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/server/ConnectionEntry.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/server/ConnectionEntry.java 2010-01-22
10:19:02 UTC (rev 8835)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/server/ConnectionEntry.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,41 +0,0 @@
-/*
- * Copyright 2010 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.remoting.server;
-
-import org.hornetq.core.remoting.RemotingConnection;
-
-/**
- * A ConnectionEntry
- *
- * @author Tim Fox
- *
- *
- */
-public class ConnectionEntry
-{
- public final RemotingConnection connection;
-
- public volatile long lastCheck;
-
- public volatile long ttl;
-
- public ConnectionEntry(final RemotingConnection connection, final long lastCheck,
final long ttl)
- {
- this.connection = connection;
-
- this.lastCheck = lastCheck;
-
- this.ttl = ttl;
- }
-}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/server/ProtocolManager.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/server/ProtocolManager.java 2010-01-22
10:19:02 UTC (rev 8835)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/server/ProtocolManager.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,31 +0,0 @@
-/*
- * Copyright 2010 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.remoting.server;
-
-import org.hornetq.spi.core.remoting.Connection;
-
-/**
- * A ProtocolManager
- *
- * @author Tim Fox
- *
- *
- */
-public interface ProtocolManager
-{
- ConnectionEntry createConnectionEntry(Connection connection);
-
- void removeHandler(String name);
-
-}
Modified:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/server/RemotingService.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/server/RemotingService.java 2010-01-22
10:19:02 UTC (rev 8835)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/server/RemotingService.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -16,8 +16,8 @@
import java.util.Set;
import org.hornetq.api.core.Interceptor;
-import org.hornetq.core.remoting.RemotingConnection;
import org.hornetq.core.server.HornetQComponent;
+import org.hornetq.spi.core.protocol.RemotingConnection;
/**
* @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
Modified:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/server/impl/RemotingServiceImpl.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/server/impl/RemotingServiceImpl.java 2010-01-22
10:19:02 UTC (rev 8835)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/server/impl/RemotingServiceImpl.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -28,15 +28,16 @@
import org.hornetq.api.core.TransportConfiguration;
import org.hornetq.core.config.Configuration;
import org.hornetq.core.logging.Logger;
-import org.hornetq.core.protocol.core.CoreProtocolManager;
-import org.hornetq.core.remoting.ProtocolType;
-import org.hornetq.core.remoting.RemotingConnection;
-import org.hornetq.core.remoting.server.ConnectionEntry;
-import org.hornetq.core.remoting.server.ProtocolManager;
+import org.hornetq.core.protocol.aardvark.impl.AardvarkProtocolManagerFactory;
+import org.hornetq.core.protocol.core.impl.CoreProtocolManagerFactory;
import org.hornetq.core.remoting.server.RemotingService;
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.server.management.ManagementService;
import org.hornetq.integration.transports.netty.ServerHolder;
+import org.hornetq.spi.core.protocol.ConnectionEntry;
+import org.hornetq.spi.core.protocol.ProtocolManager;
+import org.hornetq.spi.core.protocol.ProtocolType;
+import org.hornetq.spi.core.protocol.RemotingConnection;
import org.hornetq.spi.core.remoting.Acceptor;
import org.hornetq.spi.core.remoting.AcceptorFactory;
import org.hornetq.spi.core.remoting.BufferHandler;
@@ -70,7 +71,7 @@
private final Map<Object, ConnectionEntry> connections = new
ConcurrentHashMap<Object, ConnectionEntry>();
- private final BufferHandler bufferHandler = new DelegatingBufferHandler();
+ //private final BufferHandler bufferHandler = new DelegatingBufferHandler();
private final Configuration config;
@@ -122,7 +123,8 @@
this.threadPool = threadPool;
this.scheduledThreadPool = scheduledThreadPool;
- this.protocolMap.put(ProtocolType.CORE, new CoreProtocolManager(server,
interceptors));
+ this.protocolMap.put(ProtocolType.CORE, new
CoreProtocolManagerFactory().createProtocolManager(server, interceptors));
+ this.protocolMap.put(ProtocolType.AARDVARK, new
AardvarkProtocolManagerFactory().createProtocolManager(server, interceptors));
}
// RemotingService implementation -------------------------------
@@ -159,9 +161,15 @@
continue;
}
}
+
+ //TODO - allow protocol type to be configured from Configuration for each
acceptor
+ ProtocolType protocol = hackProtocol;
+
+ ProtocolManager manager = protocolMap.get(protocol);
+
Acceptor acceptor = factory.createAcceptor(info.getParams(),
- bufferHandler,
+ new
DelegatingBufferHandler(manager),
new ServerHolder()
{
public HornetQServer getServer()
@@ -214,6 +222,9 @@
started = true;
}
+
+ //FIXME - temp hack so we can choose AARDVARK as protocol
+ public static ProtocolType hackProtocol = ProtocolType.CORE;
public synchronized void freeze()
{
@@ -399,6 +410,13 @@
private final class DelegatingBufferHandler implements BufferHandler
{
+ private ProtocolManager manager;
+
+ DelegatingBufferHandler(final ProtocolManager manager)
+ {
+ this.manager = manager;
+ }
+
public void bufferReceived(final Object connectionID, final HornetQBuffer buffer)
{
ConnectionEntry conn = connections.get(connectionID);
@@ -408,6 +426,11 @@
conn.connection.bufferReceived(connectionID, buffer);
}
}
+
+ public int isReadyToHandle(HornetQBuffer buffer)
+ {
+ return manager.isReadyToHandle(buffer);
+ }
}
private final class FailureCheckAndFlushThread extends Thread
Modified:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/replication/impl/ReplicationEndpointImpl.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/replication/impl/ReplicationEndpointImpl.java 2010-01-22
10:19:02 UTC (rev 8835)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/replication/impl/ReplicationEndpointImpl.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -30,22 +30,22 @@
import org.hornetq.core.persistence.impl.journal.JournalStorageManager;
import org.hornetq.core.protocol.core.Channel;
import org.hornetq.core.protocol.core.Packet;
-import org.hornetq.core.protocol.core.PacketImpl;
-import org.hornetq.core.protocol.core.wireformat.HornetQExceptionMessage;
-import org.hornetq.core.protocol.core.wireformat.NullResponseMessage;
-import org.hornetq.core.protocol.core.wireformat.ReplicationAddMessage;
-import org.hornetq.core.protocol.core.wireformat.ReplicationAddTXMessage;
-import org.hornetq.core.protocol.core.wireformat.ReplicationCommitMessage;
-import org.hornetq.core.protocol.core.wireformat.ReplicationCompareDataMessage;
-import org.hornetq.core.protocol.core.wireformat.ReplicationDeleteMessage;
-import org.hornetq.core.protocol.core.wireformat.ReplicationDeleteTXMessage;
-import org.hornetq.core.protocol.core.wireformat.ReplicationLargeMessageBeingMessage;
-import org.hornetq.core.protocol.core.wireformat.ReplicationLargeMessageWriteMessage;
-import org.hornetq.core.protocol.core.wireformat.ReplicationLargemessageEndMessage;
-import org.hornetq.core.protocol.core.wireformat.ReplicationPageEventMessage;
-import org.hornetq.core.protocol.core.wireformat.ReplicationPageWriteMessage;
-import org.hornetq.core.protocol.core.wireformat.ReplicationPrepareMessage;
-import org.hornetq.core.protocol.core.wireformat.ReplicationResponseMessage;
+import org.hornetq.core.protocol.core.impl.PacketImpl;
+import org.hornetq.core.protocol.core.impl.wireformat.HornetQExceptionMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.NullResponseMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.ReplicationAddMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.ReplicationAddTXMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.ReplicationCommitMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.ReplicationCompareDataMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.ReplicationDeleteMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.ReplicationDeleteTXMessage;
+import
org.hornetq.core.protocol.core.impl.wireformat.ReplicationLargeMessageBeingMessage;
+import
org.hornetq.core.protocol.core.impl.wireformat.ReplicationLargeMessageWriteMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.ReplicationLargemessageEndMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.ReplicationPageEventMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.ReplicationPageWriteMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.ReplicationPrepareMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.ReplicationResponseMessage;
import org.hornetq.core.replication.ReplicationEndpoint;
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.server.LargeServerMessage;
Modified:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/replication/impl/ReplicationManagerImpl.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/replication/impl/ReplicationManagerImpl.java 2010-01-22
10:19:02 UTC (rev 8835)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/replication/impl/ReplicationManagerImpl.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -33,20 +33,20 @@
import org.hornetq.core.protocol.core.ChannelHandler;
import org.hornetq.core.protocol.core.CoreRemotingConnection;
import org.hornetq.core.protocol.core.Packet;
-import org.hornetq.core.protocol.core.PacketImpl;
-import org.hornetq.core.protocol.core.wireformat.CreateReplicationSessionMessage;
-import org.hornetq.core.protocol.core.wireformat.ReplicationAddMessage;
-import org.hornetq.core.protocol.core.wireformat.ReplicationAddTXMessage;
-import org.hornetq.core.protocol.core.wireformat.ReplicationCommitMessage;
-import org.hornetq.core.protocol.core.wireformat.ReplicationCompareDataMessage;
-import org.hornetq.core.protocol.core.wireformat.ReplicationDeleteMessage;
-import org.hornetq.core.protocol.core.wireformat.ReplicationDeleteTXMessage;
-import org.hornetq.core.protocol.core.wireformat.ReplicationLargeMessageBeingMessage;
-import org.hornetq.core.protocol.core.wireformat.ReplicationLargeMessageWriteMessage;
-import org.hornetq.core.protocol.core.wireformat.ReplicationLargemessageEndMessage;
-import org.hornetq.core.protocol.core.wireformat.ReplicationPageEventMessage;
-import org.hornetq.core.protocol.core.wireformat.ReplicationPageWriteMessage;
-import org.hornetq.core.protocol.core.wireformat.ReplicationPrepareMessage;
+import org.hornetq.core.protocol.core.impl.PacketImpl;
+import org.hornetq.core.protocol.core.impl.wireformat.CreateReplicationSessionMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.ReplicationAddMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.ReplicationAddTXMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.ReplicationCommitMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.ReplicationCompareDataMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.ReplicationDeleteMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.ReplicationDeleteTXMessage;
+import
org.hornetq.core.protocol.core.impl.wireformat.ReplicationLargeMessageBeingMessage;
+import
org.hornetq.core.protocol.core.impl.wireformat.ReplicationLargeMessageWriteMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.ReplicationLargemessageEndMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.ReplicationPageEventMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.ReplicationPageWriteMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.ReplicationPrepareMessage;
import org.hornetq.core.replication.ReplicationManager;
import org.hornetq.utils.ExecutorFactory;
Modified:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/server/HornetQServer.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/server/HornetQServer.java 2010-01-22
10:19:02 UTC (rev 8835)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/server/HornetQServer.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -24,7 +24,6 @@
import org.hornetq.core.persistence.StorageManager;
import org.hornetq.core.postoffice.PostOffice;
import org.hornetq.core.protocol.core.Channel;
-import org.hornetq.core.remoting.RemotingConnection;
import org.hornetq.core.remoting.server.RemotingService;
import org.hornetq.core.replication.ReplicationEndpoint;
import org.hornetq.core.security.Role;
@@ -35,6 +34,8 @@
import org.hornetq.core.settings.impl.AddressSettings;
import org.hornetq.core.transaction.ResourceManager;
import org.hornetq.core.version.Version;
+import org.hornetq.spi.core.protocol.RemotingConnection;
+import org.hornetq.spi.core.protocol.SessionCallback;
import org.hornetq.spi.core.security.HornetQSecurityManager;
import org.hornetq.utils.ExecutorFactory;
Modified:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/server/ServerSession.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/server/ServerSession.java 2010-01-22
10:19:02 UTC (rev 8835)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/server/ServerSession.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -18,6 +18,7 @@
import javax.transaction.xa.Xid;
import org.hornetq.api.core.SimpleString;
+import org.hornetq.spi.core.protocol.SessionCallback;
/**
*
@@ -85,7 +86,7 @@
void deleteQueue(SimpleString name) throws Exception;
- void createConsumer(long consumerID, SimpleString name, SimpleString filterString,
boolean browseOnly) throws Exception;
+ void createConsumer(long consumerID, SimpleString queueName, SimpleString
filterString, boolean browseOnly) throws Exception;
QueueQueryResult executeQueueQuery(SimpleString name) throws Exception;
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/server/SessionCallback.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/server/SessionCallback.java 2010-01-22
10:19:02 UTC (rev 8835)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/server/SessionCallback.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,36 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.server;
-
-import org.hornetq.api.core.SimpleString;
-
-/**
- * A SessionCallback
- *
- * @author Tim Fox
- *
- *
- */
-public interface SessionCallback
-{
- void sendProducerCreditsMessage(int credits, SimpleString address, int offset);
-
- int sendMessage(ServerMessage message, long consumerID, int deliveryCount);
-
- int sendLargeMessage(long consumerID, byte[] headerBuffer, long bodySize, int
deliveryCount);
-
- int sendLargeMessageContinuation(long consumerID, byte[] body, boolean continues,
boolean requiresResponse);
-
- void closed();
-}
Modified:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/server/cluster/Bridge.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/server/cluster/Bridge.java 2010-01-22
10:19:02 UTC (rev 8835)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/server/cluster/Bridge.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -14,11 +14,11 @@
package org.hornetq.core.server.cluster;
import org.hornetq.api.core.SimpleString;
-import org.hornetq.core.remoting.RemotingConnection;
import org.hornetq.core.server.Consumer;
import org.hornetq.core.server.HornetQComponent;
import org.hornetq.core.server.Queue;
import org.hornetq.core.server.management.NotificationService;
+import org.hornetq.spi.core.protocol.RemotingConnection;
/**
* A Core Bridge
Modified:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/server/cluster/impl/BridgeImpl.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/server/cluster/impl/BridgeImpl.java 2010-01-22
10:19:02 UTC (rev 8835)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/server/cluster/impl/BridgeImpl.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -36,7 +36,6 @@
import org.hornetq.core.message.impl.MessageImpl;
import org.hornetq.core.persistence.StorageManager;
import org.hornetq.core.postoffice.BindingType;
-import org.hornetq.core.remoting.RemotingConnection;
import org.hornetq.core.server.HandleStatus;
import org.hornetq.core.server.MessageReference;
import org.hornetq.core.server.Queue;
@@ -46,6 +45,7 @@
import org.hornetq.core.server.cluster.Transformer;
import org.hornetq.core.server.management.Notification;
import org.hornetq.core.server.management.NotificationService;
+import org.hornetq.spi.core.protocol.RemotingConnection;
import org.hornetq.utils.Future;
import org.hornetq.utils.TypedProperties;
import org.hornetq.utils.UUID;
Modified:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java 2010-01-22
10:19:02 UTC (rev 8835)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -69,7 +69,6 @@
import org.hornetq.core.postoffice.impl.LocalQueueBinding;
import org.hornetq.core.postoffice.impl.PostOfficeImpl;
import org.hornetq.core.protocol.core.Channel;
-import org.hornetq.core.remoting.RemotingConnection;
import org.hornetq.core.remoting.server.RemotingService;
import org.hornetq.core.remoting.server.impl.RemotingServiceImpl;
import org.hornetq.core.replication.ReplicationEndpoint;
@@ -87,7 +86,6 @@
import org.hornetq.core.server.Queue;
import org.hornetq.core.server.QueueFactory;
import org.hornetq.core.server.ServerSession;
-import org.hornetq.core.server.SessionCallback;
import org.hornetq.core.server.cluster.ClusterManager;
import org.hornetq.core.server.cluster.DivertConfiguration;
import org.hornetq.core.server.cluster.QueueConfiguration;
@@ -107,6 +105,8 @@
import org.hornetq.core.transaction.impl.ResourceManagerImpl;
import org.hornetq.core.version.Version;
import org.hornetq.spi.core.logging.LogDelegateFactory;
+import org.hornetq.spi.core.protocol.RemotingConnection;
+import org.hornetq.spi.core.protocol.SessionCallback;
import org.hornetq.spi.core.security.HornetQSecurityManager;
import org.hornetq.utils.ExecutorFactory;
import org.hornetq.utils.HornetQThreadFactory;
Modified:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/server/impl/ServerConsumerImpl.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/server/impl/ServerConsumerImpl.java 2010-01-22
10:19:02 UTC (rev 8835)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/server/impl/ServerConsumerImpl.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -39,11 +39,11 @@
import org.hornetq.core.server.ServerConsumer;
import org.hornetq.core.server.ServerMessage;
import org.hornetq.core.server.ServerSession;
-import org.hornetq.core.server.SessionCallback;
import org.hornetq.core.server.management.ManagementService;
import org.hornetq.core.server.management.Notification;
import org.hornetq.core.transaction.Transaction;
import org.hornetq.core.transaction.impl.TransactionImpl;
+import org.hornetq.spi.core.protocol.SessionCallback;
import org.hornetq.utils.Future;
import org.hornetq.utils.TypedProperties;
Modified:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/server/impl/ServerMessageImpl.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/server/impl/ServerMessageImpl.java 2010-01-22
10:19:02 UTC (rev 8835)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/server/impl/ServerMessageImpl.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -21,7 +21,6 @@
import org.hornetq.core.logging.Logger;
import org.hornetq.core.message.impl.MessageImpl;
import org.hornetq.core.paging.PagingStore;
-import org.hornetq.core.protocol.core.PacketImpl;
import org.hornetq.core.server.MessageReference;
import org.hornetq.core.server.Queue;
import org.hornetq.core.server.ServerMessage;
@@ -313,7 +312,7 @@
{
// We first set the message id - this needs to be set on the buffer since this
buffer will be re-used
- buffer.setLong(buffer.getInt(PacketImpl.PACKET_HEADERS_SIZE) +
DataConstants.SIZE_INT, messageID);
+ buffer.setLong(buffer.getInt(MessageImpl.BUFFER_HEADER_SPACE) +
DataConstants.SIZE_INT, messageID);
}
}
Modified:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/server/impl/ServerSessionImpl.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/server/impl/ServerSessionImpl.java 2010-01-22
10:19:02 UTC (rev 8835)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/server/impl/ServerSessionImpl.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -44,7 +44,6 @@
import org.hornetq.core.postoffice.QueueBinding;
import org.hornetq.core.remoting.CloseListener;
import org.hornetq.core.remoting.FailureListener;
-import org.hornetq.core.remoting.RemotingConnection;
import org.hornetq.core.security.CheckType;
import org.hornetq.core.security.SecurityStore;
import org.hornetq.core.server.BindingQueryResult;
@@ -57,12 +56,13 @@
import org.hornetq.core.server.ServerConsumer;
import org.hornetq.core.server.ServerMessage;
import org.hornetq.core.server.ServerSession;
-import org.hornetq.core.server.SessionCallback;
import org.hornetq.core.server.management.ManagementService;
import org.hornetq.core.server.management.Notification;
import org.hornetq.core.transaction.ResourceManager;
import org.hornetq.core.transaction.Transaction;
import org.hornetq.core.transaction.impl.TransactionImpl;
+import org.hornetq.spi.core.protocol.RemotingConnection;
+import org.hornetq.spi.core.protocol.SessionCallback;
import org.hornetq.utils.TypedProperties;
/*
@@ -283,15 +283,15 @@
}
public void createConsumer(final long consumerID,
- final SimpleString name,
+ final SimpleString queueName,
final SimpleString filterString,
final boolean browseOnly) throws Exception
{
- Binding binding = postOffice.getBinding(name);
+ Binding binding = postOffice.getBinding(queueName);
if (binding == null || binding.getType() != BindingType.LOCAL_QUEUE)
{
- throw new HornetQException(HornetQException.QUEUE_DOES_NOT_EXIST, "Queue
" + name + " does not exist");
+ throw new HornetQException(HornetQException.QUEUE_DOES_NOT_EXIST, "Queue
" + queueName + " does not exist");
}
securityStore.check(binding.getAddress(), CheckType.CONSUME, this);
Modified:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/integration/protocol/stomp/StompChannelHandler.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/integration/protocol/stomp/StompChannelHandler.java 2010-01-22
10:19:02 UTC (rev 8835)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/integration/protocol/stomp/StompChannelHandler.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -26,7 +26,6 @@
import org.hornetq.api.core.SimpleString;
import org.hornetq.api.core.client.HornetQClient;
import org.hornetq.core.logging.Logger;
-import org.hornetq.core.remoting.RemotingConnection;
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.server.ServerMessage;
import org.hornetq.core.server.ServerSession;
@@ -36,6 +35,7 @@
import org.hornetq.integration.transports.netty.ServerHolder;
import org.hornetq.jms.client.HornetQBytesMessage;
import org.hornetq.jms.client.HornetQTextMessage;
+import org.hornetq.spi.core.protocol.RemotingConnection;
import org.hornetq.spi.core.remoting.ConnectionLifeCycleListener;
import org.hornetq.utils.UUIDGenerator;
import org.jboss.netty.channel.ChannelHandlerContext;
Modified:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/integration/protocol/stomp/StompSessionCallback.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/integration/protocol/stomp/StompSessionCallback.java 2010-01-22
10:19:02 UTC (rev 8835)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/integration/protocol/stomp/StompSessionCallback.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -18,10 +18,10 @@
import org.hornetq.api.core.HornetQBuffer;
import org.hornetq.api.core.HornetQBuffers;
import org.hornetq.api.core.SimpleString;
-import org.hornetq.core.remoting.RemotingConnection;
import org.hornetq.core.server.ServerMessage;
-import org.hornetq.core.server.SessionCallback;
import org.hornetq.jms.client.HornetQTextMessage;
+import org.hornetq.spi.core.protocol.RemotingConnection;
+import org.hornetq.spi.core.protocol.SessionCallback;
/**
* A StompSessionCallback
Modified:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/integration/transports/netty/ChannelPipelineSupport.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/integration/transports/netty/ChannelPipelineSupport.java 2010-01-22
10:19:02 UTC (rev 8835)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/integration/transports/netty/ChannelPipelineSupport.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -16,6 +16,7 @@
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLEngine;
+import org.hornetq.spi.core.protocol.ProtocolType;
import org.hornetq.spi.core.remoting.BufferHandler;
import org.jboss.netty.channel.ChannelPipeline;
import org.jboss.netty.handler.ssl.SslHandler;
@@ -44,10 +45,21 @@
// Public --------------------------------------------------------
- public static void addHornetQCodecFilter(final ChannelPipeline pipeline, final
BufferHandler handler)
+ public static void addCodecFilter(final ProtocolType protocol, final ChannelPipeline
pipeline, final BufferHandler handler)
{
assert pipeline != null;
- pipeline.addLast("decoder", new HornetQFrameDecoder2());
+
+ if (protocol == ProtocolType.CORE)
+ {
+ pipeline.addLast("decoder", new HornetQFrameDecoder2());
+ }
+ else
+ {
+
+ // FIXME
+ //Use the old frame decoder for other protocols
+ //pipeline.addLast("decoder", new HornetQFrameDecoder(handler));
+ }
}
public static void addSSLFilter(final ChannelPipeline pipeline, final SSLContext
context, final boolean client) throws Exception
Modified:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/integration/transports/netty/NettyAcceptor.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/integration/transports/netty/NettyAcceptor.java 2010-01-22
10:19:02 UTC (rev 8835)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/integration/transports/netty/NettyAcceptor.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -32,13 +32,13 @@
import org.hornetq.api.core.management.NotificationType;
import org.hornetq.core.buffers.impl.ChannelBufferWrapper;
import org.hornetq.core.logging.Logger;
-import org.hornetq.core.remoting.ProtocolType;
import org.hornetq.core.remoting.impl.ssl.SSLSupport;
import org.hornetq.core.server.management.Notification;
import org.hornetq.core.server.management.NotificationService;
import org.hornetq.integration.protocol.stomp.StompChannelHandler;
+import org.hornetq.integration.protocol.stomp.StompFrameDecoder;
import org.hornetq.integration.protocol.stomp.StompFrameDelimiter;
-import org.hornetq.integration.protocol.stomp.StompFrameDecoder;
+import org.hornetq.spi.core.protocol.ProtocolType;
import org.hornetq.spi.core.remoting.Acceptor;
import org.hornetq.spi.core.remoting.BufferHandler;
import org.hornetq.spi.core.remoting.Connection;
@@ -104,7 +104,7 @@
private final boolean useInvm;
- private final String protocol;
+ private final ProtocolType protocol;
private final String host;
@@ -133,6 +133,8 @@
private NotificationService notificationService;
private VirtualExecutorService bossExecutor;
+
+ private boolean paused;
private ServerHolder serverHolder;
@@ -148,7 +150,7 @@
this.serverHolder = serverHandler;
this.listener = listener;
-
+
sslEnabled =
ConfigurationHelper.getBooleanProperty(TransportConstants.SSL_ENABLED_PROP_NAME,
TransportConstants.DEFAULT_SSL_ENABLED,
configuration);
@@ -185,9 +187,11 @@
useInvm =
ConfigurationHelper.getBooleanProperty(TransportConstants.USE_INVM_PROP_NAME,
TransportConstants.DEFAULT_USE_INVM,
configuration);
- protocol =
ConfigurationHelper.getStringProperty(TransportConstants.PROTOCOL_PROP_NAME,
+ String protocolStr =
ConfigurationHelper.getStringProperty(TransportConstants.PROTOCOL_PROP_NAME,
TransportConstants.DEFAULT_PROTOCOL,
configuration);
+ protocol = ProtocolType.valueOf(protocolStr);
+
host = ConfigurationHelper.getStringProperty(TransportConstants.HOST_PROP_NAME,
TransportConstants.DEFAULT_HOST,
configuration);
@@ -291,7 +295,7 @@
pipeline.addLast("httpResponseEncoder", new
HttpResponseEncoder());
pipeline.addLast("httphandler", new
HttpAcceptorHandler(httpKeepAliveRunnable, httpResponseTime));
}
- if (protocol.equals(TransportConstants.STOMP_PROTOCOL))
+ if (protocol == ProtocolType.STOMP)
{
pipeline.addLast("delimiter", new StompFrameDelimiter());
pipeline.addLast("codec", new StompFrameDecoder());
@@ -302,10 +306,9 @@
}
else
{
- ChannelPipelineSupport.addHornetQCodecFilter(pipeline, handler);
+ ChannelPipelineSupport.addCodecFilter(ProtocolType.CORE, pipeline,
handler);
pipeline.addLast("handler", new
HornetQServerChannelHandler(channelGroup, handler, new Listener()));
}
-
return pipeline;
}
};
@@ -443,8 +446,6 @@
return channelFactory != null;
}
- private boolean paused;
-
public void pause()
{
if (paused)
@@ -477,7 +478,6 @@
bossExecutor.shutdown();
try
{
-
bossExecutor.awaitTermination(30, TimeUnit.SECONDS);
}
catch (InterruptedException e)
@@ -532,7 +532,7 @@
throw new IllegalArgumentException("Connection already exists with id
" + connection.getID());
}
- listener.connectionCreated(connection, protocol);
+ listener.connectionCreated(connection, NettyAcceptor.this.protocol);
}
public void connectionDestroyed(final Object connectionID)
Modified:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/integration/transports/netty/NettyAcceptorFactory.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/integration/transports/netty/NettyAcceptorFactory.java 2010-01-22
10:19:02 UTC (rev 8835)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/integration/transports/netty/NettyAcceptorFactory.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -18,6 +18,7 @@
import java.util.concurrent.Executor;
import java.util.concurrent.ScheduledExecutorService;
+import org.hornetq.spi.core.protocol.ProtocolType;
import org.hornetq.spi.core.remoting.Acceptor;
import org.hornetq.spi.core.remoting.AcceptorFactory;
import org.hornetq.spi.core.remoting.BufferHandler;
Modified:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/integration/transports/netty/NettyConnection.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/integration/transports/netty/NettyConnection.java 2010-01-22
10:19:02 UTC (rev 8835)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/integration/transports/netty/NettyConnection.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -16,7 +16,7 @@
import org.hornetq.api.core.HornetQBuffer;
import org.hornetq.core.buffers.impl.ChannelBufferWrapper;
import org.hornetq.core.logging.Logger;
-import org.hornetq.core.remoting.ProtocolType;
+import org.hornetq.spi.core.protocol.ProtocolType;
import org.hornetq.spi.core.remoting.Connection;
import org.hornetq.spi.core.remoting.ConnectionLifeCycleListener;
import org.jboss.netty.buffer.ChannelBuffers;
Modified:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/integration/transports/netty/NettyConnector.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/integration/transports/netty/NettyConnector.java 2010-01-22
10:19:02 UTC (rev 8835)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/integration/transports/netty/NettyConnector.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -31,9 +31,9 @@
import org.hornetq.api.core.HornetQException;
import org.hornetq.core.buffers.impl.ChannelBufferWrapper;
import org.hornetq.core.logging.Logger;
-import org.hornetq.core.protocol.core.PacketDecoder;
-import org.hornetq.core.remoting.ProtocolType;
+import org.hornetq.core.protocol.core.impl.PacketDecoder;
import org.hornetq.core.remoting.impl.ssl.SSLSupport;
+import org.hornetq.spi.core.protocol.ProtocolType;
import org.hornetq.spi.core.remoting.BufferHandler;
import org.hornetq.spi.core.remoting.Connection;
import org.hornetq.spi.core.remoting.ConnectionLifeCycleListener;
@@ -315,7 +315,7 @@
pipeline.addLast("httpResponseDecoder", new
HttpResponseDecoder());
pipeline.addLast("httphandler", new HttpHandler());
}
- ChannelPipelineSupport.addHornetQCodecFilter(pipeline, handler);
+ ChannelPipelineSupport.addCodecFilter(ProtocolType.CORE, pipeline, handler);
pipeline.addLast("handler", new
HornetQClientChannelHandler(channelGroup, handler, new Listener()));
return pipeline;
}
Modified:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/integration/transports/netty/ServerHolder.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/integration/transports/netty/ServerHolder.java 2010-01-22
10:19:02 UTC (rev 8835)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/integration/transports/netty/ServerHolder.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -13,8 +13,8 @@
package org.hornetq.integration.transports.netty;
-import org.hornetq.core.remoting.RemotingConnection;
import org.hornetq.core.server.HornetQServer;
+import org.hornetq.spi.core.protocol.RemotingConnection;
/**
* A ServerHolder
Modified:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/integration/transports/netty/TransportConstants.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/integration/transports/netty/TransportConstants.java 2010-01-22
10:19:02 UTC (rev 8835)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/integration/transports/netty/TransportConstants.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -16,6 +16,8 @@
import java.util.HashSet;
import java.util.Set;
+import org.hornetq.spi.core.protocol.ProtocolType;
+
/**
* A TransportConstants
*
@@ -77,12 +79,8 @@
public static final boolean DEFAULT_USE_SERVLET = false;
- public static final String HORNETQ_PROTOCOL = "hornetq";
+ public static final String DEFAULT_PROTOCOL = ProtocolType.CORE.toString();
- public static final String STOMP_PROTOCOL = "stomp";
-
- public static final String DEFAULT_PROTOCOL = HORNETQ_PROTOCOL;
-
public static final String DEFAULT_HOST = "localhost";
public static final int DEFAULT_PORT = 5445;
Copied: branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/spi/core/protocol (from
rev 8832, trunk/src/main/org/hornetq/spi/core/protocol)
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/spi/core/protocol/ConnectionEntry.java
===================================================================
--- trunk/src/main/org/hornetq/spi/core/protocol/ConnectionEntry.java 2010-01-21 20:09:23
UTC (rev 8832)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/spi/core/protocol/ConnectionEntry.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,40 +0,0 @@
-/*
- * Copyright 2010 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.spi.core.protocol;
-
-
-/**
- * A ConnectionEntry
- *
- * @author Tim Fox
- *
- *
- */
-public class ConnectionEntry
-{
- public final RemotingConnection connection;
-
- public volatile long lastCheck;
-
- public volatile long ttl;
-
- public ConnectionEntry(final RemotingConnection connection, final long lastCheck,
final long ttl)
- {
- this.connection = connection;
-
- this.lastCheck = lastCheck;
-
- this.ttl = ttl;
- }
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/spi/core/protocol/ConnectionEntry.java
(from rev 8832, trunk/src/main/org/hornetq/spi/core/protocol/ConnectionEntry.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/spi/core/protocol/ConnectionEntry.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/spi/core/protocol/ConnectionEntry.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2010 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.spi.core.protocol;
+
+
+/**
+ * A ConnectionEntry
+ *
+ * @author Tim Fox
+ *
+ *
+ */
+public class ConnectionEntry
+{
+ public final RemotingConnection connection;
+
+ public volatile long lastCheck;
+
+ public volatile long ttl;
+
+ public ConnectionEntry(final RemotingConnection connection, final long lastCheck,
final long ttl)
+ {
+ this.connection = connection;
+
+ this.lastCheck = lastCheck;
+
+ this.ttl = ttl;
+ }
+}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/spi/core/protocol/ProtocolManager.java
===================================================================
--- trunk/src/main/org/hornetq/spi/core/protocol/ProtocolManager.java 2010-01-21 20:09:23
UTC (rev 8832)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/spi/core/protocol/ProtocolManager.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,29 +0,0 @@
-/*
- * Copyright 2010 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.spi.core.protocol;
-
-import org.hornetq.spi.core.remoting.BufferHandler;
-import org.hornetq.spi.core.remoting.Connection;
-
-/**
- * A ProtocolManager
- *
- * @author Tim Fox
- *
- *
- */
-public interface ProtocolManager extends BufferHandler
-{
- ConnectionEntry createConnectionEntry(Connection connection);
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/spi/core/protocol/ProtocolManager.java
(from rev 8832, trunk/src/main/org/hornetq/spi/core/protocol/ProtocolManager.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/spi/core/protocol/ProtocolManager.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/spi/core/protocol/ProtocolManager.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2010 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.spi.core.protocol;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.spi.core.remoting.BufferHandler;
+import org.hornetq.spi.core.remoting.Connection;
+
+/**
+ * A ProtocolManager
+ *
+ * @author Tim Fox
+ *
+ *
+ */
+public interface ProtocolManager extends BufferHandler
+{
+ ConnectionEntry createConnectionEntry(Connection connection);
+
+ public void removeHandler(final String name);
+
+ public int isReadyToHandle(HornetQBuffer buffer);
+}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/spi/core/protocol/ProtocolManagerFactory.java
===================================================================
--- trunk/src/main/org/hornetq/spi/core/protocol/ProtocolManagerFactory.java 2010-01-21
20:09:23 UTC (rev 8832)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/spi/core/protocol/ProtocolManagerFactory.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,31 +0,0 @@
-/*
- * Copyright 2010 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.spi.core.protocol;
-
-import java.util.List;
-
-import org.hornetq.api.core.Interceptor;
-import org.hornetq.core.server.HornetQServer;
-
-/**
- * A ProtocolManagerFactory
- *
- * @author tim
- *
- *
- */
-public interface ProtocolManagerFactory
-{
- ProtocolManager createProtocolManager(HornetQServer server, List<Interceptor>
interceptors);
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/spi/core/protocol/ProtocolManagerFactory.java
(from rev 8832, trunk/src/main/org/hornetq/spi/core/protocol/ProtocolManagerFactory.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/spi/core/protocol/ProtocolManagerFactory.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/spi/core/protocol/ProtocolManagerFactory.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2010 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.spi.core.protocol;
+
+import java.util.List;
+
+import org.hornetq.api.core.Interceptor;
+import org.hornetq.core.server.HornetQServer;
+
+/**
+ * A ProtocolManagerFactory
+ *
+ * @author tim
+ *
+ *
+ */
+public interface ProtocolManagerFactory
+{
+ ProtocolManager createProtocolManager(HornetQServer server, List<Interceptor>
interceptors);
+}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/spi/core/protocol/ProtocolType.java
===================================================================
--- trunk/src/main/org/hornetq/spi/core/protocol/ProtocolType.java 2010-01-21 20:09:23 UTC
(rev 8832)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/spi/core/protocol/ProtocolType.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,26 +0,0 @@
-/*
- * Copyright 2010 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.spi.core.protocol;
-
-/**
- * A ProtocolType
- *
- * @author Tim Fox
- *
- *
- */
-public enum ProtocolType
-{
- CORE, STOMP, AMQP, AARDVARK;
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/spi/core/protocol/ProtocolType.java
(from rev 8832, trunk/src/main/org/hornetq/spi/core/protocol/ProtocolType.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/spi/core/protocol/ProtocolType.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/spi/core/protocol/ProtocolType.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2010 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.spi.core.protocol;
+
+/**
+ * A ProtocolType
+ *
+ * @author Tim Fox
+ *
+ *
+ */
+public enum ProtocolType
+{
+ CORE, STOMP, AMQP, AARDVARK;
+}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/spi/core/protocol/RemotingConnection.java
===================================================================
--- trunk/src/main/org/hornetq/spi/core/protocol/RemotingConnection.java 2010-01-21
20:09:23 UTC (rev 8832)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/spi/core/protocol/RemotingConnection.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,155 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.spi.core.protocol;
-
-import java.util.List;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.api.core.HornetQException;
-import org.hornetq.core.remoting.CloseListener;
-import org.hornetq.core.remoting.FailureListener;
-import org.hornetq.spi.core.remoting.BufferHandler;
-import org.hornetq.spi.core.remoting.Connection;
-
-/**
- * A RemotingConnection is a connection between a client and a server.
- *
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
- */
-public interface RemotingConnection extends BufferHandler
-{
- /**
- * returns the unique id of the Remoting Connection
- *
- * @return the id
- */
- Object getID();
-
- /**
- * returns a string representation of the remote address of this connection
- *
- * @return the remote address
- */
- String getRemoteAddress();
-
- /**
- * add a failure listener.
- * <p/>
- * The listener will be called in the event of connection failure.
- *
- * @param listener the listener
- */
- void addFailureListener(FailureListener listener);
-
- /**
- * remove the failure listener
- *
- * @param listener the lister to remove
- * @return true if removed
- */
- boolean removeFailureListener(FailureListener listener);
-
- /**
- * add a CloseListener.
- * <p/>
- * This will be called in the event of the connection being closed.
- *
- * @param listener the listener to add
- */
- void addCloseListener(CloseListener listener);
-
- /**
- * remove a Close Listener
- *
- * @param listener the listener to remove
- * @return true if removed
- */
- boolean removeCloseListener(CloseListener listener);
-
- /**
- * return all the failure listeners
- *
- * @return the listeners
- */
- List<FailureListener> getFailureListeners();
-
- /**
- * set the failure listeners.
- * <p/>
- * These will be called in the event of the connection being closed. Any previosuly
added listeners will be removed.
- *
- * @param listeners the listeners to add.
- */
- void setFailureListeners(List<FailureListener> listeners);
-
- /**
- * creates a new HornetQBuffer of the specified size.
- *
- * @param size the size of buffer required
- * @return the buffer
- */
- HornetQBuffer createBuffer(int size);
-
- /**
- * called when the underlying connection fails.
- *
- * @param me the exception that caused the failure
- */
- void fail(HornetQException me);
-
- /**
- * destroys this connection.
- */
- void destroy();
-
- /**
- * return the underlying Connection.
- *
- * @return the connection
- */
- Connection getTransportConnection();
-
- /**
- * returns whether or not the Remoting Connection is a client
- *
- * @return true if client, false if a server
- */
- boolean isClient();
-
- /**
- * returns true if this Remoting Connection has been destroyed.
- *
- * @return true if destroyed, otherwise false
- */
- boolean isDestroyed();
-
- /**
- * Disconnect the connection, closing all channels
- */
- void disconnect();
-
- /**
- * returns true if any data has been received since the last time this method was
called.
- *
- * @return true if data has been received.
- */
- boolean checkDataReceived();
-
- /**
- * flush all outstanding data from the connection.
- */
- void flush();
-
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/spi/core/protocol/RemotingConnection.java
(from rev 8832, trunk/src/main/org/hornetq/spi/core/protocol/RemotingConnection.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/spi/core/protocol/RemotingConnection.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/spi/core/protocol/RemotingConnection.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -0,0 +1,155 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.spi.core.protocol;
+
+import java.util.List;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.api.core.HornetQException;
+import org.hornetq.core.remoting.CloseListener;
+import org.hornetq.core.remoting.FailureListener;
+import org.hornetq.spi.core.remoting.BufferHandler;
+import org.hornetq.spi.core.remoting.Connection;
+
+/**
+ * A RemotingConnection is a connection between a client and a server.
+ *
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
+ */
+public interface RemotingConnection extends BufferHandler
+{
+ /**
+ * returns the unique id of the Remoting Connection
+ *
+ * @return the id
+ */
+ Object getID();
+
+ /**
+ * returns a string representation of the remote address of this connection
+ *
+ * @return the remote address
+ */
+ String getRemoteAddress();
+
+ /**
+ * add a failure listener.
+ * <p/>
+ * The listener will be called in the event of connection failure.
+ *
+ * @param listener the listener
+ */
+ void addFailureListener(FailureListener listener);
+
+ /**
+ * remove the failure listener
+ *
+ * @param listener the lister to remove
+ * @return true if removed
+ */
+ boolean removeFailureListener(FailureListener listener);
+
+ /**
+ * add a CloseListener.
+ * <p/>
+ * This will be called in the event of the connection being closed.
+ *
+ * @param listener the listener to add
+ */
+ void addCloseListener(CloseListener listener);
+
+ /**
+ * remove a Close Listener
+ *
+ * @param listener the listener to remove
+ * @return true if removed
+ */
+ boolean removeCloseListener(CloseListener listener);
+
+ /**
+ * return all the failure listeners
+ *
+ * @return the listeners
+ */
+ List<FailureListener> getFailureListeners();
+
+ /**
+ * set the failure listeners.
+ * <p/>
+ * These will be called in the event of the connection being closed. Any previosuly
added listeners will be removed.
+ *
+ * @param listeners the listeners to add.
+ */
+ void setFailureListeners(List<FailureListener> listeners);
+
+ /**
+ * creates a new HornetQBuffer of the specified size.
+ *
+ * @param size the size of buffer required
+ * @return the buffer
+ */
+ HornetQBuffer createBuffer(int size);
+
+ /**
+ * called when the underlying connection fails.
+ *
+ * @param me the exception that caused the failure
+ */
+ void fail(HornetQException me);
+
+ /**
+ * destroys this connection.
+ */
+ void destroy();
+
+ /**
+ * return the underlying Connection.
+ *
+ * @return the connection
+ */
+ Connection getTransportConnection();
+
+ /**
+ * returns whether or not the Remoting Connection is a client
+ *
+ * @return true if client, false if a server
+ */
+ boolean isClient();
+
+ /**
+ * returns true if this Remoting Connection has been destroyed.
+ *
+ * @return true if destroyed, otherwise false
+ */
+ boolean isDestroyed();
+
+ /**
+ * Disconnect the connection, closing all channels
+ */
+ void disconnect();
+
+ /**
+ * returns true if any data has been received since the last time this method was
called.
+ *
+ * @return true if data has been received.
+ */
+ boolean checkDataReceived();
+
+ /**
+ * flush all outstanding data from the connection.
+ */
+ void flush();
+
+}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/spi/core/protocol/SessionCallback.java
===================================================================
--- trunk/src/main/org/hornetq/spi/core/protocol/SessionCallback.java 2010-01-21 20:09:23
UTC (rev 8832)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/spi/core/protocol/SessionCallback.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -1,37 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.spi.core.protocol;
-
-import org.hornetq.api.core.SimpleString;
-import org.hornetq.core.server.ServerMessage;
-
-/**
- * A SessionCallback
- *
- * @author Tim Fox
- *
- *
- */
-public interface SessionCallback
-{
- void sendProducerCreditsMessage(int credits, SimpleString address, int offset);
-
- int sendMessage(ServerMessage message, long consumerID, int deliveryCount);
-
- int sendLargeMessage(long consumerID, byte[] headerBuffer, long bodySize, int
deliveryCount);
-
- int sendLargeMessageContinuation(long consumerID, byte[] body, boolean continues,
boolean requiresResponse);
-
- void closed();
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/spi/core/protocol/SessionCallback.java
(from rev 8832, trunk/src/main/org/hornetq/spi/core/protocol/SessionCallback.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/spi/core/protocol/SessionCallback.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/spi/core/protocol/SessionCallback.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.spi.core.protocol;
+
+import org.hornetq.api.core.SimpleString;
+import org.hornetq.core.server.ServerMessage;
+
+/**
+ * A SessionCallback
+ *
+ * @author Tim Fox
+ *
+ *
+ */
+public interface SessionCallback
+{
+ void sendProducerCreditsMessage(int credits, SimpleString address, int offset);
+
+ int sendMessage(ServerMessage message, long consumerID, int deliveryCount);
+
+ int sendLargeMessage(long consumerID, byte[] headerBuffer, long bodySize, int
deliveryCount);
+
+ int sendLargeMessageContinuation(long consumerID, byte[] body, boolean continues,
boolean requiresResponse);
+
+ void closed();
+}
Modified:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/spi/core/remoting/ConnectionLifeCycleListener.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/spi/core/remoting/ConnectionLifeCycleListener.java 2010-01-22
10:19:02 UTC (rev 8835)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/spi/core/remoting/ConnectionLifeCycleListener.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -13,7 +13,7 @@
package org.hornetq.spi.core.remoting;
import org.hornetq.api.core.HornetQException;
-import org.hornetq.core.remoting.ProtocolType;
+import org.hornetq.spi.core.protocol.ProtocolType;
/**
* A ConnectionLifeCycleListener is called by the remoting implementation to notify of
connection events.
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/utils/XidCodecSupport.java (from
rev 8832, trunk/src/main/org/hornetq/utils/XidCodecSupport.java)
===================================================================
--- branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/utils/XidCodecSupport.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/utils/XidCodecSupport.java 2010-01-22
10:29:26 UTC (rev 8836)
@@ -0,0 +1,72 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.utils;
+
+import javax.transaction.xa.Xid;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.transaction.impl.XidImpl;
+
+/**
+ * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
+ *
+ * @version <tt>$Revision$</tt>
+ *
+ */
+public class XidCodecSupport
+{
+
+ // Constants -----------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
+ // Static --------------------------------------------------------
+
+ public static void encodeXid(final Xid xid, final HornetQBuffer out)
+ {
+ out.writeInt(xid.getFormatId());
+ out.writeInt(xid.getBranchQualifier().length);
+ out.writeBytes(xid.getBranchQualifier());
+ out.writeInt(xid.getGlobalTransactionId().length);
+ out.writeBytes(xid.getGlobalTransactionId());
+ }
+
+ public static Xid decodeXid(final HornetQBuffer in)
+ {
+ int formatID = in.readInt();
+ byte[] bq = new byte[in.readInt()];
+ in.readBytes(bq);
+ byte[] gtxid = new byte[in.readInt()];
+ in.readBytes(gtxid);
+ Xid xid = new XidImpl(bq, formatID, gtxid);
+ return xid;
+ }
+
+ public static int getXidEncodeLength(final Xid xid)
+ {
+ return DataConstants.SIZE_INT * 3 + xid.getBranchQualifier().length +
xid.getGlobalTransactionId().length;
+ }
+
+ // Constructors --------------------------------------------------
+
+ // Public --------------------------------------------------------
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+}