Author: jmesnil
Date: 2010-01-21 09:33:41 -0500 (Thu, 21 Jan 2010)
New Revision: 8822
Added:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/exception/
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/exception/HornetQXAException.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/Channel.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/ChannelHandler.java
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/CommandConfirmationHandler.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/CoreRemotingConnection.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/Packet.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/ServerSessionPacketHandler.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/CreateQueueMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/CreateReplicationSessionMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/CreateSessionMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/CreateSessionResponseMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/HornetQExceptionMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/MessagePacket.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/NullResponseMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/PacketsConfirmedMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/Ping.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/ReattachSessionMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/ReattachSessionResponseMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationAddMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationAddTXMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationCommitMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationCompareDataMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationDeleteMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationDeleteTXMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationLargeMessageBeingMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationLargeMessageWriteMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationLargemessageEndMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationPageEventMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationPageWriteMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationPrepareMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationResponseMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/RollbackMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionAcknowledgeMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionBindingQueryMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionBindingQueryResponseMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionCloseMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionCommitMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionConsumerCloseMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionConsumerFlowCreditMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionContinuationMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionCreateConsumerMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionDeleteQueueMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionExpiredMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionForceConsumerDelivery.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionProducerCreditsMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionQueueQueryMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionQueueQueryResponseMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionReceiveContinuationMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionReceiveLargeMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionReceiveMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionRequestProducerCreditsMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionSendContinuationMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionSendLargeMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionSendMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionXACommitMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionXAEndMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionXAForgetMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionXAGetInDoubtXidsResponseMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionXAGetTimeoutResponseMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionXAJoinMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionXAPrepareMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionXAResponseMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionXAResumeMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionXARollbackMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionXASetTimeoutMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionXASetTimeoutResponseMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionXAStartMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/XidCodecSupport.java
Removed:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/exception/HornetQXAException.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/Channel.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/ChannelHandler.java
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/CommandConfirmationHandler.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/CoreRemotingConnection.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/Packet.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/ServerSessionPacketHandler.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/CreateQueueMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/CreateReplicationSessionMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/CreateSessionMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/CreateSessionResponseMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/HornetQExceptionMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/MessagePacket.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/NullResponseMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/PacketsConfirmedMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/Ping.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/ReattachSessionMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/ReattachSessionResponseMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationAddMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationAddTXMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationCommitMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationCompareDataMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationDeleteMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationDeleteTXMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationLargeMessageBeingMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationLargeMessageWriteMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationLargemessageEndMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationPageEventMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationPageWriteMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationPrepareMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationResponseMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/RollbackMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionAcknowledgeMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionBindingQueryMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionBindingQueryResponseMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionCloseMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionCommitMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionConsumerCloseMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionConsumerFlowCreditMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionContinuationMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionCreateConsumerMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionDeleteQueueMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionExpiredMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionForceConsumerDelivery.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionProducerCreditsMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionQueueQueryMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionQueueQueryResponseMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionReceiveContinuationMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionReceiveLargeMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionReceiveMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionRequestProducerCreditsMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionSendContinuationMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionSendLargeMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionSendMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionXACommitMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionXAEndMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionXAForgetMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionXAGetInDoubtXidsResponseMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionXAGetTimeoutResponseMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionXAJoinMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionXAPrepareMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionXAResponseMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionXAResumeMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionXARollbackMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionXASetTimeoutMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionXASetTimeoutResponseMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionXAStartMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/XidCodecSupport.java
Modified:
branches/HORNETQ-129_STOMP_protocol/examples/jms/interceptor/src/org/hornetq/jms/example/SimpleInterceptor.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/api/core/Interceptor.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/api/core/client/ClientSession.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/client/impl/ClientConsumerImpl.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/client/impl/ClientConsumerInternal.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/client/impl/ClientProducerImpl.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/client/impl/ClientSessionImpl.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/client/impl/ClientSessionInternal.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/client/impl/ClientSessionPacketHandler.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/client/impl/DelegatingSession.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/client/impl/FailoverManager.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/client/impl/FailoverManagerImpl.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/client/impl/LargeMessageBufferImpl.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/message/impl/MessageImpl.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/persistence/impl/journal/JournalStorageManager.java
Log:
https://jira.jboss.org/jira/browse/HORNETQ-129: Implement STOMP v1.0
* sync with the trunk: svn merge -r 8806:8821
https://svn.jboss.org/repos/hornetq/trunk
Modified:
branches/HORNETQ-129_STOMP_protocol/examples/jms/interceptor/src/org/hornetq/jms/example/SimpleInterceptor.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/examples/jms/interceptor/src/org/hornetq/jms/example/SimpleInterceptor.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/examples/jms/interceptor/src/org/hornetq/jms/example/SimpleInterceptor.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -17,9 +17,9 @@
import org.hornetq.api.core.Interceptor;
import org.hornetq.api.core.Message;
import org.hornetq.api.core.SimpleString;
-import org.hornetq.core.remoting.Packet;
+import org.hornetq.core.protocol.core.Packet;
+import org.hornetq.core.protocol.core.wireformat.SessionSendMessage;
import org.hornetq.core.remoting.RemotingConnection;
-import org.hornetq.core.remoting.impl.wireformat.SessionSendMessage;
/**
* A simple Interceptor implementation
Modified:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/api/core/Interceptor.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/api/core/Interceptor.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/api/core/Interceptor.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -14,7 +14,7 @@
package org.hornetq.api.core;
import org.hornetq.api.core.client.ClientSessionFactory;
-import org.hornetq.core.remoting.Packet;
+import org.hornetq.core.protocol.core.Packet;
import org.hornetq.core.remoting.RemotingConnection;
/**
Modified:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/api/core/client/ClientSession.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/api/core/client/ClientSession.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/api/core/client/ClientSession.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -455,6 +455,7 @@
/**
* Creates a ClientMessage.
*
+ * @param type type of the message
* @param durable whether the created message is durable or not
* @param expiration the message expiration
* @param timestamp the message timestamp
Modified:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/client/impl/ClientConsumerImpl.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/client/impl/ClientConsumerImpl.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/client/impl/ClientConsumerImpl.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -25,12 +25,12 @@
import org.hornetq.core.list.PriorityLinkedList;
import org.hornetq.core.list.impl.PriorityLinkedListImpl;
import org.hornetq.core.logging.Logger;
-import org.hornetq.core.remoting.Channel;
-import org.hornetq.core.remoting.impl.wireformat.SessionConsumerCloseMessage;
-import org.hornetq.core.remoting.impl.wireformat.SessionConsumerFlowCreditMessage;
-import org.hornetq.core.remoting.impl.wireformat.SessionQueueQueryResponseMessage;
-import org.hornetq.core.remoting.impl.wireformat.SessionReceiveContinuationMessage;
-import org.hornetq.core.remoting.impl.wireformat.SessionReceiveLargeMessage;
+import org.hornetq.core.protocol.core.Channel;
+import org.hornetq.core.protocol.core.wireformat.SessionConsumerCloseMessage;
+import org.hornetq.core.protocol.core.wireformat.SessionConsumerFlowCreditMessage;
+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.utils.Future;
import org.hornetq.utils.TokenBucketLimiter;
Modified:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/client/impl/ClientConsumerInternal.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/client/impl/ClientConsumerInternal.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/client/impl/ClientConsumerInternal.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -17,9 +17,9 @@
import org.hornetq.api.core.SimpleString;
import org.hornetq.api.core.client.ClientConsumer;
import org.hornetq.api.core.client.ClientMessage;
-import org.hornetq.core.remoting.impl.wireformat.SessionQueueQueryResponseMessage;
-import org.hornetq.core.remoting.impl.wireformat.SessionReceiveContinuationMessage;
-import org.hornetq.core.remoting.impl.wireformat.SessionReceiveLargeMessage;
+import org.hornetq.core.protocol.core.wireformat.SessionQueueQueryResponseMessage;
+import org.hornetq.core.protocol.core.wireformat.SessionReceiveContinuationMessage;
+import org.hornetq.core.protocol.core.wireformat.SessionReceiveLargeMessage;
/**
*
Modified:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/client/impl/ClientProducerImpl.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/client/impl/ClientProducerImpl.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/client/impl/ClientProducerImpl.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -24,10 +24,10 @@
import org.hornetq.core.logging.Logger;
import org.hornetq.core.message.BodyEncoder;
import org.hornetq.core.message.impl.MessageInternal;
-import org.hornetq.core.remoting.Channel;
-import org.hornetq.core.remoting.impl.wireformat.SessionSendContinuationMessage;
-import org.hornetq.core.remoting.impl.wireformat.SessionSendLargeMessage;
-import org.hornetq.core.remoting.impl.wireformat.SessionSendMessage;
+import org.hornetq.core.protocol.core.Channel;
+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.utils.TokenBucketLimiter;
import org.hornetq.utils.UUIDGenerator;
Modified:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/client/impl/ClientSessionImpl.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/client/impl/ClientSessionImpl.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/client/impl/ClientSessionImpl.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -33,46 +33,47 @@
import org.hornetq.api.core.client.SendAcknowledgementHandler;
import org.hornetq.api.core.client.SessionFailureListener;
import org.hornetq.core.logging.Logger;
-import org.hornetq.core.remoting.Channel;
-import org.hornetq.core.remoting.CommandConfirmationHandler;
+import org.hornetq.core.protocol.core.Channel;
+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.PacketImpl;
+import org.hornetq.core.protocol.core.wireformat.CreateQueueMessage;
+import org.hornetq.core.protocol.core.wireformat.CreateSessionMessage;
+import org.hornetq.core.protocol.core.wireformat.ReattachSessionMessage;
+import org.hornetq.core.protocol.core.wireformat.ReattachSessionResponseMessage;
+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.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.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.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.remoting.FailureListener;
-import org.hornetq.core.remoting.Packet;
import org.hornetq.core.remoting.RemotingConnection;
-import org.hornetq.core.remoting.impl.wireformat.CreateQueueMessage;
-import org.hornetq.core.remoting.impl.wireformat.CreateSessionMessage;
-import org.hornetq.core.remoting.impl.wireformat.PacketImpl;
-import org.hornetq.core.remoting.impl.wireformat.ReattachSessionMessage;
-import org.hornetq.core.remoting.impl.wireformat.ReattachSessionResponseMessage;
-import org.hornetq.core.remoting.impl.wireformat.RollbackMessage;
-import org.hornetq.core.remoting.impl.wireformat.SessionAcknowledgeMessage;
-import org.hornetq.core.remoting.impl.wireformat.SessionBindingQueryMessage;
-import org.hornetq.core.remoting.impl.wireformat.SessionBindingQueryResponseMessage;
-import org.hornetq.core.remoting.impl.wireformat.SessionCloseMessage;
-import org.hornetq.core.remoting.impl.wireformat.SessionConsumerFlowCreditMessage;
-import org.hornetq.core.remoting.impl.wireformat.SessionCreateConsumerMessage;
-import org.hornetq.core.remoting.impl.wireformat.SessionDeleteQueueMessage;
-import org.hornetq.core.remoting.impl.wireformat.SessionExpiredMessage;
-import org.hornetq.core.remoting.impl.wireformat.SessionForceConsumerDelivery;
-import org.hornetq.core.remoting.impl.wireformat.SessionQueueQueryMessage;
-import org.hornetq.core.remoting.impl.wireformat.SessionQueueQueryResponseMessage;
-import org.hornetq.core.remoting.impl.wireformat.SessionReceiveContinuationMessage;
-import org.hornetq.core.remoting.impl.wireformat.SessionReceiveLargeMessage;
-import org.hornetq.core.remoting.impl.wireformat.SessionReceiveMessage;
-import org.hornetq.core.remoting.impl.wireformat.SessionRequestProducerCreditsMessage;
-import org.hornetq.core.remoting.impl.wireformat.SessionSendMessage;
-import org.hornetq.core.remoting.impl.wireformat.SessionXACommitMessage;
-import org.hornetq.core.remoting.impl.wireformat.SessionXAEndMessage;
-import org.hornetq.core.remoting.impl.wireformat.SessionXAForgetMessage;
-import org.hornetq.core.remoting.impl.wireformat.SessionXAGetInDoubtXidsResponseMessage;
-import org.hornetq.core.remoting.impl.wireformat.SessionXAGetTimeoutResponseMessage;
-import org.hornetq.core.remoting.impl.wireformat.SessionXAJoinMessage;
-import org.hornetq.core.remoting.impl.wireformat.SessionXAPrepareMessage;
-import org.hornetq.core.remoting.impl.wireformat.SessionXAResponseMessage;
-import org.hornetq.core.remoting.impl.wireformat.SessionXAResumeMessage;
-import org.hornetq.core.remoting.impl.wireformat.SessionXARollbackMessage;
-import org.hornetq.core.remoting.impl.wireformat.SessionXASetTimeoutMessage;
-import org.hornetq.core.remoting.impl.wireformat.SessionXASetTimeoutResponseMessage;
-import org.hornetq.core.remoting.impl.wireformat.SessionXAStartMessage;
import org.hornetq.spi.core.remoting.Connection;
import org.hornetq.utils.ConcurrentHashSet;
import org.hornetq.utils.IDGenerator;
@@ -117,7 +118,7 @@
private final Executor executor;
- private volatile RemotingConnection remotingConnection;
+ private volatile CoreRemotingConnection remotingConnection;
private final Set<ClientProducerInternal> producers = new
ConcurrentHashSet<ClientProducerInternal>();
@@ -203,7 +204,7 @@
final int minLargeMessageSize,
final int initialMessagePacketSize,
final String groupID,
- final RemotingConnection remotingConnection,
+ final CoreRemotingConnection remotingConnection,
final int version,
final Channel channel,
final Executor executor) throws HornetQException
@@ -834,7 +835,7 @@
// Needs to be synchronized to prevent issues with occurring concurrently with
close()
- public synchronized void handleFailover(final RemotingConnection backupConnection)
+ public synchronized void handleFailover(final CoreRemotingConnection
backupConnection)
{
if (closed)
{
@@ -866,7 +867,7 @@
{
// The session was found on the server - we reattached transparently ok
- channel.replayCommands(response.getLastConfirmedCommandID(),
channel.getID());
+ channel.replayCommands(response.getLastConfirmedCommandID());
}
else
{
Modified:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/client/impl/ClientSessionInternal.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/client/impl/ClientSessionInternal.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/client/impl/ClientSessionInternal.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -16,10 +16,11 @@
import org.hornetq.api.core.HornetQException;
import org.hornetq.api.core.SimpleString;
import org.hornetq.api.core.client.ClientSession;
+import org.hornetq.core.protocol.core.CoreRemotingConnection;
+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.RemotingConnection;
-import org.hornetq.core.remoting.impl.wireformat.SessionReceiveContinuationMessage;
-import org.hornetq.core.remoting.impl.wireformat.SessionReceiveLargeMessage;
-import org.hornetq.core.remoting.impl.wireformat.SessionReceiveMessage;
/**
* A ClientSessionInternal
@@ -52,7 +53,7 @@
void handleReceiveContinuation(long consumerID, SessionReceiveContinuationMessage
continuation) throws Exception;
- void handleFailover(RemotingConnection backupConnection);
+ void handleFailover(CoreRemotingConnection backupConnection);
RemotingConnection getConnection();
Modified:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/client/impl/ClientSessionPacketHandler.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/client/impl/ClientSessionPacketHandler.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/client/impl/ClientSessionPacketHandler.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -13,21 +13,21 @@
package org.hornetq.core.client.impl;
-import static org.hornetq.core.remoting.impl.wireformat.PacketImpl.EXCEPTION;
-import static
org.hornetq.core.remoting.impl.wireformat.PacketImpl.SESS_RECEIVE_CONTINUATION;
-import static
org.hornetq.core.remoting.impl.wireformat.PacketImpl.SESS_RECEIVE_LARGE_MSG;
-import static org.hornetq.core.remoting.impl.wireformat.PacketImpl.SESS_RECEIVE_MSG;
+import static org.hornetq.core.protocol.core.PacketImpl.EXCEPTION;
+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 org.hornetq.core.logging.Logger;
-import org.hornetq.core.remoting.Channel;
-import org.hornetq.core.remoting.ChannelHandler;
-import org.hornetq.core.remoting.Packet;
-import org.hornetq.core.remoting.impl.wireformat.HornetQExceptionMessage;
-import org.hornetq.core.remoting.impl.wireformat.PacketImpl;
-import org.hornetq.core.remoting.impl.wireformat.SessionProducerCreditsMessage;
-import org.hornetq.core.remoting.impl.wireformat.SessionReceiveContinuationMessage;
-import org.hornetq.core.remoting.impl.wireformat.SessionReceiveLargeMessage;
-import org.hornetq.core.remoting.impl.wireformat.SessionReceiveMessage;
+import org.hornetq.core.protocol.core.Channel;
+import org.hornetq.core.protocol.core.ChannelHandler;
+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.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;
/**
*
Modified:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/client/impl/DelegatingSession.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/client/impl/DelegatingSession.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/client/impl/DelegatingSession.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -27,10 +27,11 @@
import org.hornetq.api.core.client.SendAcknowledgementHandler;
import org.hornetq.api.core.client.SessionFailureListener;
import org.hornetq.core.logging.Logger;
+import org.hornetq.core.protocol.core.CoreRemotingConnection;
+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.RemotingConnection;
-import org.hornetq.core.remoting.impl.wireformat.SessionReceiveContinuationMessage;
-import org.hornetq.core.remoting.impl.wireformat.SessionReceiveLargeMessage;
-import org.hornetq.core.remoting.impl.wireformat.SessionReceiveMessage;
import org.hornetq.utils.ConcurrentHashSet;
/**
@@ -364,7 +365,7 @@
return session.getXAResource();
}
- public void handleFailover(final RemotingConnection backupConnection)
+ public void handleFailover(final CoreRemotingConnection backupConnection)
{
session.handleFailover(backupConnection);
}
Modified:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/client/impl/FailoverManager.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/client/impl/FailoverManager.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/client/impl/FailoverManager.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -16,7 +16,7 @@
import org.hornetq.api.core.HornetQException;
import org.hornetq.api.core.client.ClientSession;
import org.hornetq.api.core.client.SessionFailureListener;
-import org.hornetq.core.remoting.RemotingConnection;
+import org.hornetq.core.protocol.core.CoreRemotingConnection;
/**
* A ConnectionManager
@@ -52,7 +52,7 @@
void removeSession(final ClientSessionInternal session);
- public RemotingConnection getConnection();
+ public CoreRemotingConnection getConnection();
int numConnections();
Modified:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/client/impl/FailoverManagerImpl.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/client/impl/FailoverManagerImpl.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/client/impl/FailoverManagerImpl.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -35,18 +35,18 @@
import org.hornetq.api.core.client.ClientSessionFactory;
import org.hornetq.api.core.client.SessionFailureListener;
import org.hornetq.core.logging.Logger;
-import org.hornetq.core.remoting.Channel;
-import org.hornetq.core.remoting.ChannelHandler;
+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.PacketDecoder;
+import org.hornetq.core.protocol.core.PacketImpl;
+import org.hornetq.core.protocol.core.RemotingConnectionImpl;
+import org.hornetq.core.protocol.core.wireformat.CreateSessionMessage;
+import org.hornetq.core.protocol.core.wireformat.CreateSessionResponseMessage;
+import org.hornetq.core.protocol.core.wireformat.Ping;
import org.hornetq.core.remoting.FailureListener;
-import org.hornetq.core.remoting.Packet;
-import org.hornetq.core.remoting.PacketDecoder;
-import org.hornetq.core.remoting.RemotingConnection;
-import org.hornetq.core.remoting.impl.CorePacketDecoder;
-import org.hornetq.core.remoting.impl.RemotingConnectionImpl;
-import org.hornetq.core.remoting.impl.wireformat.CreateSessionMessage;
-import org.hornetq.core.remoting.impl.wireformat.CreateSessionResponseMessage;
-import org.hornetq.core.remoting.impl.wireformat.PacketImpl;
-import org.hornetq.core.remoting.impl.wireformat.Ping;
+import org.hornetq.core.remoting.ProtocolType;
import org.hornetq.core.version.Version;
import org.hornetq.spi.core.remoting.BufferHandler;
import org.hornetq.spi.core.remoting.Connection;
@@ -79,7 +79,7 @@
// debug
- private static Map<TransportConfiguration, Set<RemotingConnection>>
debugConns;
+ private static Map<TransportConfiguration, Set<CoreRemotingConnection>>
debugConns;
private static boolean debug = false;
@@ -87,7 +87,7 @@
{
FailoverManagerImpl.debug = true;
- FailoverManagerImpl.debugConns = new ConcurrentHashMap<TransportConfiguration,
Set<RemotingConnection>>();
+ FailoverManagerImpl.debugConns = new ConcurrentHashMap<TransportConfiguration,
Set<CoreRemotingConnection>>();
}
public static void disableDebug()
@@ -98,9 +98,9 @@
FailoverManagerImpl.debugConns = null;
}
- private void checkAddDebug(final RemotingConnection conn)
+ private void checkAddDebug(final CoreRemotingConnection conn)
{
- Set<RemotingConnection> conns;
+ Set<CoreRemotingConnection> conns;
synchronized (FailoverManagerImpl.debugConns)
{
@@ -108,7 +108,7 @@
if (conns == null)
{
- conns = new HashSet<RemotingConnection>();
+ conns = new HashSet<CoreRemotingConnection>();
FailoverManagerImpl.debugConns.put(connectorConfig, conns);
}
@@ -119,7 +119,7 @@
public static void failAllConnectionsForConnector(final TransportConfiguration
config)
{
- Set<RemotingConnection> conns;
+ Set<CoreRemotingConnection> conns;
synchronized (FailoverManagerImpl.debugConns)
{
@@ -127,13 +127,13 @@
if (conns != null)
{
- conns = new
HashSet<RemotingConnection>(FailoverManagerImpl.debugConns.get(config));
+ conns = new
HashSet<CoreRemotingConnection>(FailoverManagerImpl.debugConns.get(config));
}
}
if (conns != null)
{
- for (RemotingConnection conn : conns)
+ for (CoreRemotingConnection conn : conns)
{
conn.fail(new HornetQException(HornetQException.INTERNAL_ERROR,
"simulated connection failure"));
}
@@ -177,7 +177,7 @@
private final Executor closeExecutor;
- private RemotingConnection connection;
+ private CoreRemotingConnection connection;
private final long retryInterval;
@@ -274,7 +274,7 @@
// ConnectionLifeCycleListener implementation
--------------------------------------------------
- public void connectionCreated(final Connection connection)
+ public void connectionCreated(final Connection connection, final ProtocolType
protocol)
{
}
@@ -321,7 +321,7 @@
{
Version clientVersion = VersionLoader.getVersion();
- RemotingConnection theConnection = null;
+ CoreRemotingConnection theConnection = null;
Lock lock = null;
@@ -531,7 +531,7 @@
private volatile boolean stopPingingAfterOne;
- private final PacketDecoder decoder = new CorePacketDecoder();
+ private final PacketDecoder decoder = new PacketDecoder();
public void stopPingingAfterOne()
{
@@ -655,7 +655,7 @@
// So.. do failover / reconnection
- RemotingConnection oldConnection = connection;
+ CoreRemotingConnection oldConnection = connection;
connection = null;
@@ -757,9 +757,9 @@
/*
* Re-attach sessions all pre-existing sessions to the new remoting connection
*/
- private void reconnectSessions(final RemotingConnection oldConnection, final int
reconnectAttempts)
+ private void reconnectSessions(final CoreRemotingConnection oldConnection, final int
reconnectAttempts)
{
- RemotingConnection newConnection = getConnectionWithRetry(reconnectAttempts);
+ CoreRemotingConnection newConnection = getConnectionWithRetry(reconnectAttempts);
if (newConnection == null)
{
@@ -790,7 +790,7 @@
}
}
- private RemotingConnection getConnectionWithRetry(final int reconnectAttempts)
+ private CoreRemotingConnection getConnectionWithRetry(final int reconnectAttempts)
{
long interval = retryInterval;
@@ -803,7 +803,7 @@
return null;
}
- RemotingConnection theConnection = getConnection();
+ CoreRemotingConnection theConnection = getConnection();
if (theConnection == null)
{
@@ -901,7 +901,7 @@
}
}
- public RemotingConnection getConnection()
+ public CoreRemotingConnection getConnection()
{
if (connection == null)
{
@@ -1061,9 +1061,9 @@
private class Channel0Handler implements ChannelHandler
{
- private final RemotingConnection conn;
+ private final CoreRemotingConnection conn;
- private Channel0Handler(final RemotingConnection conn)
+ private Channel0Handler(final CoreRemotingConnection conn)
{
this.conn = conn;
}
@@ -1090,13 +1090,13 @@
private class DelegatingBufferHandler implements BufferHandler
{
- public void bufferReceived(final Object connectionID, final HornetQBuffer buffer,
final PacketDecoder decoder)
+ public void bufferReceived(final Object connectionID, final HornetQBuffer buffer)
{
- RemotingConnection theConn = connection;
+ CoreRemotingConnection theConn = connection;
if (theConn != null && connectionID == theConn.getID())
{
- theConn.bufferReceived(connectionID, buffer, decoder );
+ theConn.bufferReceived(connectionID, buffer);
}
}
}
Modified:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/client/impl/LargeMessageBufferImpl.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/client/impl/LargeMessageBufferImpl.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/client/impl/LargeMessageBufferImpl.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -30,7 +30,7 @@
import org.hornetq.api.core.HornetQException;
import org.hornetq.api.core.SimpleString;
import org.hornetq.core.logging.Logger;
-import org.hornetq.core.remoting.impl.wireformat.SessionReceiveContinuationMessage;
+import org.hornetq.core.protocol.core.wireformat.SessionReceiveContinuationMessage;
import org.hornetq.utils.DataConstants;
import org.hornetq.utils.UTF8Util;
import org.jboss.netty.buffer.ChannelBuffer;
Copied: branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/exception (from rev
8819, trunk/src/main/org/hornetq/core/exception)
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/exception/HornetQXAException.java
===================================================================
--- trunk/src/main/org/hornetq/core/exception/HornetQXAException.java 2010-01-21 09:02:52
UTC (rev 8819)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/exception/HornetQXAException.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -1,40 +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.exception;
-
-import javax.transaction.xa.XAException;
-
-/**
- * A HornetQXAException
- *
- * @author Tim Fox
- *
- *
- */
-public class HornetQXAException extends XAException
-{
- private static final long serialVersionUID = 6535914602965015803L;
-
- public HornetQXAException(final int errorCode, final String message)
- {
- super(message);
-
- this.errorCode = errorCode;
- }
-
- public HornetQXAException(final int errorCode)
- {
- super(errorCode);
- }
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/exception/HornetQXAException.java
(from rev 8819, trunk/src/main/org/hornetq/core/exception/HornetQXAException.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/exception/HornetQXAException.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/exception/HornetQXAException.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -0,0 +1,40 @@
+/*
+ * 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.exception;
+
+import javax.transaction.xa.XAException;
+
+/**
+ * A HornetQXAException
+ *
+ * @author Tim Fox
+ *
+ *
+ */
+public class HornetQXAException extends XAException
+{
+ private static final long serialVersionUID = 6535914602965015803L;
+
+ public HornetQXAException(final int errorCode, final String message)
+ {
+ super(message);
+
+ this.errorCode = errorCode;
+ }
+
+ public HornetQXAException(final int errorCode)
+ {
+ super(errorCode);
+ }
+}
Modified:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/message/impl/MessageImpl.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/message/impl/MessageImpl.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/message/impl/MessageImpl.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -27,7 +27,7 @@
import org.hornetq.core.client.impl.LargeMessageBufferInternal;
import org.hornetq.core.logging.Logger;
import org.hornetq.core.message.BodyEncoder;
-import org.hornetq.core.remoting.impl.wireformat.PacketImpl;
+import org.hornetq.core.protocol.core.PacketImpl;
import org.hornetq.utils.DataConstants;
import org.hornetq.utils.TypedProperties;
Modified:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/persistence/impl/journal/JournalStorageManager.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/persistence/impl/journal/JournalStorageManager.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/persistence/impl/journal/JournalStorageManager.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -55,7 +55,7 @@
import org.hornetq.core.persistence.StorageManager;
import org.hornetq.core.postoffice.Binding;
import org.hornetq.core.postoffice.PostOffice;
-import org.hornetq.core.remoting.impl.wireformat.XidCodecSupport;
+import org.hornetq.core.protocol.core.wireformat.XidCodecSupport;
import org.hornetq.core.replication.ReplicationManager;
import org.hornetq.core.replication.impl.ReplicatedJournal;
import org.hornetq.core.server.JournalType;
Copied: branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol (from rev
8821, trunk/src/main/org/hornetq/core/protocol)
Copied: branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core (from
rev 8821, trunk/src/main/org/hornetq/core/protocol/core)
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/Channel.java
===================================================================
--- trunk/src/main/org/hornetq/core/protocol/core/Channel.java 2010-01-21 13:31:05 UTC
(rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/Channel.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -1,178 +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.locks.Lock;
-
-import org.hornetq.api.core.HornetQException;
-
-/**
- * A channel is a way of interleaving data meant for different endpoints over the same
{@link org.hornetq.core.protocol.core.CoreRemotingConnection}.
- * <p/>
- * Any packet sent will have its channel id set to the specific channel sending so it can
be routed to its correct channel
- * when received by the {@link org.hornetq.core.protocol.core.CoreRemotingConnection}.
see {@link org.hornetq.core.protocol.core.Packet#setChannelID(long)}.
- * <p/>
- * Each Channel should will forward any packets received to its {@link
org.hornetq.core.protocol.core.ChannelHandler}.
- * <p/>
- * A Channel *does not* support concurrent access by more than one thread!
- *
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- */
-public interface Channel
-{
- /**
- * returns the id of this channel.
- *
- * @return the id
- */
- long getID();
-
- /**
- * sends a packet on this channel.
- *
- * @param packet the packet to send
- */
- void send(Packet packet);
-
- /**
- * sends a packet on this channel and then blocks until it has been written to the
connection.
- *
- * @param packet the packet to send
- */
- void sendAndFlush(Packet packet);
-
- /**
- * sends a packet on this channel and then blocks until a response is received or a
timeout occurs.
- *
- * @param packet the packet to send
- * @return the response
- * @throws HornetQException if an error occurs during the send
- */
- Packet sendBlocking(Packet packet) throws HornetQException;
-
- /**
- * sets the {@link org.hornetq.core.protocol.core.ChannelHandler} that this channel
should forward received packets to.
- *
- * @param handler the handler
- */
- void setHandler(ChannelHandler handler);
-
- /**
- * closes this channel.
- * <p/>
- * once closed no packets can be sent.
- */
- void close();
-
- /**
- * transfers the connection used by this channel to the one specified.
- * <p/>
- * All new packets will be sent via this connection.
- *
- * @param newConnection the new connection
- */
- void transferConnection(CoreRemotingConnection newConnection);
-
- /**
- * resends any packets that have not received confirmations yet.
- * <p/>
- * Typically called after a connection has been transferred.
- *
- * @param lastConfirmedCommandID the last confirmed packet
- */
- void replayCommands(int lastConfirmedCommandID);
-
- /**
- * returns the last confirmed packet command id
- *
- * @return the id
- */
- int getLastConfirmedCommandID();
-
- /**
- * locks the channel.
- * <p/>
- * While locked no packets can be sent or received
- */
- void lock();
-
- /**
- * unlocks the channel.
- */
- void unlock();
-
- /**
- * forces any {@link org.hornetq.core.protocol.core.Channel#sendBlocking(Packet)}
request to return with an exception.
- */
- void returnBlocking();
-
- /**
- * returns the channel lock
- *
- * @return the lock
- */
- Lock getLock();
-
- /**
- * returns the Remoting Connection being used by the channel
- */
- CoreRemotingConnection getConnection();
-
- /**
- * sends a confirmation of a packet being received.
- *
- * @param packet the packet to confirm
- */
- void confirm(Packet packet);
-
- /**
- * sets the handler to use when a confirmation is received.
- *
- * @param handler the handler to call
- */
- void setCommandConfirmationHandler(CommandConfirmationHandler handler);
-
- /**
- * flushes any confirmations on to the connection.
- */
- void flushConfirmations();
-
- /**
- * Called by {@link org.hornetq.core.protocol.core.CoreRemotingConnection} when a
packet is received.
- * <p/>
- * This method should then call its {@link
org.hornetq.core.protocol.core.ChannelHandler} after appropriate processing of
- * the packet
- *
- * @param packet the packet to process.
- */
- void handlePacket(Packet packet);
-
- /**
- * clears any commands from the cache that are yet to be confirmed.
- */
- void clearCommands();
-
- /**
- * returns the confirmation window size this channel is using.
- *
- * @return the window size
- */
- int getConfirmationWindowSize();
-
- /**
- * notifies the channel if it is transferring its connection. When true it is illegal
to send messages.
- *
- * @param transferring whether the channel is transferring
- */
- void setTransferring(boolean transferring);
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/Channel.java
(from rev 8821, trunk/src/main/org/hornetq/core/protocol/core/Channel.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/Channel.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/Channel.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -0,0 +1,178 @@
+/*
+ * 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.locks.Lock;
+
+import org.hornetq.api.core.HornetQException;
+
+/**
+ * A channel is a way of interleaving data meant for different endpoints over the same
{@link org.hornetq.core.protocol.core.CoreRemotingConnection}.
+ * <p/>
+ * Any packet sent will have its channel id set to the specific channel sending so it can
be routed to its correct channel
+ * when received by the {@link org.hornetq.core.protocol.core.CoreRemotingConnection}.
see {@link org.hornetq.core.protocol.core.Packet#setChannelID(long)}.
+ * <p/>
+ * Each Channel should will forward any packets received to its {@link
org.hornetq.core.protocol.core.ChannelHandler}.
+ * <p/>
+ * A Channel *does not* support concurrent access by more than one thread!
+ *
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ */
+public interface Channel
+{
+ /**
+ * returns the id of this channel.
+ *
+ * @return the id
+ */
+ long getID();
+
+ /**
+ * sends a packet on this channel.
+ *
+ * @param packet the packet to send
+ */
+ void send(Packet packet);
+
+ /**
+ * sends a packet on this channel and then blocks until it has been written to the
connection.
+ *
+ * @param packet the packet to send
+ */
+ void sendAndFlush(Packet packet);
+
+ /**
+ * sends a packet on this channel and then blocks until a response is received or a
timeout occurs.
+ *
+ * @param packet the packet to send
+ * @return the response
+ * @throws HornetQException if an error occurs during the send
+ */
+ Packet sendBlocking(Packet packet) throws HornetQException;
+
+ /**
+ * sets the {@link org.hornetq.core.protocol.core.ChannelHandler} that this channel
should forward received packets to.
+ *
+ * @param handler the handler
+ */
+ void setHandler(ChannelHandler handler);
+
+ /**
+ * closes this channel.
+ * <p/>
+ * once closed no packets can be sent.
+ */
+ void close();
+
+ /**
+ * transfers the connection used by this channel to the one specified.
+ * <p/>
+ * All new packets will be sent via this connection.
+ *
+ * @param newConnection the new connection
+ */
+ void transferConnection(CoreRemotingConnection newConnection);
+
+ /**
+ * resends any packets that have not received confirmations yet.
+ * <p/>
+ * Typically called after a connection has been transferred.
+ *
+ * @param lastConfirmedCommandID the last confirmed packet
+ */
+ void replayCommands(int lastConfirmedCommandID);
+
+ /**
+ * returns the last confirmed packet command id
+ *
+ * @return the id
+ */
+ int getLastConfirmedCommandID();
+
+ /**
+ * locks the channel.
+ * <p/>
+ * While locked no packets can be sent or received
+ */
+ void lock();
+
+ /**
+ * unlocks the channel.
+ */
+ void unlock();
+
+ /**
+ * forces any {@link org.hornetq.core.protocol.core.Channel#sendBlocking(Packet)}
request to return with an exception.
+ */
+ void returnBlocking();
+
+ /**
+ * returns the channel lock
+ *
+ * @return the lock
+ */
+ Lock getLock();
+
+ /**
+ * returns the Remoting Connection being used by the channel
+ */
+ CoreRemotingConnection getConnection();
+
+ /**
+ * sends a confirmation of a packet being received.
+ *
+ * @param packet the packet to confirm
+ */
+ void confirm(Packet packet);
+
+ /**
+ * sets the handler to use when a confirmation is received.
+ *
+ * @param handler the handler to call
+ */
+ void setCommandConfirmationHandler(CommandConfirmationHandler handler);
+
+ /**
+ * flushes any confirmations on to the connection.
+ */
+ void flushConfirmations();
+
+ /**
+ * Called by {@link org.hornetq.core.protocol.core.CoreRemotingConnection} when a
packet is received.
+ * <p/>
+ * This method should then call its {@link
org.hornetq.core.protocol.core.ChannelHandler} after appropriate processing of
+ * the packet
+ *
+ * @param packet the packet to process.
+ */
+ void handlePacket(Packet packet);
+
+ /**
+ * clears any commands from the cache that are yet to be confirmed.
+ */
+ void clearCommands();
+
+ /**
+ * returns the confirmation window size this channel is using.
+ *
+ * @return the window size
+ */
+ int getConfirmationWindowSize();
+
+ /**
+ * notifies the channel if it is transferring its connection. When true it is illegal
to send messages.
+ *
+ * @param transferring whether the channel is transferring
+ */
+ void setTransferring(boolean transferring);
+}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/ChannelHandler.java
===================================================================
--- trunk/src/main/org/hornetq/core/protocol/core/ChannelHandler.java 2010-01-21 13:31:05
UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/ChannelHandler.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -1,30 +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;
-
-
-/**
- * A ChannelHandler is used by {@link Channel}. When a channel receives a packet it will
call its handler to deal with the
- * packet.
- *
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- */
-public interface ChannelHandler
-{
- /**
- * called by the channel when a packet is received..
- *
- * @param packet the packet received
- */
- void handlePacket(Packet packet);
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/ChannelHandler.java
(from rev 8821, trunk/src/main/org/hornetq/core/protocol/core/ChannelHandler.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/ChannelHandler.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/ChannelHandler.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -0,0 +1,30 @@
+/*
+ * 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;
+
+
+/**
+ * A ChannelHandler is used by {@link Channel}. When a channel receives a packet it will
call its handler to deal with the
+ * packet.
+ *
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ */
+public interface ChannelHandler
+{
+ /**
+ * called by the channel when a packet is received..
+ *
+ * @param packet the packet received
+ */
+ void handlePacket(Packet packet);
+}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/ChannelImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/protocol/core/ChannelImpl.java 2010-01-21 13:31:05 UTC
(rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/ChannelImpl.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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;
- }
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/ChannelImpl.java
(from rev 8821, trunk/src/main/org/hornetq/core/protocol/core/ChannelImpl.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/ChannelImpl.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/ChannelImpl.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -0,0 +1,508 @@
+/*
+ * 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/CommandConfirmationHandler.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/CommandConfirmationHandler.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/CommandConfirmationHandler.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -1,32 +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;
-
-
-/**
- * A CommandConfirmationHandler is used by the channel to confirm confirmations of
packets.
- *
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- * <p/>
- * Created 9 Feb 2009 12:39:11
- */
-public interface CommandConfirmationHandler
-{
- /**
- * called by channel after a confirmation has been received.
- *
- * @param packet the packet confirmed
- */
- void commandConfirmed(Packet packet);
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/CommandConfirmationHandler.java
(from rev 8821,
trunk/src/main/org/hornetq/core/protocol/core/CommandConfirmationHandler.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/CommandConfirmationHandler.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/CommandConfirmationHandler.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -0,0 +1,32 @@
+/*
+ * 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;
+
+
+/**
+ * A CommandConfirmationHandler is used by the channel to confirm confirmations of
packets.
+ *
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ * <p/>
+ * Created 9 Feb 2009 12:39:11
+ */
+public interface CommandConfirmationHandler
+{
+ /**
+ * called by channel after a confirmation has been received.
+ *
+ * @param packet the packet confirmed
+ */
+ void commandConfirmed(Packet packet);
+}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/CoreProtocolManager.java
===================================================================
--- trunk/src/main/org/hornetq/core/protocol/core/CoreProtocolManager.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/CoreProtocolManager.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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);
- }
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/CoreProtocolManager.java
(from rev 8821, trunk/src/main/org/hornetq/core/protocol/core/CoreProtocolManager.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/CoreProtocolManager.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/CoreProtocolManager.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -0,0 +1,116 @@
+/*
+ * 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);
+ }
+}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/CoreRemotingConnection.java
===================================================================
--- trunk/src/main/org/hornetq/core/protocol/core/CoreRemotingConnection.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/CoreRemotingConnection.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -1,89 +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 org.hornetq.core.remoting.RemotingConnection;
-
-
-/**
- * Extension of RemotingConnection for the HornetQ core protocol
- *
- * @author Tim Fox
- *
- *
- */
-public interface CoreRemotingConnection extends RemotingConnection
-{
- /**
- * return the channel with the channel id specified.
- * <p/>
- * If it does not exist create it with the confirmation window size.
- *
- * @param channelID the channel id
- * @param confWindowSize the confirmation window size
- * @return the channel
- */
- Channel getChannel(long channelID, int confWindowSize);
-
- /**
- * add the channel with the specified channel id
- *
- * @param channelID the channel id
- * @param channel the channel
- */
- void putChannel(long channelID, Channel channel);
-
- /**
- * remove the channel with the specified channel id
- *
- * @param channelID the channel id
- * @return true if removed
- */
- boolean removeChannel(long channelID);
-
- /**
- * generate a unique (within this connection) channel id
- *
- * @return the id
- */
- long generateChannelID();
-
- /**
- * resets the id generator used to when generating id's
- *
- * @param id the first id to set it to
- */
- void syncIDGeneratorSequence(long id);
-
- /**
- * return the next id that will be chosen.
- *
- * @return the id
- */
- long getIDGeneratorSequence();
-
- /**
- * return the current tomeout for blocking calls
- *
- * @return the timeout in milliseconds
- */
- long getBlockingCallTimeout();
-
- /**
- * return the transfer lock used when transferring connections.
- *
- * @return the lock
- */
- Object getTransferLock();
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/CoreRemotingConnection.java
(from rev 8821,
trunk/src/main/org/hornetq/core/protocol/core/CoreRemotingConnection.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/CoreRemotingConnection.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/CoreRemotingConnection.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -0,0 +1,89 @@
+/*
+ * 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 org.hornetq.core.remoting.RemotingConnection;
+
+
+/**
+ * Extension of RemotingConnection for the HornetQ core protocol
+ *
+ * @author Tim Fox
+ *
+ *
+ */
+public interface CoreRemotingConnection extends RemotingConnection
+{
+ /**
+ * return the channel with the channel id specified.
+ * <p/>
+ * If it does not exist create it with the confirmation window size.
+ *
+ * @param channelID the channel id
+ * @param confWindowSize the confirmation window size
+ * @return the channel
+ */
+ Channel getChannel(long channelID, int confWindowSize);
+
+ /**
+ * add the channel with the specified channel id
+ *
+ * @param channelID the channel id
+ * @param channel the channel
+ */
+ void putChannel(long channelID, Channel channel);
+
+ /**
+ * remove the channel with the specified channel id
+ *
+ * @param channelID the channel id
+ * @return true if removed
+ */
+ boolean removeChannel(long channelID);
+
+ /**
+ * generate a unique (within this connection) channel id
+ *
+ * @return the id
+ */
+ long generateChannelID();
+
+ /**
+ * resets the id generator used to when generating id's
+ *
+ * @param id the first id to set it to
+ */
+ void syncIDGeneratorSequence(long id);
+
+ /**
+ * return the next id that will be chosen.
+ *
+ * @return the id
+ */
+ long getIDGeneratorSequence();
+
+ /**
+ * return the current tomeout for blocking calls
+ *
+ * @return the timeout in milliseconds
+ */
+ long getBlockingCallTimeout();
+
+ /**
+ * return the transfer lock used when transferring connections.
+ *
+ * @return the lock
+ */
+ Object getTransferLock();
+}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/HornetQPacketHandler.java
===================================================================
--- trunk/src/main/org/hornetq/core/protocol/core/HornetQPacketHandler.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/HornetQPacketHandler.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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 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");
- }
-
- 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/HornetQPacketHandler.java
(from rev 8821, trunk/src/main/org/hornetq/core/protocol/core/HornetQPacketHandler.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/HornetQPacketHandler.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/HornetQPacketHandler.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -0,0 +1,310 @@
+/*
+ * 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");
+ }
+
+ 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
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/Packet.java
===================================================================
--- trunk/src/main/org/hornetq/core/protocol/core/Packet.java 2010-01-21 13:31:05 UTC (rev
8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/Packet.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -1,86 +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.remoting.RemotingConnection;
-
-/**
- * A Packet represents a pcaket of data transmitted over a connection.
- *
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- */
-public interface Packet
-{
- /**
- * This sets the channel id that should be used once the packet has been successfully
decoded it is sent to the correct channel.
- *
- * @param channelID the id of the channel to handle the packet
- */
- void setChannelID(long channelID);
-
- /**
- * returns the channel id of the channel that should handle this pcaket
- *
- * @return the id of the channel
- */
- long getChannelID();
-
- /**
- * returns true if this packet is being sent in response to a previously received
packet
- *
- * @return true if a response
- */
- boolean isResponse();
-
- /**
- * returns the type of the packet.
- * <p/>
- * This is needed when decoding the packet
- *
- * @return the packet type
- */
- byte getType();
-
- /**
- * Encodes the packet and returns a {@link org.hornetq.api.core.HornetQBuffer}
containing the data
- *
- * @param connection the connection
- * @return the buffer to encode to
- */
- HornetQBuffer encode(RemotingConnection connection);
-
- /**
- * decodes the buffer into this packet
- *
- * @param buffer the buffer to decode from
- */
- void decode(HornetQBuffer buffer);
-
- /**
- * returns the size needed to encode this packet.
- *
- * @return The size of the entire packet including headers, and extra data
- */
- int getPacketSize();
-
- /**
- * returns true if a confirmation should be sent on receipt of this packet.
- *
- * @return true if confirmation is required
- */
- boolean isRequiresConfirmations();
-
- boolean isAsyncExec();
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/Packet.java
(from rev 8821, trunk/src/main/org/hornetq/core/protocol/core/Packet.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/Packet.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/Packet.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -0,0 +1,86 @@
+/*
+ * 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.remoting.RemotingConnection;
+
+/**
+ * A Packet represents a pcaket of data transmitted over a connection.
+ *
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ */
+public interface Packet
+{
+ /**
+ * This sets the channel id that should be used once the packet has been successfully
decoded it is sent to the correct channel.
+ *
+ * @param channelID the id of the channel to handle the packet
+ */
+ void setChannelID(long channelID);
+
+ /**
+ * returns the channel id of the channel that should handle this pcaket
+ *
+ * @return the id of the channel
+ */
+ long getChannelID();
+
+ /**
+ * returns true if this packet is being sent in response to a previously received
packet
+ *
+ * @return true if a response
+ */
+ boolean isResponse();
+
+ /**
+ * returns the type of the packet.
+ * <p/>
+ * This is needed when decoding the packet
+ *
+ * @return the packet type
+ */
+ byte getType();
+
+ /**
+ * Encodes the packet and returns a {@link org.hornetq.api.core.HornetQBuffer}
containing the data
+ *
+ * @param connection the connection
+ * @return the buffer to encode to
+ */
+ HornetQBuffer encode(RemotingConnection connection);
+
+ /**
+ * decodes the buffer into this packet
+ *
+ * @param buffer the buffer to decode from
+ */
+ void decode(HornetQBuffer buffer);
+
+ /**
+ * returns the size needed to encode this packet.
+ *
+ * @return The size of the entire packet including headers, and extra data
+ */
+ int getPacketSize();
+
+ /**
+ * returns true if a confirmation should be sent on receipt of this packet.
+ *
+ * @return true if confirmation is required
+ */
+ boolean isRequiresConfirmations();
+
+ boolean isAsyncExec();
+}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/PacketDecoder.java
===================================================================
--- trunk/src/main/org/hornetq/core/protocol/core/PacketDecoder.java 2010-01-21 13:31:05
UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/PacketDecoder.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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;
- }
-
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/PacketDecoder.java
(from rev 8821, trunk/src/main/org/hornetq/core/protocol/core/PacketDecoder.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/PacketDecoder.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/PacketDecoder.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -0,0 +1,492 @@
+/*
+ * 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
===================================================================
--- trunk/src/main/org/hornetq/core/protocol/core/PacketImpl.java 2010-01-21 13:31:05 UTC
(rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/PacketImpl.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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 -------------------------------------------------
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/PacketImpl.java
(from rev 8821, trunk/src/main/org/hornetq/core/protocol/core/PacketImpl.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/PacketImpl.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/PacketImpl.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -0,0 +1,310 @@
+/*
+ * 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
===================================================================
--- trunk/src/main/org/hornetq/core/protocol/core/RemotingConnectionImpl.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/RemotingConnectionImpl.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.core.remoting.impl.AbstractBufferHandler;
-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/RemotingConnectionImpl.java
(from rev 8821,
trunk/src/main/org/hornetq/core/protocol/core/RemotingConnectionImpl.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/RemotingConnectionImpl.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/RemotingConnectionImpl.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -0,0 +1,509 @@
+/*
+ * 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();
+ }
+ }
+}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/ServerSessionPacketHandler.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/ServerSessionPacketHandler.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/ServerSessionPacketHandler.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -1,648 +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.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 java.util.List;
-
-import javax.transaction.xa.XAResource;
-import javax.transaction.xa.Xid;
-
-import org.hornetq.api.core.HornetQException;
-import org.hornetq.api.core.SimpleString;
-import org.hornetq.core.exception.HornetQXAException;
-import org.hornetq.core.journal.IOAsyncTask;
-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.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;
-import org.hornetq.core.remoting.CloseListener;
-import org.hornetq.core.remoting.FailureListener;
-import org.hornetq.core.server.BindingQueryResult;
-import org.hornetq.core.server.QueueQueryResult;
-import org.hornetq.core.server.ServerMessage;
-import org.hornetq.core.server.ServerSession;
-import org.hornetq.core.server.SessionCallback;
-
-/**
- * A ServerSessionPacketHandler
- *
- * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- * @author <a href="mailto:andy.taylor@jboss.org>Andy Taylor</a>
- * @author <a href="mailto:clebert.suconic@jboss.org>Clebert
Suconic</a>
- */
-public class ServerSessionPacketHandler implements ChannelHandler, CloseListener,
FailureListener, SessionCallback
-{
- private static final Logger log = Logger.getLogger(ServerSessionPacketHandler.class);
-
- private final CoreProtocolManager protocolManager;
-
- private final ServerSession session;
-
- private final OperationContext sessionContext;
-
- // Storagemanager here is used to set the Context
- private final StorageManager storageManager;
-
- private final Channel channel;
-
- private volatile CoreRemotingConnection remotingConnection;
-
- public ServerSessionPacketHandler(final CoreProtocolManager protocolManager,
- final ServerSession session,
- final OperationContext sessionContext,
- final StorageManager storageManager,
- final Channel channel)
- {
- this.protocolManager = protocolManager;
-
- this.session = session;
-
- this.storageManager = storageManager;
-
- this.sessionContext = sessionContext;
-
- this.channel = channel;
-
- this.remotingConnection = channel.getConnection();
-
- addConnectionListeners();
- }
-
- public long getID()
- {
- return channel.getID();
- }
-
- public void connectionFailed(final HornetQException exception)
- {
- log.warn("Client connection failed, clearing up resources for session " +
session.getName());
-
- session.runConnectionFailureRunners();
-
- try
- {
- session.close();
- }
- catch (Exception e)
- {
- log.error("Failed to close session", e);
- }
-
- log.warn("Cleared up resources for session " + session.getName());
- }
-
- public void close()
- {
- channel.flushConfirmations();
-
- try
- {
- session.close();
- }
- catch (Exception e)
- {
- log.error("Failed to close session", e);
- }
- }
-
- public void connectionClosed()
- {
- session.runConnectionFailureRunners();
- }
-
- private void addConnectionListeners()
- {
- remotingConnection.addFailureListener(this);
- remotingConnection.addCloseListener(this);
- }
-
- private void removeConnectionListeners()
- {
- remotingConnection.removeFailureListener(this);
- remotingConnection.removeCloseListener(this);
- }
-
- public Channel getChannel()
- {
- return channel;
- }
-
- public void handlePacket(final Packet packet)
- {
- byte type = packet.getType();
-
- storageManager.setContext(sessionContext);
-
- Packet response = null;
- boolean flush = false;
- boolean closeChannel = false;
- boolean requiresResponse = false;
-
- try
- {
- try
- {
- switch (type)
- {
- case SESS_CREATECONSUMER:
- {
- SessionCreateConsumerMessage request =
(SessionCreateConsumerMessage)packet;
- requiresResponse = request.isRequiresResponse();
- session.createConsumer(request.getID(),
- request.getQueueName(),
- request.getFilterString(),
- request.isBrowseOnly());
- if (requiresResponse)
- {
- // We send back queue information on the queue as a response- this
allows the queue to
- // be automaticall recreated on failover
- response = new
SessionQueueQueryResponseMessage(session.executeQueueQuery(request.getQueueName()));
- }
-
- break;
- }
- case CREATE_QUEUE:
- {
- CreateQueueMessage request = (CreateQueueMessage)packet;
- requiresResponse = request.isRequiresResponse();
- session.createQueue(request.getAddress(),
- request.getQueueName(),
- request.getFilterString(),
- request.isTemporary(),
- request.isDurable());
- if (requiresResponse)
- {
- response = new NullResponseMessage();
- }
- break;
- }
- case DELETE_QUEUE:
- {
- requiresResponse = true;
- SessionDeleteQueueMessage request = (SessionDeleteQueueMessage)packet;
- session.deleteQueue(request.getQueueName());
- response = new NullResponseMessage();
- break;
- }
- case SESS_QUEUEQUERY:
- {
- requiresResponse = true;
- SessionQueueQueryMessage request = (SessionQueueQueryMessage)packet;
- QueueQueryResult result =
session.executeQueueQuery(request.getQueueName());
- response = new SessionQueueQueryResponseMessage(result);
- break;
- }
- case SESS_BINDINGQUERY:
- {
- requiresResponse = true;
- SessionBindingQueryMessage request =
(SessionBindingQueryMessage)packet;
- BindingQueryResult result =
session.executeBindingQuery(request.getAddress());
- response = new SessionBindingQueryResponseMessage(result.isExists(),
result.getQueueNames());
- break;
- }
- case SESS_ACKNOWLEDGE:
- {
- SessionAcknowledgeMessage message = (SessionAcknowledgeMessage)packet;
- requiresResponse = message.isRequiresResponse();
- session.acknowledge(message.getConsumerID(), message.getMessageID());
- if (requiresResponse)
- {
- response = new NullResponseMessage();
- }
- break;
- }
- case SESS_EXPIRED:
- {
- SessionExpiredMessage message = (SessionExpiredMessage)packet;
- session.expire(message.getConsumerID(), message.getMessageID());
- break;
- }
- case SESS_COMMIT:
- {
- requiresResponse = true;
- session.commit();
- response = new NullResponseMessage();
- break;
- }
- case SESS_ROLLBACK:
- {
- requiresResponse = true;
-
session.rollback(((RollbackMessage)packet).isConsiderLastMessageAsDelivered());
- response = new NullResponseMessage();
- break;
- }
- case SESS_XA_COMMIT:
- {
- requiresResponse = true;
- SessionXACommitMessage message = (SessionXACommitMessage)packet;
- session.xaCommit(message.getXid(), message.isOnePhase());
- response = new SessionXAResponseMessage(false, XAResource.XA_OK,
null);
- break;
- }
- case SESS_XA_END:
- {
- requiresResponse = true;
- SessionXAEndMessage message = (SessionXAEndMessage)packet;
- session.xaEnd(message.getXid());
- response = new SessionXAResponseMessage(false, XAResource.XA_OK,
null);
- break;
- }
- case SESS_XA_FORGET:
- {
- requiresResponse = true;
- SessionXAForgetMessage message = (SessionXAForgetMessage)packet;
- session.xaForget(message.getXid());
- response = new SessionXAResponseMessage(false, XAResource.XA_OK,
null);
- break;
- }
- case SESS_XA_JOIN:
- {
- requiresResponse = true;
- SessionXAJoinMessage message = (SessionXAJoinMessage)packet;
- session.xaJoin(message.getXid());
- response = new SessionXAResponseMessage(false, XAResource.XA_OK,
null);
- break;
- }
- case SESS_XA_RESUME:
- {
- requiresResponse = true;
- SessionXAResumeMessage message = (SessionXAResumeMessage)packet;
- session.xaResume(message.getXid());
- response = new SessionXAResponseMessage(false, XAResource.XA_OK,
null);
- break;
- }
- case SESS_XA_ROLLBACK:
- {
- requiresResponse = true;
- SessionXARollbackMessage message = (SessionXARollbackMessage)packet;
- session.xaRollback(message.getXid());
- response = new SessionXAResponseMessage(false, XAResource.XA_OK,
null);
- break;
- }
- case SESS_XA_START:
- {
- requiresResponse = true;
- SessionXAStartMessage message = (SessionXAStartMessage)packet;
- session.xaStart(message.getXid());
- response = new SessionXAResponseMessage(false, XAResource.XA_OK,
null);
- break;
- }
- case SESS_XA_SUSPEND:
- {
- requiresResponse = true;
- session.xaSuspend();
- response = new SessionXAResponseMessage(false, XAResource.XA_OK,
null);
- break;
- }
- case SESS_XA_PREPARE:
- {
- requiresResponse = true;
- SessionXAPrepareMessage message = (SessionXAPrepareMessage)packet;
- session.xaPrepare(message.getXid());
- response = new SessionXAResponseMessage(false, XAResource.XA_OK,
null);
- break;
- }
- case SESS_XA_INDOUBT_XIDS:
- {
- requiresResponse = true;
- List<Xid> xids = session.xaGetInDoubtXids();
- response = new SessionXAGetInDoubtXidsResponseMessage(xids);
- break;
- }
- case SESS_XA_GET_TIMEOUT:
- {
- requiresResponse = true;
- int timeout = session.xaGetTimeout();
- response = new SessionXAGetTimeoutResponseMessage(timeout);
- break;
- }
- case SESS_XA_SET_TIMEOUT:
- {
- requiresResponse = true;
- SessionXASetTimeoutMessage message =
(SessionXASetTimeoutMessage)packet;
- session.xaSetTimeout(message.getTimeoutSeconds());
- response = new SessionXASetTimeoutResponseMessage(true);
- break;
- }
- case SESS_START:
- {
- session.start();
- break;
- }
- case SESS_STOP:
- {
- requiresResponse = true;
- session.stop();
- response = new NullResponseMessage();
- break;
- }
- case SESS_CLOSE:
- {
- requiresResponse = true;
- session.close();
- removeConnectionListeners();
- response = new NullResponseMessage();
- flush = true;
- closeChannel = true;
- break;
- }
- case SESS_CONSUMER_CLOSE:
- {
- requiresResponse = true;
- SessionConsumerCloseMessage message =
(SessionConsumerCloseMessage)packet;
- session.closeConsumer(message.getConsumerID());
- response = new NullResponseMessage();
- break;
- }
- case SESS_FLOWTOKEN:
- {
- SessionConsumerFlowCreditMessage message =
(SessionConsumerFlowCreditMessage)packet;
- session.receiveConsumerCredits(message.getConsumerID(),
message.getCredits());
- break;
- }
- case SESS_SEND:
- {
- SessionSendMessage message = (SessionSendMessage)packet;
- requiresResponse = message.isRequiresResponse();
- session.send((ServerMessage)message.getMessage());
- if (requiresResponse)
- {
- response = new NullResponseMessage();
- }
- break;
- }
- case SESS_SEND_LARGE:
- {
- SessionSendLargeMessage message = (SessionSendLargeMessage)packet;
- session.sendLarge(message.getLargeMessageHeader());
- break;
- }
- case SESS_SEND_CONTINUATION:
- {
- SessionSendContinuationMessage message =
(SessionSendContinuationMessage)packet;
- requiresResponse = message.isRequiresResponse();
- session.sendContinuations(message.getPacketSize(), message.getBody(),
message.isContinues());
- if (requiresResponse)
- {
- response = new NullResponseMessage();
- }
- break;
- }
- case SESS_FORCE_CONSUMER_DELIVERY:
- {
- SessionForceConsumerDelivery message =
(SessionForceConsumerDelivery)packet;
- session.forceConsumerDelivery(message.getConsumerID(),
message.getSequence());
- break;
- }
- case PacketImpl.SESS_PRODUCER_REQUEST_CREDITS:
- {
- SessionRequestProducerCreditsMessage message =
(SessionRequestProducerCreditsMessage)packet;
- session.requestProducerCredits(message.getAddress(),
message.getCredits());
- break;
- }
- }
- }
- catch (HornetQXAException e)
- {
- if (requiresResponse)
- {
- response = new SessionXAResponseMessage(true, e.errorCode,
e.getMessage());
- }
- else
- {
- log.error("Caught XA exception", e);
- }
- }
- catch (HornetQException e)
- {
- if (requiresResponse)
- {
- response = new HornetQExceptionMessage((HornetQException)e);
- }
- else
- {
- log.error("Caught exception", e);
- }
- }
- catch (Throwable t)
- {
- log.error("Caught unexpected exception", t);
- }
-
- sendResponse(packet, response, flush, closeChannel);
- }
- finally
- {
- storageManager.completeOperations();
- storageManager.clearContext();
- }
- }
-
- private void sendResponse(final Packet confirmPacket,
- final Packet response,
- final boolean flush,
- final boolean closeChannel)
- {
- storageManager.afterCompleteOperations(new IOAsyncTask()
- {
- public void onError(final int errorCode, final String errorMessage)
- {
- log.warn("Error processing IOCallback code = " + errorCode + "
message = " + errorMessage);
-
- HornetQExceptionMessage exceptionMessage = new HornetQExceptionMessage(new
HornetQException(errorCode,
-
errorMessage));
-
- doConfirmAndResponse(confirmPacket, exceptionMessage, flush, closeChannel);
- }
-
- public void done()
- {
- doConfirmAndResponse(confirmPacket, response, flush, closeChannel);
- }
- });
- }
-
- private void doConfirmAndResponse(final Packet confirmPacket,
- final Packet response,
- final boolean flush,
- final boolean closeChannel)
- {
- if (confirmPacket != null)
- {
- channel.confirm(confirmPacket);
-
- if (flush)
- {
- channel.flushConfirmations();
- }
- }
-
- if (response != null)
- {
- channel.send(response);
- }
-
- if (closeChannel)
- {
- channel.close();
- }
- }
-
- public int sendLargeMessage(long consumerID, byte[] headerBuffer, long bodySize, int
deliveryCount)
- {
- Packet packet = new SessionReceiveLargeMessage(consumerID, headerBuffer, bodySize,
deliveryCount);
-
- channel.send(packet);
-
- return packet.getPacketSize();
- }
-
- public int sendLargeMessageContinuation(long consumerID, byte[] body, boolean
continues, boolean requiresResponse)
- {
- Packet packet = new SessionReceiveContinuationMessage(consumerID, body, continues,
requiresResponse);
-
- channel.send(packet);
-
- return packet.getPacketSize();
- }
-
- public int sendMessage(ServerMessage message, long consumerID, int deliveryCount)
- {
- Packet packet = new SessionReceiveMessage(consumerID, message, deliveryCount);
-
- channel.send(packet);
-
- return packet.getPacketSize();
- }
-
- public void sendProducerCreditsMessage(int credits, SimpleString address, int offset)
- {
- Packet packet = new SessionProducerCreditsMessage(credits, address, offset);
-
- channel.send(packet);
- }
-
- public void closed()
- {
- protocolManager.removeHandler(session.getName());
- }
-
- public int transferConnection(final CoreRemotingConnection newConnection, final int
lastReceivedCommandID)
- {
- // We need to disable delivery on all the consumers while the transfer is
occurring- otherwise packets might get
- // delivered
- // after the channel has transferred but *before* packets have been replayed - this
will give the client the wrong
- // sequence of packets.
- // It is not sufficient to just stop the session, since right after stopping the
session, another session start
- // might be executed
- // before we have transferred the connection, leaving it in a started state
- session.setTransferring(true);
-
- remotingConnection.removeFailureListener(this);
- remotingConnection.removeCloseListener(this);
-
- // Note. We do not destroy the replicating connection here. In the case the live
server has really crashed
- // then the connection will get cleaned up anyway when the server ping timeout
kicks in.
- // In the case the live server is really still up, i.e. a split brain situation (or
in tests), then closing
- // the replicating connection will cause the outstanding responses to be be
replayed on the live server,
- // if these reach the client who then subsequently fails over, on reconnection to
backup, it will have
- // received responses that the backup did not know about.
-
- channel.transferConnection(newConnection);
-
-
newConnection.syncIDGeneratorSequence(remotingConnection.getIDGeneratorSequence());
-
- remotingConnection = newConnection;
-
- remotingConnection.addFailureListener(this);
- remotingConnection.addCloseListener(this);
-
- int serverLastReceivedCommandID = channel.getLastConfirmedCommandID();
-
- channel.replayCommands(lastReceivedCommandID);
-
- channel.setTransferring(false);
-
- session.setTransferring(false);
-
- return serverLastReceivedCommandID;
- }
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/ServerSessionPacketHandler.java
(from rev 8821,
trunk/src/main/org/hornetq/core/protocol/core/ServerSessionPacketHandler.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/ServerSessionPacketHandler.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/ServerSessionPacketHandler.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -0,0 +1,648 @@
+/*
+ * 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.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 java.util.List;
+
+import javax.transaction.xa.XAResource;
+import javax.transaction.xa.Xid;
+
+import org.hornetq.api.core.HornetQException;
+import org.hornetq.api.core.SimpleString;
+import org.hornetq.core.exception.HornetQXAException;
+import org.hornetq.core.journal.IOAsyncTask;
+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.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;
+import org.hornetq.core.remoting.CloseListener;
+import org.hornetq.core.remoting.FailureListener;
+import org.hornetq.core.server.BindingQueryResult;
+import org.hornetq.core.server.QueueQueryResult;
+import org.hornetq.core.server.ServerMessage;
+import org.hornetq.core.server.ServerSession;
+import org.hornetq.core.server.SessionCallback;
+
+/**
+ * A ServerSessionPacketHandler
+ *
+ * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ * @author <a href="mailto:andy.taylor@jboss.org>Andy Taylor</a>
+ * @author <a href="mailto:clebert.suconic@jboss.org>Clebert
Suconic</a>
+ */
+public class ServerSessionPacketHandler implements ChannelHandler, CloseListener,
FailureListener, SessionCallback
+{
+ private static final Logger log = Logger.getLogger(ServerSessionPacketHandler.class);
+
+ private final CoreProtocolManager protocolManager;
+
+ private final ServerSession session;
+
+ private final OperationContext sessionContext;
+
+ // Storagemanager here is used to set the Context
+ private final StorageManager storageManager;
+
+ private final Channel channel;
+
+ private volatile CoreRemotingConnection remotingConnection;
+
+ public ServerSessionPacketHandler(final CoreProtocolManager protocolManager,
+ final ServerSession session,
+ final OperationContext sessionContext,
+ final StorageManager storageManager,
+ final Channel channel)
+ {
+ this.protocolManager = protocolManager;
+
+ this.session = session;
+
+ this.storageManager = storageManager;
+
+ this.sessionContext = sessionContext;
+
+ this.channel = channel;
+
+ this.remotingConnection = channel.getConnection();
+
+ addConnectionListeners();
+ }
+
+ public long getID()
+ {
+ return channel.getID();
+ }
+
+ public void connectionFailed(final HornetQException exception)
+ {
+ log.warn("Client connection failed, clearing up resources for session " +
session.getName());
+
+ session.runConnectionFailureRunners();
+
+ try
+ {
+ session.close();
+ }
+ catch (Exception e)
+ {
+ log.error("Failed to close session", e);
+ }
+
+ log.warn("Cleared up resources for session " + session.getName());
+ }
+
+ public void close()
+ {
+ channel.flushConfirmations();
+
+ try
+ {
+ session.close();
+ }
+ catch (Exception e)
+ {
+ log.error("Failed to close session", e);
+ }
+ }
+
+ public void connectionClosed()
+ {
+ session.runConnectionFailureRunners();
+ }
+
+ private void addConnectionListeners()
+ {
+ remotingConnection.addFailureListener(this);
+ remotingConnection.addCloseListener(this);
+ }
+
+ private void removeConnectionListeners()
+ {
+ remotingConnection.removeFailureListener(this);
+ remotingConnection.removeCloseListener(this);
+ }
+
+ public Channel getChannel()
+ {
+ return channel;
+ }
+
+ public void handlePacket(final Packet packet)
+ {
+ byte type = packet.getType();
+
+ storageManager.setContext(sessionContext);
+
+ Packet response = null;
+ boolean flush = false;
+ boolean closeChannel = false;
+ boolean requiresResponse = false;
+
+ try
+ {
+ try
+ {
+ switch (type)
+ {
+ case SESS_CREATECONSUMER:
+ {
+ SessionCreateConsumerMessage request =
(SessionCreateConsumerMessage)packet;
+ requiresResponse = request.isRequiresResponse();
+ session.createConsumer(request.getID(),
+ request.getQueueName(),
+ request.getFilterString(),
+ request.isBrowseOnly());
+ if (requiresResponse)
+ {
+ // We send back queue information on the queue as a response- this
allows the queue to
+ // be automaticall recreated on failover
+ response = new
SessionQueueQueryResponseMessage(session.executeQueueQuery(request.getQueueName()));
+ }
+
+ break;
+ }
+ case CREATE_QUEUE:
+ {
+ CreateQueueMessage request = (CreateQueueMessage)packet;
+ requiresResponse = request.isRequiresResponse();
+ session.createQueue(request.getAddress(),
+ request.getQueueName(),
+ request.getFilterString(),
+ request.isTemporary(),
+ request.isDurable());
+ if (requiresResponse)
+ {
+ response = new NullResponseMessage();
+ }
+ break;
+ }
+ case DELETE_QUEUE:
+ {
+ requiresResponse = true;
+ SessionDeleteQueueMessage request = (SessionDeleteQueueMessage)packet;
+ session.deleteQueue(request.getQueueName());
+ response = new NullResponseMessage();
+ break;
+ }
+ case SESS_QUEUEQUERY:
+ {
+ requiresResponse = true;
+ SessionQueueQueryMessage request = (SessionQueueQueryMessage)packet;
+ QueueQueryResult result =
session.executeQueueQuery(request.getQueueName());
+ response = new SessionQueueQueryResponseMessage(result);
+ break;
+ }
+ case SESS_BINDINGQUERY:
+ {
+ requiresResponse = true;
+ SessionBindingQueryMessage request =
(SessionBindingQueryMessage)packet;
+ BindingQueryResult result =
session.executeBindingQuery(request.getAddress());
+ response = new SessionBindingQueryResponseMessage(result.isExists(),
result.getQueueNames());
+ break;
+ }
+ case SESS_ACKNOWLEDGE:
+ {
+ SessionAcknowledgeMessage message = (SessionAcknowledgeMessage)packet;
+ requiresResponse = message.isRequiresResponse();
+ session.acknowledge(message.getConsumerID(), message.getMessageID());
+ if (requiresResponse)
+ {
+ response = new NullResponseMessage();
+ }
+ break;
+ }
+ case SESS_EXPIRED:
+ {
+ SessionExpiredMessage message = (SessionExpiredMessage)packet;
+ session.expire(message.getConsumerID(), message.getMessageID());
+ break;
+ }
+ case SESS_COMMIT:
+ {
+ requiresResponse = true;
+ session.commit();
+ response = new NullResponseMessage();
+ break;
+ }
+ case SESS_ROLLBACK:
+ {
+ requiresResponse = true;
+
session.rollback(((RollbackMessage)packet).isConsiderLastMessageAsDelivered());
+ response = new NullResponseMessage();
+ break;
+ }
+ case SESS_XA_COMMIT:
+ {
+ requiresResponse = true;
+ SessionXACommitMessage message = (SessionXACommitMessage)packet;
+ session.xaCommit(message.getXid(), message.isOnePhase());
+ response = new SessionXAResponseMessage(false, XAResource.XA_OK,
null);
+ break;
+ }
+ case SESS_XA_END:
+ {
+ requiresResponse = true;
+ SessionXAEndMessage message = (SessionXAEndMessage)packet;
+ session.xaEnd(message.getXid());
+ response = new SessionXAResponseMessage(false, XAResource.XA_OK,
null);
+ break;
+ }
+ case SESS_XA_FORGET:
+ {
+ requiresResponse = true;
+ SessionXAForgetMessage message = (SessionXAForgetMessage)packet;
+ session.xaForget(message.getXid());
+ response = new SessionXAResponseMessage(false, XAResource.XA_OK,
null);
+ break;
+ }
+ case SESS_XA_JOIN:
+ {
+ requiresResponse = true;
+ SessionXAJoinMessage message = (SessionXAJoinMessage)packet;
+ session.xaJoin(message.getXid());
+ response = new SessionXAResponseMessage(false, XAResource.XA_OK,
null);
+ break;
+ }
+ case SESS_XA_RESUME:
+ {
+ requiresResponse = true;
+ SessionXAResumeMessage message = (SessionXAResumeMessage)packet;
+ session.xaResume(message.getXid());
+ response = new SessionXAResponseMessage(false, XAResource.XA_OK,
null);
+ break;
+ }
+ case SESS_XA_ROLLBACK:
+ {
+ requiresResponse = true;
+ SessionXARollbackMessage message = (SessionXARollbackMessage)packet;
+ session.xaRollback(message.getXid());
+ response = new SessionXAResponseMessage(false, XAResource.XA_OK,
null);
+ break;
+ }
+ case SESS_XA_START:
+ {
+ requiresResponse = true;
+ SessionXAStartMessage message = (SessionXAStartMessage)packet;
+ session.xaStart(message.getXid());
+ response = new SessionXAResponseMessage(false, XAResource.XA_OK,
null);
+ break;
+ }
+ case SESS_XA_SUSPEND:
+ {
+ requiresResponse = true;
+ session.xaSuspend();
+ response = new SessionXAResponseMessage(false, XAResource.XA_OK,
null);
+ break;
+ }
+ case SESS_XA_PREPARE:
+ {
+ requiresResponse = true;
+ SessionXAPrepareMessage message = (SessionXAPrepareMessage)packet;
+ session.xaPrepare(message.getXid());
+ response = new SessionXAResponseMessage(false, XAResource.XA_OK,
null);
+ break;
+ }
+ case SESS_XA_INDOUBT_XIDS:
+ {
+ requiresResponse = true;
+ List<Xid> xids = session.xaGetInDoubtXids();
+ response = new SessionXAGetInDoubtXidsResponseMessage(xids);
+ break;
+ }
+ case SESS_XA_GET_TIMEOUT:
+ {
+ requiresResponse = true;
+ int timeout = session.xaGetTimeout();
+ response = new SessionXAGetTimeoutResponseMessage(timeout);
+ break;
+ }
+ case SESS_XA_SET_TIMEOUT:
+ {
+ requiresResponse = true;
+ SessionXASetTimeoutMessage message =
(SessionXASetTimeoutMessage)packet;
+ session.xaSetTimeout(message.getTimeoutSeconds());
+ response = new SessionXASetTimeoutResponseMessage(true);
+ break;
+ }
+ case SESS_START:
+ {
+ session.start();
+ break;
+ }
+ case SESS_STOP:
+ {
+ requiresResponse = true;
+ session.stop();
+ response = new NullResponseMessage();
+ break;
+ }
+ case SESS_CLOSE:
+ {
+ requiresResponse = true;
+ session.close();
+ removeConnectionListeners();
+ response = new NullResponseMessage();
+ flush = true;
+ closeChannel = true;
+ break;
+ }
+ case SESS_CONSUMER_CLOSE:
+ {
+ requiresResponse = true;
+ SessionConsumerCloseMessage message =
(SessionConsumerCloseMessage)packet;
+ session.closeConsumer(message.getConsumerID());
+ response = new NullResponseMessage();
+ break;
+ }
+ case SESS_FLOWTOKEN:
+ {
+ SessionConsumerFlowCreditMessage message =
(SessionConsumerFlowCreditMessage)packet;
+ session.receiveConsumerCredits(message.getConsumerID(),
message.getCredits());
+ break;
+ }
+ case SESS_SEND:
+ {
+ SessionSendMessage message = (SessionSendMessage)packet;
+ requiresResponse = message.isRequiresResponse();
+ session.send((ServerMessage)message.getMessage());
+ if (requiresResponse)
+ {
+ response = new NullResponseMessage();
+ }
+ break;
+ }
+ case SESS_SEND_LARGE:
+ {
+ SessionSendLargeMessage message = (SessionSendLargeMessage)packet;
+ session.sendLarge(message.getLargeMessageHeader());
+ break;
+ }
+ case SESS_SEND_CONTINUATION:
+ {
+ SessionSendContinuationMessage message =
(SessionSendContinuationMessage)packet;
+ requiresResponse = message.isRequiresResponse();
+ session.sendContinuations(message.getPacketSize(), message.getBody(),
message.isContinues());
+ if (requiresResponse)
+ {
+ response = new NullResponseMessage();
+ }
+ break;
+ }
+ case SESS_FORCE_CONSUMER_DELIVERY:
+ {
+ SessionForceConsumerDelivery message =
(SessionForceConsumerDelivery)packet;
+ session.forceConsumerDelivery(message.getConsumerID(),
message.getSequence());
+ break;
+ }
+ case PacketImpl.SESS_PRODUCER_REQUEST_CREDITS:
+ {
+ SessionRequestProducerCreditsMessage message =
(SessionRequestProducerCreditsMessage)packet;
+ session.requestProducerCredits(message.getAddress(),
message.getCredits());
+ break;
+ }
+ }
+ }
+ catch (HornetQXAException e)
+ {
+ if (requiresResponse)
+ {
+ response = new SessionXAResponseMessage(true, e.errorCode,
e.getMessage());
+ }
+ else
+ {
+ log.error("Caught XA exception", e);
+ }
+ }
+ catch (HornetQException e)
+ {
+ if (requiresResponse)
+ {
+ response = new HornetQExceptionMessage((HornetQException)e);
+ }
+ else
+ {
+ log.error("Caught exception", e);
+ }
+ }
+ catch (Throwable t)
+ {
+ log.error("Caught unexpected exception", t);
+ }
+
+ sendResponse(packet, response, flush, closeChannel);
+ }
+ finally
+ {
+ storageManager.completeOperations();
+ storageManager.clearContext();
+ }
+ }
+
+ private void sendResponse(final Packet confirmPacket,
+ final Packet response,
+ final boolean flush,
+ final boolean closeChannel)
+ {
+ storageManager.afterCompleteOperations(new IOAsyncTask()
+ {
+ public void onError(final int errorCode, final String errorMessage)
+ {
+ log.warn("Error processing IOCallback code = " + errorCode + "
message = " + errorMessage);
+
+ HornetQExceptionMessage exceptionMessage = new HornetQExceptionMessage(new
HornetQException(errorCode,
+
errorMessage));
+
+ doConfirmAndResponse(confirmPacket, exceptionMessage, flush, closeChannel);
+ }
+
+ public void done()
+ {
+ doConfirmAndResponse(confirmPacket, response, flush, closeChannel);
+ }
+ });
+ }
+
+ private void doConfirmAndResponse(final Packet confirmPacket,
+ final Packet response,
+ final boolean flush,
+ final boolean closeChannel)
+ {
+ if (confirmPacket != null)
+ {
+ channel.confirm(confirmPacket);
+
+ if (flush)
+ {
+ channel.flushConfirmations();
+ }
+ }
+
+ if (response != null)
+ {
+ channel.send(response);
+ }
+
+ if (closeChannel)
+ {
+ channel.close();
+ }
+ }
+
+ public int sendLargeMessage(long consumerID, byte[] headerBuffer, long bodySize, int
deliveryCount)
+ {
+ Packet packet = new SessionReceiveLargeMessage(consumerID, headerBuffer, bodySize,
deliveryCount);
+
+ channel.send(packet);
+
+ return packet.getPacketSize();
+ }
+
+ public int sendLargeMessageContinuation(long consumerID, byte[] body, boolean
continues, boolean requiresResponse)
+ {
+ Packet packet = new SessionReceiveContinuationMessage(consumerID, body, continues,
requiresResponse);
+
+ channel.send(packet);
+
+ return packet.getPacketSize();
+ }
+
+ public int sendMessage(ServerMessage message, long consumerID, int deliveryCount)
+ {
+ Packet packet = new SessionReceiveMessage(consumerID, message, deliveryCount);
+
+ channel.send(packet);
+
+ return packet.getPacketSize();
+ }
+
+ public void sendProducerCreditsMessage(int credits, SimpleString address, int offset)
+ {
+ Packet packet = new SessionProducerCreditsMessage(credits, address, offset);
+
+ channel.send(packet);
+ }
+
+ public void closed()
+ {
+ protocolManager.removeHandler(session.getName());
+ }
+
+ public int transferConnection(final CoreRemotingConnection newConnection, final int
lastReceivedCommandID)
+ {
+ // We need to disable delivery on all the consumers while the transfer is
occurring- otherwise packets might get
+ // delivered
+ // after the channel has transferred but *before* packets have been replayed - this
will give the client the wrong
+ // sequence of packets.
+ // It is not sufficient to just stop the session, since right after stopping the
session, another session start
+ // might be executed
+ // before we have transferred the connection, leaving it in a started state
+ session.setTransferring(true);
+
+ remotingConnection.removeFailureListener(this);
+ remotingConnection.removeCloseListener(this);
+
+ // Note. We do not destroy the replicating connection here. In the case the live
server has really crashed
+ // then the connection will get cleaned up anyway when the server ping timeout
kicks in.
+ // In the case the live server is really still up, i.e. a split brain situation (or
in tests), then closing
+ // the replicating connection will cause the outstanding responses to be be
replayed on the live server,
+ // if these reach the client who then subsequently fails over, on reconnection to
backup, it will have
+ // received responses that the backup did not know about.
+
+ channel.transferConnection(newConnection);
+
+
newConnection.syncIDGeneratorSequence(remotingConnection.getIDGeneratorSequence());
+
+ remotingConnection = newConnection;
+
+ remotingConnection.addFailureListener(this);
+ remotingConnection.addCloseListener(this);
+
+ int serverLastReceivedCommandID = channel.getLastConfirmedCommandID();
+
+ channel.replayCommands(lastReceivedCommandID);
+
+ channel.setTransferring(false);
+
+ session.setTransferring(false);
+
+ return serverLastReceivedCommandID;
+ }
+}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat
(from rev 8821, trunk/src/main/org/hornetq/core/protocol/core/wireformat)
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/CreateQueueMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/wireformat/CreateQueueMessage.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/CreateQueueMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.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.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/wireformat/CreateQueueMessage.java
(from rev 8821,
trunk/src/main/org/hornetq/core/protocol/core/wireformat/CreateQueueMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/CreateQueueMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/CreateQueueMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.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.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/wireformat/CreateReplicationSessionMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/wireformat/CreateReplicationSessionMessage.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/CreateReplicationSessionMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.protocol.core.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/wireformat/CreateReplicationSessionMessage.java
(from rev 8821,
trunk/src/main/org/hornetq/core/protocol/core/wireformat/CreateReplicationSessionMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/CreateReplicationSessionMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/CreateReplicationSessionMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.protocol.core.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/wireformat/CreateSessionMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/wireformat/CreateSessionMessage.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/CreateSessionMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.protocol.core.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/wireformat/CreateSessionMessage.java
(from rev 8821,
trunk/src/main/org/hornetq/core/protocol/core/wireformat/CreateSessionMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/CreateSessionMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/CreateSessionMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.protocol.core.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/wireformat/CreateSessionResponseMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/wireformat/CreateSessionResponseMessage.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/CreateSessionResponseMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.protocol.core.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/wireformat/CreateSessionResponseMessage.java
(from rev 8821,
trunk/src/main/org/hornetq/core/protocol/core/wireformat/CreateSessionResponseMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/CreateSessionResponseMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/CreateSessionResponseMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.protocol.core.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/wireformat/HornetQExceptionMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/wireformat/HornetQExceptionMessage.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/HornetQExceptionMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.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.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/wireformat/HornetQExceptionMessage.java
(from rev 8821,
trunk/src/main/org/hornetq/core/protocol/core/wireformat/HornetQExceptionMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/HornetQExceptionMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/HornetQExceptionMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.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.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/wireformat/MessagePacket.java
===================================================================
--- trunk/src/main/org/hornetq/core/protocol/core/wireformat/MessagePacket.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/MessagePacket.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.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.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/wireformat/MessagePacket.java
(from rev 8821,
trunk/src/main/org/hornetq/core/protocol/core/wireformat/MessagePacket.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/MessagePacket.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/MessagePacket.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.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.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/wireformat/NullResponseMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/wireformat/NullResponseMessage.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/NullResponseMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
-
-import org.hornetq.core.protocol.core.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/wireformat/NullResponseMessage.java
(from rev 8821,
trunk/src/main/org/hornetq/core/protocol/core/wireformat/NullResponseMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/NullResponseMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/NullResponseMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
+
+import org.hornetq.core.protocol.core.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/wireformat/PacketsConfirmedMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/wireformat/PacketsConfirmedMessage.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/PacketsConfirmedMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.protocol.core.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/wireformat/PacketsConfirmedMessage.java
(from rev 8821,
trunk/src/main/org/hornetq/core/protocol/core/wireformat/PacketsConfirmedMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/PacketsConfirmedMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/PacketsConfirmedMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.protocol.core.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/wireformat/Ping.java
===================================================================
--- trunk/src/main/org/hornetq/core/protocol/core/wireformat/Ping.java 2010-01-21 13:31:05
UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/Ping.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.protocol.core.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/wireformat/Ping.java
(from rev 8821, trunk/src/main/org/hornetq/core/protocol/core/wireformat/Ping.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/Ping.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/Ping.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.protocol.core.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/wireformat/ReattachSessionMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/wireformat/ReattachSessionMessage.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/ReattachSessionMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.protocol.core.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/wireformat/ReattachSessionMessage.java
(from rev 8821,
trunk/src/main/org/hornetq/core/protocol/core/wireformat/ReattachSessionMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/ReattachSessionMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/ReattachSessionMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.protocol.core.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/wireformat/ReattachSessionResponseMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/wireformat/ReattachSessionResponseMessage.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/ReattachSessionResponseMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.protocol.core.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/wireformat/ReattachSessionResponseMessage.java
(from rev 8821,
trunk/src/main/org/hornetq/core/protocol/core/wireformat/ReattachSessionResponseMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/ReattachSessionResponseMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/ReattachSessionResponseMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.protocol.core.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/wireformat/ReplicationAddMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationAddMessage.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationAddMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.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.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/wireformat/ReplicationAddMessage.java
(from rev 8821,
trunk/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationAddMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationAddMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationAddMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.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.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/wireformat/ReplicationAddTXMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationAddTXMessage.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationAddTXMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.journal.EncodingSupport;
-import org.hornetq.core.protocol.core.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/wireformat/ReplicationAddTXMessage.java
(from rev 8821,
trunk/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationAddTXMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationAddTXMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationAddTXMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.journal.EncodingSupport;
+import org.hornetq.core.protocol.core.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/wireformat/ReplicationCommitMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationCommitMessage.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationCommitMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.protocol.core.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/wireformat/ReplicationCommitMessage.java
(from rev 8821,
trunk/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationCommitMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationCommitMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationCommitMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.protocol.core.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/wireformat/ReplicationCompareDataMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationCompareDataMessage.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationCompareDataMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.journal.JournalLoadInformation;
-import org.hornetq.core.protocol.core.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/wireformat/ReplicationCompareDataMessage.java
(from rev 8821,
trunk/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationCompareDataMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationCompareDataMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationCompareDataMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.journal.JournalLoadInformation;
+import org.hornetq.core.protocol.core.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/wireformat/ReplicationDeleteMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationDeleteMessage.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationDeleteMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.protocol.core.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/wireformat/ReplicationDeleteMessage.java
(from rev 8821,
trunk/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationDeleteMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationDeleteMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationDeleteMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.protocol.core.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/wireformat/ReplicationDeleteTXMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationDeleteTXMessage.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationDeleteTXMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.journal.EncodingSupport;
-import org.hornetq.core.protocol.core.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/wireformat/ReplicationDeleteTXMessage.java
(from rev 8821,
trunk/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationDeleteTXMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationDeleteTXMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationDeleteTXMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.journal.EncodingSupport;
+import org.hornetq.core.protocol.core.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/wireformat/ReplicationLargeMessageBeingMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationLargeMessageBeingMessage.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationLargeMessageBeingMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.protocol.core.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/wireformat/ReplicationLargeMessageBeingMessage.java
(from rev 8821,
trunk/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationLargeMessageBeingMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationLargeMessageBeingMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationLargeMessageBeingMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.protocol.core.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/wireformat/ReplicationLargeMessageWriteMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationLargeMessageWriteMessage.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationLargeMessageWriteMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.protocol.core.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/wireformat/ReplicationLargeMessageWriteMessage.java
(from rev 8821,
trunk/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationLargeMessageWriteMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationLargeMessageWriteMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationLargeMessageWriteMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.protocol.core.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/wireformat/ReplicationLargemessageEndMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationLargemessageEndMessage.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationLargemessageEndMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.protocol.core.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/wireformat/ReplicationLargemessageEndMessage.java
(from rev 8821,
trunk/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationLargemessageEndMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationLargemessageEndMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationLargemessageEndMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.protocol.core.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/wireformat/ReplicationPageEventMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationPageEventMessage.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationPageEventMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.api.core.SimpleString;
-import org.hornetq.core.protocol.core.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/wireformat/ReplicationPageEventMessage.java
(from rev 8821,
trunk/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationPageEventMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationPageEventMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationPageEventMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.api.core.SimpleString;
+import org.hornetq.core.protocol.core.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/wireformat/ReplicationPageWriteMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationPageWriteMessage.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationPageWriteMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.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.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/wireformat/ReplicationPageWriteMessage.java
(from rev 8821,
trunk/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationPageWriteMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationPageWriteMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationPageWriteMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.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.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/wireformat/ReplicationPrepareMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationPrepareMessage.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationPrepareMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.journal.EncodingSupport;
-import org.hornetq.core.protocol.core.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/wireformat/ReplicationPrepareMessage.java
(from rev 8821,
trunk/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationPrepareMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationPrepareMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationPrepareMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.journal.EncodingSupport;
+import org.hornetq.core.protocol.core.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/wireformat/ReplicationResponseMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationResponseMessage.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationResponseMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
-
-import org.hornetq.core.protocol.core.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/wireformat/ReplicationResponseMessage.java
(from rev 8821,
trunk/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationResponseMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationResponseMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/ReplicationResponseMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
+
+import org.hornetq.core.protocol.core.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/wireformat/RollbackMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/wireformat/RollbackMessage.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/RollbackMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.protocol.core.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/wireformat/RollbackMessage.java
(from rev 8821,
trunk/src/main/org/hornetq/core/protocol/core/wireformat/RollbackMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/RollbackMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/RollbackMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.protocol.core.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/wireformat/SessionAcknowledgeMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/wireformat/SessionAcknowledgeMessage.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionAcknowledgeMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.protocol.core.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/wireformat/SessionAcknowledgeMessage.java
(from rev 8821,
trunk/src/main/org/hornetq/core/protocol/core/wireformat/SessionAcknowledgeMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionAcknowledgeMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionAcknowledgeMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.protocol.core.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/wireformat/SessionBindingQueryMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/wireformat/SessionBindingQueryMessage.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionBindingQueryMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.api.core.SimpleString;
-import org.hornetq.core.protocol.core.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/wireformat/SessionBindingQueryMessage.java
(from rev 8821,
trunk/src/main/org/hornetq/core/protocol/core/wireformat/SessionBindingQueryMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionBindingQueryMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionBindingQueryMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.api.core.SimpleString;
+import org.hornetq.core.protocol.core.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/wireformat/SessionBindingQueryResponseMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/wireformat/SessionBindingQueryResponseMessage.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionBindingQueryResponseMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.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.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/wireformat/SessionBindingQueryResponseMessage.java
(from rev 8821,
trunk/src/main/org/hornetq/core/protocol/core/wireformat/SessionBindingQueryResponseMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionBindingQueryResponseMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionBindingQueryResponseMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.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.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/wireformat/SessionCloseMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/wireformat/SessionCloseMessage.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionCloseMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
-
-import org.hornetq.core.protocol.core.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/wireformat/SessionCloseMessage.java
(from rev 8821,
trunk/src/main/org/hornetq/core/protocol/core/wireformat/SessionCloseMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionCloseMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionCloseMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
+
+import org.hornetq.core.protocol.core.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/wireformat/SessionCommitMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/wireformat/SessionCommitMessage.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionCommitMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
-
-import org.hornetq.core.protocol.core.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/wireformat/SessionCommitMessage.java
(from rev 8821,
trunk/src/main/org/hornetq/core/protocol/core/wireformat/SessionCommitMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionCommitMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionCommitMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
+
+import org.hornetq.core.protocol.core.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/wireformat/SessionConsumerCloseMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/wireformat/SessionConsumerCloseMessage.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionConsumerCloseMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.protocol.core.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/wireformat/SessionConsumerCloseMessage.java
(from rev 8821,
trunk/src/main/org/hornetq/core/protocol/core/wireformat/SessionConsumerCloseMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionConsumerCloseMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionConsumerCloseMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.protocol.core.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/wireformat/SessionConsumerFlowCreditMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/wireformat/SessionConsumerFlowCreditMessage.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionConsumerFlowCreditMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.protocol.core.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/wireformat/SessionConsumerFlowCreditMessage.java
(from rev 8821,
trunk/src/main/org/hornetq/core/protocol/core/wireformat/SessionConsumerFlowCreditMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionConsumerFlowCreditMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionConsumerFlowCreditMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.protocol.core.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/wireformat/SessionContinuationMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/wireformat/SessionContinuationMessage.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionContinuationMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.protocol.core.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/wireformat/SessionContinuationMessage.java
(from rev 8821,
trunk/src/main/org/hornetq/core/protocol/core/wireformat/SessionContinuationMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionContinuationMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionContinuationMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.protocol.core.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/wireformat/SessionCreateConsumerMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/wireformat/SessionCreateConsumerMessage.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionCreateConsumerMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.api.core.SimpleString;
-import org.hornetq.core.protocol.core.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/wireformat/SessionCreateConsumerMessage.java
(from rev 8821,
trunk/src/main/org/hornetq/core/protocol/core/wireformat/SessionCreateConsumerMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionCreateConsumerMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionCreateConsumerMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.api.core.SimpleString;
+import org.hornetq.core.protocol.core.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/wireformat/SessionDeleteQueueMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/wireformat/SessionDeleteQueueMessage.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionDeleteQueueMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.api.core.SimpleString;
-import org.hornetq.core.protocol.core.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/wireformat/SessionDeleteQueueMessage.java
(from rev 8821,
trunk/src/main/org/hornetq/core/protocol/core/wireformat/SessionDeleteQueueMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionDeleteQueueMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionDeleteQueueMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.api.core.SimpleString;
+import org.hornetq.core.protocol.core.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/wireformat/SessionExpiredMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/wireformat/SessionExpiredMessage.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionExpiredMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.protocol.core.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/wireformat/SessionExpiredMessage.java
(from rev 8821,
trunk/src/main/org/hornetq/core/protocol/core/wireformat/SessionExpiredMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionExpiredMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionExpiredMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.protocol.core.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/wireformat/SessionForceConsumerDelivery.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/wireformat/SessionForceConsumerDelivery.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionForceConsumerDelivery.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.protocol.core.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/wireformat/SessionForceConsumerDelivery.java
(from rev 8821,
trunk/src/main/org/hornetq/core/protocol/core/wireformat/SessionForceConsumerDelivery.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionForceConsumerDelivery.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionForceConsumerDelivery.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.protocol.core.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/wireformat/SessionProducerCreditsMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/wireformat/SessionProducerCreditsMessage.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionProducerCreditsMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.api.core.SimpleString;
-import org.hornetq.core.protocol.core.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/wireformat/SessionProducerCreditsMessage.java
(from rev 8821,
trunk/src/main/org/hornetq/core/protocol/core/wireformat/SessionProducerCreditsMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionProducerCreditsMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionProducerCreditsMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.api.core.SimpleString;
+import org.hornetq.core.protocol.core.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/wireformat/SessionQueueQueryMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/wireformat/SessionQueueQueryMessage.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionQueueQueryMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.api.core.SimpleString;
-import org.hornetq.core.protocol.core.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/wireformat/SessionQueueQueryMessage.java
(from rev 8821,
trunk/src/main/org/hornetq/core/protocol/core/wireformat/SessionQueueQueryMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionQueueQueryMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionQueueQueryMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.api.core.SimpleString;
+import org.hornetq.core.protocol.core.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/wireformat/SessionQueueQueryResponseMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/wireformat/SessionQueueQueryResponseMessage.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionQueueQueryResponseMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.api.core.SimpleString;
-import org.hornetq.core.protocol.core.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/wireformat/SessionQueueQueryResponseMessage.java
(from rev 8821,
trunk/src/main/org/hornetq/core/protocol/core/wireformat/SessionQueueQueryResponseMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionQueueQueryResponseMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionQueueQueryResponseMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.api.core.SimpleString;
+import org.hornetq.core.protocol.core.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/wireformat/SessionReceiveContinuationMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/wireformat/SessionReceiveContinuationMessage.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionReceiveContinuationMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.protocol.core.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/wireformat/SessionReceiveContinuationMessage.java
(from rev 8821,
trunk/src/main/org/hornetq/core/protocol/core/wireformat/SessionReceiveContinuationMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionReceiveContinuationMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionReceiveContinuationMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.protocol.core.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/wireformat/SessionReceiveLargeMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/wireformat/SessionReceiveLargeMessage.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionReceiveLargeMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.protocol.core.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/wireformat/SessionReceiveLargeMessage.java
(from rev 8821,
trunk/src/main/org/hornetq/core/protocol/core/wireformat/SessionReceiveLargeMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionReceiveLargeMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionReceiveLargeMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.protocol.core.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/wireformat/SessionReceiveMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/wireformat/SessionReceiveMessage.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionReceiveMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.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.PacketImpl;
-import org.hornetq.core.remoting.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/wireformat/SessionReceiveMessage.java
(from rev 8821,
trunk/src/main/org/hornetq/core/protocol/core/wireformat/SessionReceiveMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionReceiveMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionReceiveMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.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.PacketImpl;
+import org.hornetq.core.remoting.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/wireformat/SessionRequestProducerCreditsMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/wireformat/SessionRequestProducerCreditsMessage.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionRequestProducerCreditsMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.api.core.SimpleString;
-import org.hornetq.core.protocol.core.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/wireformat/SessionRequestProducerCreditsMessage.java
(from rev 8821,
trunk/src/main/org/hornetq/core/protocol/core/wireformat/SessionRequestProducerCreditsMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionRequestProducerCreditsMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionRequestProducerCreditsMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.api.core.SimpleString;
+import org.hornetq.core.protocol.core.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/wireformat/SessionSendContinuationMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/wireformat/SessionSendContinuationMessage.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionSendContinuationMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.protocol.core.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/wireformat/SessionSendContinuationMessage.java
(from rev 8821,
trunk/src/main/org/hornetq/core/protocol/core/wireformat/SessionSendContinuationMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionSendContinuationMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionSendContinuationMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.protocol.core.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/wireformat/SessionSendLargeMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/wireformat/SessionSendLargeMessage.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionSendLargeMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.protocol.core.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/wireformat/SessionSendLargeMessage.java
(from rev 8821,
trunk/src/main/org/hornetq/core/protocol/core/wireformat/SessionSendLargeMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionSendLargeMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionSendLargeMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.protocol.core.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/wireformat/SessionSendMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/wireformat/SessionSendMessage.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionSendMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.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.PacketImpl;
-import org.hornetq.core.remoting.RemotingConnection;
-import org.hornetq.core.server.impl.ServerMessageImpl;
-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/wireformat/SessionSendMessage.java
(from rev 8821,
trunk/src/main/org/hornetq/core/protocol/core/wireformat/SessionSendMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionSendMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionSendMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.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.PacketImpl;
+import org.hornetq.core.remoting.RemotingConnection;
+import org.hornetq.core.server.impl.ServerMessageImpl;
+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/wireformat/SessionXACommitMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/wireformat/SessionXACommitMessage.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionXACommitMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -1,111 +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.wireformat;
-
-import javax.transaction.xa.Xid;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.protocol.core.PacketImpl;
-
-/**
- * @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/wireformat/SessionXACommitMessage.java
(from rev 8821,
trunk/src/main/org/hornetq/core/protocol/core/wireformat/SessionXACommitMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionXACommitMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionXACommitMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -0,0 +1,111 @@
+/*
+ * 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.wireformat;
+
+import javax.transaction.xa.Xid;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.protocol.core.PacketImpl;
+
+/**
+ * @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/wireformat/SessionXAEndMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/wireformat/SessionXAEndMessage.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionXAEndMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
-
-import javax.transaction.xa.Xid;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.protocol.core.PacketImpl;
-
-/**
- * @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/wireformat/SessionXAEndMessage.java
(from rev 8821,
trunk/src/main/org/hornetq/core/protocol/core/wireformat/SessionXAEndMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionXAEndMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionXAEndMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
+
+import javax.transaction.xa.Xid;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.protocol.core.PacketImpl;
+
+/**
+ * @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/wireformat/SessionXAForgetMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/wireformat/SessionXAForgetMessage.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionXAForgetMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
-
-import javax.transaction.xa.Xid;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.protocol.core.PacketImpl;
-
-/**
- * @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/wireformat/SessionXAForgetMessage.java
(from rev 8821,
trunk/src/main/org/hornetq/core/protocol/core/wireformat/SessionXAForgetMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionXAForgetMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionXAForgetMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
+
+import javax.transaction.xa.Xid;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.protocol.core.PacketImpl;
+
+/**
+ * @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/wireformat/SessionXAGetInDoubtXidsResponseMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/wireformat/SessionXAGetInDoubtXidsResponseMessage.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionXAGetInDoubtXidsResponseMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -1,127 +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.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.PacketImpl;
-
-/**
- * @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/wireformat/SessionXAGetInDoubtXidsResponseMessage.java
(from rev 8821,
trunk/src/main/org/hornetq/core/protocol/core/wireformat/SessionXAGetInDoubtXidsResponseMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionXAGetInDoubtXidsResponseMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionXAGetInDoubtXidsResponseMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -0,0 +1,127 @@
+/*
+ * 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.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.PacketImpl;
+
+/**
+ * @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/wireformat/SessionXAGetTimeoutResponseMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/wireformat/SessionXAGetTimeoutResponseMessage.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionXAGetTimeoutResponseMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.protocol.core.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/wireformat/SessionXAGetTimeoutResponseMessage.java
(from rev 8821,
trunk/src/main/org/hornetq/core/protocol/core/wireformat/SessionXAGetTimeoutResponseMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionXAGetTimeoutResponseMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionXAGetTimeoutResponseMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.protocol.core.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/wireformat/SessionXAJoinMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/wireformat/SessionXAJoinMessage.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionXAJoinMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
-
-import javax.transaction.xa.Xid;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.protocol.core.PacketImpl;
-
-/**
- * @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/wireformat/SessionXAJoinMessage.java
(from rev 8821,
trunk/src/main/org/hornetq/core/protocol/core/wireformat/SessionXAJoinMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionXAJoinMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionXAJoinMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
+
+import javax.transaction.xa.Xid;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.protocol.core.PacketImpl;
+
+/**
+ * @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/wireformat/SessionXAPrepareMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/wireformat/SessionXAPrepareMessage.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionXAPrepareMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
-
-import javax.transaction.xa.Xid;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.protocol.core.PacketImpl;
-
-/**
- * @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/wireformat/SessionXAPrepareMessage.java
(from rev 8821,
trunk/src/main/org/hornetq/core/protocol/core/wireformat/SessionXAPrepareMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionXAPrepareMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionXAPrepareMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
+
+import javax.transaction.xa.Xid;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.protocol.core.PacketImpl;
+
+/**
+ * @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/wireformat/SessionXAResponseMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/wireformat/SessionXAResponseMessage.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionXAResponseMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.protocol.core.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/wireformat/SessionXAResponseMessage.java
(from rev 8821,
trunk/src/main/org/hornetq/core/protocol/core/wireformat/SessionXAResponseMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionXAResponseMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionXAResponseMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.protocol.core.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/wireformat/SessionXAResumeMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/wireformat/SessionXAResumeMessage.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionXAResumeMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
-
-import javax.transaction.xa.Xid;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.protocol.core.PacketImpl;
-
-/**
- * @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/wireformat/SessionXAResumeMessage.java
(from rev 8821,
trunk/src/main/org/hornetq/core/protocol/core/wireformat/SessionXAResumeMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionXAResumeMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionXAResumeMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
+
+import javax.transaction.xa.Xid;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.protocol.core.PacketImpl;
+
+/**
+ * @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/wireformat/SessionXARollbackMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/wireformat/SessionXARollbackMessage.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionXARollbackMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
-
-import javax.transaction.xa.Xid;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.protocol.core.PacketImpl;
-
-/**
- * @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/wireformat/SessionXARollbackMessage.java
(from rev 8821,
trunk/src/main/org/hornetq/core/protocol/core/wireformat/SessionXARollbackMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionXARollbackMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionXARollbackMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
+
+import javax.transaction.xa.Xid;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.protocol.core.PacketImpl;
+
+/**
+ * @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/wireformat/SessionXASetTimeoutMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/wireformat/SessionXASetTimeoutMessage.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionXASetTimeoutMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.protocol.core.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/wireformat/SessionXASetTimeoutMessage.java
(from rev 8821,
trunk/src/main/org/hornetq/core/protocol/core/wireformat/SessionXASetTimeoutMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionXASetTimeoutMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionXASetTimeoutMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.protocol.core.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/wireformat/SessionXASetTimeoutResponseMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/wireformat/SessionXASetTimeoutResponseMessage.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionXASetTimeoutResponseMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.protocol.core.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/wireformat/SessionXASetTimeoutResponseMessage.java
(from rev 8821,
trunk/src/main/org/hornetq/core/protocol/core/wireformat/SessionXASetTimeoutResponseMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionXASetTimeoutResponseMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionXASetTimeoutResponseMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.protocol.core.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/wireformat/SessionXAStartMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/wireformat/SessionXAStartMessage.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionXAStartMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
-
-import javax.transaction.xa.Xid;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.protocol.core.PacketImpl;
-
-/**
- * @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/wireformat/SessionXAStartMessage.java
(from rev 8821,
trunk/src/main/org/hornetq/core/protocol/core/wireformat/SessionXAStartMessage.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionXAStartMessage.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/SessionXAStartMessage.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
+
+import javax.transaction.xa.Xid;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.protocol.core.PacketImpl;
+
+/**
+ * @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 -------------------------------------------------
+}
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/XidCodecSupport.java
===================================================================
---
trunk/src/main/org/hornetq/core/protocol/core/wireformat/XidCodecSupport.java 2010-01-21
13:31:05 UTC (rev 8821)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/XidCodecSupport.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
-
-import javax.transaction.xa.Xid;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.transaction.impl.XidImpl;
-import org.hornetq.utils.DataConstants;
-
-/**
- * @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 -------------------------------------------------
-}
Copied:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/XidCodecSupport.java
(from rev 8821,
trunk/src/main/org/hornetq/core/protocol/core/wireformat/XidCodecSupport.java)
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/XidCodecSupport.java
(rev 0)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/protocol/core/wireformat/XidCodecSupport.java 2010-01-21
14:33:41 UTC (rev 8822)
@@ -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.wireformat;
+
+import javax.transaction.xa.Xid;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.transaction.impl.XidImpl;
+import org.hornetq.utils.DataConstants;
+
+/**
+ * @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 -------------------------------------------------
+}