From aecbd1c3f22e6aec4de90bd937f15ad4b77baa42 Mon Sep 17 00:00:00 2001 From: "Hiram R. Chirino" Date: Tue, 21 Mar 2006 23:20:55 +0000 Subject: [PATCH] did a bunch of svn propset svn:eol-style native git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@387665 13f79535-47bb-0310-9956-ffa450edef68 --- .../impl/SimpleDestinationMarshaller.java | 148 +-- .../broker/jmx/DestinationViewMBean.java | 166 +-- .../apache/activemq/kaha/StoreFactory.java | 94 +- .../activemq/kaha/impl/ContainerMapEntry.java | 100 +- .../activemq/kaha/impl/FreeSpaceManager.java | 324 +++--- .../activemq/kaha/impl/FreeSpaceTree.java | 216 ++-- .../org/apache/activemq/kaha/impl/Item.java | 230 ++--- .../activemq/kaha/impl/LocatableItem.java | 250 ++--- .../activemq/kaha/impl/MapContainerImpl.java | 950 +++++++++--------- .../activemq/kaha/impl/RootContainer.java | 192 ++-- .../apache/activemq/kaha/impl/StoreImpl.java | 760 +++++++------- .../v1/NetworkBridgeFilterMarshaller.java | 133 ++- .../JmsQueueCompositeSendReceiveTest.java | 2 +- .../openwire/v1/NetworkBridgeFilterTest.java | 58 +- .../main/csharp/ActiveMQ/BrokerException.cs | 108 +- .../ActiveMQ/Commands/ActiveMQBytesMessage.cs | 66 +- .../ActiveMQ/Commands/ActiveMQMapMessage.cs | 130 +-- .../ActiveMQ/Commands/ActiveMQMessage.cs | 590 +++++------ .../Commands/ActiveMQObjectMessage.cs | 110 +- .../Commands/ActiveMQStreamMessage.cs | 88 +- .../ActiveMQ/Commands/ActiveMQTextMessage.cs | 186 ++-- .../main/csharp/ActiveMQ/Commands/BrokerId.cs | 87 +- .../csharp/ActiveMQ/Commands/BrokerInfo.cs | 97 +- .../ActiveMQ/Commands/ConnectionError.cs | 73 +- .../csharp/ActiveMQ/Commands/ConnectionId.cs | 87 +- .../ActiveMQ/Commands/ConnectionInfo.cs | 97 +- .../csharp/ActiveMQ/Commands/ConsumerId.cs | 107 +- .../csharp/ActiveMQ/Commands/ConsumerInfo.cs | 177 +++- .../ActiveMQ/Commands/ControlCommand.cs | 65 +- .../ActiveMQ/Commands/DataArrayResponse.cs | 65 +- .../csharp/ActiveMQ/Commands/DataResponse.cs | 65 +- .../ActiveMQ/Commands/DataStructureSupport.cs | 86 +- .../ActiveMQ/Commands/DestinationInfo.cs | 97 +- .../ActiveMQ/Commands/DiscoveryEvent.cs | 73 +- .../ActiveMQ/Commands/ExceptionResponse.cs | 65 +- .../csharp/ActiveMQ/Commands/FlushCommand.cs | 57 +- .../ActiveMQ/Commands/IntegerResponse.cs | 65 +- .../ActiveMQ/Commands/JournalQueueAck.cs | 73 +- .../ActiveMQ/Commands/JournalTopicAck.cs | 105 +- .../csharp/ActiveMQ/Commands/JournalTrace.cs | 65 +- .../ActiveMQ/Commands/JournalTransaction.cs | 81 +- .../ActiveMQ/Commands/LastPartialCommand.cs | 57 +- .../ActiveMQ/Commands/LocalTransactionId.cs | 97 +- .../csharp/ActiveMQ/Commands/MarshallAware.cs | 76 +- .../main/csharp/ActiveMQ/Commands/Message.cs | 257 ++++- .../csharp/ActiveMQ/Commands/MessageAck.cs | 113 ++- .../ActiveMQ/Commands/MessageDispatch.cs | 89 +- .../Commands/MessageDispatchNotification.cs | 89 +- .../csharp/ActiveMQ/Commands/MessageId.cs | 107 +- .../ActiveMQ/Commands/NetworkBridgeFilter.cs | 73 +- .../ActiveMQ/Commands/PartialCommand.cs | 73 +- .../csharp/ActiveMQ/Commands/ProducerId.cs | 107 +- .../csharp/ActiveMQ/Commands/ProducerInfo.cs | 81 +- .../csharp/ActiveMQ/Commands/RemoveInfo.cs | 65 +- .../Commands/RemoveSubscriptionInfo.cs | 81 +- .../csharp/ActiveMQ/Commands/ReplayCommand.cs | 73 +- .../main/csharp/ActiveMQ/Commands/Response.cs | 65 +- .../csharp/ActiveMQ/Commands/SessionId.cs | 97 +- .../csharp/ActiveMQ/Commands/SessionInfo.cs | 65 +- .../csharp/ActiveMQ/Commands/ShutdownInfo.cs | 57 +- .../ActiveMQ/Commands/SubscriptionInfo.cs | 89 +- .../csharp/ActiveMQ/Commands/TransactionId.cs | 77 +- .../ActiveMQ/Commands/TransactionInfo.cs | 81 +- .../ActiveMQ/Commands/XATransactionId.cs | 107 +- .../main/csharp/ActiveMQ/ISynchronization.cs | 76 +- .../csharp/ActiveMQ/OpenWire/BooleanStream.cs | 244 ++--- .../OpenWire/MessagePropertyHelper.cs | 106 +- .../ActiveMQ/OpenWire/OpenWireFormat.cs | 558 +++++----- .../V1/DataStructureSupportMarshaller.cs | 128 +-- .../V1/LastPartialCommandMarshaller.cs | 99 +- .../MessageDispatchNotificationMarshaller.cs | 127 ++- .../V1/NetworkBridgeFilterMarshaller.cs | 116 ++- .../OpenWire/V1/PartialCommandMarshaller.cs | 124 ++- .../OpenWire/V1/ReplayCommandMarshaller.cs | 115 ++- .../csharp/ActiveMQ/TransactionContext.cs | 236 ++--- .../ActiveMQ/Transport/ITransportFactory.cs | 52 +- .../ActiveMQ/Transport/LoggingTransport.cs | 100 +- .../ActiveMQ/Transport/MutexTransport.cs | 140 +-- .../ActiveMQ/Transport/ResponseCorrelator.cs | 208 ++-- .../ActiveMQ/Transport/Tcp/TcpTransport.cs | 304 +++--- .../Transport/Tcp/TcpTransportFactory.cs | 124 +-- .../ActiveMQ/Transport/TransportFilter.cs | 218 ++-- .../src/main/csharp/NMS/IBytesMessage.cs | 66 +- .../src/main/csharp/NMS/IConnectionFactory.cs | 76 +- .../src/main/csharp/NMS/IMapMessage.cs | 68 +- .../src/main/csharp/NMS/IMessage.cs | 260 ++--- .../src/main/csharp/NMS/IMessageProducer.cs | 138 +-- activemq-dotnet/src/main/csharp/NMS/IQueue.cs | 64 +- .../src/main/csharp/NMS/ISession.cs | 246 ++--- .../src/main/csharp/NMS/IStartable.cs | 56 +- .../src/main/csharp/NMS/IStoppable.cs | 54 +- .../src/main/csharp/NMS/ITemporaryQueue.cs | 54 +- .../src/main/csharp/NMS/ITemporaryTopic.cs | 54 +- .../src/main/csharp/NMS/ITextMessage.cs | 66 +- activemq-dotnet/src/main/csharp/NMS/ITopic.cs | 64 +- .../main/csharp/NMS/NMSConnectionException.cs | 60 +- .../src/main/csharp/NMS/NMSException.cs | 60 +- .../csharp/ActiveMQ/Commands/CommandTest.cs | 126 +-- .../ActiveMQ/OpenWire/BooleanStreamTest.cs | 256 ++--- .../src/test/csharp/ActiveMQ/TestMain.cs | 154 +-- .../HttpJmsDurableTopicSendReceiveTest.java | 112 +-- .../HttpPersistentSendAndReceiveTest.java | 76 +- .../https/HttpsJmsSendAndReceiveTest.java | 78 +- .../https/HttpsTransportBrokerTest.java | 102 +- .../soaktest/MarshallingWithCachingTest.java | 284 +++--- .../soaktest/PublishThenConsumeSoakTest.java | 94 +- .../activemq/soaktest/SoakTestSupport.java | 366 +++---- .../org/apache/activemq/tool/Consumer.java | 230 ++--- .../org/apache/activemq/tool/Producer.java | 134 +-- .../src/command/NetworkBridgeFilter.cpp | 62 +- .../marshal/NetworkBridgeFilterMarshaller.cpp | 88 +- 111 files changed, 9855 insertions(+), 5432 deletions(-) diff --git a/activecluster/src/java/org/apache/activecluster/impl/SimpleDestinationMarshaller.java b/activecluster/src/java/org/apache/activecluster/impl/SimpleDestinationMarshaller.java index 43ed80700d..9d061770e1 100644 --- a/activecluster/src/java/org/apache/activecluster/impl/SimpleDestinationMarshaller.java +++ b/activecluster/src/java/org/apache/activecluster/impl/SimpleDestinationMarshaller.java @@ -1,75 +1,75 @@ -/** - * - * Copyright 2005-2006 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - **/ - -package org.apache.activecluster.impl; - - - -import javax.jms.Destination; -import javax.jms.JMSException; -import javax.jms.Queue; -import javax.jms.Topic; -import org.apache.activecluster.DestinationMarshaller; -import org.apache.activemq.command.ActiveMQTopic; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -/** - * A simple marshaller for Destinations - * - * @version $Revision: 1.5 $ - */ -public class SimpleDestinationMarshaller implements DestinationMarshaller { - private final static Log log = LogFactory.getLog(SimpleDestinationMarshaller.class); - /** - * Builds a destination from a destinationName - * @param destinationName - * - * @return the destination to send messages to all members of the cluster - */ - public Destination getDestination(String destinationName){ - return new ActiveMQTopic(destinationName); - } - - /** - * Gets a destination's physical name - * @param destination - * @return the destination's physical name - */ - public String getDestinationName(Destination destination){ - String result = null; - if (destination != null){ - if (destination instanceof Topic){ - Topic topic = (Topic) destination; - try{ - result = topic.getTopicName(); - }catch(JMSException e){ - log.error("Failed to get topic name for " + destination,e); - } - }else{ - Queue queue = (Queue) destination; - try{ - result = queue.getQueueName(); - }catch(JMSException e){ - log.error("Failed to get queue name for " + destination,e); - } - } - } - return result; - } +/** + * + * Copyright 2005-2006 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + **/ + +package org.apache.activecluster.impl; + + + +import javax.jms.Destination; +import javax.jms.JMSException; +import javax.jms.Queue; +import javax.jms.Topic; +import org.apache.activecluster.DestinationMarshaller; +import org.apache.activemq.command.ActiveMQTopic; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * A simple marshaller for Destinations + * + * @version $Revision: 1.5 $ + */ +public class SimpleDestinationMarshaller implements DestinationMarshaller { + private final static Log log = LogFactory.getLog(SimpleDestinationMarshaller.class); + /** + * Builds a destination from a destinationName + * @param destinationName + * + * @return the destination to send messages to all members of the cluster + */ + public Destination getDestination(String destinationName){ + return new ActiveMQTopic(destinationName); + } + + /** + * Gets a destination's physical name + * @param destination + * @return the destination's physical name + */ + public String getDestinationName(Destination destination){ + String result = null; + if (destination != null){ + if (destination instanceof Topic){ + Topic topic = (Topic) destination; + try{ + result = topic.getTopicName(); + }catch(JMSException e){ + log.error("Failed to get topic name for " + destination,e); + } + }else{ + Queue queue = (Queue) destination; + try{ + result = queue.getQueueName(); + }catch(JMSException e){ + log.error("Failed to get queue name for " + destination,e); + } + } + } + return result; + } } \ No newline at end of file diff --git a/activemq-core/src/main/java/org/apache/activemq/broker/jmx/DestinationViewMBean.java b/activemq-core/src/main/java/org/apache/activemq/broker/jmx/DestinationViewMBean.java index d3a44e998a..dfa6100338 100644 --- a/activemq-core/src/main/java/org/apache/activemq/broker/jmx/DestinationViewMBean.java +++ b/activemq-core/src/main/java/org/apache/activemq/broker/jmx/DestinationViewMBean.java @@ -1,84 +1,84 @@ -/** - * - * Copyright 2005-2006 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.activemq.broker.jmx; - -import java.util.Map; - -import javax.management.openmbean.CompositeData; -import javax.management.openmbean.OpenDataException; -import javax.management.openmbean.TabularData; - - -public interface DestinationViewMBean { - - /** - * Resets the managment counters. - */ - public void resetStatistics(); - - /** - * @return The number of messages that have been sent to the destination. - */ - public long getEnqueueCount(); - - /** - * @return The number of messages that have been received from the destination. - */ - public long getDequeueCount(); - - /** - * @return The number of consmers subscribed to messages from this destination. - */ - public long getConsumerCount(); - - /** - * @return The number of messages being buffered by this destination - */ - public long getQueueSize(); - - /** - * @return An array of all the messages in the destination's queue. - */ - public CompositeData[] browse() throws OpenDataException; - - /** - * @return A list of all the messages in the destination's queue. - */ - public TabularData browseAsTable() throws OpenDataException; - - /** - * Sends a TextMesage to the destination. - * @param body the text to send - * @return the message id of the message sent. - * @throws Exception - */ - public String sendTextMessage(String body) throws Exception; - - /** - * Sends a TextMesage to the destination. - * @param headers the message headers and properties to set. Can only container Strings maped to primitive types. - * @param body the text to send - * @return the message id of the message sent. - * @throws Exception - */ - public String sendTextMessage(Map headers, String body) throws Exception; - - public int getMemoryPercentageUsed(); - public long getMemoryLimit(); - public void setMemoryLimit(long limit); - +/** + * + * Copyright 2005-2006 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.activemq.broker.jmx; + +import java.util.Map; + +import javax.management.openmbean.CompositeData; +import javax.management.openmbean.OpenDataException; +import javax.management.openmbean.TabularData; + + +public interface DestinationViewMBean { + + /** + * Resets the managment counters. + */ + public void resetStatistics(); + + /** + * @return The number of messages that have been sent to the destination. + */ + public long getEnqueueCount(); + + /** + * @return The number of messages that have been received from the destination. + */ + public long getDequeueCount(); + + /** + * @return The number of consmers subscribed to messages from this destination. + */ + public long getConsumerCount(); + + /** + * @return The number of messages being buffered by this destination + */ + public long getQueueSize(); + + /** + * @return An array of all the messages in the destination's queue. + */ + public CompositeData[] browse() throws OpenDataException; + + /** + * @return A list of all the messages in the destination's queue. + */ + public TabularData browseAsTable() throws OpenDataException; + + /** + * Sends a TextMesage to the destination. + * @param body the text to send + * @return the message id of the message sent. + * @throws Exception + */ + public String sendTextMessage(String body) throws Exception; + + /** + * Sends a TextMesage to the destination. + * @param headers the message headers and properties to set. Can only container Strings maped to primitive types. + * @param body the text to send + * @return the message id of the message sent. + * @throws Exception + */ + public String sendTextMessage(Map headers, String body) throws Exception; + + public int getMemoryPercentageUsed(); + public long getMemoryLimit(); + public void setMemoryLimit(long limit); + } \ No newline at end of file diff --git a/activemq-core/src/main/java/org/apache/activemq/kaha/StoreFactory.java b/activemq-core/src/main/java/org/apache/activemq/kaha/StoreFactory.java index 93a95373a3..2d47e09cd5 100755 --- a/activemq-core/src/main/java/org/apache/activemq/kaha/StoreFactory.java +++ b/activemq-core/src/main/java/org/apache/activemq/kaha/StoreFactory.java @@ -1,47 +1,47 @@ -/** - * - * Copyright 2005-2006 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package org.apache.activemq.kaha; - -import java.io.File; -import java.io.IOException; -import org.apache.activemq.kaha.impl.StoreImpl; -/** - * Factory for creating stores - * - * @version $Revision: 1.2 $ - */ -public class StoreFactory{ - - - /** - * open or create a Store - * @param name - * @param mode - * @return the opened/created store - * @throws IOException - */ - public static Store open(String name,String mode) throws IOException{ - return new StoreImpl(name,mode); - } - - /** - * Delete a database - * @param name of the database - * @return true if successful - */ - public static boolean delete(String name){ - File file = new File(name); - return file.delete(); - } -} +/** + * + * Copyright 2005-2006 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package org.apache.activemq.kaha; + +import java.io.File; +import java.io.IOException; +import org.apache.activemq.kaha.impl.StoreImpl; +/** + * Factory for creating stores + * + * @version $Revision: 1.2 $ + */ +public class StoreFactory{ + + + /** + * open or create a Store + * @param name + * @param mode + * @return the opened/created store + * @throws IOException + */ + public static Store open(String name,String mode) throws IOException{ + return new StoreImpl(name,mode); + } + + /** + * Delete a database + * @param name of the database + * @return true if successful + */ + public static boolean delete(String name){ + File file = new File(name); + return file.delete(); + } +} diff --git a/activemq-core/src/main/java/org/apache/activemq/kaha/impl/ContainerMapEntry.java b/activemq-core/src/main/java/org/apache/activemq/kaha/impl/ContainerMapEntry.java index bfe769cefa..195f28d93b 100755 --- a/activemq-core/src/main/java/org/apache/activemq/kaha/impl/ContainerMapEntry.java +++ b/activemq-core/src/main/java/org/apache/activemq/kaha/impl/ContainerMapEntry.java @@ -1,50 +1,50 @@ -/** - * - * Copyright 2005-2006 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package org.apache.activemq.kaha.impl; - -import java.util.Map; -import org.apache.activemq.kaha.MapContainer; - -/** -* Map.Entry implementation for a container -* -* @version $Revision: 1.2 $ -*/ -class ContainerMapEntry implements Map.Entry { - - private MapContainer container; - private Object key; - - ContainerMapEntry(MapContainer container,Object key){ - this.container = container; - this.key = key; - - } - - - public Object getKey(){ - return key; - } - - public Object getValue(){ - return container.get(key); - } - - public Object setValue(Object value){ - return container.put(key, value); - } -} - - - +/** + * + * Copyright 2005-2006 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package org.apache.activemq.kaha.impl; + +import java.util.Map; +import org.apache.activemq.kaha.MapContainer; + +/** +* Map.Entry implementation for a container +* +* @version $Revision: 1.2 $ +*/ +class ContainerMapEntry implements Map.Entry { + + private MapContainer container; + private Object key; + + ContainerMapEntry(MapContainer container,Object key){ + this.container = container; + this.key = key; + + } + + + public Object getKey(){ + return key; + } + + public Object getValue(){ + return container.get(key); + } + + public Object setValue(Object value){ + return container.put(key, value); + } +} + + + diff --git a/activemq-core/src/main/java/org/apache/activemq/kaha/impl/FreeSpaceManager.java b/activemq-core/src/main/java/org/apache/activemq/kaha/impl/FreeSpaceManager.java index 254fa18059..9c3b0ae766 100755 --- a/activemq-core/src/main/java/org/apache/activemq/kaha/impl/FreeSpaceManager.java +++ b/activemq-core/src/main/java/org/apache/activemq/kaha/impl/FreeSpaceManager.java @@ -1,162 +1,162 @@ -/** - * - * Copyright 2005-2006 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package org.apache.activemq.kaha.impl; - -import java.io.IOException; -import java.io.PrintWriter; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -/** - * Free space list in the Store - * - * @version $Revision: 1.2 $ - */ -final class FreeSpaceManager{ - private static final Log log = LogFactory.getLog(FreeSpaceManager.class); - static final int ROOT_SIZE=64; - static final int RESIZE_INCREMENT=4096*1024; - private Map map=new HashMap(); - private Map prevMap=new HashMap(); - private FreeSpaceTree tree=new FreeSpaceTree(); - private StoreWriter writer; - private StoreReader reader; - private long dataEnd=ROOT_SIZE; - private long fileLength=-1; - - FreeSpaceManager(StoreWriter writer,StoreReader reader) throws IOException{ - this.writer=writer; - this.reader=reader; - this.fileLength=reader.length(); - } - - final Item getFreeSpace(Item item) throws IOException{ - Item result=tree.getNextFreeSpace(item); - if(result==null){ - while(dataEnd>=fileLength){ - writer.allocateSpace(fileLength+RESIZE_INCREMENT); - fileLength=reader.length(); - } - result=new Item(); - result.setOffset(dataEnd); - int newSize = ((item.getSize()/8)+1)*8; - - result.setSize(newSize); - dataEnd=dataEnd+result.getSize()+Item.HEAD_SIZE; - }else{ - removeFreeSpace(result); - } - // reset the item - item.setActive(true); - item.setOffset(result.getOffset()); - item.setSize(result.getSize()); - return item; - } - - final void addFreeSpace(Item item) throws IOException{ - long currentOffset=reader.position(); - reader.readHeader(item); - item.setActive(false); - // see if we can condense some space together - // first look for free space adjacent up the disk - Long nextKey=new Long(item.getOffset()+item.getSize()+Item.HEAD_SIZE); - Item next=(Item) map.remove(nextKey); - if(next!=null){ - tree.removeItem(next); - Long prevKey=new Long(next.getOffset()+next.getSize()+Item.HEAD_SIZE); - prevMap.remove(prevKey); - int newSize=item.getSize()+next.getSize()+Item.HEAD_SIZE; - item.setSize(newSize); - } - // now see if there was a previous item - // in the next map - Long key=new Long(item.getOffset()); - Item prev=(Item) prevMap.remove(key); - Long prevKey=prev!=null?new Long(prev.getOffset()):null; - if(prev!=null&&prevKey!=null){ - // we can condense the free space - // first we are about to change the item so remove it from the tree - tree.removeItem(prev); - int newSize=prev.getSize()+item.getSize()+Item.HEAD_SIZE; - prev.setSize(newSize); - // update the header - writer.updateHeader(prev); - // put back in the tree - tree.addItem(prev); - }else{ - // update the item header - writer.updateHeader(item); - tree.addItem(item); - map.put(key,item); - prevKey=new Long(item.getOffset()+item.getSize()+Item.HEAD_SIZE); - prevMap.put(prevKey,item); - } - reader.position(currentOffset); - } - - /** - * validates and builds free list - * - * @throws IOException - */ - final void scanStoredItems() throws IOException{ - if(reader.length()>ROOT_SIZE){ - long offset=ROOT_SIZE; - while((offset+Item.HEAD_SIZE)=0){ - if(!item.isActive()){ - addFreeSpace(item); - } - offset+=item.getSize()+Item.HEAD_SIZE; - }else{ - // we've hit free space or end of file - break; - } - } - dataEnd=offset; - }else { - dataEnd = ROOT_SIZE; - } - } - - private void removeFreeSpace(Item item){ - if(item!=null){ - long next=item.getOffset()+item.getSize()+Item.HEAD_SIZE; - Long nextKey=new Long(next); - prevMap.remove(nextKey); - Long key=new Long(item.getOffset()); - map.remove(key); - } - } - - void dump(PrintWriter printer){ - printer.println("FreeSpace: map size = "+map.size()+", tree size = "+tree.size()+", prevMap size = " - +prevMap.size()); - for(Iterator i=map.entrySet().iterator();i.hasNext();){ - printer.println("map = "+i.next()); - } - } -} +/** + * + * Copyright 2005-2006 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package org.apache.activemq.kaha.impl; + +import java.io.IOException; +import java.io.PrintWriter; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +/** + * Free space list in the Store + * + * @version $Revision: 1.2 $ + */ +final class FreeSpaceManager{ + private static final Log log = LogFactory.getLog(FreeSpaceManager.class); + static final int ROOT_SIZE=64; + static final int RESIZE_INCREMENT=4096*1024; + private Map map=new HashMap(); + private Map prevMap=new HashMap(); + private FreeSpaceTree tree=new FreeSpaceTree(); + private StoreWriter writer; + private StoreReader reader; + private long dataEnd=ROOT_SIZE; + private long fileLength=-1; + + FreeSpaceManager(StoreWriter writer,StoreReader reader) throws IOException{ + this.writer=writer; + this.reader=reader; + this.fileLength=reader.length(); + } + + final Item getFreeSpace(Item item) throws IOException{ + Item result=tree.getNextFreeSpace(item); + if(result==null){ + while(dataEnd>=fileLength){ + writer.allocateSpace(fileLength+RESIZE_INCREMENT); + fileLength=reader.length(); + } + result=new Item(); + result.setOffset(dataEnd); + int newSize = ((item.getSize()/8)+1)*8; + + result.setSize(newSize); + dataEnd=dataEnd+result.getSize()+Item.HEAD_SIZE; + }else{ + removeFreeSpace(result); + } + // reset the item + item.setActive(true); + item.setOffset(result.getOffset()); + item.setSize(result.getSize()); + return item; + } + + final void addFreeSpace(Item item) throws IOException{ + long currentOffset=reader.position(); + reader.readHeader(item); + item.setActive(false); + // see if we can condense some space together + // first look for free space adjacent up the disk + Long nextKey=new Long(item.getOffset()+item.getSize()+Item.HEAD_SIZE); + Item next=(Item) map.remove(nextKey); + if(next!=null){ + tree.removeItem(next); + Long prevKey=new Long(next.getOffset()+next.getSize()+Item.HEAD_SIZE); + prevMap.remove(prevKey); + int newSize=item.getSize()+next.getSize()+Item.HEAD_SIZE; + item.setSize(newSize); + } + // now see if there was a previous item + // in the next map + Long key=new Long(item.getOffset()); + Item prev=(Item) prevMap.remove(key); + Long prevKey=prev!=null?new Long(prev.getOffset()):null; + if(prev!=null&&prevKey!=null){ + // we can condense the free space + // first we are about to change the item so remove it from the tree + tree.removeItem(prev); + int newSize=prev.getSize()+item.getSize()+Item.HEAD_SIZE; + prev.setSize(newSize); + // update the header + writer.updateHeader(prev); + // put back in the tree + tree.addItem(prev); + }else{ + // update the item header + writer.updateHeader(item); + tree.addItem(item); + map.put(key,item); + prevKey=new Long(item.getOffset()+item.getSize()+Item.HEAD_SIZE); + prevMap.put(prevKey,item); + } + reader.position(currentOffset); + } + + /** + * validates and builds free list + * + * @throws IOException + */ + final void scanStoredItems() throws IOException{ + if(reader.length()>ROOT_SIZE){ + long offset=ROOT_SIZE; + while((offset+Item.HEAD_SIZE)=0){ + if(!item.isActive()){ + addFreeSpace(item); + } + offset+=item.getSize()+Item.HEAD_SIZE; + }else{ + // we've hit free space or end of file + break; + } + } + dataEnd=offset; + }else { + dataEnd = ROOT_SIZE; + } + } + + private void removeFreeSpace(Item item){ + if(item!=null){ + long next=item.getOffset()+item.getSize()+Item.HEAD_SIZE; + Long nextKey=new Long(next); + prevMap.remove(nextKey); + Long key=new Long(item.getOffset()); + map.remove(key); + } + } + + void dump(PrintWriter printer){ + printer.println("FreeSpace: map size = "+map.size()+", tree size = "+tree.size()+", prevMap size = " + +prevMap.size()); + for(Iterator i=map.entrySet().iterator();i.hasNext();){ + printer.println("map = "+i.next()); + } + } +} diff --git a/activemq-core/src/main/java/org/apache/activemq/kaha/impl/FreeSpaceTree.java b/activemq-core/src/main/java/org/apache/activemq/kaha/impl/FreeSpaceTree.java index 77e2fed3d2..3b8759117a 100755 --- a/activemq-core/src/main/java/org/apache/activemq/kaha/impl/FreeSpaceTree.java +++ b/activemq-core/src/main/java/org/apache/activemq/kaha/impl/FreeSpaceTree.java @@ -1,109 +1,109 @@ -/** - * - * Copyright 2005-2006 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package org.apache.activemq.kaha.impl; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.SortedMap; -import java.util.TreeMap; -/** - * A a wrapper for a TreeMap of free Items - sorted by size This enables us to re-use free Items on disk - * - * @version $Revision: 1.2 $ - */ -class FreeSpaceTree{ - private Map sizeMap=new HashMap(); - private TreeMap tree=new TreeMap(); - - void addItem(Item item){ - Long sizeKey=new Long(item.getSize()); - Item old=(Item) tree.put(sizeKey,item); - if(old!=null){ - // We'll preserve old items to reuse - List list=(List) sizeMap.get(sizeKey); - if(list==null){ - list=new ArrayList(); - sizeMap.put(sizeKey,list); - } - list.add(old); - } - } - - boolean removeItem(Item item){ - boolean result=false; - Long sizeKey=new Long(item.getSize()); - Item retrieved=(Item) tree.get(sizeKey); - if(retrieved==item){ - Object foo=tree.remove(sizeKey); - if(foo!=retrieved){ - Thread.dumpStack(); - System.exit(0); - } - result=true; - reconfigureTree(sizeKey); - }else{ - List list=(List) sizeMap.get(sizeKey); - if(list!=null){ - boolean foo=list.remove(item); - if(list.isEmpty()){ - sizeMap.remove(sizeKey); - } - } - } - return result; - } - - Item getNextFreeSpace(Item item){ - Item result=null; - if(!tree.isEmpty()){ - Long sizeKey=new Long(item.getSize()); - SortedMap map=tree.tailMap(sizeKey); - if(map!=null&&!map.isEmpty()){ - Long resultKey=(Long) map.firstKey(); - result=(Item) map.get(resultKey); - if(result!=null){ - // remove from the tree - tree.remove(resultKey); - reconfigureTree(resultKey); - } - } - } - return result; - } - - void reconfigureTree(Long sizeKey){ - List list=(List) sizeMap.get(sizeKey); - if(list!=null){ - if(!list.isEmpty()){ - Object newItem=list.remove(list.size()-1); - tree.put(sizeKey,newItem); - } - if(list.isEmpty()){ - sizeMap.remove(sizeKey); - } - } - } - - int size(){ - int result=0; - for(Iterator i=sizeMap.values().iterator();i.hasNext();){ - List list=(List) i.next(); - result+=list.size(); - } - return result+tree.size(); - } +/** + * + * Copyright 2005-2006 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package org.apache.activemq.kaha.impl; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.SortedMap; +import java.util.TreeMap; +/** + * A a wrapper for a TreeMap of free Items - sorted by size This enables us to re-use free Items on disk + * + * @version $Revision: 1.2 $ + */ +class FreeSpaceTree{ + private Map sizeMap=new HashMap(); + private TreeMap tree=new TreeMap(); + + void addItem(Item item){ + Long sizeKey=new Long(item.getSize()); + Item old=(Item) tree.put(sizeKey,item); + if(old!=null){ + // We'll preserve old items to reuse + List list=(List) sizeMap.get(sizeKey); + if(list==null){ + list=new ArrayList(); + sizeMap.put(sizeKey,list); + } + list.add(old); + } + } + + boolean removeItem(Item item){ + boolean result=false; + Long sizeKey=new Long(item.getSize()); + Item retrieved=(Item) tree.get(sizeKey); + if(retrieved==item){ + Object foo=tree.remove(sizeKey); + if(foo!=retrieved){ + Thread.dumpStack(); + System.exit(0); + } + result=true; + reconfigureTree(sizeKey); + }else{ + List list=(List) sizeMap.get(sizeKey); + if(list!=null){ + boolean foo=list.remove(item); + if(list.isEmpty()){ + sizeMap.remove(sizeKey); + } + } + } + return result; + } + + Item getNextFreeSpace(Item item){ + Item result=null; + if(!tree.isEmpty()){ + Long sizeKey=new Long(item.getSize()); + SortedMap map=tree.tailMap(sizeKey); + if(map!=null&&!map.isEmpty()){ + Long resultKey=(Long) map.firstKey(); + result=(Item) map.get(resultKey); + if(result!=null){ + // remove from the tree + tree.remove(resultKey); + reconfigureTree(resultKey); + } + } + } + return result; + } + + void reconfigureTree(Long sizeKey){ + List list=(List) sizeMap.get(sizeKey); + if(list!=null){ + if(!list.isEmpty()){ + Object newItem=list.remove(list.size()-1); + tree.put(sizeKey,newItem); + } + if(list.isEmpty()){ + sizeMap.remove(sizeKey); + } + } + } + + int size(){ + int result=0; + for(Iterator i=sizeMap.values().iterator();i.hasNext();){ + List list=(List) i.next(); + result+=list.size(); + } + return result+tree.size(); + } } \ No newline at end of file diff --git a/activemq-core/src/main/java/org/apache/activemq/kaha/impl/Item.java b/activemq-core/src/main/java/org/apache/activemq/kaha/impl/Item.java index fec1ad55c3..c25a7ce7f9 100755 --- a/activemq-core/src/main/java/org/apache/activemq/kaha/impl/Item.java +++ b/activemq-core/src/main/java/org/apache/activemq/kaha/impl/Item.java @@ -1,116 +1,116 @@ -/** - * - * Copyright 2005-2006 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package org.apache.activemq.kaha.impl; - -import java.io.DataInput; -import java.io.DataInputStream; -import java.io.DataOutput; -import java.io.DataOutputStream; -import java.io.IOException; -import org.apache.activemq.kaha.Marshaller; -/** - * A a wrapper for a data in the store - * - * @version $Revision: 1.2 $ - */ -public class Item{ - static final long POSITION_NOT_SET=-1; - static final short MAGIC=31317; - static final int ACTIVE=22; - static final int FREE=33; - static final int HEAD_SIZE=8; // magic + active + len - static final int LOCATION_SIZE=24; - private long offset=POSITION_NOT_SET; - private int size; - private boolean active; - - Item(){} - - void writeHeader(DataOutput dataOut) throws IOException{ - dataOut.writeShort(MAGIC); - dataOut.writeByte(active?ACTIVE:FREE); - dataOut.writeInt(size); - dataOut.writeByte(0);//padding - } - - void readHeader(DataInput dataIn) throws IOException{ - int magic=dataIn.readShort(); - if(magic==MAGIC){ - active=(dataIn.readByte()==ACTIVE); - size=dataIn.readInt(); - }else if (magic == 0){ - size = -999; //end of data - }else{ - throw new BadMagicException("Unexpected Magic value: "+magic); - } - } - - void writePayload(Marshaller marshaller,Object object,DataOutputStream dataOut) throws IOException{ - marshaller.writePayload(object,dataOut); - } - - Object readPayload(Marshaller marshaller,DataInputStream dataIn) throws IOException{ - return marshaller.readPayload(dataIn); - } - - void readLocation(DataInput dataIn) throws IOException{} - - void writeLocation(DataOutput dataOut) throws IOException{} - - /** - * @return Returns the size. - */ - int getSize(){ - return size; - } - - /** - * @param size - * The size to set. - */ - void setSize(int size){ - this.size=size; - } - - void setOffset(long pos){ - offset=pos; - } - - long getOffset(){ - return offset; - } - - /** - * @return Returns the active. - */ - boolean isActive(){ - return active; - } - - /** - * @param active - * The active to set. - */ - void setActive(boolean active){ - this.active=active; - } - - /** - * @return a pretty print - */ - public String toString(){ - String result="offset = "+offset+" ,active = "+active+" , size = "+size; - return result; - } +/** + * + * Copyright 2005-2006 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package org.apache.activemq.kaha.impl; + +import java.io.DataInput; +import java.io.DataInputStream; +import java.io.DataOutput; +import java.io.DataOutputStream; +import java.io.IOException; +import org.apache.activemq.kaha.Marshaller; +/** + * A a wrapper for a data in the store + * + * @version $Revision: 1.2 $ + */ +public class Item{ + static final long POSITION_NOT_SET=-1; + static final short MAGIC=31317; + static final int ACTIVE=22; + static final int FREE=33; + static final int HEAD_SIZE=8; // magic + active + len + static final int LOCATION_SIZE=24; + private long offset=POSITION_NOT_SET; + private int size; + private boolean active; + + Item(){} + + void writeHeader(DataOutput dataOut) throws IOException{ + dataOut.writeShort(MAGIC); + dataOut.writeByte(active?ACTIVE:FREE); + dataOut.writeInt(size); + dataOut.writeByte(0);//padding + } + + void readHeader(DataInput dataIn) throws IOException{ + int magic=dataIn.readShort(); + if(magic==MAGIC){ + active=(dataIn.readByte()==ACTIVE); + size=dataIn.readInt(); + }else if (magic == 0){ + size = -999; //end of data + }else{ + throw new BadMagicException("Unexpected Magic value: "+magic); + } + } + + void writePayload(Marshaller marshaller,Object object,DataOutputStream dataOut) throws IOException{ + marshaller.writePayload(object,dataOut); + } + + Object readPayload(Marshaller marshaller,DataInputStream dataIn) throws IOException{ + return marshaller.readPayload(dataIn); + } + + void readLocation(DataInput dataIn) throws IOException{} + + void writeLocation(DataOutput dataOut) throws IOException{} + + /** + * @return Returns the size. + */ + int getSize(){ + return size; + } + + /** + * @param size + * The size to set. + */ + void setSize(int size){ + this.size=size; + } + + void setOffset(long pos){ + offset=pos; + } + + long getOffset(){ + return offset; + } + + /** + * @return Returns the active. + */ + boolean isActive(){ + return active; + } + + /** + * @param active + * The active to set. + */ + void setActive(boolean active){ + this.active=active; + } + + /** + * @return a pretty print + */ + public String toString(){ + String result="offset = "+offset+" ,active = "+active+" , size = "+size; + return result; + } } \ No newline at end of file diff --git a/activemq-core/src/main/java/org/apache/activemq/kaha/impl/LocatableItem.java b/activemq-core/src/main/java/org/apache/activemq/kaha/impl/LocatableItem.java index b7163a1069..0f10bb71dc 100755 --- a/activemq-core/src/main/java/org/apache/activemq/kaha/impl/LocatableItem.java +++ b/activemq-core/src/main/java/org/apache/activemq/kaha/impl/LocatableItem.java @@ -1,126 +1,126 @@ -/** - * - * Copyright 2005-2006 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package org.apache.activemq.kaha.impl; - -import java.io.DataInput; -import java.io.DataInputStream; -import java.io.DataOutput; -import java.io.DataOutputStream; -import java.io.Externalizable; -import java.io.IOException; -import java.io.ObjectInput; -import java.io.ObjectOutput; -import org.apache.activemq.kaha.Marshaller; - -/** -* A an Item with a relative postion and location to other Items in the Store -* -* @version $Revision: 1.2 $ -*/ -public final class LocatableItem extends Item implements Externalizable{ - - - private static final long serialVersionUID=-6888731361600185708L; - private long previousItem=POSITION_NOT_SET; - private long nextItem=POSITION_NOT_SET; - private long referenceItem=POSITION_NOT_SET; - - - public LocatableItem(){} - - public LocatableItem(long prev,long next,long objOffset) throws IOException{ - this.previousItem=prev; - this.nextItem=next; - this.referenceItem=objOffset; - } - - - public void writePayload(Marshaller marshaller,Object object,DataOutputStream dataOut) throws IOException{ - dataOut.writeLong(previousItem); - dataOut.writeLong(nextItem); - dataOut.writeLong(referenceItem); - super.writePayload(marshaller,object,dataOut); - } - - public Object readPayload(Marshaller marshaller,DataInputStream dataIn) throws IOException{ - previousItem=dataIn.readLong(); - nextItem=dataIn.readLong(); - referenceItem=dataIn.readLong(); - return super.readPayload(marshaller, dataIn); - } - - void readLocation(DataInput dataIn) throws IOException{ - previousItem=dataIn.readLong(); - nextItem=dataIn.readLong(); - referenceItem=dataIn.readLong(); - } - - public void writeLocation(DataOutput dataOut) throws IOException{ - dataOut.writeLong(previousItem); - dataOut.writeLong(nextItem); - } - - public void setPreviousItem(long newPrevEntry){ - previousItem=newPrevEntry; - } - - public long getPreviousItem(){ - return previousItem; - } - - public void setNextItem(long newNextEntry){ - nextItem=newNextEntry; - } - - public long getNextItem(){ - return nextItem; - } - - public void setReferenceItem(long newObjectOffset){ - referenceItem=newObjectOffset; - } - - public long getReferenceItem(){ - return referenceItem; - } - - /* (non-Javadoc) - * @see org.apache.activemq.kaha.impl.Item#toString() - */ - public String toString(){ - String result=super.toString(); - result+=" , referenceItem = "+referenceItem+", previousItem = "+previousItem+" , nextItem = "+nextItem; - return result; - } - - /* (non-Javadoc) - * @see java.io.Externalizable#writeExternal(java.io.ObjectOutput) - */ - public void writeExternal(ObjectOutput out) throws IOException{ - out.writeLong(previousItem); - out.writeLong(nextItem); - out.writeLong(referenceItem); - - } - - /* (non-Javadoc) - * @see java.io.Externalizable#readExternal(java.io.ObjectInput) - */ - public void readExternal(ObjectInput in) throws IOException,ClassNotFoundException{ - previousItem = in.readLong(); - nextItem = in.readLong(); - referenceItem = in.readLong(); - - } +/** + * + * Copyright 2005-2006 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package org.apache.activemq.kaha.impl; + +import java.io.DataInput; +import java.io.DataInputStream; +import java.io.DataOutput; +import java.io.DataOutputStream; +import java.io.Externalizable; +import java.io.IOException; +import java.io.ObjectInput; +import java.io.ObjectOutput; +import org.apache.activemq.kaha.Marshaller; + +/** +* A an Item with a relative postion and location to other Items in the Store +* +* @version $Revision: 1.2 $ +*/ +public final class LocatableItem extends Item implements Externalizable{ + + + private static final long serialVersionUID=-6888731361600185708L; + private long previousItem=POSITION_NOT_SET; + private long nextItem=POSITION_NOT_SET; + private long referenceItem=POSITION_NOT_SET; + + + public LocatableItem(){} + + public LocatableItem(long prev,long next,long objOffset) throws IOException{ + this.previousItem=prev; + this.nextItem=next; + this.referenceItem=objOffset; + } + + + public void writePayload(Marshaller marshaller,Object object,DataOutputStream dataOut) throws IOException{ + dataOut.writeLong(previousItem); + dataOut.writeLong(nextItem); + dataOut.writeLong(referenceItem); + super.writePayload(marshaller,object,dataOut); + } + + public Object readPayload(Marshaller marshaller,DataInputStream dataIn) throws IOException{ + previousItem=dataIn.readLong(); + nextItem=dataIn.readLong(); + referenceItem=dataIn.readLong(); + return super.readPayload(marshaller, dataIn); + } + + void readLocation(DataInput dataIn) throws IOException{ + previousItem=dataIn.readLong(); + nextItem=dataIn.readLong(); + referenceItem=dataIn.readLong(); + } + + public void writeLocation(DataOutput dataOut) throws IOException{ + dataOut.writeLong(previousItem); + dataOut.writeLong(nextItem); + } + + public void setPreviousItem(long newPrevEntry){ + previousItem=newPrevEntry; + } + + public long getPreviousItem(){ + return previousItem; + } + + public void setNextItem(long newNextEntry){ + nextItem=newNextEntry; + } + + public long getNextItem(){ + return nextItem; + } + + public void setReferenceItem(long newObjectOffset){ + referenceItem=newObjectOffset; + } + + public long getReferenceItem(){ + return referenceItem; + } + + /* (non-Javadoc) + * @see org.apache.activemq.kaha.impl.Item#toString() + */ + public String toString(){ + String result=super.toString(); + result+=" , referenceItem = "+referenceItem+", previousItem = "+previousItem+" , nextItem = "+nextItem; + return result; + } + + /* (non-Javadoc) + * @see java.io.Externalizable#writeExternal(java.io.ObjectOutput) + */ + public void writeExternal(ObjectOutput out) throws IOException{ + out.writeLong(previousItem); + out.writeLong(nextItem); + out.writeLong(referenceItem); + + } + + /* (non-Javadoc) + * @see java.io.Externalizable#readExternal(java.io.ObjectInput) + */ + public void readExternal(ObjectInput in) throws IOException,ClassNotFoundException{ + previousItem = in.readLong(); + nextItem = in.readLong(); + referenceItem = in.readLong(); + + } } \ No newline at end of file diff --git a/activemq-core/src/main/java/org/apache/activemq/kaha/impl/MapContainerImpl.java b/activemq-core/src/main/java/org/apache/activemq/kaha/impl/MapContainerImpl.java index 020b565fb3..4b7b1258cb 100755 --- a/activemq-core/src/main/java/org/apache/activemq/kaha/impl/MapContainerImpl.java +++ b/activemq-core/src/main/java/org/apache/activemq/kaha/impl/MapContainerImpl.java @@ -1,476 +1,476 @@ -/** - * - * Copyright 2005-2006 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package org.apache.activemq.kaha.impl; - -import java.io.IOException; -import java.util.Collection; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.LinkedList; -import java.util.Map; -import java.util.Set; -import org.apache.activemq.kaha.MapContainer; -import org.apache.activemq.kaha.Marshaller; -import org.apache.activemq.kaha.ObjectMarshaller; -import org.apache.activemq.kaha.RuntimeStoreException; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -/** - * Implementation of a MapContainer - * - * @version $Revision: 1.2 $ - */ -public class MapContainerImpl implements MapContainer{ - private static final Log log=LogFactory.getLog(MapContainerImpl.class); - protected StoreImpl store; - protected LocatableItem root; - protected Object id; - protected Map map=new HashMap(); - protected Map valueToKeyMap=new HashMap(); - protected LinkedList list=new LinkedList(); - protected boolean loaded=false; - protected Marshaller keyMarshaller=new ObjectMarshaller(); - protected Marshaller valueMarshaller=new ObjectMarshaller(); - protected final Object mutex=new Object(); - protected boolean closed=false; - - protected MapContainerImpl(Object id,StoreImpl rfs,LocatableItem root) throws IOException{ - this.id=id; - this.store=rfs; - this.root=root; - } - - /* - * (non-Javadoc) - * - * @see org.apache.activemq.kaha.MapContainer#load() - */ - public void load(){ - checkClosed(); - if(!loaded){ - loaded=true; - synchronized(mutex){ - try{ - long start=root.getNextItem(); - if(start!=Item.POSITION_NOT_SET){ - long nextItem=start; - while(nextItem!=Item.POSITION_NOT_SET){ - LocatableItem item=new LocatableItem(); - item.setOffset(nextItem); - Object key=store.readItem(keyMarshaller,item); - map.put(key,item); - valueToKeyMap.put(item,key); - list.add(item); - nextItem=item.getNextItem(); - } - } - }catch(IOException e){ - log.error("Failed to load container "+getId(),e); - throw new RuntimeStoreException(e); - } - } - } - } - - /* - * (non-Javadoc) - * - * @see org.apache.activemq.kaha.MapContainer#unload() - */ - public void unload(){ - checkClosed(); - if(loaded){ - loaded=false; - synchronized(mutex){ - map.clear(); - valueToKeyMap.clear(); - list.clear(); - } - } - } - - public void close(){ - unload(); - closed=true; - } - - public void setKeyMarshaller(Marshaller keyMarshaller){ - checkClosed(); - this.keyMarshaller=keyMarshaller; - } - - public void setValueMarshaller(Marshaller valueMarshaller){ - checkClosed(); - this.valueMarshaller=valueMarshaller; - } - - /* - * (non-Javadoc) - * - * @see org.apache.activemq.kaha.MapContainer#isLoaded() - */ - public boolean isLoaded(){ - checkClosed(); - return loaded; - } - - /* - * (non-Javadoc) - * - * @see org.apache.activemq.kaha.MapContainer#getId() - */ - public Object getId(){ - checkClosed(); - return id; - } - - /* - * (non-Javadoc) - * - * @see org.apache.activemq.kaha.MapContainer#size() - */ - public int size(){ - checkClosed(); - checkLoaded(); - return map.size(); - } - - /* - * (non-Javadoc) - * - * @see org.apache.activemq.kaha.MapContainer#isEmpty() - */ - public boolean isEmpty(){ - checkClosed(); - checkLoaded(); - return map.isEmpty(); - } - - /* - * (non-Javadoc) - * - * @see org.apache.activemq.kaha.MapContainer#containsKey(java.lang.Object) - */ - public boolean containsKey(Object key){ - checkClosed(); - checkLoaded(); - synchronized(mutex){ - return map.containsKey(key); - } - } - - /* - * (non-Javadoc) - * - * @see org.apache.activemq.kaha.MapContainer#get(java.lang.Object) - */ - public Object get(Object key){ - checkClosed(); - checkLoaded(); - Object result=null; - LocatableItem item=null; - synchronized(mutex){ - item=(LocatableItem) map.get(key); - } - if(item!=null){ - result=getValue(item); - } - return result; - } - - /* - * (non-Javadoc) - * - * @see org.apache.activemq.kaha.MapContainer#containsValue(java.lang.Object) - */ - public boolean containsValue(Object o){ - checkClosed(); - checkLoaded(); - boolean result=false; - if(o!=null){ - synchronized(list){ - for(Iterator i=list.iterator();i.hasNext();){ - LocatableItem item=(LocatableItem) i.next(); - Object value=getValue(item); - if(value!=null&&value.equals(o)){ - result=true; - break; - } - } - } - } - return result; - } - - /* - * (non-Javadoc) - * - * @see org.apache.activemq.kaha.MapContainer#putAll(java.util.Map) - */ - public void putAll(Map t){ - checkClosed(); - checkLoaded(); - if(t!=null){ - synchronized(mutex){ - for(Iterator i=t.entrySet().iterator();i.hasNext();){ - Map.Entry entry=(Map.Entry) i.next(); - put(entry.getKey(),entry.getValue()); - } - } - } - } - - /* - * (non-Javadoc) - * - * @see org.apache.activemq.kaha.MapContainer#keySet() - */ - public Set keySet(){ - checkClosed(); - checkLoaded(); - return new ContainerKeySet(this); - } - - /* - * (non-Javadoc) - * - * @see org.apache.activemq.kaha.MapContainer#values() - */ - public Collection values(){ - checkClosed(); - checkLoaded(); - return new ContainerValueCollection(this); - } - - /* - * (non-Javadoc) - * - * @see org.apache.activemq.kaha.MapContainer#entrySet() - */ - public Set entrySet(){ - checkClosed(); - checkLoaded(); - return new ContainerEntrySet(this); - } - - /* - * (non-Javadoc) - * - * @see org.apache.activemq.kaha.MapContainer#put(java.lang.Object, java.lang.Object) - */ - public Object put(Object key,Object value){ - checkClosed(); - checkLoaded(); - Object result=null; - synchronized(mutex){ - if(map.containsKey(key)){ - result=remove(key); - } - LocatableItem item=write(key,value); - map.put(key,item); - valueToKeyMap.put(item,key); - list.add(item); - } - return result; - } - - /* - * (non-Javadoc) - * - * @see org.apache.activemq.kaha.MapContainer#remove(java.lang.Object) - */ - public Object remove(Object key){ - checkClosed(); - checkLoaded(); - Object result=null; - synchronized(mutex){ - LocatableItem item=(LocatableItem) map.get(key); - if(item!=null){ - map.remove(key); - valueToKeyMap.remove(item); - result=getValue(item); - int index=list.indexOf(item); - LocatableItem prev=index>0?(LocatableItem) list.get(index-1):root; - LocatableItem next=index<(list.size()-1)?(LocatableItem) list.get(index+1):null; - list.remove(index); - { - delete(item,prev,next); - } - item=null; - } - } - return result; - } - - public boolean removeValue(Object o){ - checkClosed(); - checkLoaded(); - boolean result=false; - if(o!=null){ - synchronized(list){ - for(Iterator i=list.iterator();i.hasNext();){ - LocatableItem item=(LocatableItem) i.next(); - Object value=getValue(item); - if(value!=null&&value.equals(o)){ - result=true; - // find the key - Object key=valueToKeyMap.get(item); - if(key!=null){ - remove(key); - } - break; - } - } - } - } - return result; - } - - protected void remove(LocatableItem item){ - Object key=valueToKeyMap.get(item); - if(key!=null){ - remove(key); - } - } - - /* - * (non-Javadoc) - * - * @see org.apache.activemq.kaha.MapContainer#clear() - */ - public void clear(){ - checkClosed(); - synchronized(mutex){ - loaded=true; - synchronized(mutex){ - map.clear(); - valueToKeyMap.clear(); - list.clear();// going to re-use this - try{ - long start=root.getNextItem(); - if(start!=Item.POSITION_NOT_SET){ - long nextItem=start; - while(nextItem!=Item.POSITION_NOT_SET){ - LocatableItem item=new LocatableItem(); - item.setOffset(nextItem); - list.add(item); - nextItem=item.getNextItem(); - } - } - root.setNextItem(Item.POSITION_NOT_SET); - store.updateItem(root); - for(int i=0;i0?(LocatableItem) list.get(index-1):root; + LocatableItem next=index<(list.size()-1)?(LocatableItem) list.get(index+1):null; + list.remove(index); + { + delete(item,prev,next); + } + item=null; + } + } + return result; + } + + public boolean removeValue(Object o){ + checkClosed(); + checkLoaded(); + boolean result=false; + if(o!=null){ + synchronized(list){ + for(Iterator i=list.iterator();i.hasNext();){ + LocatableItem item=(LocatableItem) i.next(); + Object value=getValue(item); + if(value!=null&&value.equals(o)){ + result=true; + // find the key + Object key=valueToKeyMap.get(item); + if(key!=null){ + remove(key); + } + break; + } + } + } + } + return result; + } + + protected void remove(LocatableItem item){ + Object key=valueToKeyMap.get(item); + if(key!=null){ + remove(key); + } + } + + /* + * (non-Javadoc) + * + * @see org.apache.activemq.kaha.MapContainer#clear() + */ + public void clear(){ + checkClosed(); + synchronized(mutex){ + loaded=true; + synchronized(mutex){ + map.clear(); + valueToKeyMap.clear(); + list.clear();// going to re-use this + try{ + long start=root.getNextItem(); + if(start!=Item.POSITION_NOT_SET){ + long nextItem=start; + while(nextItem!=Item.POSITION_NOT_SET){ + LocatableItem item=new LocatableItem(); + item.setOffset(nextItem); + list.add(item); + nextItem=item.getNextItem(); + } + } + root.setNextItem(Item.POSITION_NOT_SET); + store.updateItem(root); + for(int i=0;i - /// Exception thrown when the broker returns an error - /// - public class BrokerException : NMSException - { - - private BrokerError brokerError; - - public BrokerException(BrokerError brokerError) : base( - brokerError.ExceptionClass + " : " + brokerError.Message) - { - this.brokerError = brokerError; - } - - public BrokerError BrokerError - { - get { - return brokerError; - } - } - - public virtual string JavaStackTrace - { - get { - return brokerError.StackTrace; - } - } - - } -} - - +/* + * Copyright 2006 The Apache Software Foundation or its licensors, as + * applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +using ActiveMQ.Commands; +using NMS; + +namespace ActiveMQ +{ + + /// + /// Exception thrown when the broker returns an error + /// + public class BrokerException : NMSException + { + + private BrokerError brokerError; + + public BrokerException(BrokerError brokerError) : base( + brokerError.ExceptionClass + " : " + brokerError.Message) + { + this.brokerError = brokerError; + } + + public BrokerError BrokerError + { + get { + return brokerError; + } + } + + public virtual string JavaStackTrace + { + get { + return brokerError.StackTrace; + } + } + + } +} + + diff --git a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/ActiveMQBytesMessage.cs b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/ActiveMQBytesMessage.cs index c9ba218467..e77254e922 100644 --- a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/ActiveMQBytesMessage.cs +++ b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/ActiveMQBytesMessage.cs @@ -1,33 +1,33 @@ -/* - * Copyright 2006 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -using NMS; - - -namespace ActiveMQ.Commands -{ - public class ActiveMQBytesMessage : ActiveMQMessage, IBytesMessage - { - public const byte ID_ActiveMQBytesMessage = 24; - - - public override byte GetDataStructureType() - { - return ID_ActiveMQBytesMessage; - } - } -} - +/* + * Copyright 2006 The Apache Software Foundation or its licensors, as + * applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +using NMS; + + +namespace ActiveMQ.Commands +{ + public class ActiveMQBytesMessage : ActiveMQMessage, IBytesMessage + { + public const byte ID_ActiveMQBytesMessage = 24; + + + public override byte GetDataStructureType() + { + return ID_ActiveMQBytesMessage; + } + } +} + diff --git a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/ActiveMQMapMessage.cs b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/ActiveMQMapMessage.cs index c6309b0071..6901c537c6 100644 --- a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/ActiveMQMapMessage.cs +++ b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/ActiveMQMapMessage.cs @@ -1,65 +1,65 @@ -/* - * Copyright 2006 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -using ActiveMQ.OpenWire; -using NMS; -using System; - - -namespace ActiveMQ.Commands -{ - public class ActiveMQMapMessage : ActiveMQMessage, IMapMessage - { - public const byte ID_ActiveMQMapMessage = 25; - - private PrimitiveMap body; - - - public override byte GetDataStructureType() - { - return ID_ActiveMQMapMessage; - } - - public IPrimitiveMap Body - { - get { - if (body == null) - { - body = PrimitiveMap.Unmarshal(Content); - } - return body; - } - } - - public override void BeforeMarshall(OpenWireFormat wireFormat) - { - if (body == null) - { - Content = null; - } - else - { - Content = body.Marshal(); - } - - Console.WriteLine("BeforeMarshalling, content is: " + Content); - - base.BeforeMarshall(wireFormat); - } - - } -} - +/* + * Copyright 2006 The Apache Software Foundation or its licensors, as + * applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +using ActiveMQ.OpenWire; +using NMS; +using System; + + +namespace ActiveMQ.Commands +{ + public class ActiveMQMapMessage : ActiveMQMessage, IMapMessage + { + public const byte ID_ActiveMQMapMessage = 25; + + private PrimitiveMap body; + + + public override byte GetDataStructureType() + { + return ID_ActiveMQMapMessage; + } + + public IPrimitiveMap Body + { + get { + if (body == null) + { + body = PrimitiveMap.Unmarshal(Content); + } + return body; + } + } + + public override void BeforeMarshall(OpenWireFormat wireFormat) + { + if (body == null) + { + Content = null; + } + else + { + Content = body.Marshal(); + } + + Console.WriteLine("BeforeMarshalling, content is: " + Content); + + base.BeforeMarshall(wireFormat); + } + + } +} + diff --git a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/ActiveMQMessage.cs b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/ActiveMQMessage.cs index 3ff768f198..1fc7eb3ac6 100644 --- a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/ActiveMQMessage.cs +++ b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/ActiveMQMessage.cs @@ -1,295 +1,295 @@ -/* - * Copyright 2006 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -using ActiveMQ.OpenWire; -using NMS; - - -namespace ActiveMQ.Commands -{ - public delegate void AcknowledgeHandler(ActiveMQMessage message); -} - -namespace ActiveMQ.Commands -{ - public class ActiveMQMessage : Message, IMessage, MarshallAware - { - public const byte ID_ActiveMQMessage = 23; - - protected static MessagePropertyHelper propertyHelper = new MessagePropertyHelper(); - - private PrimitiveMap properties; - - public event AcknowledgeHandler Acknowledger; - - public static ActiveMQMessage Transform(IMessage message) - { - return (ActiveMQMessage) message; - } - - // TODO generate Equals method - // TODO generate GetHashCode method - - - public override byte GetDataStructureType() - { - return ID_ActiveMQMessage; - } - - public void Acknowledge() - { - if (Acknowledger == null) - { - throw new NMSException("No Acknowledger has been associated with this message: " + this); - } - else - { - Acknowledger(this); - } - } - - - // Properties - - public IPrimitiveMap Properties - { - get { - if (properties == null) - { - properties = PrimitiveMap.Unmarshal(MarshalledProperties); - } - return properties; - } - } - - public IDestination FromDestination - { - get { return Destination; } - set { this.Destination = ActiveMQDestination.Transform(value); } - } - - - // IMessage interface - - // JMS headers - - /// - /// The correlation ID used to correlate messages with conversations or long running business processes - /// - public string NMSCorrelationID - { - get { - return CorrelationId; - } - set { - CorrelationId = value; - } - } - - /// - /// The destination of the message - /// - public IDestination NMSDestination - { - get { - return OriginalDestination; - } - } - - /// - /// The time in milliseconds that this message should expire in - /// - public long NMSExpiration - { - get { - return Expiration; - } - set { - Expiration = value; - } - } - - /// - /// The message ID which is set by the provider - /// - public string NMSMessageId - { - get { - return BaseDataStreamMarshaller.ToString(MessageId); - } - } - - /// - /// Whether or not this message is persistent - /// - public bool NMSPersistent - { - get { - return Persistent; - } - set { - Persistent = value; - } - } - - /// - /// The Priority on this message - /// - public byte NMSPriority - { - get { - return Priority; - } - set { - Priority = value; - } - } - - /// - /// Returns true if this message has been redelivered to this or another consumer before being acknowledged successfully. - /// - public bool NMSRedelivered - { - get { - return RedeliveryCounter > 0; - } - } - - - /// - /// The destination that the consumer of this message should send replies to - /// - public IDestination NMSReplyTo - { - get { - return ReplyTo; - } - set { - ReplyTo = ActiveMQDestination.Transform(value); - } - } - - - /// - /// The timestamp the broker added to the message - /// - public long NMSTimestamp - { - get { - return Timestamp; - } - } - - /// - /// The type name of this message - /// - public string NMSType - { - get { - return Type; - } - set { - Type = value; - } - } - - - // JMS Extension headers - - /// - /// Returns the number of times this message has been redelivered to other consumers without being acknowledged successfully. - /// - public int JMSXDeliveryCount - { - get { - return RedeliveryCounter + 1; - } - } - - - /// - /// The Message Group ID used to group messages together to the same consumer for the same group ID value - /// - public string JMSXGroupID - { - get { - return GroupID; - } - set { - GroupID = value; - } - } - /// - /// The Message Group Sequence counter to indicate the position in a group - /// - public int JMSXGroupSeq - { - get { - return GroupSequence; - } - set { - GroupSequence = value; - } - } - - /// - /// Returns the ID of the producers transaction - /// - public string JMSXProducerTXID - { - get { - TransactionId txnId = OriginalTransactionId; - if (txnId == null) - { - txnId = TransactionId; - } - if (txnId != null) - { - return BaseDataStreamMarshaller.ToString(txnId); - } - return null; - } - } - - public object GetObjectProperty(string name) - { - return propertyHelper.GetObjectProperty(this, name); - } - - public void SetObjectProperty(string name, object value) - { - propertyHelper.SetObjectProperty(this, name, value); - } - - // MarshallAware interface - public override bool IsMarshallAware() - { - return true; - } - - public override void BeforeMarshall(OpenWireFormat wireFormat) - { - MarshalledProperties = null; - if (properties != null) - { - MarshalledProperties = properties.Marshal(); - } - } - - - } -} - +/* + * Copyright 2006 The Apache Software Foundation or its licensors, as + * applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +using ActiveMQ.OpenWire; +using NMS; + + +namespace ActiveMQ.Commands +{ + public delegate void AcknowledgeHandler(ActiveMQMessage message); +} + +namespace ActiveMQ.Commands +{ + public class ActiveMQMessage : Message, IMessage, MarshallAware + { + public const byte ID_ActiveMQMessage = 23; + + protected static MessagePropertyHelper propertyHelper = new MessagePropertyHelper(); + + private PrimitiveMap properties; + + public event AcknowledgeHandler Acknowledger; + + public static ActiveMQMessage Transform(IMessage message) + { + return (ActiveMQMessage) message; + } + + // TODO generate Equals method + // TODO generate GetHashCode method + + + public override byte GetDataStructureType() + { + return ID_ActiveMQMessage; + } + + public void Acknowledge() + { + if (Acknowledger == null) + { + throw new NMSException("No Acknowledger has been associated with this message: " + this); + } + else + { + Acknowledger(this); + } + } + + + // Properties + + public IPrimitiveMap Properties + { + get { + if (properties == null) + { + properties = PrimitiveMap.Unmarshal(MarshalledProperties); + } + return properties; + } + } + + public IDestination FromDestination + { + get { return Destination; } + set { this.Destination = ActiveMQDestination.Transform(value); } + } + + + // IMessage interface + + // JMS headers + + /// + /// The correlation ID used to correlate messages with conversations or long running business processes + /// + public string NMSCorrelationID + { + get { + return CorrelationId; + } + set { + CorrelationId = value; + } + } + + /// + /// The destination of the message + /// + public IDestination NMSDestination + { + get { + return OriginalDestination; + } + } + + /// + /// The time in milliseconds that this message should expire in + /// + public long NMSExpiration + { + get { + return Expiration; + } + set { + Expiration = value; + } + } + + /// + /// The message ID which is set by the provider + /// + public string NMSMessageId + { + get { + return BaseDataStreamMarshaller.ToString(MessageId); + } + } + + /// + /// Whether or not this message is persistent + /// + public bool NMSPersistent + { + get { + return Persistent; + } + set { + Persistent = value; + } + } + + /// + /// The Priority on this message + /// + public byte NMSPriority + { + get { + return Priority; + } + set { + Priority = value; + } + } + + /// + /// Returns true if this message has been redelivered to this or another consumer before being acknowledged successfully. + /// + public bool NMSRedelivered + { + get { + return RedeliveryCounter > 0; + } + } + + + /// + /// The destination that the consumer of this message should send replies to + /// + public IDestination NMSReplyTo + { + get { + return ReplyTo; + } + set { + ReplyTo = ActiveMQDestination.Transform(value); + } + } + + + /// + /// The timestamp the broker added to the message + /// + public long NMSTimestamp + { + get { + return Timestamp; + } + } + + /// + /// The type name of this message + /// + public string NMSType + { + get { + return Type; + } + set { + Type = value; + } + } + + + // JMS Extension headers + + /// + /// Returns the number of times this message has been redelivered to other consumers without being acknowledged successfully. + /// + public int JMSXDeliveryCount + { + get { + return RedeliveryCounter + 1; + } + } + + + /// + /// The Message Group ID used to group messages together to the same consumer for the same group ID value + /// + public string JMSXGroupID + { + get { + return GroupID; + } + set { + GroupID = value; + } + } + /// + /// The Message Group Sequence counter to indicate the position in a group + /// + public int JMSXGroupSeq + { + get { + return GroupSequence; + } + set { + GroupSequence = value; + } + } + + /// + /// Returns the ID of the producers transaction + /// + public string JMSXProducerTXID + { + get { + TransactionId txnId = OriginalTransactionId; + if (txnId == null) + { + txnId = TransactionId; + } + if (txnId != null) + { + return BaseDataStreamMarshaller.ToString(txnId); + } + return null; + } + } + + public object GetObjectProperty(string name) + { + return propertyHelper.GetObjectProperty(this, name); + } + + public void SetObjectProperty(string name, object value) + { + propertyHelper.SetObjectProperty(this, name, value); + } + + // MarshallAware interface + public override bool IsMarshallAware() + { + return true; + } + + public override void BeforeMarshall(OpenWireFormat wireFormat) + { + MarshalledProperties = null; + if (properties != null) + { + MarshalledProperties = properties.Marshal(); + } + } + + + } +} + diff --git a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/ActiveMQObjectMessage.cs b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/ActiveMQObjectMessage.cs index 25d32eaf14..451eaea368 100644 --- a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/ActiveMQObjectMessage.cs +++ b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/ActiveMQObjectMessage.cs @@ -1,55 +1,55 @@ -/* -* Copyright 2006 The Apache Software Foundation or its licensors, as -* applicable. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -using System; -using System.Collections; - -using ActiveMQ.OpenWire; -using ActiveMQ.Commands; - -namespace ActiveMQ.Commands -{ - // - // Marshalling code for Open Wire Format for ActiveMQObjectMessage - // - // - // NOTE!: This file is autogenerated - do not modify! - // if you need to make a change, please see the Groovy scripts in the - // activemq-core module - // - public class ActiveMQObjectMessage : ActiveMQMessage - { - public const byte ID_ActiveMQObjectMessage = 26; - - - public override string ToString() { - return GetType().Name + "[" - + " ]"; - - } - - - - public override byte GetDataStructureType() { - return ID_ActiveMQObjectMessage; - } - - - // Properties - - } -} +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +using System; +using System.Collections; + +using ActiveMQ.OpenWire; +using ActiveMQ.Commands; + +namespace ActiveMQ.Commands +{ + // + // Marshalling code for Open Wire Format for ActiveMQObjectMessage + // + // + // NOTE!: This file is autogenerated - do not modify! + // if you need to make a change, please see the Groovy scripts in the + // activemq-core module + // + public class ActiveMQObjectMessage : ActiveMQMessage + { + public const byte ID_ActiveMQObjectMessage = 26; + + + public override string ToString() { + return GetType().Name + "[" + + " ]"; + + } + + + + public override byte GetDataStructureType() { + return ID_ActiveMQObjectMessage; + } + + + // Properties + + } +} diff --git a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/ActiveMQStreamMessage.cs b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/ActiveMQStreamMessage.cs index 9efcd481cb..413834f858 100644 --- a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/ActiveMQStreamMessage.cs +++ b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/ActiveMQStreamMessage.cs @@ -1,44 +1,44 @@ -/* - * Copyright 2006 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -using ActiveMQ.Commands; - - -namespace ActiveMQ.Commands -{ - public class ActiveMQStreamMessage : ActiveMQMessage - { - public const byte ID_ActiveMQStreamMessage = 27; - - - - - // TODO generate Equals method - // TODO generate GetHashCode method - // TODO generate ToString method - - - public override byte GetDataStructureType() - { - return ID_ActiveMQStreamMessage; - } - - - // Properties - - } -} - +/* + * Copyright 2006 The Apache Software Foundation or its licensors, as + * applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +using ActiveMQ.Commands; + + +namespace ActiveMQ.Commands +{ + public class ActiveMQStreamMessage : ActiveMQMessage + { + public const byte ID_ActiveMQStreamMessage = 27; + + + + + // TODO generate Equals method + // TODO generate GetHashCode method + // TODO generate ToString method + + + public override byte GetDataStructureType() + { + return ID_ActiveMQStreamMessage; + } + + + // Properties + + } +} + diff --git a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/ActiveMQTextMessage.cs b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/ActiveMQTextMessage.cs index fc3de8f240..0ed085706c 100644 --- a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/ActiveMQTextMessage.cs +++ b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/ActiveMQTextMessage.cs @@ -1,93 +1,93 @@ -/* - * Copyright 2006 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -using NMS; -using System; - - -namespace ActiveMQ.Commands -{ - public class ActiveMQTextMessage : ActiveMQMessage, ITextMessage - { - public const byte ID_ActiveMQTextMessage = 28; - - private String text; - - public ActiveMQTextMessage() - { - } - - public ActiveMQTextMessage(String text) - { - this.Text = text; - } - - // TODO generate Equals method - // TODO generate GetHashCode method - // TODO generate ToString method - - - public override byte GetDataStructureType() - { - return ID_ActiveMQTextMessage; - } - - - // Properties - - public string Text - { - get { - if (text == null) - { - // now lets read the content - - byte[] data = this.Content; - if (data != null) - { - // TODO assume that the text is ASCII - char[] chars = new char[data.Length]; - for (int i = 0; i < chars.Length; i++) - { - chars[i] = (char) data[i]; - } - text = new String(chars); - } - } - return text; - } - - set { - this.text = value; - byte[] data = null; - if (text != null) - { - // TODO assume that the text is ASCII - data = new byte[text.Length]; - - // now lets write the bytes - char[] chars = text.ToCharArray(); - for (int i = 0; i < chars.Length; i++) - { - data[i] = (byte) chars[i]; - } - } - this.Content = data; - } - } - } -} - +/* + * Copyright 2006 The Apache Software Foundation or its licensors, as + * applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +using NMS; +using System; + + +namespace ActiveMQ.Commands +{ + public class ActiveMQTextMessage : ActiveMQMessage, ITextMessage + { + public const byte ID_ActiveMQTextMessage = 28; + + private String text; + + public ActiveMQTextMessage() + { + } + + public ActiveMQTextMessage(String text) + { + this.Text = text; + } + + // TODO generate Equals method + // TODO generate GetHashCode method + // TODO generate ToString method + + + public override byte GetDataStructureType() + { + return ID_ActiveMQTextMessage; + } + + + // Properties + + public string Text + { + get { + if (text == null) + { + // now lets read the content + + byte[] data = this.Content; + if (data != null) + { + // TODO assume that the text is ASCII + char[] chars = new char[data.Length]; + for (int i = 0; i < chars.Length; i++) + { + chars[i] = (char) data[i]; + } + text = new String(chars); + } + } + return text; + } + + set { + this.text = value; + byte[] data = null; + if (text != null) + { + // TODO assume that the text is ASCII + data = new byte[text.Length]; + + // now lets write the bytes + char[] chars = text.ToCharArray(); + for (int i = 0; i < chars.Length; i++) + { + data[i] = (byte) chars[i]; + } + } + this.Content = data; + } + } + } +} + diff --git a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/BrokerId.cs b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/BrokerId.cs index 8d4052b78b..d5f4d17d56 100644 --- a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/BrokerId.cs +++ b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/BrokerId.cs @@ -1 +1,86 @@ -/* * Copyright 2006 The Apache Software Foundation or its licensors, as * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // // NOTE!: This file is autogenerated - do not modify! // if you need to make a change, please see the Groovy scripts in the // activemq-core module // using System; using System.Collections; using ActiveMQ.OpenWire; using ActiveMQ.Commands; namespace ActiveMQ.Commands { /// /// The ActiveMQ BrokerId Command /// public class BrokerId : BaseDataStructure, DataStructure { public const byte ID_BrokerId = 124; string value; public override int GetHashCode() { int answer = 0; answer = (answer * 37) + HashCode(Value); return answer; } public override bool Equals(object that) { if (that is BrokerId) { return Equals((BrokerId) that); } return false; } public virtual bool Equals(BrokerId that) { if (! Equals(this.Value, that.Value)) return false; return true; } public override string ToString() { return GetType().Name + "[" + " Value=" + Value + " ]"; } public override byte GetDataStructureType() { return ID_BrokerId; } // Properties public string Value { get { return value; } set { this.value = value; } } } } \ No newline at end of file +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// +// NOTE!: This file is autogenerated - do not modify! +// if you need to make a change, please see the Groovy scripts in the +// activemq-core module +// + +using System; +using System.Collections; + +using ActiveMQ.OpenWire; +using ActiveMQ.Commands; + +namespace ActiveMQ.Commands +{ + /// + /// The ActiveMQ BrokerId Command + /// + public class BrokerId : BaseDataStructure, DataStructure + { + public const byte ID_BrokerId = 124; + + string value; + + public override int GetHashCode() { + int answer = 0; + answer = (answer * 37) + HashCode(Value); + return answer; + + } + + + public override bool Equals(object that) { + if (that is BrokerId) { + return Equals((BrokerId) that); + } + return false; + } + + public virtual bool Equals(BrokerId that) { + if (! Equals(this.Value, that.Value)) return false; + return true; + + } + + + public override string ToString() { + return GetType().Name + "[" + + " Value=" + Value + + " ]"; + + } + + + + public override byte GetDataStructureType() { + return ID_BrokerId; + } + + + // Properties + + public string Value + { + get { return value; } + set { this.value = value; } + } + + } +} diff --git a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/BrokerInfo.cs b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/BrokerInfo.cs index 7db9f8ee51..d9ba67b425 100644 --- a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/BrokerInfo.cs +++ b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/BrokerInfo.cs @@ -1 +1,96 @@ -/* * Copyright 2006 The Apache Software Foundation or its licensors, as * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // // NOTE!: This file is autogenerated - do not modify! // if you need to make a change, please see the Groovy scripts in the // activemq-core module // using System; using System.Collections; using ActiveMQ.OpenWire; using ActiveMQ.Commands; namespace ActiveMQ.Commands { /// /// The ActiveMQ BrokerInfo Command /// public class BrokerInfo : BaseCommand { public const byte ID_BrokerInfo = 2; BrokerId brokerId; string brokerURL; BrokerInfo[] peerBrokerInfos; string brokerName; bool slaveBroker; public override string ToString() { return GetType().Name + "[" + " BrokerId=" + BrokerId + " BrokerURL=" + BrokerURL + " PeerBrokerInfos=" + PeerBrokerInfos + " BrokerName=" + BrokerName + " SlaveBroker=" + SlaveBroker + " ]"; } public override byte GetDataStructureType() { return ID_BrokerInfo; } // Properties public BrokerId BrokerId { get { return brokerId; } set { this.brokerId = value; } } public string BrokerURL { get { return brokerURL; } set { this.brokerURL = value; } } public BrokerInfo[] PeerBrokerInfos { get { return peerBrokerInfos; } set { this.peerBrokerInfos = value; } } public string BrokerName { get { return brokerName; } set { this.brokerName = value; } } public bool SlaveBroker { get { return slaveBroker; } set { this.slaveBroker = value; } } } } \ No newline at end of file +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// +// NOTE!: This file is autogenerated - do not modify! +// if you need to make a change, please see the Groovy scripts in the +// activemq-core module +// + +using System; +using System.Collections; + +using ActiveMQ.OpenWire; +using ActiveMQ.Commands; + +namespace ActiveMQ.Commands +{ + /// + /// The ActiveMQ BrokerInfo Command + /// + public class BrokerInfo : BaseCommand + { + public const byte ID_BrokerInfo = 2; + + BrokerId brokerId; + string brokerURL; + BrokerInfo[] peerBrokerInfos; + string brokerName; + bool slaveBroker; + + public override string ToString() { + return GetType().Name + "[" + + " BrokerId=" + BrokerId + + " BrokerURL=" + BrokerURL + + " PeerBrokerInfos=" + PeerBrokerInfos + + " BrokerName=" + BrokerName + + " SlaveBroker=" + SlaveBroker + + " ]"; + + } + + + + public override byte GetDataStructureType() { + return ID_BrokerInfo; + } + + + // Properties + + public BrokerId BrokerId + { + get { return brokerId; } + set { this.brokerId = value; } + } + + public string BrokerURL + { + get { return brokerURL; } + set { this.brokerURL = value; } + } + + public BrokerInfo[] PeerBrokerInfos + { + get { return peerBrokerInfos; } + set { this.peerBrokerInfos = value; } + } + + public string BrokerName + { + get { return brokerName; } + set { this.brokerName = value; } + } + + public bool SlaveBroker + { + get { return slaveBroker; } + set { this.slaveBroker = value; } + } + + } +} diff --git a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/ConnectionError.cs b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/ConnectionError.cs index 36a097045c..569d637def 100644 --- a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/ConnectionError.cs +++ b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/ConnectionError.cs @@ -1 +1,72 @@ -/* * Copyright 2006 The Apache Software Foundation or its licensors, as * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // // NOTE!: This file is autogenerated - do not modify! // if you need to make a change, please see the Groovy scripts in the // activemq-core module // using System; using System.Collections; using ActiveMQ.OpenWire; using ActiveMQ.Commands; namespace ActiveMQ.Commands { /// /// The ActiveMQ ConnectionError Command /// public class ConnectionError : BaseCommand { public const byte ID_ConnectionError = 16; BrokerError exception; ConnectionId connectionId; public override string ToString() { return GetType().Name + "[" + " Exception=" + Exception + " ConnectionId=" + ConnectionId + " ]"; } public override byte GetDataStructureType() { return ID_ConnectionError; } // Properties public BrokerError Exception { get { return exception; } set { this.exception = value; } } public ConnectionId ConnectionId { get { return connectionId; } set { this.connectionId = value; } } } } \ No newline at end of file +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// +// NOTE!: This file is autogenerated - do not modify! +// if you need to make a change, please see the Groovy scripts in the +// activemq-core module +// + +using System; +using System.Collections; + +using ActiveMQ.OpenWire; +using ActiveMQ.Commands; + +namespace ActiveMQ.Commands +{ + /// + /// The ActiveMQ ConnectionError Command + /// + public class ConnectionError : BaseCommand + { + public const byte ID_ConnectionError = 16; + + BrokerError exception; + ConnectionId connectionId; + + public override string ToString() { + return GetType().Name + "[" + + " Exception=" + Exception + + " ConnectionId=" + ConnectionId + + " ]"; + + } + + + + public override byte GetDataStructureType() { + return ID_ConnectionError; + } + + + // Properties + + public BrokerError Exception + { + get { return exception; } + set { this.exception = value; } + } + + public ConnectionId ConnectionId + { + get { return connectionId; } + set { this.connectionId = value; } + } + + } +} diff --git a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/ConnectionId.cs b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/ConnectionId.cs index cd7455e23e..b91eee7b62 100644 --- a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/ConnectionId.cs +++ b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/ConnectionId.cs @@ -1 +1,86 @@ -/* * Copyright 2006 The Apache Software Foundation or its licensors, as * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // // NOTE!: This file is autogenerated - do not modify! // if you need to make a change, please see the Groovy scripts in the // activemq-core module // using System; using System.Collections; using ActiveMQ.OpenWire; using ActiveMQ.Commands; namespace ActiveMQ.Commands { /// /// The ActiveMQ ConnectionId Command /// public class ConnectionId : BaseDataStructure, DataStructure { public const byte ID_ConnectionId = 120; string value; public override int GetHashCode() { int answer = 0; answer = (answer * 37) + HashCode(Value); return answer; } public override bool Equals(object that) { if (that is ConnectionId) { return Equals((ConnectionId) that); } return false; } public virtual bool Equals(ConnectionId that) { if (! Equals(this.Value, that.Value)) return false; return true; } public override string ToString() { return GetType().Name + "[" + " Value=" + Value + " ]"; } public override byte GetDataStructureType() { return ID_ConnectionId; } // Properties public string Value { get { return value; } set { this.value = value; } } } } \ No newline at end of file +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// +// NOTE!: This file is autogenerated - do not modify! +// if you need to make a change, please see the Groovy scripts in the +// activemq-core module +// + +using System; +using System.Collections; + +using ActiveMQ.OpenWire; +using ActiveMQ.Commands; + +namespace ActiveMQ.Commands +{ + /// + /// The ActiveMQ ConnectionId Command + /// + public class ConnectionId : BaseDataStructure, DataStructure + { + public const byte ID_ConnectionId = 120; + + string value; + + public override int GetHashCode() { + int answer = 0; + answer = (answer * 37) + HashCode(Value); + return answer; + + } + + + public override bool Equals(object that) { + if (that is ConnectionId) { + return Equals((ConnectionId) that); + } + return false; + } + + public virtual bool Equals(ConnectionId that) { + if (! Equals(this.Value, that.Value)) return false; + return true; + + } + + + public override string ToString() { + return GetType().Name + "[" + + " Value=" + Value + + " ]"; + + } + + + + public override byte GetDataStructureType() { + return ID_ConnectionId; + } + + + // Properties + + public string Value + { + get { return value; } + set { this.value = value; } + } + + } +} diff --git a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/ConnectionInfo.cs b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/ConnectionInfo.cs index 95c510762f..9c2a3a4c3b 100644 --- a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/ConnectionInfo.cs +++ b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/ConnectionInfo.cs @@ -1 +1,96 @@ -/* * Copyright 2006 The Apache Software Foundation or its licensors, as * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // // NOTE!: This file is autogenerated - do not modify! // if you need to make a change, please see the Groovy scripts in the // activemq-core module // using System; using System.Collections; using ActiveMQ.OpenWire; using ActiveMQ.Commands; namespace ActiveMQ.Commands { /// /// The ActiveMQ ConnectionInfo Command /// public class ConnectionInfo : BaseCommand { public const byte ID_ConnectionInfo = 3; ConnectionId connectionId; string clientId; string password; string userName; BrokerId[] brokerPath; public override string ToString() { return GetType().Name + "[" + " ConnectionId=" + ConnectionId + " ClientId=" + ClientId + " Password=" + Password + " UserName=" + UserName + " BrokerPath=" + BrokerPath + " ]"; } public override byte GetDataStructureType() { return ID_ConnectionInfo; } // Properties public ConnectionId ConnectionId { get { return connectionId; } set { this.connectionId = value; } } public string ClientId { get { return clientId; } set { this.clientId = value; } } public string Password { get { return password; } set { this.password = value; } } public string UserName { get { return userName; } set { this.userName = value; } } public BrokerId[] BrokerPath { get { return brokerPath; } set { this.brokerPath = value; } } } } \ No newline at end of file +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// +// NOTE!: This file is autogenerated - do not modify! +// if you need to make a change, please see the Groovy scripts in the +// activemq-core module +// + +using System; +using System.Collections; + +using ActiveMQ.OpenWire; +using ActiveMQ.Commands; + +namespace ActiveMQ.Commands +{ + /// + /// The ActiveMQ ConnectionInfo Command + /// + public class ConnectionInfo : BaseCommand + { + public const byte ID_ConnectionInfo = 3; + + ConnectionId connectionId; + string clientId; + string password; + string userName; + BrokerId[] brokerPath; + + public override string ToString() { + return GetType().Name + "[" + + " ConnectionId=" + ConnectionId + + " ClientId=" + ClientId + + " Password=" + Password + + " UserName=" + UserName + + " BrokerPath=" + BrokerPath + + " ]"; + + } + + + + public override byte GetDataStructureType() { + return ID_ConnectionInfo; + } + + + // Properties + + public ConnectionId ConnectionId + { + get { return connectionId; } + set { this.connectionId = value; } + } + + public string ClientId + { + get { return clientId; } + set { this.clientId = value; } + } + + public string Password + { + get { return password; } + set { this.password = value; } + } + + public string UserName + { + get { return userName; } + set { this.userName = value; } + } + + public BrokerId[] BrokerPath + { + get { return brokerPath; } + set { this.brokerPath = value; } + } + + } +} diff --git a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/ConsumerId.cs b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/ConsumerId.cs index 746b37c9d7..b550ca8d35 100644 --- a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/ConsumerId.cs +++ b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/ConsumerId.cs @@ -1 +1,106 @@ -/* * Copyright 2006 The Apache Software Foundation or its licensors, as * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // // NOTE!: This file is autogenerated - do not modify! // if you need to make a change, please see the Groovy scripts in the // activemq-core module // using System; using System.Collections; using ActiveMQ.OpenWire; using ActiveMQ.Commands; namespace ActiveMQ.Commands { /// /// The ActiveMQ ConsumerId Command /// public class ConsumerId : BaseDataStructure, DataStructure { public const byte ID_ConsumerId = 122; string connectionId; long sessionId; long value; public override int GetHashCode() { int answer = 0; answer = (answer * 37) + HashCode(ConnectionId); answer = (answer * 37) + HashCode(SessionId); answer = (answer * 37) + HashCode(Value); return answer; } public override bool Equals(object that) { if (that is ConsumerId) { return Equals((ConsumerId) that); } return false; } public virtual bool Equals(ConsumerId that) { if (! Equals(this.ConnectionId, that.ConnectionId)) return false; if (! Equals(this.SessionId, that.SessionId)) return false; if (! Equals(this.Value, that.Value)) return false; return true; } public override string ToString() { return GetType().Name + "[" + " ConnectionId=" + ConnectionId + " SessionId=" + SessionId + " Value=" + Value + " ]"; } public override byte GetDataStructureType() { return ID_ConsumerId; } // Properties public string ConnectionId { get { return connectionId; } set { this.connectionId = value; } } public long SessionId { get { return sessionId; } set { this.sessionId = value; } } public long Value { get { return value; } set { this.value = value; } } } } \ No newline at end of file +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// +// NOTE!: This file is autogenerated - do not modify! +// if you need to make a change, please see the Groovy scripts in the +// activemq-core module +// + +using System; +using System.Collections; + +using ActiveMQ.OpenWire; +using ActiveMQ.Commands; + +namespace ActiveMQ.Commands +{ + /// + /// The ActiveMQ ConsumerId Command + /// + public class ConsumerId : BaseDataStructure, DataStructure + { + public const byte ID_ConsumerId = 122; + + string connectionId; + long sessionId; + long value; + + public override int GetHashCode() { + int answer = 0; + answer = (answer * 37) + HashCode(ConnectionId); + answer = (answer * 37) + HashCode(SessionId); + answer = (answer * 37) + HashCode(Value); + return answer; + + } + + + public override bool Equals(object that) { + if (that is ConsumerId) { + return Equals((ConsumerId) that); + } + return false; + } + + public virtual bool Equals(ConsumerId that) { + if (! Equals(this.ConnectionId, that.ConnectionId)) return false; + if (! Equals(this.SessionId, that.SessionId)) return false; + if (! Equals(this.Value, that.Value)) return false; + return true; + + } + + + public override string ToString() { + return GetType().Name + "[" + + " ConnectionId=" + ConnectionId + + " SessionId=" + SessionId + + " Value=" + Value + + " ]"; + + } + + + + public override byte GetDataStructureType() { + return ID_ConsumerId; + } + + + // Properties + + public string ConnectionId + { + get { return connectionId; } + set { this.connectionId = value; } + } + + public long SessionId + { + get { return sessionId; } + set { this.sessionId = value; } + } + + public long Value + { + get { return value; } + set { this.value = value; } + } + + } +} diff --git a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/ConsumerInfo.cs b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/ConsumerInfo.cs index 4eb56e7ff9..c1a06a977c 100644 --- a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/ConsumerInfo.cs +++ b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/ConsumerInfo.cs @@ -1 +1,176 @@ -/* * Copyright 2006 The Apache Software Foundation or its licensors, as * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // // NOTE!: This file is autogenerated - do not modify! // if you need to make a change, please see the Groovy scripts in the // activemq-core module // using System; using System.Collections; using ActiveMQ.OpenWire; using ActiveMQ.Commands; namespace ActiveMQ.Commands { /// /// The ActiveMQ ConsumerInfo Command /// public class ConsumerInfo : BaseCommand { public const byte ID_ConsumerInfo = 5; ConsumerId consumerId; bool browser; ActiveMQDestination destination; int prefetchSize; int maximumPendingMessageLimit; bool dispatchAsync; string selector; string subcriptionName; bool noLocal; bool exclusive; bool retroactive; byte priority; BrokerId[] brokerPath; BooleanExpression additionalPredicate; bool networkSubscription; public override string ToString() { return GetType().Name + "[" + " ConsumerId=" + ConsumerId + " Browser=" + Browser + " Destination=" + Destination + " PrefetchSize=" + PrefetchSize + " MaximumPendingMessageLimit=" + MaximumPendingMessageLimit + " DispatchAsync=" + DispatchAsync + " Selector=" + Selector + " SubcriptionName=" + SubcriptionName + " NoLocal=" + NoLocal + " Exclusive=" + Exclusive + " Retroactive=" + Retroactive + " Priority=" + Priority + " BrokerPath=" + BrokerPath + " AdditionalPredicate=" + AdditionalPredicate + " NetworkSubscription=" + NetworkSubscription + " ]"; } public override byte GetDataStructureType() { return ID_ConsumerInfo; } // Properties public ConsumerId ConsumerId { get { return consumerId; } set { this.consumerId = value; } } public bool Browser { get { return browser; } set { this.browser = value; } } public ActiveMQDestination Destination { get { return destination; } set { this.destination = value; } } public int PrefetchSize { get { return prefetchSize; } set { this.prefetchSize = value; } } public int MaximumPendingMessageLimit { get { return maximumPendingMessageLimit; } set { this.maximumPendingMessageLimit = value; } } public bool DispatchAsync { get { return dispatchAsync; } set { this.dispatchAsync = value; } } public string Selector { get { return selector; } set { this.selector = value; } } public string SubcriptionName { get { return subcriptionName; } set { this.subcriptionName = value; } } public bool NoLocal { get { return noLocal; } set { this.noLocal = value; } } public bool Exclusive { get { return exclusive; } set { this.exclusive = value; } } public bool Retroactive { get { return retroactive; } set { this.retroactive = value; } } public byte Priority { get { return priority; } set { this.priority = value; } } public BrokerId[] BrokerPath { get { return brokerPath; } set { this.brokerPath = value; } } public BooleanExpression AdditionalPredicate { get { return additionalPredicate; } set { this.additionalPredicate = value; } } public bool NetworkSubscription { get { return networkSubscription; } set { this.networkSubscription = value; } } } } \ No newline at end of file +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// +// NOTE!: This file is autogenerated - do not modify! +// if you need to make a change, please see the Groovy scripts in the +// activemq-core module +// + +using System; +using System.Collections; + +using ActiveMQ.OpenWire; +using ActiveMQ.Commands; + +namespace ActiveMQ.Commands +{ + /// + /// The ActiveMQ ConsumerInfo Command + /// + public class ConsumerInfo : BaseCommand + { + public const byte ID_ConsumerInfo = 5; + + ConsumerId consumerId; + bool browser; + ActiveMQDestination destination; + int prefetchSize; + int maximumPendingMessageLimit; + bool dispatchAsync; + string selector; + string subcriptionName; + bool noLocal; + bool exclusive; + bool retroactive; + byte priority; + BrokerId[] brokerPath; + BooleanExpression additionalPredicate; + bool networkSubscription; + + public override string ToString() { + return GetType().Name + "[" + + " ConsumerId=" + ConsumerId + + " Browser=" + Browser + + " Destination=" + Destination + + " PrefetchSize=" + PrefetchSize + + " MaximumPendingMessageLimit=" + MaximumPendingMessageLimit + + " DispatchAsync=" + DispatchAsync + + " Selector=" + Selector + + " SubcriptionName=" + SubcriptionName + + " NoLocal=" + NoLocal + + " Exclusive=" + Exclusive + + " Retroactive=" + Retroactive + + " Priority=" + Priority + + " BrokerPath=" + BrokerPath + + " AdditionalPredicate=" + AdditionalPredicate + + " NetworkSubscription=" + NetworkSubscription + + " ]"; + + } + + + + public override byte GetDataStructureType() { + return ID_ConsumerInfo; + } + + + // Properties + + public ConsumerId ConsumerId + { + get { return consumerId; } + set { this.consumerId = value; } + } + + public bool Browser + { + get { return browser; } + set { this.browser = value; } + } + + public ActiveMQDestination Destination + { + get { return destination; } + set { this.destination = value; } + } + + public int PrefetchSize + { + get { return prefetchSize; } + set { this.prefetchSize = value; } + } + + public int MaximumPendingMessageLimit + { + get { return maximumPendingMessageLimit; } + set { this.maximumPendingMessageLimit = value; } + } + + public bool DispatchAsync + { + get { return dispatchAsync; } + set { this.dispatchAsync = value; } + } + + public string Selector + { + get { return selector; } + set { this.selector = value; } + } + + public string SubcriptionName + { + get { return subcriptionName; } + set { this.subcriptionName = value; } + } + + public bool NoLocal + { + get { return noLocal; } + set { this.noLocal = value; } + } + + public bool Exclusive + { + get { return exclusive; } + set { this.exclusive = value; } + } + + public bool Retroactive + { + get { return retroactive; } + set { this.retroactive = value; } + } + + public byte Priority + { + get { return priority; } + set { this.priority = value; } + } + + public BrokerId[] BrokerPath + { + get { return brokerPath; } + set { this.brokerPath = value; } + } + + public BooleanExpression AdditionalPredicate + { + get { return additionalPredicate; } + set { this.additionalPredicate = value; } + } + + public bool NetworkSubscription + { + get { return networkSubscription; } + set { this.networkSubscription = value; } + } + + } +} diff --git a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/ControlCommand.cs b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/ControlCommand.cs index c9394361e5..e3e0299d48 100644 --- a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/ControlCommand.cs +++ b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/ControlCommand.cs @@ -1 +1,64 @@ -/* * Copyright 2006 The Apache Software Foundation or its licensors, as * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // // NOTE!: This file is autogenerated - do not modify! // if you need to make a change, please see the Groovy scripts in the // activemq-core module // using System; using System.Collections; using ActiveMQ.OpenWire; using ActiveMQ.Commands; namespace ActiveMQ.Commands { /// /// The ActiveMQ ControlCommand Command /// public class ControlCommand : BaseCommand { public const byte ID_ControlCommand = 14; string command; public override string ToString() { return GetType().Name + "[" + " Command=" + Command + " ]"; } public override byte GetDataStructureType() { return ID_ControlCommand; } // Properties public string Command { get { return command; } set { this.command = value; } } } } \ No newline at end of file +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// +// NOTE!: This file is autogenerated - do not modify! +// if you need to make a change, please see the Groovy scripts in the +// activemq-core module +// + +using System; +using System.Collections; + +using ActiveMQ.OpenWire; +using ActiveMQ.Commands; + +namespace ActiveMQ.Commands +{ + /// + /// The ActiveMQ ControlCommand Command + /// + public class ControlCommand : BaseCommand + { + public const byte ID_ControlCommand = 14; + + string command; + + public override string ToString() { + return GetType().Name + "[" + + " Command=" + Command + + " ]"; + + } + + + + public override byte GetDataStructureType() { + return ID_ControlCommand; + } + + + // Properties + + public string Command + { + get { return command; } + set { this.command = value; } + } + + } +} diff --git a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/DataArrayResponse.cs b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/DataArrayResponse.cs index 187cd14014..aa98eebb1c 100644 --- a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/DataArrayResponse.cs +++ b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/DataArrayResponse.cs @@ -1 +1,64 @@ -/* * Copyright 2006 The Apache Software Foundation or its licensors, as * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // // NOTE!: This file is autogenerated - do not modify! // if you need to make a change, please see the Groovy scripts in the // activemq-core module // using System; using System.Collections; using ActiveMQ.OpenWire; using ActiveMQ.Commands; namespace ActiveMQ.Commands { /// /// The ActiveMQ DataArrayResponse Command /// public class DataArrayResponse : Response { public const byte ID_DataArrayResponse = 33; DataStructure[] data; public override string ToString() { return GetType().Name + "[" + " Data=" + Data + " ]"; } public override byte GetDataStructureType() { return ID_DataArrayResponse; } // Properties public DataStructure[] Data { get { return data; } set { this.data = value; } } } } \ No newline at end of file +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// +// NOTE!: This file is autogenerated - do not modify! +// if you need to make a change, please see the Groovy scripts in the +// activemq-core module +// + +using System; +using System.Collections; + +using ActiveMQ.OpenWire; +using ActiveMQ.Commands; + +namespace ActiveMQ.Commands +{ + /// + /// The ActiveMQ DataArrayResponse Command + /// + public class DataArrayResponse : Response + { + public const byte ID_DataArrayResponse = 33; + + DataStructure[] data; + + public override string ToString() { + return GetType().Name + "[" + + " Data=" + Data + + " ]"; + + } + + + + public override byte GetDataStructureType() { + return ID_DataArrayResponse; + } + + + // Properties + + public DataStructure[] Data + { + get { return data; } + set { this.data = value; } + } + + } +} diff --git a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/DataResponse.cs b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/DataResponse.cs index f81d971920..e7db439331 100644 --- a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/DataResponse.cs +++ b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/DataResponse.cs @@ -1 +1,64 @@ -/* * Copyright 2006 The Apache Software Foundation or its licensors, as * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // // NOTE!: This file is autogenerated - do not modify! // if you need to make a change, please see the Groovy scripts in the // activemq-core module // using System; using System.Collections; using ActiveMQ.OpenWire; using ActiveMQ.Commands; namespace ActiveMQ.Commands { /// /// The ActiveMQ DataResponse Command /// public class DataResponse : Response { public const byte ID_DataResponse = 32; DataStructure data; public override string ToString() { return GetType().Name + "[" + " Data=" + Data + " ]"; } public override byte GetDataStructureType() { return ID_DataResponse; } // Properties public DataStructure Data { get { return data; } set { this.data = value; } } } } \ No newline at end of file +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// +// NOTE!: This file is autogenerated - do not modify! +// if you need to make a change, please see the Groovy scripts in the +// activemq-core module +// + +using System; +using System.Collections; + +using ActiveMQ.OpenWire; +using ActiveMQ.Commands; + +namespace ActiveMQ.Commands +{ + /// + /// The ActiveMQ DataResponse Command + /// + public class DataResponse : Response + { + public const byte ID_DataResponse = 32; + + DataStructure data; + + public override string ToString() { + return GetType().Name + "[" + + " Data=" + Data + + " ]"; + + } + + + + public override byte GetDataStructureType() { + return ID_DataResponse; + } + + + // Properties + + public DataStructure Data + { + get { return data; } + set { this.data = value; } + } + + } +} diff --git a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/DataStructureSupport.cs b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/DataStructureSupport.cs index e2e8ba51a3..f6ebe51832 100755 --- a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/DataStructureSupport.cs +++ b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/DataStructureSupport.cs @@ -1,43 +1,43 @@ -/* - * Copyright 2006 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -using ActiveMQ.Commands; - -namespace ActiveMQ.Commands -{ - - /// - /// Summary description for DataStructureSupport. - /// - public abstract class DataStructureSupport : DataStructure - { - - protected DataStructureSupport() - { - } - - public virtual byte GetDataStructureType() - { - return 0; - } - - public virtual bool IsMarshallAware() - { - return false; - } - } -} - +/* + * Copyright 2006 The Apache Software Foundation or its licensors, as + * applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +using ActiveMQ.Commands; + +namespace ActiveMQ.Commands +{ + + /// + /// Summary description for DataStructureSupport. + /// + public abstract class DataStructureSupport : DataStructure + { + + protected DataStructureSupport() + { + } + + public virtual byte GetDataStructureType() + { + return 0; + } + + public virtual bool IsMarshallAware() + { + return false; + } + } +} + diff --git a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/DestinationInfo.cs b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/DestinationInfo.cs index d0603e2875..b7055e7b05 100644 --- a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/DestinationInfo.cs +++ b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/DestinationInfo.cs @@ -1 +1,96 @@ -/* * Copyright 2006 The Apache Software Foundation or its licensors, as * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // // NOTE!: This file is autogenerated - do not modify! // if you need to make a change, please see the Groovy scripts in the // activemq-core module // using System; using System.Collections; using ActiveMQ.OpenWire; using ActiveMQ.Commands; namespace ActiveMQ.Commands { /// /// The ActiveMQ DestinationInfo Command /// public class DestinationInfo : BaseCommand { public const byte ID_DestinationInfo = 8; ConnectionId connectionId; ActiveMQDestination destination; byte operationType; long timeout; BrokerId[] brokerPath; public override string ToString() { return GetType().Name + "[" + " ConnectionId=" + ConnectionId + " Destination=" + Destination + " OperationType=" + OperationType + " Timeout=" + Timeout + " BrokerPath=" + BrokerPath + " ]"; } public override byte GetDataStructureType() { return ID_DestinationInfo; } // Properties public ConnectionId ConnectionId { get { return connectionId; } set { this.connectionId = value; } } public ActiveMQDestination Destination { get { return destination; } set { this.destination = value; } } public byte OperationType { get { return operationType; } set { this.operationType = value; } } public long Timeout { get { return timeout; } set { this.timeout = value; } } public BrokerId[] BrokerPath { get { return brokerPath; } set { this.brokerPath = value; } } } } \ No newline at end of file +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// +// NOTE!: This file is autogenerated - do not modify! +// if you need to make a change, please see the Groovy scripts in the +// activemq-core module +// + +using System; +using System.Collections; + +using ActiveMQ.OpenWire; +using ActiveMQ.Commands; + +namespace ActiveMQ.Commands +{ + /// + /// The ActiveMQ DestinationInfo Command + /// + public class DestinationInfo : BaseCommand + { + public const byte ID_DestinationInfo = 8; + + ConnectionId connectionId; + ActiveMQDestination destination; + byte operationType; + long timeout; + BrokerId[] brokerPath; + + public override string ToString() { + return GetType().Name + "[" + + " ConnectionId=" + ConnectionId + + " Destination=" + Destination + + " OperationType=" + OperationType + + " Timeout=" + Timeout + + " BrokerPath=" + BrokerPath + + " ]"; + + } + + + + public override byte GetDataStructureType() { + return ID_DestinationInfo; + } + + + // Properties + + public ConnectionId ConnectionId + { + get { return connectionId; } + set { this.connectionId = value; } + } + + public ActiveMQDestination Destination + { + get { return destination; } + set { this.destination = value; } + } + + public byte OperationType + { + get { return operationType; } + set { this.operationType = value; } + } + + public long Timeout + { + get { return timeout; } + set { this.timeout = value; } + } + + public BrokerId[] BrokerPath + { + get { return brokerPath; } + set { this.brokerPath = value; } + } + + } +} diff --git a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/DiscoveryEvent.cs b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/DiscoveryEvent.cs index 3ab0561a7c..3693a677b2 100644 --- a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/DiscoveryEvent.cs +++ b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/DiscoveryEvent.cs @@ -1 +1,72 @@ -/* * Copyright 2006 The Apache Software Foundation or its licensors, as * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // // NOTE!: This file is autogenerated - do not modify! // if you need to make a change, please see the Groovy scripts in the // activemq-core module // using System; using System.Collections; using ActiveMQ.OpenWire; using ActiveMQ.Commands; namespace ActiveMQ.Commands { /// /// The ActiveMQ DiscoveryEvent Command /// public class DiscoveryEvent : BaseDataStructure, DataStructure { public const byte ID_DiscoveryEvent = 40; string serviceName; string brokerName; public override string ToString() { return GetType().Name + "[" + " ServiceName=" + ServiceName + " BrokerName=" + BrokerName + " ]"; } public override byte GetDataStructureType() { return ID_DiscoveryEvent; } // Properties public string ServiceName { get { return serviceName; } set { this.serviceName = value; } } public string BrokerName { get { return brokerName; } set { this.brokerName = value; } } } } \ No newline at end of file +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// +// NOTE!: This file is autogenerated - do not modify! +// if you need to make a change, please see the Groovy scripts in the +// activemq-core module +// + +using System; +using System.Collections; + +using ActiveMQ.OpenWire; +using ActiveMQ.Commands; + +namespace ActiveMQ.Commands +{ + /// + /// The ActiveMQ DiscoveryEvent Command + /// + public class DiscoveryEvent : BaseDataStructure, DataStructure + { + public const byte ID_DiscoveryEvent = 40; + + string serviceName; + string brokerName; + + public override string ToString() { + return GetType().Name + "[" + + " ServiceName=" + ServiceName + + " BrokerName=" + BrokerName + + " ]"; + + } + + + + public override byte GetDataStructureType() { + return ID_DiscoveryEvent; + } + + + // Properties + + public string ServiceName + { + get { return serviceName; } + set { this.serviceName = value; } + } + + public string BrokerName + { + get { return brokerName; } + set { this.brokerName = value; } + } + + } +} diff --git a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/ExceptionResponse.cs b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/ExceptionResponse.cs index d35f7d8588..2f7927eab6 100644 --- a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/ExceptionResponse.cs +++ b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/ExceptionResponse.cs @@ -1 +1,64 @@ -/* * Copyright 2006 The Apache Software Foundation or its licensors, as * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // // NOTE!: This file is autogenerated - do not modify! // if you need to make a change, please see the Groovy scripts in the // activemq-core module // using System; using System.Collections; using ActiveMQ.OpenWire; using ActiveMQ.Commands; namespace ActiveMQ.Commands { /// /// The ActiveMQ ExceptionResponse Command /// public class ExceptionResponse : Response { public const byte ID_ExceptionResponse = 31; BrokerError exception; public override string ToString() { return GetType().Name + "[" + " Exception=" + Exception + " ]"; } public override byte GetDataStructureType() { return ID_ExceptionResponse; } // Properties public BrokerError Exception { get { return exception; } set { this.exception = value; } } } } \ No newline at end of file +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// +// NOTE!: This file is autogenerated - do not modify! +// if you need to make a change, please see the Groovy scripts in the +// activemq-core module +// + +using System; +using System.Collections; + +using ActiveMQ.OpenWire; +using ActiveMQ.Commands; + +namespace ActiveMQ.Commands +{ + /// + /// The ActiveMQ ExceptionResponse Command + /// + public class ExceptionResponse : Response + { + public const byte ID_ExceptionResponse = 31; + + BrokerError exception; + + public override string ToString() { + return GetType().Name + "[" + + " Exception=" + Exception + + " ]"; + + } + + + + public override byte GetDataStructureType() { + return ID_ExceptionResponse; + } + + + // Properties + + public BrokerError Exception + { + get { return exception; } + set { this.exception = value; } + } + + } +} diff --git a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/FlushCommand.cs b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/FlushCommand.cs index b922688c36..aaab02b386 100644 --- a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/FlushCommand.cs +++ b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/FlushCommand.cs @@ -1 +1,56 @@ -/* * Copyright 2006 The Apache Software Foundation or its licensors, as * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // // NOTE!: This file is autogenerated - do not modify! // if you need to make a change, please see the Groovy scripts in the // activemq-core module // using System; using System.Collections; using ActiveMQ.OpenWire; using ActiveMQ.Commands; namespace ActiveMQ.Commands { /// /// The ActiveMQ FlushCommand Command /// public class FlushCommand : BaseCommand { public const byte ID_FlushCommand = 15; public override string ToString() { return GetType().Name + "[" + " ]"; } public override byte GetDataStructureType() { return ID_FlushCommand; } // Properties } } \ No newline at end of file +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// +// NOTE!: This file is autogenerated - do not modify! +// if you need to make a change, please see the Groovy scripts in the +// activemq-core module +// + +using System; +using System.Collections; + +using ActiveMQ.OpenWire; +using ActiveMQ.Commands; + +namespace ActiveMQ.Commands +{ + /// + /// The ActiveMQ FlushCommand Command + /// + public class FlushCommand : BaseCommand + { + public const byte ID_FlushCommand = 15; + + + public override string ToString() { + return GetType().Name + "[" + + " ]"; + + } + + + + public override byte GetDataStructureType() { + return ID_FlushCommand; + } + + + // Properties + + } +} diff --git a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/IntegerResponse.cs b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/IntegerResponse.cs index 1ea83e6f93..87b85f24f9 100644 --- a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/IntegerResponse.cs +++ b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/IntegerResponse.cs @@ -1 +1,64 @@ -/* * Copyright 2006 The Apache Software Foundation or its licensors, as * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // // NOTE!: This file is autogenerated - do not modify! // if you need to make a change, please see the Groovy scripts in the // activemq-core module // using System; using System.Collections; using ActiveMQ.OpenWire; using ActiveMQ.Commands; namespace ActiveMQ.Commands { /// /// The ActiveMQ IntegerResponse Command /// public class IntegerResponse : Response { public const byte ID_IntegerResponse = 34; int result; public override string ToString() { return GetType().Name + "[" + " Result=" + Result + " ]"; } public override byte GetDataStructureType() { return ID_IntegerResponse; } // Properties public int Result { get { return result; } set { this.result = value; } } } } \ No newline at end of file +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// +// NOTE!: This file is autogenerated - do not modify! +// if you need to make a change, please see the Groovy scripts in the +// activemq-core module +// + +using System; +using System.Collections; + +using ActiveMQ.OpenWire; +using ActiveMQ.Commands; + +namespace ActiveMQ.Commands +{ + /// + /// The ActiveMQ IntegerResponse Command + /// + public class IntegerResponse : Response + { + public const byte ID_IntegerResponse = 34; + + int result; + + public override string ToString() { + return GetType().Name + "[" + + " Result=" + Result + + " ]"; + + } + + + + public override byte GetDataStructureType() { + return ID_IntegerResponse; + } + + + // Properties + + public int Result + { + get { return result; } + set { this.result = value; } + } + + } +} diff --git a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/JournalQueueAck.cs b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/JournalQueueAck.cs index b53323b445..6627875bbd 100644 --- a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/JournalQueueAck.cs +++ b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/JournalQueueAck.cs @@ -1 +1,72 @@ -/* * Copyright 2006 The Apache Software Foundation or its licensors, as * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // // NOTE!: This file is autogenerated - do not modify! // if you need to make a change, please see the Groovy scripts in the // activemq-core module // using System; using System.Collections; using ActiveMQ.OpenWire; using ActiveMQ.Commands; namespace ActiveMQ.Commands { /// /// The ActiveMQ JournalQueueAck Command /// public class JournalQueueAck : BaseDataStructure, DataStructure { public const byte ID_JournalQueueAck = 52; ActiveMQDestination destination; MessageAck messageAck; public override string ToString() { return GetType().Name + "[" + " Destination=" + Destination + " MessageAck=" + MessageAck + " ]"; } public override byte GetDataStructureType() { return ID_JournalQueueAck; } // Properties public ActiveMQDestination Destination { get { return destination; } set { this.destination = value; } } public MessageAck MessageAck { get { return messageAck; } set { this.messageAck = value; } } } } \ No newline at end of file +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// +// NOTE!: This file is autogenerated - do not modify! +// if you need to make a change, please see the Groovy scripts in the +// activemq-core module +// + +using System; +using System.Collections; + +using ActiveMQ.OpenWire; +using ActiveMQ.Commands; + +namespace ActiveMQ.Commands +{ + /// + /// The ActiveMQ JournalQueueAck Command + /// + public class JournalQueueAck : BaseDataStructure, DataStructure + { + public const byte ID_JournalQueueAck = 52; + + ActiveMQDestination destination; + MessageAck messageAck; + + public override string ToString() { + return GetType().Name + "[" + + " Destination=" + Destination + + " MessageAck=" + MessageAck + + " ]"; + + } + + + + public override byte GetDataStructureType() { + return ID_JournalQueueAck; + } + + + // Properties + + public ActiveMQDestination Destination + { + get { return destination; } + set { this.destination = value; } + } + + public MessageAck MessageAck + { + get { return messageAck; } + set { this.messageAck = value; } + } + + } +} diff --git a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/JournalTopicAck.cs b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/JournalTopicAck.cs index 00ae54dbfc..e482a1359a 100644 --- a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/JournalTopicAck.cs +++ b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/JournalTopicAck.cs @@ -1 +1,104 @@ -/* * Copyright 2006 The Apache Software Foundation or its licensors, as * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // // NOTE!: This file is autogenerated - do not modify! // if you need to make a change, please see the Groovy scripts in the // activemq-core module // using System; using System.Collections; using ActiveMQ.OpenWire; using ActiveMQ.Commands; namespace ActiveMQ.Commands { /// /// The ActiveMQ JournalTopicAck Command /// public class JournalTopicAck : BaseDataStructure, DataStructure { public const byte ID_JournalTopicAck = 50; ActiveMQDestination destination; MessageId messageId; long messageSequenceId; string subscritionName; string clientId; TransactionId transactionId; public override string ToString() { return GetType().Name + "[" + " Destination=" + Destination + " MessageId=" + MessageId + " MessageSequenceId=" + MessageSequenceId + " SubscritionName=" + SubscritionName + " ClientId=" + ClientId + " TransactionId=" + TransactionId + " ]"; } public override byte GetDataStructureType() { return ID_JournalTopicAck; } // Properties public ActiveMQDestination Destination { get { return destination; } set { this.destination = value; } } public MessageId MessageId { get { return messageId; } set { this.messageId = value; } } public long MessageSequenceId { get { return messageSequenceId; } set { this.messageSequenceId = value; } } public string SubscritionName { get { return subscritionName; } set { this.subscritionName = value; } } public string ClientId { get { return clientId; } set { this.clientId = value; } } public TransactionId TransactionId { get { return transactionId; } set { this.transactionId = value; } } } } \ No newline at end of file +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// +// NOTE!: This file is autogenerated - do not modify! +// if you need to make a change, please see the Groovy scripts in the +// activemq-core module +// + +using System; +using System.Collections; + +using ActiveMQ.OpenWire; +using ActiveMQ.Commands; + +namespace ActiveMQ.Commands +{ + /// + /// The ActiveMQ JournalTopicAck Command + /// + public class JournalTopicAck : BaseDataStructure, DataStructure + { + public const byte ID_JournalTopicAck = 50; + + ActiveMQDestination destination; + MessageId messageId; + long messageSequenceId; + string subscritionName; + string clientId; + TransactionId transactionId; + + public override string ToString() { + return GetType().Name + "[" + + " Destination=" + Destination + + " MessageId=" + MessageId + + " MessageSequenceId=" + MessageSequenceId + + " SubscritionName=" + SubscritionName + + " ClientId=" + ClientId + + " TransactionId=" + TransactionId + + " ]"; + + } + + + + public override byte GetDataStructureType() { + return ID_JournalTopicAck; + } + + + // Properties + + public ActiveMQDestination Destination + { + get { return destination; } + set { this.destination = value; } + } + + public MessageId MessageId + { + get { return messageId; } + set { this.messageId = value; } + } + + public long MessageSequenceId + { + get { return messageSequenceId; } + set { this.messageSequenceId = value; } + } + + public string SubscritionName + { + get { return subscritionName; } + set { this.subscritionName = value; } + } + + public string ClientId + { + get { return clientId; } + set { this.clientId = value; } + } + + public TransactionId TransactionId + { + get { return transactionId; } + set { this.transactionId = value; } + } + + } +} diff --git a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/JournalTrace.cs b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/JournalTrace.cs index 58ff5e29bf..675ae860ad 100644 --- a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/JournalTrace.cs +++ b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/JournalTrace.cs @@ -1 +1,64 @@ -/* * Copyright 2006 The Apache Software Foundation or its licensors, as * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // // NOTE!: This file is autogenerated - do not modify! // if you need to make a change, please see the Groovy scripts in the // activemq-core module // using System; using System.Collections; using ActiveMQ.OpenWire; using ActiveMQ.Commands; namespace ActiveMQ.Commands { /// /// The ActiveMQ JournalTrace Command /// public class JournalTrace : BaseDataStructure, DataStructure { public const byte ID_JournalTrace = 53; string message; public override string ToString() { return GetType().Name + "[" + " Message=" + Message + " ]"; } public override byte GetDataStructureType() { return ID_JournalTrace; } // Properties public string Message { get { return message; } set { this.message = value; } } } } \ No newline at end of file +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// +// NOTE!: This file is autogenerated - do not modify! +// if you need to make a change, please see the Groovy scripts in the +// activemq-core module +// + +using System; +using System.Collections; + +using ActiveMQ.OpenWire; +using ActiveMQ.Commands; + +namespace ActiveMQ.Commands +{ + /// + /// The ActiveMQ JournalTrace Command + /// + public class JournalTrace : BaseDataStructure, DataStructure + { + public const byte ID_JournalTrace = 53; + + string message; + + public override string ToString() { + return GetType().Name + "[" + + " Message=" + Message + + " ]"; + + } + + + + public override byte GetDataStructureType() { + return ID_JournalTrace; + } + + + // Properties + + public string Message + { + get { return message; } + set { this.message = value; } + } + + } +} diff --git a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/JournalTransaction.cs b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/JournalTransaction.cs index c608e0ab77..8cfd921a52 100644 --- a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/JournalTransaction.cs +++ b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/JournalTransaction.cs @@ -1 +1,80 @@ -/* * Copyright 2006 The Apache Software Foundation or its licensors, as * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // // NOTE!: This file is autogenerated - do not modify! // if you need to make a change, please see the Groovy scripts in the // activemq-core module // using System; using System.Collections; using ActiveMQ.OpenWire; using ActiveMQ.Commands; namespace ActiveMQ.Commands { /// /// The ActiveMQ JournalTransaction Command /// public class JournalTransaction : BaseDataStructure, DataStructure { public const byte ID_JournalTransaction = 54; TransactionId transactionId; byte type; bool wasPrepared; public override string ToString() { return GetType().Name + "[" + " TransactionId=" + TransactionId + " Type=" + Type + " WasPrepared=" + WasPrepared + " ]"; } public override byte GetDataStructureType() { return ID_JournalTransaction; } // Properties public TransactionId TransactionId { get { return transactionId; } set { this.transactionId = value; } } public byte Type { get { return type; } set { this.type = value; } } public bool WasPrepared { get { return wasPrepared; } set { this.wasPrepared = value; } } } } \ No newline at end of file +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// +// NOTE!: This file is autogenerated - do not modify! +// if you need to make a change, please see the Groovy scripts in the +// activemq-core module +// + +using System; +using System.Collections; + +using ActiveMQ.OpenWire; +using ActiveMQ.Commands; + +namespace ActiveMQ.Commands +{ + /// + /// The ActiveMQ JournalTransaction Command + /// + public class JournalTransaction : BaseDataStructure, DataStructure + { + public const byte ID_JournalTransaction = 54; + + TransactionId transactionId; + byte type; + bool wasPrepared; + + public override string ToString() { + return GetType().Name + "[" + + " TransactionId=" + TransactionId + + " Type=" + Type + + " WasPrepared=" + WasPrepared + + " ]"; + + } + + + + public override byte GetDataStructureType() { + return ID_JournalTransaction; + } + + + // Properties + + public TransactionId TransactionId + { + get { return transactionId; } + set { this.transactionId = value; } + } + + public byte Type + { + get { return type; } + set { this.type = value; } + } + + public bool WasPrepared + { + get { return wasPrepared; } + set { this.wasPrepared = value; } + } + + } +} diff --git a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/LastPartialCommand.cs b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/LastPartialCommand.cs index 369c4b491c..afb049c728 100644 --- a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/LastPartialCommand.cs +++ b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/LastPartialCommand.cs @@ -1 +1,56 @@ -/* * Copyright 2006 The Apache Software Foundation or its licensors, as * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // // NOTE!: This file is autogenerated - do not modify! // if you need to make a change, please see the Groovy scripts in the // activemq-core module // using System; using System.Collections; using ActiveMQ.OpenWire; using ActiveMQ.Commands; namespace ActiveMQ.Commands { /// /// The ActiveMQ LastPartialCommand Command /// public class LastPartialCommand : BaseCommand { public const byte ID_LastPartialCommand = 61; public override string ToString() { return GetType().Name + "[" + " ]"; } public override byte GetDataStructureType() { return ID_LastPartialCommand; } // Properties } } \ No newline at end of file +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// +// NOTE!: This file is autogenerated - do not modify! +// if you need to make a change, please see the Groovy scripts in the +// activemq-core module +// + +using System; +using System.Collections; + +using ActiveMQ.OpenWire; +using ActiveMQ.Commands; + +namespace ActiveMQ.Commands +{ + /// + /// The ActiveMQ LastPartialCommand Command + /// + public class LastPartialCommand : BaseCommand + { + public const byte ID_LastPartialCommand = 61; + + + public override string ToString() { + return GetType().Name + "[" + + " ]"; + + } + + + + public override byte GetDataStructureType() { + return ID_LastPartialCommand; + } + + + // Properties + + } +} diff --git a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/LocalTransactionId.cs b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/LocalTransactionId.cs index 31c1a046a9..5f095f0bb2 100644 --- a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/LocalTransactionId.cs +++ b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/LocalTransactionId.cs @@ -1 +1,96 @@ -/* * Copyright 2006 The Apache Software Foundation or its licensors, as * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // // NOTE!: This file is autogenerated - do not modify! // if you need to make a change, please see the Groovy scripts in the // activemq-core module // using System; using System.Collections; using ActiveMQ.OpenWire; using ActiveMQ.Commands; namespace ActiveMQ.Commands { /// /// The ActiveMQ LocalTransactionId Command /// public class LocalTransactionId : TransactionId { public const byte ID_LocalTransactionId = 111; long value; ConnectionId connectionId; public override int GetHashCode() { int answer = 0; answer = (answer * 37) + HashCode(Value); answer = (answer * 37) + HashCode(ConnectionId); return answer; } public override bool Equals(object that) { if (that is LocalTransactionId) { return Equals((LocalTransactionId) that); } return false; } public virtual bool Equals(LocalTransactionId that) { if (! Equals(this.Value, that.Value)) return false; if (! Equals(this.ConnectionId, that.ConnectionId)) return false; return true; } public override string ToString() { return GetType().Name + "[" + " Value=" + Value + " ConnectionId=" + ConnectionId + " ]"; } public override byte GetDataStructureType() { return ID_LocalTransactionId; } // Properties public long Value { get { return value; } set { this.value = value; } } public ConnectionId ConnectionId { get { return connectionId; } set { this.connectionId = value; } } } } \ No newline at end of file +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// +// NOTE!: This file is autogenerated - do not modify! +// if you need to make a change, please see the Groovy scripts in the +// activemq-core module +// + +using System; +using System.Collections; + +using ActiveMQ.OpenWire; +using ActiveMQ.Commands; + +namespace ActiveMQ.Commands +{ + /// + /// The ActiveMQ LocalTransactionId Command + /// + public class LocalTransactionId : TransactionId + { + public const byte ID_LocalTransactionId = 111; + + long value; + ConnectionId connectionId; + + public override int GetHashCode() { + int answer = 0; + answer = (answer * 37) + HashCode(Value); + answer = (answer * 37) + HashCode(ConnectionId); + return answer; + + } + + + public override bool Equals(object that) { + if (that is LocalTransactionId) { + return Equals((LocalTransactionId) that); + } + return false; + } + + public virtual bool Equals(LocalTransactionId that) { + if (! Equals(this.Value, that.Value)) return false; + if (! Equals(this.ConnectionId, that.ConnectionId)) return false; + return true; + + } + + + public override string ToString() { + return GetType().Name + "[" + + " Value=" + Value + + " ConnectionId=" + ConnectionId + + " ]"; + + } + + + + public override byte GetDataStructureType() { + return ID_LocalTransactionId; + } + + + // Properties + + public long Value + { + get { return value; } + set { this.value = value; } + } + + public ConnectionId ConnectionId + { + get { return connectionId; } + set { this.connectionId = value; } + } + + } +} diff --git a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/MarshallAware.cs b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/MarshallAware.cs index f6f5df9fe0..b5c82c14a3 100644 --- a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/MarshallAware.cs +++ b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/MarshallAware.cs @@ -1,38 +1,38 @@ -/* - * Copyright 2006 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -using ActiveMQ.OpenWire; - -namespace ActiveMQ.Commands -{ - - /// - /// Represents a marshallable entity - /// - public interface MarshallAware - { - - void BeforeMarshall(OpenWireFormat wireFormat); - void AfterMarshall(OpenWireFormat wireFormat); - - void BeforeUnmarshall(OpenWireFormat wireFormat); - void AfterUnmarshall(OpenWireFormat wireFormat); - - void SetMarshalledForm(OpenWireFormat wireFormat, byte[] data); - byte[] GetMarshalledForm(OpenWireFormat wireFormat); - } -} - +/* + * Copyright 2006 The Apache Software Foundation or its licensors, as + * applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +using ActiveMQ.OpenWire; + +namespace ActiveMQ.Commands +{ + + /// + /// Represents a marshallable entity + /// + public interface MarshallAware + { + + void BeforeMarshall(OpenWireFormat wireFormat); + void AfterMarshall(OpenWireFormat wireFormat); + + void BeforeUnmarshall(OpenWireFormat wireFormat); + void AfterUnmarshall(OpenWireFormat wireFormat); + + void SetMarshalledForm(OpenWireFormat wireFormat, byte[] data); + byte[] GetMarshalledForm(OpenWireFormat wireFormat); + } +} + diff --git a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/Message.cs b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/Message.cs index 4e369e48fb..4336ed51ae 100644 --- a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/Message.cs +++ b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/Message.cs @@ -1 +1,256 @@ -/* * Copyright 2006 The Apache Software Foundation or its licensors, as * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // // NOTE!: This file is autogenerated - do not modify! // if you need to make a change, please see the Groovy scripts in the // activemq-core module // using System; using System.Collections; using ActiveMQ.OpenWire; using ActiveMQ.Commands; namespace ActiveMQ.Commands { /// /// The ActiveMQ Message Command /// public class Message : BaseCommand, MarshallAware, MessageReference { public const byte ID_Message = 0; ProducerId producerId; ActiveMQDestination destination; TransactionId transactionId; ActiveMQDestination originalDestination; MessageId messageId; TransactionId originalTransactionId; string groupID; int groupSequence; string correlationId; bool persistent; long expiration; byte priority; ActiveMQDestination replyTo; long timestamp; string type; byte[] content; byte[] marshalledProperties; DataStructure dataStructure; ConsumerId targetConsumerId; bool compressed; int redeliveryCounter; BrokerId[] brokerPath; long arrival; string userID; bool recievedByDFBridge; public override string ToString() { return GetType().Name + "[" + " ProducerId=" + ProducerId + " Destination=" + Destination + " TransactionId=" + TransactionId + " OriginalDestination=" + OriginalDestination + " MessageId=" + MessageId + " OriginalTransactionId=" + OriginalTransactionId + " GroupID=" + GroupID + " GroupSequence=" + GroupSequence + " CorrelationId=" + CorrelationId + " Persistent=" + Persistent + " Expiration=" + Expiration + " Priority=" + Priority + " ReplyTo=" + ReplyTo + " Timestamp=" + Timestamp + " Type=" + Type + " Content=" + Content + " MarshalledProperties=" + MarshalledProperties + " DataStructure=" + DataStructure + " TargetConsumerId=" + TargetConsumerId + " Compressed=" + Compressed + " RedeliveryCounter=" + RedeliveryCounter + " BrokerPath=" + BrokerPath + " Arrival=" + Arrival + " UserID=" + UserID + " RecievedByDFBridge=" + RecievedByDFBridge + " ]"; } public override byte GetDataStructureType() { return ID_Message; } // Properties public ProducerId ProducerId { get { return producerId; } set { this.producerId = value; } } public ActiveMQDestination Destination { get { return destination; } set { this.destination = value; } } public TransactionId TransactionId { get { return transactionId; } set { this.transactionId = value; } } public ActiveMQDestination OriginalDestination { get { return originalDestination; } set { this.originalDestination = value; } } public MessageId MessageId { get { return messageId; } set { this.messageId = value; } } public TransactionId OriginalTransactionId { get { return originalTransactionId; } set { this.originalTransactionId = value; } } public string GroupID { get { return groupID; } set { this.groupID = value; } } public int GroupSequence { get { return groupSequence; } set { this.groupSequence = value; } } public string CorrelationId { get { return correlationId; } set { this.correlationId = value; } } public bool Persistent { get { return persistent; } set { this.persistent = value; } } public long Expiration { get { return expiration; } set { this.expiration = value; } } public byte Priority { get { return priority; } set { this.priority = value; } } public ActiveMQDestination ReplyTo { get { return replyTo; } set { this.replyTo = value; } } public long Timestamp { get { return timestamp; } set { this.timestamp = value; } } public string Type { get { return type; } set { this.type = value; } } public byte[] Content { get { return content; } set { this.content = value; } } public byte[] MarshalledProperties { get { return marshalledProperties; } set { this.marshalledProperties = value; } } public DataStructure DataStructure { get { return dataStructure; } set { this.dataStructure = value; } } public ConsumerId TargetConsumerId { get { return targetConsumerId; } set { this.targetConsumerId = value; } } public bool Compressed { get { return compressed; } set { this.compressed = value; } } public int RedeliveryCounter { get { return redeliveryCounter; } set { this.redeliveryCounter = value; } } public BrokerId[] BrokerPath { get { return brokerPath; } set { this.brokerPath = value; } } public long Arrival { get { return arrival; } set { this.arrival = value; } } public string UserID { get { return userID; } set { this.userID = value; } } public bool RecievedByDFBridge { get { return recievedByDFBridge; } set { this.recievedByDFBridge = value; } } } } \ No newline at end of file +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// +// NOTE!: This file is autogenerated - do not modify! +// if you need to make a change, please see the Groovy scripts in the +// activemq-core module +// + +using System; +using System.Collections; + +using ActiveMQ.OpenWire; +using ActiveMQ.Commands; + +namespace ActiveMQ.Commands +{ + /// + /// The ActiveMQ Message Command + /// + public class Message : BaseCommand, MarshallAware, MessageReference + { + public const byte ID_Message = 0; + + ProducerId producerId; + ActiveMQDestination destination; + TransactionId transactionId; + ActiveMQDestination originalDestination; + MessageId messageId; + TransactionId originalTransactionId; + string groupID; + int groupSequence; + string correlationId; + bool persistent; + long expiration; + byte priority; + ActiveMQDestination replyTo; + long timestamp; + string type; + byte[] content; + byte[] marshalledProperties; + DataStructure dataStructure; + ConsumerId targetConsumerId; + bool compressed; + int redeliveryCounter; + BrokerId[] brokerPath; + long arrival; + string userID; + bool recievedByDFBridge; + + public override string ToString() { + return GetType().Name + "[" + + " ProducerId=" + ProducerId + + " Destination=" + Destination + + " TransactionId=" + TransactionId + + " OriginalDestination=" + OriginalDestination + + " MessageId=" + MessageId + + " OriginalTransactionId=" + OriginalTransactionId + + " GroupID=" + GroupID + + " GroupSequence=" + GroupSequence + + " CorrelationId=" + CorrelationId + + " Persistent=" + Persistent + + " Expiration=" + Expiration + + " Priority=" + Priority + + " ReplyTo=" + ReplyTo + + " Timestamp=" + Timestamp + + " Type=" + Type + + " Content=" + Content + + " MarshalledProperties=" + MarshalledProperties + + " DataStructure=" + DataStructure + + " TargetConsumerId=" + TargetConsumerId + + " Compressed=" + Compressed + + " RedeliveryCounter=" + RedeliveryCounter + + " BrokerPath=" + BrokerPath + + " Arrival=" + Arrival + + " UserID=" + UserID + + " RecievedByDFBridge=" + RecievedByDFBridge + + " ]"; + + } + + + + public override byte GetDataStructureType() { + return ID_Message; + } + + + // Properties + + public ProducerId ProducerId + { + get { return producerId; } + set { this.producerId = value; } + } + + public ActiveMQDestination Destination + { + get { return destination; } + set { this.destination = value; } + } + + public TransactionId TransactionId + { + get { return transactionId; } + set { this.transactionId = value; } + } + + public ActiveMQDestination OriginalDestination + { + get { return originalDestination; } + set { this.originalDestination = value; } + } + + public MessageId MessageId + { + get { return messageId; } + set { this.messageId = value; } + } + + public TransactionId OriginalTransactionId + { + get { return originalTransactionId; } + set { this.originalTransactionId = value; } + } + + public string GroupID + { + get { return groupID; } + set { this.groupID = value; } + } + + public int GroupSequence + { + get { return groupSequence; } + set { this.groupSequence = value; } + } + + public string CorrelationId + { + get { return correlationId; } + set { this.correlationId = value; } + } + + public bool Persistent + { + get { return persistent; } + set { this.persistent = value; } + } + + public long Expiration + { + get { return expiration; } + set { this.expiration = value; } + } + + public byte Priority + { + get { return priority; } + set { this.priority = value; } + } + + public ActiveMQDestination ReplyTo + { + get { return replyTo; } + set { this.replyTo = value; } + } + + public long Timestamp + { + get { return timestamp; } + set { this.timestamp = value; } + } + + public string Type + { + get { return type; } + set { this.type = value; } + } + + public byte[] Content + { + get { return content; } + set { this.content = value; } + } + + public byte[] MarshalledProperties + { + get { return marshalledProperties; } + set { this.marshalledProperties = value; } + } + + public DataStructure DataStructure + { + get { return dataStructure; } + set { this.dataStructure = value; } + } + + public ConsumerId TargetConsumerId + { + get { return targetConsumerId; } + set { this.targetConsumerId = value; } + } + + public bool Compressed + { + get { return compressed; } + set { this.compressed = value; } + } + + public int RedeliveryCounter + { + get { return redeliveryCounter; } + set { this.redeliveryCounter = value; } + } + + public BrokerId[] BrokerPath + { + get { return brokerPath; } + set { this.brokerPath = value; } + } + + public long Arrival + { + get { return arrival; } + set { this.arrival = value; } + } + + public string UserID + { + get { return userID; } + set { this.userID = value; } + } + + public bool RecievedByDFBridge + { + get { return recievedByDFBridge; } + set { this.recievedByDFBridge = value; } + } + + } +} diff --git a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/MessageAck.cs b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/MessageAck.cs index dbf027f8ee..d644f0580a 100644 --- a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/MessageAck.cs +++ b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/MessageAck.cs @@ -1 +1,112 @@ -/* * Copyright 2006 The Apache Software Foundation or its licensors, as * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // // NOTE!: This file is autogenerated - do not modify! // if you need to make a change, please see the Groovy scripts in the // activemq-core module // using System; using System.Collections; using ActiveMQ.OpenWire; using ActiveMQ.Commands; namespace ActiveMQ.Commands { /// /// The ActiveMQ MessageAck Command /// public class MessageAck : BaseCommand { public const byte ID_MessageAck = 22; ActiveMQDestination destination; TransactionId transactionId; ConsumerId consumerId; byte ackType; MessageId firstMessageId; MessageId lastMessageId; int messageCount; public override string ToString() { return GetType().Name + "[" + " Destination=" + Destination + " TransactionId=" + TransactionId + " ConsumerId=" + ConsumerId + " AckType=" + AckType + " FirstMessageId=" + FirstMessageId + " LastMessageId=" + LastMessageId + " MessageCount=" + MessageCount + " ]"; } public override byte GetDataStructureType() { return ID_MessageAck; } // Properties public ActiveMQDestination Destination { get { return destination; } set { this.destination = value; } } public TransactionId TransactionId { get { return transactionId; } set { this.transactionId = value; } } public ConsumerId ConsumerId { get { return consumerId; } set { this.consumerId = value; } } public byte AckType { get { return ackType; } set { this.ackType = value; } } public MessageId FirstMessageId { get { return firstMessageId; } set { this.firstMessageId = value; } } public MessageId LastMessageId { get { return lastMessageId; } set { this.lastMessageId = value; } } public int MessageCount { get { return messageCount; } set { this.messageCount = value; } } } } \ No newline at end of file +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// +// NOTE!: This file is autogenerated - do not modify! +// if you need to make a change, please see the Groovy scripts in the +// activemq-core module +// + +using System; +using System.Collections; + +using ActiveMQ.OpenWire; +using ActiveMQ.Commands; + +namespace ActiveMQ.Commands +{ + /// + /// The ActiveMQ MessageAck Command + /// + public class MessageAck : BaseCommand + { + public const byte ID_MessageAck = 22; + + ActiveMQDestination destination; + TransactionId transactionId; + ConsumerId consumerId; + byte ackType; + MessageId firstMessageId; + MessageId lastMessageId; + int messageCount; + + public override string ToString() { + return GetType().Name + "[" + + " Destination=" + Destination + + " TransactionId=" + TransactionId + + " ConsumerId=" + ConsumerId + + " AckType=" + AckType + + " FirstMessageId=" + FirstMessageId + + " LastMessageId=" + LastMessageId + + " MessageCount=" + MessageCount + + " ]"; + + } + + + + public override byte GetDataStructureType() { + return ID_MessageAck; + } + + + // Properties + + public ActiveMQDestination Destination + { + get { return destination; } + set { this.destination = value; } + } + + public TransactionId TransactionId + { + get { return transactionId; } + set { this.transactionId = value; } + } + + public ConsumerId ConsumerId + { + get { return consumerId; } + set { this.consumerId = value; } + } + + public byte AckType + { + get { return ackType; } + set { this.ackType = value; } + } + + public MessageId FirstMessageId + { + get { return firstMessageId; } + set { this.firstMessageId = value; } + } + + public MessageId LastMessageId + { + get { return lastMessageId; } + set { this.lastMessageId = value; } + } + + public int MessageCount + { + get { return messageCount; } + set { this.messageCount = value; } + } + + } +} diff --git a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/MessageDispatch.cs b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/MessageDispatch.cs index d549224da3..68fb8f71c2 100644 --- a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/MessageDispatch.cs +++ b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/MessageDispatch.cs @@ -1 +1,88 @@ -/* * Copyright 2006 The Apache Software Foundation or its licensors, as * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // // NOTE!: This file is autogenerated - do not modify! // if you need to make a change, please see the Groovy scripts in the // activemq-core module // using System; using System.Collections; using ActiveMQ.OpenWire; using ActiveMQ.Commands; namespace ActiveMQ.Commands { /// /// The ActiveMQ MessageDispatch Command /// public class MessageDispatch : BaseCommand { public const byte ID_MessageDispatch = 21; ConsumerId consumerId; ActiveMQDestination destination; Message message; int redeliveryCounter; public override string ToString() { return GetType().Name + "[" + " ConsumerId=" + ConsumerId + " Destination=" + Destination + " Message=" + Message + " RedeliveryCounter=" + RedeliveryCounter + " ]"; } public override byte GetDataStructureType() { return ID_MessageDispatch; } // Properties public ConsumerId ConsumerId { get { return consumerId; } set { this.consumerId = value; } } public ActiveMQDestination Destination { get { return destination; } set { this.destination = value; } } public Message Message { get { return message; } set { this.message = value; } } public int RedeliveryCounter { get { return redeliveryCounter; } set { this.redeliveryCounter = value; } } } } \ No newline at end of file +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// +// NOTE!: This file is autogenerated - do not modify! +// if you need to make a change, please see the Groovy scripts in the +// activemq-core module +// + +using System; +using System.Collections; + +using ActiveMQ.OpenWire; +using ActiveMQ.Commands; + +namespace ActiveMQ.Commands +{ + /// + /// The ActiveMQ MessageDispatch Command + /// + public class MessageDispatch : BaseCommand + { + public const byte ID_MessageDispatch = 21; + + ConsumerId consumerId; + ActiveMQDestination destination; + Message message; + int redeliveryCounter; + + public override string ToString() { + return GetType().Name + "[" + + " ConsumerId=" + ConsumerId + + " Destination=" + Destination + + " Message=" + Message + + " RedeliveryCounter=" + RedeliveryCounter + + " ]"; + + } + + + + public override byte GetDataStructureType() { + return ID_MessageDispatch; + } + + + // Properties + + public ConsumerId ConsumerId + { + get { return consumerId; } + set { this.consumerId = value; } + } + + public ActiveMQDestination Destination + { + get { return destination; } + set { this.destination = value; } + } + + public Message Message + { + get { return message; } + set { this.message = value; } + } + + public int RedeliveryCounter + { + get { return redeliveryCounter; } + set { this.redeliveryCounter = value; } + } + + } +} diff --git a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/MessageDispatchNotification.cs b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/MessageDispatchNotification.cs index 625e4e235d..f2582155af 100644 --- a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/MessageDispatchNotification.cs +++ b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/MessageDispatchNotification.cs @@ -1 +1,88 @@ -/* * Copyright 2006 The Apache Software Foundation or its licensors, as * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // // NOTE!: This file is autogenerated - do not modify! // if you need to make a change, please see the Groovy scripts in the // activemq-core module // using System; using System.Collections; using ActiveMQ.OpenWire; using ActiveMQ.Commands; namespace ActiveMQ.Commands { /// /// The ActiveMQ MessageDispatchNotification Command /// public class MessageDispatchNotification : BaseCommand { public const byte ID_MessageDispatchNotification = 90; ConsumerId consumerId; ActiveMQDestination destination; long deliverySequenceId; MessageId messageId; public override string ToString() { return GetType().Name + "[" + " ConsumerId=" + ConsumerId + " Destination=" + Destination + " DeliverySequenceId=" + DeliverySequenceId + " MessageId=" + MessageId + " ]"; } public override byte GetDataStructureType() { return ID_MessageDispatchNotification; } // Properties public ConsumerId ConsumerId { get { return consumerId; } set { this.consumerId = value; } } public ActiveMQDestination Destination { get { return destination; } set { this.destination = value; } } public long DeliverySequenceId { get { return deliverySequenceId; } set { this.deliverySequenceId = value; } } public MessageId MessageId { get { return messageId; } set { this.messageId = value; } } } } \ No newline at end of file +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// +// NOTE!: This file is autogenerated - do not modify! +// if you need to make a change, please see the Groovy scripts in the +// activemq-core module +// + +using System; +using System.Collections; + +using ActiveMQ.OpenWire; +using ActiveMQ.Commands; + +namespace ActiveMQ.Commands +{ + /// + /// The ActiveMQ MessageDispatchNotification Command + /// + public class MessageDispatchNotification : BaseCommand + { + public const byte ID_MessageDispatchNotification = 90; + + ConsumerId consumerId; + ActiveMQDestination destination; + long deliverySequenceId; + MessageId messageId; + + public override string ToString() { + return GetType().Name + "[" + + " ConsumerId=" + ConsumerId + + " Destination=" + Destination + + " DeliverySequenceId=" + DeliverySequenceId + + " MessageId=" + MessageId + + " ]"; + + } + + + + public override byte GetDataStructureType() { + return ID_MessageDispatchNotification; + } + + + // Properties + + public ConsumerId ConsumerId + { + get { return consumerId; } + set { this.consumerId = value; } + } + + public ActiveMQDestination Destination + { + get { return destination; } + set { this.destination = value; } + } + + public long DeliverySequenceId + { + get { return deliverySequenceId; } + set { this.deliverySequenceId = value; } + } + + public MessageId MessageId + { + get { return messageId; } + set { this.messageId = value; } + } + + } +} diff --git a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/MessageId.cs b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/MessageId.cs index 617581d823..e05564640a 100644 --- a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/MessageId.cs +++ b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/MessageId.cs @@ -1 +1,106 @@ -/* * Copyright 2006 The Apache Software Foundation or its licensors, as * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // // NOTE!: This file is autogenerated - do not modify! // if you need to make a change, please see the Groovy scripts in the // activemq-core module // using System; using System.Collections; using ActiveMQ.OpenWire; using ActiveMQ.Commands; namespace ActiveMQ.Commands { /// /// The ActiveMQ MessageId Command /// public class MessageId : BaseDataStructure, DataStructure { public const byte ID_MessageId = 110; ProducerId producerId; long producerSequenceId; long brokerSequenceId; public override int GetHashCode() { int answer = 0; answer = (answer * 37) + HashCode(ProducerId); answer = (answer * 37) + HashCode(ProducerSequenceId); answer = (answer * 37) + HashCode(BrokerSequenceId); return answer; } public override bool Equals(object that) { if (that is MessageId) { return Equals((MessageId) that); } return false; } public virtual bool Equals(MessageId that) { if (! Equals(this.ProducerId, that.ProducerId)) return false; if (! Equals(this.ProducerSequenceId, that.ProducerSequenceId)) return false; if (! Equals(this.BrokerSequenceId, that.BrokerSequenceId)) return false; return true; } public override string ToString() { return GetType().Name + "[" + " ProducerId=" + ProducerId + " ProducerSequenceId=" + ProducerSequenceId + " BrokerSequenceId=" + BrokerSequenceId + " ]"; } public override byte GetDataStructureType() { return ID_MessageId; } // Properties public ProducerId ProducerId { get { return producerId; } set { this.producerId = value; } } public long ProducerSequenceId { get { return producerSequenceId; } set { this.producerSequenceId = value; } } public long BrokerSequenceId { get { return brokerSequenceId; } set { this.brokerSequenceId = value; } } } } \ No newline at end of file +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// +// NOTE!: This file is autogenerated - do not modify! +// if you need to make a change, please see the Groovy scripts in the +// activemq-core module +// + +using System; +using System.Collections; + +using ActiveMQ.OpenWire; +using ActiveMQ.Commands; + +namespace ActiveMQ.Commands +{ + /// + /// The ActiveMQ MessageId Command + /// + public class MessageId : BaseDataStructure, DataStructure + { + public const byte ID_MessageId = 110; + + ProducerId producerId; + long producerSequenceId; + long brokerSequenceId; + + public override int GetHashCode() { + int answer = 0; + answer = (answer * 37) + HashCode(ProducerId); + answer = (answer * 37) + HashCode(ProducerSequenceId); + answer = (answer * 37) + HashCode(BrokerSequenceId); + return answer; + + } + + + public override bool Equals(object that) { + if (that is MessageId) { + return Equals((MessageId) that); + } + return false; + } + + public virtual bool Equals(MessageId that) { + if (! Equals(this.ProducerId, that.ProducerId)) return false; + if (! Equals(this.ProducerSequenceId, that.ProducerSequenceId)) return false; + if (! Equals(this.BrokerSequenceId, that.BrokerSequenceId)) return false; + return true; + + } + + + public override string ToString() { + return GetType().Name + "[" + + " ProducerId=" + ProducerId + + " ProducerSequenceId=" + ProducerSequenceId + + " BrokerSequenceId=" + BrokerSequenceId + + " ]"; + + } + + + + public override byte GetDataStructureType() { + return ID_MessageId; + } + + + // Properties + + public ProducerId ProducerId + { + get { return producerId; } + set { this.producerId = value; } + } + + public long ProducerSequenceId + { + get { return producerSequenceId; } + set { this.producerSequenceId = value; } + } + + public long BrokerSequenceId + { + get { return brokerSequenceId; } + set { this.brokerSequenceId = value; } + } + + } +} diff --git a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/NetworkBridgeFilter.cs b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/NetworkBridgeFilter.cs index 7d7ac1aaeb..e7194e51e1 100644 --- a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/NetworkBridgeFilter.cs +++ b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/NetworkBridgeFilter.cs @@ -1 +1,72 @@ -/* * Copyright 2006 The Apache Software Foundation or its licensors, as * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // // NOTE!: This file is autogenerated - do not modify! // if you need to make a change, please see the Groovy scripts in the // activemq-core module // using System; using System.Collections; using ActiveMQ.OpenWire; using ActiveMQ.Commands; namespace ActiveMQ.Commands { /// /// The ActiveMQ NetworkBridgeFilter Command /// public class NetworkBridgeFilter : BaseDataStructure, DataStructure, BooleanExpression { public const byte ID_NetworkBridgeFilter = 91; int networkTTL; BrokerId networkBrokerId; public override string ToString() { return GetType().Name + "[" + " NetworkTTL=" + NetworkTTL + " NetworkBrokerId=" + NetworkBrokerId + " ]"; } public override byte GetDataStructureType() { return ID_NetworkBridgeFilter; } // Properties public int NetworkTTL { get { return networkTTL; } set { this.networkTTL = value; } } public BrokerId NetworkBrokerId { get { return networkBrokerId; } set { this.networkBrokerId = value; } } } } \ No newline at end of file +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// +// NOTE!: This file is autogenerated - do not modify! +// if you need to make a change, please see the Groovy scripts in the +// activemq-core module +// + +using System; +using System.Collections; + +using ActiveMQ.OpenWire; +using ActiveMQ.Commands; + +namespace ActiveMQ.Commands +{ + /// + /// The ActiveMQ NetworkBridgeFilter Command + /// + public class NetworkBridgeFilter : BaseDataStructure, DataStructure, BooleanExpression + { + public const byte ID_NetworkBridgeFilter = 91; + + int networkTTL; + BrokerId networkBrokerId; + + public override string ToString() { + return GetType().Name + "[" + + " NetworkTTL=" + NetworkTTL + + " NetworkBrokerId=" + NetworkBrokerId + + " ]"; + + } + + + + public override byte GetDataStructureType() { + return ID_NetworkBridgeFilter; + } + + + // Properties + + public int NetworkTTL + { + get { return networkTTL; } + set { this.networkTTL = value; } + } + + public BrokerId NetworkBrokerId + { + get { return networkBrokerId; } + set { this.networkBrokerId = value; } + } + + } +} diff --git a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/PartialCommand.cs b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/PartialCommand.cs index 58ed2420b6..9974d24a4e 100644 --- a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/PartialCommand.cs +++ b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/PartialCommand.cs @@ -1 +1,72 @@ -/* * Copyright 2006 The Apache Software Foundation or its licensors, as * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // // NOTE!: This file is autogenerated - do not modify! // if you need to make a change, please see the Groovy scripts in the // activemq-core module // using System; using System.Collections; using ActiveMQ.OpenWire; using ActiveMQ.Commands; namespace ActiveMQ.Commands { /// /// The ActiveMQ PartialCommand Command /// public class PartialCommand : BaseDataStructure, Command { public const byte ID_PartialCommand = 60; int commandId; byte[] data; public override string ToString() { return GetType().Name + "[" + " CommandId=" + CommandId + " Data=" + Data + " ]"; } public override byte GetDataStructureType() { return ID_PartialCommand; } // Properties public int CommandId { get { return commandId; } set { this.commandId = value; } } public byte[] Data { get { return data; } set { this.data = value; } } } } \ No newline at end of file +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// +// NOTE!: This file is autogenerated - do not modify! +// if you need to make a change, please see the Groovy scripts in the +// activemq-core module +// + +using System; +using System.Collections; + +using ActiveMQ.OpenWire; +using ActiveMQ.Commands; + +namespace ActiveMQ.Commands +{ + /// + /// The ActiveMQ PartialCommand Command + /// + public class PartialCommand : BaseDataStructure, Command + { + public const byte ID_PartialCommand = 60; + + int commandId; + byte[] data; + + public override string ToString() { + return GetType().Name + "[" + + " CommandId=" + CommandId + + " Data=" + Data + + " ]"; + + } + + + + public override byte GetDataStructureType() { + return ID_PartialCommand; + } + + + // Properties + + public int CommandId + { + get { return commandId; } + set { this.commandId = value; } + } + + public byte[] Data + { + get { return data; } + set { this.data = value; } + } + + } +} diff --git a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/ProducerId.cs b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/ProducerId.cs index d70d5994ed..329c923aeb 100644 --- a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/ProducerId.cs +++ b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/ProducerId.cs @@ -1 +1,106 @@ -/* * Copyright 2006 The Apache Software Foundation or its licensors, as * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // // NOTE!: This file is autogenerated - do not modify! // if you need to make a change, please see the Groovy scripts in the // activemq-core module // using System; using System.Collections; using ActiveMQ.OpenWire; using ActiveMQ.Commands; namespace ActiveMQ.Commands { /// /// The ActiveMQ ProducerId Command /// public class ProducerId : BaseDataStructure, DataStructure { public const byte ID_ProducerId = 123; string connectionId; long value; long sessionId; public override int GetHashCode() { int answer = 0; answer = (answer * 37) + HashCode(ConnectionId); answer = (answer * 37) + HashCode(Value); answer = (answer * 37) + HashCode(SessionId); return answer; } public override bool Equals(object that) { if (that is ProducerId) { return Equals((ProducerId) that); } return false; } public virtual bool Equals(ProducerId that) { if (! Equals(this.ConnectionId, that.ConnectionId)) return false; if (! Equals(this.Value, that.Value)) return false; if (! Equals(this.SessionId, that.SessionId)) return false; return true; } public override string ToString() { return GetType().Name + "[" + " ConnectionId=" + ConnectionId + " Value=" + Value + " SessionId=" + SessionId + " ]"; } public override byte GetDataStructureType() { return ID_ProducerId; } // Properties public string ConnectionId { get { return connectionId; } set { this.connectionId = value; } } public long Value { get { return value; } set { this.value = value; } } public long SessionId { get { return sessionId; } set { this.sessionId = value; } } } } \ No newline at end of file +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// +// NOTE!: This file is autogenerated - do not modify! +// if you need to make a change, please see the Groovy scripts in the +// activemq-core module +// + +using System; +using System.Collections; + +using ActiveMQ.OpenWire; +using ActiveMQ.Commands; + +namespace ActiveMQ.Commands +{ + /// + /// The ActiveMQ ProducerId Command + /// + public class ProducerId : BaseDataStructure, DataStructure + { + public const byte ID_ProducerId = 123; + + string connectionId; + long value; + long sessionId; + + public override int GetHashCode() { + int answer = 0; + answer = (answer * 37) + HashCode(ConnectionId); + answer = (answer * 37) + HashCode(Value); + answer = (answer * 37) + HashCode(SessionId); + return answer; + + } + + + public override bool Equals(object that) { + if (that is ProducerId) { + return Equals((ProducerId) that); + } + return false; + } + + public virtual bool Equals(ProducerId that) { + if (! Equals(this.ConnectionId, that.ConnectionId)) return false; + if (! Equals(this.Value, that.Value)) return false; + if (! Equals(this.SessionId, that.SessionId)) return false; + return true; + + } + + + public override string ToString() { + return GetType().Name + "[" + + " ConnectionId=" + ConnectionId + + " Value=" + Value + + " SessionId=" + SessionId + + " ]"; + + } + + + + public override byte GetDataStructureType() { + return ID_ProducerId; + } + + + // Properties + + public string ConnectionId + { + get { return connectionId; } + set { this.connectionId = value; } + } + + public long Value + { + get { return value; } + set { this.value = value; } + } + + public long SessionId + { + get { return sessionId; } + set { this.sessionId = value; } + } + + } +} diff --git a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/ProducerInfo.cs b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/ProducerInfo.cs index 4be8c9aec3..21c651198f 100644 --- a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/ProducerInfo.cs +++ b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/ProducerInfo.cs @@ -1 +1,80 @@ -/* * Copyright 2006 The Apache Software Foundation or its licensors, as * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // // NOTE!: This file is autogenerated - do not modify! // if you need to make a change, please see the Groovy scripts in the // activemq-core module // using System; using System.Collections; using ActiveMQ.OpenWire; using ActiveMQ.Commands; namespace ActiveMQ.Commands { /// /// The ActiveMQ ProducerInfo Command /// public class ProducerInfo : BaseCommand { public const byte ID_ProducerInfo = 6; ProducerId producerId; ActiveMQDestination destination; BrokerId[] brokerPath; public override string ToString() { return GetType().Name + "[" + " ProducerId=" + ProducerId + " Destination=" + Destination + " BrokerPath=" + BrokerPath + " ]"; } public override byte GetDataStructureType() { return ID_ProducerInfo; } // Properties public ProducerId ProducerId { get { return producerId; } set { this.producerId = value; } } public ActiveMQDestination Destination { get { return destination; } set { this.destination = value; } } public BrokerId[] BrokerPath { get { return brokerPath; } set { this.brokerPath = value; } } } } \ No newline at end of file +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// +// NOTE!: This file is autogenerated - do not modify! +// if you need to make a change, please see the Groovy scripts in the +// activemq-core module +// + +using System; +using System.Collections; + +using ActiveMQ.OpenWire; +using ActiveMQ.Commands; + +namespace ActiveMQ.Commands +{ + /// + /// The ActiveMQ ProducerInfo Command + /// + public class ProducerInfo : BaseCommand + { + public const byte ID_ProducerInfo = 6; + + ProducerId producerId; + ActiveMQDestination destination; + BrokerId[] brokerPath; + + public override string ToString() { + return GetType().Name + "[" + + " ProducerId=" + ProducerId + + " Destination=" + Destination + + " BrokerPath=" + BrokerPath + + " ]"; + + } + + + + public override byte GetDataStructureType() { + return ID_ProducerInfo; + } + + + // Properties + + public ProducerId ProducerId + { + get { return producerId; } + set { this.producerId = value; } + } + + public ActiveMQDestination Destination + { + get { return destination; } + set { this.destination = value; } + } + + public BrokerId[] BrokerPath + { + get { return brokerPath; } + set { this.brokerPath = value; } + } + + } +} diff --git a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/RemoveInfo.cs b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/RemoveInfo.cs index 4a1a0ef9f3..4228b8fd5d 100644 --- a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/RemoveInfo.cs +++ b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/RemoveInfo.cs @@ -1 +1,64 @@ -/* * Copyright 2006 The Apache Software Foundation or its licensors, as * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // // NOTE!: This file is autogenerated - do not modify! // if you need to make a change, please see the Groovy scripts in the // activemq-core module // using System; using System.Collections; using ActiveMQ.OpenWire; using ActiveMQ.Commands; namespace ActiveMQ.Commands { /// /// The ActiveMQ RemoveInfo Command /// public class RemoveInfo : BaseCommand { public const byte ID_RemoveInfo = 12; DataStructure objectId; public override string ToString() { return GetType().Name + "[" + " ObjectId=" + ObjectId + " ]"; } public override byte GetDataStructureType() { return ID_RemoveInfo; } // Properties public DataStructure ObjectId { get { return objectId; } set { this.objectId = value; } } } } \ No newline at end of file +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// +// NOTE!: This file is autogenerated - do not modify! +// if you need to make a change, please see the Groovy scripts in the +// activemq-core module +// + +using System; +using System.Collections; + +using ActiveMQ.OpenWire; +using ActiveMQ.Commands; + +namespace ActiveMQ.Commands +{ + /// + /// The ActiveMQ RemoveInfo Command + /// + public class RemoveInfo : BaseCommand + { + public const byte ID_RemoveInfo = 12; + + DataStructure objectId; + + public override string ToString() { + return GetType().Name + "[" + + " ObjectId=" + ObjectId + + " ]"; + + } + + + + public override byte GetDataStructureType() { + return ID_RemoveInfo; + } + + + // Properties + + public DataStructure ObjectId + { + get { return objectId; } + set { this.objectId = value; } + } + + } +} diff --git a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/RemoveSubscriptionInfo.cs b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/RemoveSubscriptionInfo.cs index 397930fc8a..c215c0a929 100644 --- a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/RemoveSubscriptionInfo.cs +++ b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/RemoveSubscriptionInfo.cs @@ -1 +1,80 @@ -/* * Copyright 2006 The Apache Software Foundation or its licensors, as * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // // NOTE!: This file is autogenerated - do not modify! // if you need to make a change, please see the Groovy scripts in the // activemq-core module // using System; using System.Collections; using ActiveMQ.OpenWire; using ActiveMQ.Commands; namespace ActiveMQ.Commands { /// /// The ActiveMQ RemoveSubscriptionInfo Command /// public class RemoveSubscriptionInfo : BaseCommand { public const byte ID_RemoveSubscriptionInfo = 0; ConnectionId connectionId; string subcriptionName; string clientId; public override string ToString() { return GetType().Name + "[" + " ConnectionId=" + ConnectionId + " SubcriptionName=" + SubcriptionName + " ClientId=" + ClientId + " ]"; } public override byte GetDataStructureType() { return ID_RemoveSubscriptionInfo; } // Properties public ConnectionId ConnectionId { get { return connectionId; } set { this.connectionId = value; } } public string SubcriptionName { get { return subcriptionName; } set { this.subcriptionName = value; } } public string ClientId { get { return clientId; } set { this.clientId = value; } } } } \ No newline at end of file +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// +// NOTE!: This file is autogenerated - do not modify! +// if you need to make a change, please see the Groovy scripts in the +// activemq-core module +// + +using System; +using System.Collections; + +using ActiveMQ.OpenWire; +using ActiveMQ.Commands; + +namespace ActiveMQ.Commands +{ + /// + /// The ActiveMQ RemoveSubscriptionInfo Command + /// + public class RemoveSubscriptionInfo : BaseCommand + { + public const byte ID_RemoveSubscriptionInfo = 0; + + ConnectionId connectionId; + string subcriptionName; + string clientId; + + public override string ToString() { + return GetType().Name + "[" + + " ConnectionId=" + ConnectionId + + " SubcriptionName=" + SubcriptionName + + " ClientId=" + ClientId + + " ]"; + + } + + + + public override byte GetDataStructureType() { + return ID_RemoveSubscriptionInfo; + } + + + // Properties + + public ConnectionId ConnectionId + { + get { return connectionId; } + set { this.connectionId = value; } + } + + public string SubcriptionName + { + get { return subcriptionName; } + set { this.subcriptionName = value; } + } + + public string ClientId + { + get { return clientId; } + set { this.clientId = value; } + } + + } +} diff --git a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/ReplayCommand.cs b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/ReplayCommand.cs index ab36a39788..1d4ef98fa2 100644 --- a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/ReplayCommand.cs +++ b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/ReplayCommand.cs @@ -1 +1,72 @@ -/* * Copyright 2006 The Apache Software Foundation or its licensors, as * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // // NOTE!: This file is autogenerated - do not modify! // if you need to make a change, please see the Groovy scripts in the // activemq-core module // using System; using System.Collections; using ActiveMQ.OpenWire; using ActiveMQ.Commands; namespace ActiveMQ.Commands { /// /// The ActiveMQ ReplayCommand Command /// public class ReplayCommand : BaseCommand { public const byte ID_ReplayCommand = 65; int firstNakNumber; int lastNakNumber; public override string ToString() { return GetType().Name + "[" + " FirstNakNumber=" + FirstNakNumber + " LastNakNumber=" + LastNakNumber + " ]"; } public override byte GetDataStructureType() { return ID_ReplayCommand; } // Properties public int FirstNakNumber { get { return firstNakNumber; } set { this.firstNakNumber = value; } } public int LastNakNumber { get { return lastNakNumber; } set { this.lastNakNumber = value; } } } } \ No newline at end of file +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// +// NOTE!: This file is autogenerated - do not modify! +// if you need to make a change, please see the Groovy scripts in the +// activemq-core module +// + +using System; +using System.Collections; + +using ActiveMQ.OpenWire; +using ActiveMQ.Commands; + +namespace ActiveMQ.Commands +{ + /// + /// The ActiveMQ ReplayCommand Command + /// + public class ReplayCommand : BaseCommand + { + public const byte ID_ReplayCommand = 65; + + int firstNakNumber; + int lastNakNumber; + + public override string ToString() { + return GetType().Name + "[" + + " FirstNakNumber=" + FirstNakNumber + + " LastNakNumber=" + LastNakNumber + + " ]"; + + } + + + + public override byte GetDataStructureType() { + return ID_ReplayCommand; + } + + + // Properties + + public int FirstNakNumber + { + get { return firstNakNumber; } + set { this.firstNakNumber = value; } + } + + public int LastNakNumber + { + get { return lastNakNumber; } + set { this.lastNakNumber = value; } + } + + } +} diff --git a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/Response.cs b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/Response.cs index f0e21b2a95..9db5a8747d 100644 --- a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/Response.cs +++ b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/Response.cs @@ -1 +1,64 @@ -/* * Copyright 2006 The Apache Software Foundation or its licensors, as * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // // NOTE!: This file is autogenerated - do not modify! // if you need to make a change, please see the Groovy scripts in the // activemq-core module // using System; using System.Collections; using ActiveMQ.OpenWire; using ActiveMQ.Commands; namespace ActiveMQ.Commands { /// /// The ActiveMQ Response Command /// public class Response : BaseCommand { public const byte ID_Response = 30; int correlationId; public override string ToString() { return GetType().Name + "[" + " CorrelationId=" + CorrelationId + " ]"; } public override byte GetDataStructureType() { return ID_Response; } // Properties public int CorrelationId { get { return correlationId; } set { this.correlationId = value; } } } } \ No newline at end of file +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// +// NOTE!: This file is autogenerated - do not modify! +// if you need to make a change, please see the Groovy scripts in the +// activemq-core module +// + +using System; +using System.Collections; + +using ActiveMQ.OpenWire; +using ActiveMQ.Commands; + +namespace ActiveMQ.Commands +{ + /// + /// The ActiveMQ Response Command + /// + public class Response : BaseCommand + { + public const byte ID_Response = 30; + + int correlationId; + + public override string ToString() { + return GetType().Name + "[" + + " CorrelationId=" + CorrelationId + + " ]"; + + } + + + + public override byte GetDataStructureType() { + return ID_Response; + } + + + // Properties + + public int CorrelationId + { + get { return correlationId; } + set { this.correlationId = value; } + } + + } +} diff --git a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/SessionId.cs b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/SessionId.cs index 9445d853fb..e8d3368ae5 100644 --- a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/SessionId.cs +++ b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/SessionId.cs @@ -1 +1,96 @@ -/* * Copyright 2006 The Apache Software Foundation or its licensors, as * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // // NOTE!: This file is autogenerated - do not modify! // if you need to make a change, please see the Groovy scripts in the // activemq-core module // using System; using System.Collections; using ActiveMQ.OpenWire; using ActiveMQ.Commands; namespace ActiveMQ.Commands { /// /// The ActiveMQ SessionId Command /// public class SessionId : BaseDataStructure, DataStructure { public const byte ID_SessionId = 121; string connectionId; long value; public override int GetHashCode() { int answer = 0; answer = (answer * 37) + HashCode(ConnectionId); answer = (answer * 37) + HashCode(Value); return answer; } public override bool Equals(object that) { if (that is SessionId) { return Equals((SessionId) that); } return false; } public virtual bool Equals(SessionId that) { if (! Equals(this.ConnectionId, that.ConnectionId)) return false; if (! Equals(this.Value, that.Value)) return false; return true; } public override string ToString() { return GetType().Name + "[" + " ConnectionId=" + ConnectionId + " Value=" + Value + " ]"; } public override byte GetDataStructureType() { return ID_SessionId; } // Properties public string ConnectionId { get { return connectionId; } set { this.connectionId = value; } } public long Value { get { return value; } set { this.value = value; } } } } \ No newline at end of file +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// +// NOTE!: This file is autogenerated - do not modify! +// if you need to make a change, please see the Groovy scripts in the +// activemq-core module +// + +using System; +using System.Collections; + +using ActiveMQ.OpenWire; +using ActiveMQ.Commands; + +namespace ActiveMQ.Commands +{ + /// + /// The ActiveMQ SessionId Command + /// + public class SessionId : BaseDataStructure, DataStructure + { + public const byte ID_SessionId = 121; + + string connectionId; + long value; + + public override int GetHashCode() { + int answer = 0; + answer = (answer * 37) + HashCode(ConnectionId); + answer = (answer * 37) + HashCode(Value); + return answer; + + } + + + public override bool Equals(object that) { + if (that is SessionId) { + return Equals((SessionId) that); + } + return false; + } + + public virtual bool Equals(SessionId that) { + if (! Equals(this.ConnectionId, that.ConnectionId)) return false; + if (! Equals(this.Value, that.Value)) return false; + return true; + + } + + + public override string ToString() { + return GetType().Name + "[" + + " ConnectionId=" + ConnectionId + + " Value=" + Value + + " ]"; + + } + + + + public override byte GetDataStructureType() { + return ID_SessionId; + } + + + // Properties + + public string ConnectionId + { + get { return connectionId; } + set { this.connectionId = value; } + } + + public long Value + { + get { return value; } + set { this.value = value; } + } + + } +} diff --git a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/SessionInfo.cs b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/SessionInfo.cs index 5f0d200462..2b71d4d518 100644 --- a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/SessionInfo.cs +++ b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/SessionInfo.cs @@ -1 +1,64 @@ -/* * Copyright 2006 The Apache Software Foundation or its licensors, as * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // // NOTE!: This file is autogenerated - do not modify! // if you need to make a change, please see the Groovy scripts in the // activemq-core module // using System; using System.Collections; using ActiveMQ.OpenWire; using ActiveMQ.Commands; namespace ActiveMQ.Commands { /// /// The ActiveMQ SessionInfo Command /// public class SessionInfo : BaseCommand { public const byte ID_SessionInfo = 4; SessionId sessionId; public override string ToString() { return GetType().Name + "[" + " SessionId=" + SessionId + " ]"; } public override byte GetDataStructureType() { return ID_SessionInfo; } // Properties public SessionId SessionId { get { return sessionId; } set { this.sessionId = value; } } } } \ No newline at end of file +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// +// NOTE!: This file is autogenerated - do not modify! +// if you need to make a change, please see the Groovy scripts in the +// activemq-core module +// + +using System; +using System.Collections; + +using ActiveMQ.OpenWire; +using ActiveMQ.Commands; + +namespace ActiveMQ.Commands +{ + /// + /// The ActiveMQ SessionInfo Command + /// + public class SessionInfo : BaseCommand + { + public const byte ID_SessionInfo = 4; + + SessionId sessionId; + + public override string ToString() { + return GetType().Name + "[" + + " SessionId=" + SessionId + + " ]"; + + } + + + + public override byte GetDataStructureType() { + return ID_SessionInfo; + } + + + // Properties + + public SessionId SessionId + { + get { return sessionId; } + set { this.sessionId = value; } + } + + } +} diff --git a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/ShutdownInfo.cs b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/ShutdownInfo.cs index c4015afc76..7e72d90dc8 100644 --- a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/ShutdownInfo.cs +++ b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/ShutdownInfo.cs @@ -1 +1,56 @@ -/* * Copyright 2006 The Apache Software Foundation or its licensors, as * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // // NOTE!: This file is autogenerated - do not modify! // if you need to make a change, please see the Groovy scripts in the // activemq-core module // using System; using System.Collections; using ActiveMQ.OpenWire; using ActiveMQ.Commands; namespace ActiveMQ.Commands { /// /// The ActiveMQ ShutdownInfo Command /// public class ShutdownInfo : BaseCommand { public const byte ID_ShutdownInfo = 11; public override string ToString() { return GetType().Name + "[" + " ]"; } public override byte GetDataStructureType() { return ID_ShutdownInfo; } // Properties } } \ No newline at end of file +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// +// NOTE!: This file is autogenerated - do not modify! +// if you need to make a change, please see the Groovy scripts in the +// activemq-core module +// + +using System; +using System.Collections; + +using ActiveMQ.OpenWire; +using ActiveMQ.Commands; + +namespace ActiveMQ.Commands +{ + /// + /// The ActiveMQ ShutdownInfo Command + /// + public class ShutdownInfo : BaseCommand + { + public const byte ID_ShutdownInfo = 11; + + + public override string ToString() { + return GetType().Name + "[" + + " ]"; + + } + + + + public override byte GetDataStructureType() { + return ID_ShutdownInfo; + } + + + // Properties + + } +} diff --git a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/SubscriptionInfo.cs b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/SubscriptionInfo.cs index 0da8e6f1c7..1b2252b1c7 100644 --- a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/SubscriptionInfo.cs +++ b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/SubscriptionInfo.cs @@ -1 +1,88 @@ -/* * Copyright 2006 The Apache Software Foundation or its licensors, as * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // // NOTE!: This file is autogenerated - do not modify! // if you need to make a change, please see the Groovy scripts in the // activemq-core module // using System; using System.Collections; using ActiveMQ.OpenWire; using ActiveMQ.Commands; namespace ActiveMQ.Commands { /// /// The ActiveMQ SubscriptionInfo Command /// public class SubscriptionInfo : BaseDataStructure, DataStructure { public const byte ID_SubscriptionInfo = 55; string clientId; ActiveMQDestination destination; string selector; string subcriptionName; public override string ToString() { return GetType().Name + "[" + " ClientId=" + ClientId + " Destination=" + Destination + " Selector=" + Selector + " SubcriptionName=" + SubcriptionName + " ]"; } public override byte GetDataStructureType() { return ID_SubscriptionInfo; } // Properties public string ClientId { get { return clientId; } set { this.clientId = value; } } public ActiveMQDestination Destination { get { return destination; } set { this.destination = value; } } public string Selector { get { return selector; } set { this.selector = value; } } public string SubcriptionName { get { return subcriptionName; } set { this.subcriptionName = value; } } } } \ No newline at end of file +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// +// NOTE!: This file is autogenerated - do not modify! +// if you need to make a change, please see the Groovy scripts in the +// activemq-core module +// + +using System; +using System.Collections; + +using ActiveMQ.OpenWire; +using ActiveMQ.Commands; + +namespace ActiveMQ.Commands +{ + /// + /// The ActiveMQ SubscriptionInfo Command + /// + public class SubscriptionInfo : BaseDataStructure, DataStructure + { + public const byte ID_SubscriptionInfo = 55; + + string clientId; + ActiveMQDestination destination; + string selector; + string subcriptionName; + + public override string ToString() { + return GetType().Name + "[" + + " ClientId=" + ClientId + + " Destination=" + Destination + + " Selector=" + Selector + + " SubcriptionName=" + SubcriptionName + + " ]"; + + } + + + + public override byte GetDataStructureType() { + return ID_SubscriptionInfo; + } + + + // Properties + + public string ClientId + { + get { return clientId; } + set { this.clientId = value; } + } + + public ActiveMQDestination Destination + { + get { return destination; } + set { this.destination = value; } + } + + public string Selector + { + get { return selector; } + set { this.selector = value; } + } + + public string SubcriptionName + { + get { return subcriptionName; } + set { this.subcriptionName = value; } + } + + } +} diff --git a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/TransactionId.cs b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/TransactionId.cs index d149205c6e..288e876b06 100644 --- a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/TransactionId.cs +++ b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/TransactionId.cs @@ -1 +1,76 @@ -/* * Copyright 2006 The Apache Software Foundation or its licensors, as * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // // NOTE!: This file is autogenerated - do not modify! // if you need to make a change, please see the Groovy scripts in the // activemq-core module // using System; using System.Collections; using ActiveMQ.OpenWire; using ActiveMQ.Commands; namespace ActiveMQ.Commands { /// /// The ActiveMQ TransactionId Command /// public class TransactionId : BaseDataStructure, DataStructure { public const byte ID_TransactionId = 0; public override int GetHashCode() { int answer = 0; return answer; } public override bool Equals(object that) { if (that is TransactionId) { return Equals((TransactionId) that); } return false; } public virtual bool Equals(TransactionId that) { return true; } public override string ToString() { return GetType().Name + "[" + " ]"; } public override byte GetDataStructureType() { return ID_TransactionId; } // Properties } } \ No newline at end of file +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// +// NOTE!: This file is autogenerated - do not modify! +// if you need to make a change, please see the Groovy scripts in the +// activemq-core module +// + +using System; +using System.Collections; + +using ActiveMQ.OpenWire; +using ActiveMQ.Commands; + +namespace ActiveMQ.Commands +{ + /// + /// The ActiveMQ TransactionId Command + /// + public class TransactionId : BaseDataStructure, DataStructure + { + public const byte ID_TransactionId = 0; + + + public override int GetHashCode() { + int answer = 0; + return answer; + + } + + + public override bool Equals(object that) { + if (that is TransactionId) { + return Equals((TransactionId) that); + } + return false; + } + + public virtual bool Equals(TransactionId that) { + return true; + + } + + + public override string ToString() { + return GetType().Name + "[" + + " ]"; + + } + + + + public override byte GetDataStructureType() { + return ID_TransactionId; + } + + + // Properties + + } +} diff --git a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/TransactionInfo.cs b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/TransactionInfo.cs index 0b038db765..3331e0ee6c 100644 --- a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/TransactionInfo.cs +++ b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/TransactionInfo.cs @@ -1 +1,80 @@ -/* * Copyright 2006 The Apache Software Foundation or its licensors, as * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // // NOTE!: This file is autogenerated - do not modify! // if you need to make a change, please see the Groovy scripts in the // activemq-core module // using System; using System.Collections; using ActiveMQ.OpenWire; using ActiveMQ.Commands; namespace ActiveMQ.Commands { /// /// The ActiveMQ TransactionInfo Command /// public class TransactionInfo : BaseCommand { public const byte ID_TransactionInfo = 7; ConnectionId connectionId; TransactionId transactionId; byte type; public override string ToString() { return GetType().Name + "[" + " ConnectionId=" + ConnectionId + " TransactionId=" + TransactionId + " Type=" + Type + " ]"; } public override byte GetDataStructureType() { return ID_TransactionInfo; } // Properties public ConnectionId ConnectionId { get { return connectionId; } set { this.connectionId = value; } } public TransactionId TransactionId { get { return transactionId; } set { this.transactionId = value; } } public byte Type { get { return type; } set { this.type = value; } } } } \ No newline at end of file +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// +// NOTE!: This file is autogenerated - do not modify! +// if you need to make a change, please see the Groovy scripts in the +// activemq-core module +// + +using System; +using System.Collections; + +using ActiveMQ.OpenWire; +using ActiveMQ.Commands; + +namespace ActiveMQ.Commands +{ + /// + /// The ActiveMQ TransactionInfo Command + /// + public class TransactionInfo : BaseCommand + { + public const byte ID_TransactionInfo = 7; + + ConnectionId connectionId; + TransactionId transactionId; + byte type; + + public override string ToString() { + return GetType().Name + "[" + + " ConnectionId=" + ConnectionId + + " TransactionId=" + TransactionId + + " Type=" + Type + + " ]"; + + } + + + + public override byte GetDataStructureType() { + return ID_TransactionInfo; + } + + + // Properties + + public ConnectionId ConnectionId + { + get { return connectionId; } + set { this.connectionId = value; } + } + + public TransactionId TransactionId + { + get { return transactionId; } + set { this.transactionId = value; } + } + + public byte Type + { + get { return type; } + set { this.type = value; } + } + + } +} diff --git a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/XATransactionId.cs b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/XATransactionId.cs index 8437ab2dce..6c42707822 100644 --- a/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/XATransactionId.cs +++ b/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/XATransactionId.cs @@ -1 +1,106 @@ -/* * Copyright 2006 The Apache Software Foundation or its licensors, as * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // // NOTE!: This file is autogenerated - do not modify! // if you need to make a change, please see the Groovy scripts in the // activemq-core module // using System; using System.Collections; using ActiveMQ.OpenWire; using ActiveMQ.Commands; namespace ActiveMQ.Commands { /// /// The ActiveMQ XATransactionId Command /// public class XATransactionId : TransactionId, Xid { public const byte ID_XATransactionId = 112; int formatId; byte[] globalTransactionId; byte[] branchQualifier; public override int GetHashCode() { int answer = 0; answer = (answer * 37) + HashCode(FormatId); answer = (answer * 37) + HashCode(GlobalTransactionId); answer = (answer * 37) + HashCode(BranchQualifier); return answer; } public override bool Equals(object that) { if (that is XATransactionId) { return Equals((XATransactionId) that); } return false; } public virtual bool Equals(XATransactionId that) { if (! Equals(this.FormatId, that.FormatId)) return false; if (! Equals(this.GlobalTransactionId, that.GlobalTransactionId)) return false; if (! Equals(this.BranchQualifier, that.BranchQualifier)) return false; return true; } public override string ToString() { return GetType().Name + "[" + " FormatId=" + FormatId + " GlobalTransactionId=" + GlobalTransactionId + " BranchQualifier=" + BranchQualifier + " ]"; } public override byte GetDataStructureType() { return ID_XATransactionId; } // Properties public int FormatId { get { return formatId; } set { this.formatId = value; } } public byte[] GlobalTransactionId { get { return globalTransactionId; } set { this.globalTransactionId = value; } } public byte[] BranchQualifier { get { return branchQualifier; } set { this.branchQualifier = value; } } } } \ No newline at end of file +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// +// NOTE!: This file is autogenerated - do not modify! +// if you need to make a change, please see the Groovy scripts in the +// activemq-core module +// + +using System; +using System.Collections; + +using ActiveMQ.OpenWire; +using ActiveMQ.Commands; + +namespace ActiveMQ.Commands +{ + /// + /// The ActiveMQ XATransactionId Command + /// + public class XATransactionId : TransactionId, Xid + { + public const byte ID_XATransactionId = 112; + + int formatId; + byte[] globalTransactionId; + byte[] branchQualifier; + + public override int GetHashCode() { + int answer = 0; + answer = (answer * 37) + HashCode(FormatId); + answer = (answer * 37) + HashCode(GlobalTransactionId); + answer = (answer * 37) + HashCode(BranchQualifier); + return answer; + + } + + + public override bool Equals(object that) { + if (that is XATransactionId) { + return Equals((XATransactionId) that); + } + return false; + } + + public virtual bool Equals(XATransactionId that) { + if (! Equals(this.FormatId, that.FormatId)) return false; + if (! Equals(this.GlobalTransactionId, that.GlobalTransactionId)) return false; + if (! Equals(this.BranchQualifier, that.BranchQualifier)) return false; + return true; + + } + + + public override string ToString() { + return GetType().Name + "[" + + " FormatId=" + FormatId + + " GlobalTransactionId=" + GlobalTransactionId + + " BranchQualifier=" + BranchQualifier + + " ]"; + + } + + + + public override byte GetDataStructureType() { + return ID_XATransactionId; + } + + + // Properties + + public int FormatId + { + get { return formatId; } + set { this.formatId = value; } + } + + public byte[] GlobalTransactionId + { + get { return globalTransactionId; } + set { this.globalTransactionId = value; } + } + + public byte[] BranchQualifier + { + get { return branchQualifier; } + set { this.branchQualifier = value; } + } + + } +} diff --git a/activemq-dotnet/src/main/csharp/ActiveMQ/ISynchronization.cs b/activemq-dotnet/src/main/csharp/ActiveMQ/ISynchronization.cs index cbfaa9ab37..0124fe7f18 100644 --- a/activemq-dotnet/src/main/csharp/ActiveMQ/ISynchronization.cs +++ b/activemq-dotnet/src/main/csharp/ActiveMQ/ISynchronization.cs @@ -1,38 +1,38 @@ -/* - * Copyright 2006 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace ActiveMQ -{ - public interface ISynchronization - { - /// - /// Called before a commit - /// - void BeforeCommit(); - - /// - /// Called after a commit - /// - void AfterCommit(); - - /// - /// Called after a transaction rollback - /// - void AfterRollback(); - } -} - +/* + * Copyright 2006 The Apache Software Foundation or its licensors, as + * applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +namespace ActiveMQ +{ + public interface ISynchronization + { + /// + /// Called before a commit + /// + void BeforeCommit(); + + /// + /// Called after a commit + /// + void AfterCommit(); + + /// + /// Called after a transaction rollback + /// + void AfterRollback(); + } +} + diff --git a/activemq-dotnet/src/main/csharp/ActiveMQ/OpenWire/BooleanStream.cs b/activemq-dotnet/src/main/csharp/ActiveMQ/OpenWire/BooleanStream.cs index 9b39b5bdbd..21b5444bc3 100755 --- a/activemq-dotnet/src/main/csharp/ActiveMQ/OpenWire/BooleanStream.cs +++ b/activemq-dotnet/src/main/csharp/ActiveMQ/OpenWire/BooleanStream.cs @@ -1,122 +1,122 @@ -/* - * Copyright 2006 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -using System; -using System.IO; - -using ActiveMQ.OpenWire; - -namespace ActiveMQ.OpenWire - -{ - /// - /// Represents a stream of boolean flags - /// - public class BooleanStream - { - byte[] data = new byte[48]; - short arrayLimit; - short arrayPos; - byte bytePos; - - public bool ReadBoolean() - { - byte b = data[arrayPos]; - bool rc = ((b >> bytePos) & 0x01) != 0; - bytePos++; - if (bytePos >= 8) - { - bytePos = 0; - arrayPos++; - } - return rc; - } - - public void WriteBoolean(bool value) - { - if (bytePos == 0) - { - arrayLimit++; - if (arrayLimit >= data.Length) - { - // re-grow the array. - byte[] d = new byte[data.Length * 2]; - Array.Copy(data, d, data.Length); - data = d; - } - } - if (value) - { - data[arrayPos] |= (byte) (0x01 << bytePos); - } - bytePos++; - if (bytePos >= 8) - { - bytePos = 0; - arrayPos++; - } - } - - public void Marshal(BinaryWriter dataOut) - { - if( arrayLimit < 64 ) { - dataOut.Write((byte)arrayLimit); - } else if( arrayLimit < 256 ) { // max value of unsigned byte - dataOut.Write((byte)0xC0); - dataOut.Write((byte)arrayLimit); - } else { - dataOut.Write((byte)0x80); - dataOut.Write(arrayLimit); - } - dataOut.Write(data, 0, arrayLimit); - Clear(); - } - - public void Unmarshal(BinaryReader dataIn) - { - arrayLimit = (short)(dataIn.ReadByte() & 0xFF); - if ( arrayLimit == 0xC0 ) { - arrayLimit = (short)(dataIn.ReadByte() & 0xFF); - } else if( arrayLimit == 0x80 ) { - arrayLimit = dataIn.ReadInt16(); - } - if( data.Length < arrayLimit ) { - data = new byte[arrayLimit]; - } - - dataIn.Read(data, 0, arrayLimit); - Clear(); - } - - public void Clear() - { - arrayPos = 0; - bytePos = 0; - } - - public int MarshalledSize() - { - if( arrayLimit < 64 ) { - return 1+arrayLimit; - } else if (arrayLimit < 256) { - return 2+arrayLimit; - } else { - return 3+arrayLimit; - } - - } - } -} +/* + * Copyright 2006 The Apache Software Foundation or its licensors, as + * applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +using System; +using System.IO; + +using ActiveMQ.OpenWire; + +namespace ActiveMQ.OpenWire + +{ + /// + /// Represents a stream of boolean flags + /// + public class BooleanStream + { + byte[] data = new byte[48]; + short arrayLimit; + short arrayPos; + byte bytePos; + + public bool ReadBoolean() + { + byte b = data[arrayPos]; + bool rc = ((b >> bytePos) & 0x01) != 0; + bytePos++; + if (bytePos >= 8) + { + bytePos = 0; + arrayPos++; + } + return rc; + } + + public void WriteBoolean(bool value) + { + if (bytePos == 0) + { + arrayLimit++; + if (arrayLimit >= data.Length) + { + // re-grow the array. + byte[] d = new byte[data.Length * 2]; + Array.Copy(data, d, data.Length); + data = d; + } + } + if (value) + { + data[arrayPos] |= (byte) (0x01 << bytePos); + } + bytePos++; + if (bytePos >= 8) + { + bytePos = 0; + arrayPos++; + } + } + + public void Marshal(BinaryWriter dataOut) + { + if( arrayLimit < 64 ) { + dataOut.Write((byte)arrayLimit); + } else if( arrayLimit < 256 ) { // max value of unsigned byte + dataOut.Write((byte)0xC0); + dataOut.Write((byte)arrayLimit); + } else { + dataOut.Write((byte)0x80); + dataOut.Write(arrayLimit); + } + dataOut.Write(data, 0, arrayLimit); + Clear(); + } + + public void Unmarshal(BinaryReader dataIn) + { + arrayLimit = (short)(dataIn.ReadByte() & 0xFF); + if ( arrayLimit == 0xC0 ) { + arrayLimit = (short)(dataIn.ReadByte() & 0xFF); + } else if( arrayLimit == 0x80 ) { + arrayLimit = dataIn.ReadInt16(); + } + if( data.Length < arrayLimit ) { + data = new byte[arrayLimit]; + } + + dataIn.Read(data, 0, arrayLimit); + Clear(); + } + + public void Clear() + { + arrayPos = 0; + bytePos = 0; + } + + public int MarshalledSize() + { + if( arrayLimit < 64 ) { + return 1+arrayLimit; + } else if (arrayLimit < 256) { + return 2+arrayLimit; + } else { + return 3+arrayLimit; + } + + } + } +} diff --git a/activemq-dotnet/src/main/csharp/ActiveMQ/OpenWire/MessagePropertyHelper.cs b/activemq-dotnet/src/main/csharp/ActiveMQ/OpenWire/MessagePropertyHelper.cs index 742ef349ff..97de2a2941 100644 --- a/activemq-dotnet/src/main/csharp/ActiveMQ/OpenWire/MessagePropertyHelper.cs +++ b/activemq-dotnet/src/main/csharp/ActiveMQ/OpenWire/MessagePropertyHelper.cs @@ -1,53 +1,53 @@ -/* - * Copyright 2006 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. -*/ -using ActiveMQ.Commands; -using System.Collections; - -namespace ActiveMQ.OpenWire -{ - public delegate object PropertyGetter(ActiveMQMessage message); - public delegate void PropertySetter(ActiveMQMessage message, object value); - - public class MessagePropertyHelper - { - private IDictionary setters = new Hashtable(); - private IDictionary getters = new Hashtable(); - - public MessagePropertyHelper() - { - // TODO find all of the JMS properties via introspection - } - - - public object GetObjectProperty(ActiveMQMessage message, string name) { - object getter = getters[name]; - if (getter != null) { - } - return message.Properties[name]; - } - - public void SetObjectProperty(ActiveMQMessage message, string name, object value) { - PropertySetter setter = (PropertySetter) setters[name]; - if (setter != null) { - setter(message, value); - } - else { - message.Properties[name] = value; - } - } - } -} +/* + * Copyright 2006 The Apache Software Foundation or its licensors, as + * applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. +*/ +using ActiveMQ.Commands; +using System.Collections; + +namespace ActiveMQ.OpenWire +{ + public delegate object PropertyGetter(ActiveMQMessage message); + public delegate void PropertySetter(ActiveMQMessage message, object value); + + public class MessagePropertyHelper + { + private IDictionary setters = new Hashtable(); + private IDictionary getters = new Hashtable(); + + public MessagePropertyHelper() + { + // TODO find all of the JMS properties via introspection + } + + + public object GetObjectProperty(ActiveMQMessage message, string name) { + object getter = getters[name]; + if (getter != null) { + } + return message.Properties[name]; + } + + public void SetObjectProperty(ActiveMQMessage message, string name, object value) { + PropertySetter setter = (PropertySetter) setters[name]; + if (setter != null) { + setter(message, value); + } + else { + message.Properties[name] = value; + } + } + } +} diff --git a/activemq-dotnet/src/main/csharp/ActiveMQ/OpenWire/OpenWireFormat.cs b/activemq-dotnet/src/main/csharp/ActiveMQ/OpenWire/OpenWireFormat.cs index 3ae3a917f4..604f703576 100755 --- a/activemq-dotnet/src/main/csharp/ActiveMQ/OpenWire/OpenWireFormat.cs +++ b/activemq-dotnet/src/main/csharp/ActiveMQ/OpenWire/OpenWireFormat.cs @@ -1,279 +1,279 @@ -/* - * Copyright 2006 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -using ActiveMQ.Commands; -using ActiveMQ.OpenWire.V1; -using System; -using System.IO; - -namespace ActiveMQ.OpenWire -{ - /// - /// Represents the wire format - /// - public class OpenWireFormat - { - - private BaseDataStreamMarshaller[] dataMarshallers; - private const byte NULL_TYPE = 0; - - private int version=1; - private bool stackTraceEnabled=false; - private bool tightEncodingEnabled=false; - private bool sizePrefixDisabled=false; - - public OpenWireFormat() - { - dataMarshallers = new BaseDataStreamMarshaller[256]; - MarshallerFactory factory = new MarshallerFactory(); - factory.configure(this); - } - - public bool StackTraceEnabled { - get { return stackTraceEnabled; } - set { stackTraceEnabled = value; } - } - public int Version { - get { return version; } - set { version = value; } - } - public bool SizePrefixDisabled { - get { return sizePrefixDisabled; } - set { sizePrefixDisabled = value; } - } - public bool TightEncodingEnabled { - get { return tightEncodingEnabled; } - set { tightEncodingEnabled = value; } - } - - public void addMarshaller(BaseDataStreamMarshaller marshaller) - { - byte type = marshaller.GetDataStructureType(); - dataMarshallers[type & 0xFF] = marshaller; - } - - public void Marshal(Object o, BinaryWriter ds) - { - int size = 1; - if (o != null) - { - DataStructure c = (DataStructure) o; - byte type = c.GetDataStructureType(); - BaseDataStreamMarshaller dsm = dataMarshallers[type & 0xFF]; - if (dsm == null) - throw new IOException("Unknown data type: " + type); - - if(tightEncodingEnabled) { - - BooleanStream bs = new BooleanStream(); - size += dsm.TightMarshal1(this, c, bs); - size += bs.MarshalledSize(); - - if( !sizePrefixDisabled ) { - ds.Write(size); - } - - ds.Write(type); - bs.Marshal(ds); - dsm.TightMarshal2(this, c, ds, bs); - - } else { - - BinaryWriter looseOut = ds; - MemoryStream ms = null; - // If we are prefixing then we need to first write it to memory, - // otherwise we can write direct to the stream. - if( !sizePrefixDisabled ) { - ms= new MemoryStream(); - looseOut = new OpenWireBinaryWriter(ms); - looseOut.Write(size); - } - - looseOut.Write(type); - dsm.LooseMarshal(this, c, looseOut); - - if( !sizePrefixDisabled ) { - ms.Position=0; - looseOut.Write( (int)ms.Length-4 ); - ds.Write(ms.GetBuffer(), 0, (int)ms.Length); - } - } - } - else - { - ds.Write(size); - ds.Write(NULL_TYPE); - } - } - - public Object Unmarshal(BinaryReader dis) - { - // lets ignore the size of the packet - if( !sizePrefixDisabled ) { - dis.ReadInt32(); - } - - // first byte is the type of the packet - byte dataType = dis.ReadByte(); - if (dataType != NULL_TYPE) - { - BaseDataStreamMarshaller dsm = dataMarshallers[dataType & 0xFF]; - if (dsm == null) - throw new IOException("Unknown data type: " + dataType); - //Console.WriteLine("Parsing type: " + dataType + " with: " + dsm); - Object data = dsm.CreateObject(); - - if(tightEncodingEnabled) { - BooleanStream bs = new BooleanStream(); - bs.Unmarshal(dis); - dsm.TightUnmarshal(this, data, dis, bs); - return data; - } else { - dsm.LooseUnmarshal(this, data, dis); - return data; - } - } - else - { - return null; - } - } - - public int TightMarshalNestedObject1(DataStructure o, BooleanStream bs) - { - bs.WriteBoolean(o != null); - if (o == null) - return 0; - - if (o.IsMarshallAware()) - { - MarshallAware ma = (MarshallAware) o; - byte[] sequence = ma.GetMarshalledForm(this); - bs.WriteBoolean(sequence != null); - if (sequence != null) - { - return 1 + sequence.Length; - } - } - - byte type = o.GetDataStructureType(); - if (type == 0) { - throw new IOException("No valid data structure type for: " + o + " of type: " + o.GetType()); - } - BaseDataStreamMarshaller dsm = (BaseDataStreamMarshaller) dataMarshallers[type & 0xFF]; - if (dsm == null) - throw new IOException("Unknown data type: " + type); - //Console.WriteLine("Marshalling type: " + type + " with structure: " + o); - return 1 + dsm.TightMarshal1(this, o, bs); - } - - public void TightMarshalNestedObject2(DataStructure o, BinaryWriter ds, BooleanStream bs) - { - if (!bs.ReadBoolean()) - return ; - - byte type = o.GetDataStructureType(); - ds.Write(type); - - if (o.IsMarshallAware() && bs.ReadBoolean()) - { - MarshallAware ma = (MarshallAware) o; - byte[] sequence = ma.GetMarshalledForm(this); - ds.Write(sequence, 0, sequence.Length); - } - else - { - - BaseDataStreamMarshaller dsm = (BaseDataStreamMarshaller) dataMarshallers[type & 0xFF]; - if (dsm == null) - throw new IOException("Unknown data type: " + type); - dsm.TightMarshal2(this, o, ds, bs); - } - } - - public DataStructure TightUnmarshalNestedObject(BinaryReader dis, BooleanStream bs) - { - if (bs.ReadBoolean()) - { - - byte dataType = dis.ReadByte(); - BaseDataStreamMarshaller dsm = (BaseDataStreamMarshaller) dataMarshallers[dataType & 0xFF]; - if (dsm == null) - throw new IOException("Unknown data type: " + dataType); - DataStructure data = dsm.CreateObject(); - - if (data.IsMarshallAware() && bs.ReadBoolean()) - { - dis.ReadInt32(); - dis.ReadByte(); - - BooleanStream bs2 = new BooleanStream(); - bs2.Unmarshal(dis); - dsm.TightUnmarshal(this, data, dis, bs2); - - // TODO: extract the sequence from the dis and associate it. - // MarshallAware ma = (MarshallAware)data - // ma.setCachedMarshalledForm(this, sequence); - } - else - { - dsm.TightUnmarshal(this, data, dis, bs); - } - - return data; - } - else - { - return null; - } - } - - - - public void LooseMarshalNestedObject(DataStructure o, BinaryWriter dataOut) - { - dataOut.Write(o!=null); - if( o!=null ) { - byte type = o.GetDataStructureType(); - dataOut.Write(type); - BaseDataStreamMarshaller dsm = (BaseDataStreamMarshaller) dataMarshallers[type & 0xFF]; - if( dsm == null ) - throw new IOException("Unknown data type: "+type); - dsm.LooseMarshal(this, o, dataOut); - } - } - - public DataStructure LooseUnmarshalNestedObject(BinaryReader dis) - { - if (dis.ReadBoolean()) - { - - byte dataType = dis.ReadByte(); - BaseDataStreamMarshaller dsm = (BaseDataStreamMarshaller) dataMarshallers[dataType & 0xFF]; - if (dsm == null) - throw new IOException("Unknown data type: " + dataType); - DataStructure data = dsm.CreateObject(); - dsm.LooseUnmarshal(this, data, dis); - return data; - } - else - { - return null; - } - } - - } -} +/* + * Copyright 2006 The Apache Software Foundation or its licensors, as + * applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +using ActiveMQ.Commands; +using ActiveMQ.OpenWire.V1; +using System; +using System.IO; + +namespace ActiveMQ.OpenWire +{ + /// + /// Represents the wire format + /// + public class OpenWireFormat + { + + private BaseDataStreamMarshaller[] dataMarshallers; + private const byte NULL_TYPE = 0; + + private int version=1; + private bool stackTraceEnabled=false; + private bool tightEncodingEnabled=false; + private bool sizePrefixDisabled=false; + + public OpenWireFormat() + { + dataMarshallers = new BaseDataStreamMarshaller[256]; + MarshallerFactory factory = new MarshallerFactory(); + factory.configure(this); + } + + public bool StackTraceEnabled { + get { return stackTraceEnabled; } + set { stackTraceEnabled = value; } + } + public int Version { + get { return version; } + set { version = value; } + } + public bool SizePrefixDisabled { + get { return sizePrefixDisabled; } + set { sizePrefixDisabled = value; } + } + public bool TightEncodingEnabled { + get { return tightEncodingEnabled; } + set { tightEncodingEnabled = value; } + } + + public void addMarshaller(BaseDataStreamMarshaller marshaller) + { + byte type = marshaller.GetDataStructureType(); + dataMarshallers[type & 0xFF] = marshaller; + } + + public void Marshal(Object o, BinaryWriter ds) + { + int size = 1; + if (o != null) + { + DataStructure c = (DataStructure) o; + byte type = c.GetDataStructureType(); + BaseDataStreamMarshaller dsm = dataMarshallers[type & 0xFF]; + if (dsm == null) + throw new IOException("Unknown data type: " + type); + + if(tightEncodingEnabled) { + + BooleanStream bs = new BooleanStream(); + size += dsm.TightMarshal1(this, c, bs); + size += bs.MarshalledSize(); + + if( !sizePrefixDisabled ) { + ds.Write(size); + } + + ds.Write(type); + bs.Marshal(ds); + dsm.TightMarshal2(this, c, ds, bs); + + } else { + + BinaryWriter looseOut = ds; + MemoryStream ms = null; + // If we are prefixing then we need to first write it to memory, + // otherwise we can write direct to the stream. + if( !sizePrefixDisabled ) { + ms= new MemoryStream(); + looseOut = new OpenWireBinaryWriter(ms); + looseOut.Write(size); + } + + looseOut.Write(type); + dsm.LooseMarshal(this, c, looseOut); + + if( !sizePrefixDisabled ) { + ms.Position=0; + looseOut.Write( (int)ms.Length-4 ); + ds.Write(ms.GetBuffer(), 0, (int)ms.Length); + } + } + } + else + { + ds.Write(size); + ds.Write(NULL_TYPE); + } + } + + public Object Unmarshal(BinaryReader dis) + { + // lets ignore the size of the packet + if( !sizePrefixDisabled ) { + dis.ReadInt32(); + } + + // first byte is the type of the packet + byte dataType = dis.ReadByte(); + if (dataType != NULL_TYPE) + { + BaseDataStreamMarshaller dsm = dataMarshallers[dataType & 0xFF]; + if (dsm == null) + throw new IOException("Unknown data type: " + dataType); + //Console.WriteLine("Parsing type: " + dataType + " with: " + dsm); + Object data = dsm.CreateObject(); + + if(tightEncodingEnabled) { + BooleanStream bs = new BooleanStream(); + bs.Unmarshal(dis); + dsm.TightUnmarshal(this, data, dis, bs); + return data; + } else { + dsm.LooseUnmarshal(this, data, dis); + return data; + } + } + else + { + return null; + } + } + + public int TightMarshalNestedObject1(DataStructure o, BooleanStream bs) + { + bs.WriteBoolean(o != null); + if (o == null) + return 0; + + if (o.IsMarshallAware()) + { + MarshallAware ma = (MarshallAware) o; + byte[] sequence = ma.GetMarshalledForm(this); + bs.WriteBoolean(sequence != null); + if (sequence != null) + { + return 1 + sequence.Length; + } + } + + byte type = o.GetDataStructureType(); + if (type == 0) { + throw new IOException("No valid data structure type for: " + o + " of type: " + o.GetType()); + } + BaseDataStreamMarshaller dsm = (BaseDataStreamMarshaller) dataMarshallers[type & 0xFF]; + if (dsm == null) + throw new IOException("Unknown data type: " + type); + //Console.WriteLine("Marshalling type: " + type + " with structure: " + o); + return 1 + dsm.TightMarshal1(this, o, bs); + } + + public void TightMarshalNestedObject2(DataStructure o, BinaryWriter ds, BooleanStream bs) + { + if (!bs.ReadBoolean()) + return ; + + byte type = o.GetDataStructureType(); + ds.Write(type); + + if (o.IsMarshallAware() && bs.ReadBoolean()) + { + MarshallAware ma = (MarshallAware) o; + byte[] sequence = ma.GetMarshalledForm(this); + ds.Write(sequence, 0, sequence.Length); + } + else + { + + BaseDataStreamMarshaller dsm = (BaseDataStreamMarshaller) dataMarshallers[type & 0xFF]; + if (dsm == null) + throw new IOException("Unknown data type: " + type); + dsm.TightMarshal2(this, o, ds, bs); + } + } + + public DataStructure TightUnmarshalNestedObject(BinaryReader dis, BooleanStream bs) + { + if (bs.ReadBoolean()) + { + + byte dataType = dis.ReadByte(); + BaseDataStreamMarshaller dsm = (BaseDataStreamMarshaller) dataMarshallers[dataType & 0xFF]; + if (dsm == null) + throw new IOException("Unknown data type: " + dataType); + DataStructure data = dsm.CreateObject(); + + if (data.IsMarshallAware() && bs.ReadBoolean()) + { + dis.ReadInt32(); + dis.ReadByte(); + + BooleanStream bs2 = new BooleanStream(); + bs2.Unmarshal(dis); + dsm.TightUnmarshal(this, data, dis, bs2); + + // TODO: extract the sequence from the dis and associate it. + // MarshallAware ma = (MarshallAware)data + // ma.setCachedMarshalledForm(this, sequence); + } + else + { + dsm.TightUnmarshal(this, data, dis, bs); + } + + return data; + } + else + { + return null; + } + } + + + + public void LooseMarshalNestedObject(DataStructure o, BinaryWriter dataOut) + { + dataOut.Write(o!=null); + if( o!=null ) { + byte type = o.GetDataStructureType(); + dataOut.Write(type); + BaseDataStreamMarshaller dsm = (BaseDataStreamMarshaller) dataMarshallers[type & 0xFF]; + if( dsm == null ) + throw new IOException("Unknown data type: "+type); + dsm.LooseMarshal(this, o, dataOut); + } + } + + public DataStructure LooseUnmarshalNestedObject(BinaryReader dis) + { + if (dis.ReadBoolean()) + { + + byte dataType = dis.ReadByte(); + BaseDataStreamMarshaller dsm = (BaseDataStreamMarshaller) dataMarshallers[dataType & 0xFF]; + if (dsm == null) + throw new IOException("Unknown data type: " + dataType); + DataStructure data = dsm.CreateObject(); + dsm.LooseUnmarshal(this, data, dis); + return data; + } + else + { + return null; + } + } + + } +} diff --git a/activemq-dotnet/src/main/csharp/ActiveMQ/OpenWire/V1/DataStructureSupportMarshaller.cs b/activemq-dotnet/src/main/csharp/ActiveMQ/OpenWire/V1/DataStructureSupportMarshaller.cs index 9161b62c30..de2421db13 100644 --- a/activemq-dotnet/src/main/csharp/ActiveMQ/OpenWire/V1/DataStructureSupportMarshaller.cs +++ b/activemq-dotnet/src/main/csharp/ActiveMQ/OpenWire/V1/DataStructureSupportMarshaller.cs @@ -1,64 +1,64 @@ -// -// -// Copyright 2005-2006 The Apache Software Foundation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -using ActiveMQ.Commands; -using System; -using System.IO; - -namespace ActiveMQ.OpenWire.V1 -{ - // - // Marshalling code for Open Wire Format for DataStructureSupport - // - // - // NOTE!: This file is autogenerated - do not modify! - // if you need to make a change, please see the Groovy scripts in the - // activemq-core module - // - public abstract class DataStructureSupportMarshaller : BaseDataStreamMarshaller - { - - // - // Un-marshal an object instance from the data input stream - // - public override void TightUnmarshal(OpenWireFormat wireFormat, Object o, BinaryReader dataIn, BooleanStream bs) - { - base.TightUnmarshal(wireFormat, o, dataIn, bs); - - } - - - // - // Write the booleans that this object uses to a BooleanStream - // - public override int TightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) { - DataStructureSupport info = (DataStructureSupport)o; - - int rc = base.TightMarshal1(wireFormat, info, bs); - - return rc + 0; - } - - // - // Write a object instance to data output stream - // - public override void TightMarshal2(OpenWireFormat wireFormat, Object o, BinaryWriter dataOut, BooleanStream bs) { - base.TightMarshal2(wireFormat, o, dataOut, bs); - - } - } -} +// +// +// Copyright 2005-2006 The Apache Software Foundation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +using ActiveMQ.Commands; +using System; +using System.IO; + +namespace ActiveMQ.OpenWire.V1 +{ + // + // Marshalling code for Open Wire Format for DataStructureSupport + // + // + // NOTE!: This file is autogenerated - do not modify! + // if you need to make a change, please see the Groovy scripts in the + // activemq-core module + // + public abstract class DataStructureSupportMarshaller : BaseDataStreamMarshaller + { + + // + // Un-marshal an object instance from the data input stream + // + public override void TightUnmarshal(OpenWireFormat wireFormat, Object o, BinaryReader dataIn, BooleanStream bs) + { + base.TightUnmarshal(wireFormat, o, dataIn, bs); + + } + + + // + // Write the booleans that this object uses to a BooleanStream + // + public override int TightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) { + DataStructureSupport info = (DataStructureSupport)o; + + int rc = base.TightMarshal1(wireFormat, info, bs); + + return rc + 0; + } + + // + // Write a object instance to data output stream + // + public override void TightMarshal2(OpenWireFormat wireFormat, Object o, BinaryWriter dataOut, BooleanStream bs) { + base.TightMarshal2(wireFormat, o, dataOut, bs); + + } + } +} diff --git a/activemq-dotnet/src/main/csharp/ActiveMQ/OpenWire/V1/LastPartialCommandMarshaller.cs b/activemq-dotnet/src/main/csharp/ActiveMQ/OpenWire/V1/LastPartialCommandMarshaller.cs index 6f19ccded0..94b15e1e6a 100644 --- a/activemq-dotnet/src/main/csharp/ActiveMQ/OpenWire/V1/LastPartialCommandMarshaller.cs +++ b/activemq-dotnet/src/main/csharp/ActiveMQ/OpenWire/V1/LastPartialCommandMarshaller.cs @@ -1 +1,98 @@ -/* * Copyright 2006 The Apache Software Foundation or its licensors, as * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // // NOTE!: This file is autogenerated - do not modify! // if you need to make a change, please see the Groovy scripts in the // activemq-core module // using System; using System.Collections; using System.IO; using ActiveMQ.Commands; using ActiveMQ.OpenWire; using ActiveMQ.OpenWire.V1; namespace ActiveMQ.OpenWire.V1 { /// /// Marshalling code for Open Wire Format for LastPartialCommand /// class LastPartialCommandMarshaller : BaseCommandMarshaller { public override DataStructure CreateObject() { return new LastPartialCommand(); } public override byte GetDataStructureType() { return LastPartialCommand.ID_LastPartialCommand; } // // Un-marshal an object instance from the data input stream // public override void TightUnmarshal(OpenWireFormat wireFormat, Object o, BinaryReader dataIn, BooleanStream bs) { base.TightUnmarshal(wireFormat, o, dataIn, bs); } // // Write the booleans that this object uses to a BooleanStream // public override int TightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) { LastPartialCommand info = (LastPartialCommand)o; int rc = base.TightMarshal1(wireFormat, info, bs); return rc + 0; } // // Write a object instance to data output stream // public override void TightMarshal2(OpenWireFormat wireFormat, Object o, BinaryWriter dataOut, BooleanStream bs) { base.TightMarshal2(wireFormat, o, dataOut, bs); } // // Un-marshal an object instance from the data input stream // public override void LooseUnmarshal(OpenWireFormat wireFormat, Object o, BinaryReader dataIn) { base.LooseUnmarshal(wireFormat, o, dataIn); } // // Write a object instance to data output stream // public override void LooseMarshal(OpenWireFormat wireFormat, Object o, BinaryWriter dataOut) { base.LooseMarshal(wireFormat, o, dataOut); } } } \ No newline at end of file +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// +// NOTE!: This file is autogenerated - do not modify! +// if you need to make a change, please see the Groovy scripts in the +// activemq-core module +// + +using System; +using System.Collections; +using System.IO; + +using ActiveMQ.Commands; +using ActiveMQ.OpenWire; +using ActiveMQ.OpenWire.V1; + +namespace ActiveMQ.OpenWire.V1 +{ + /// + /// Marshalling code for Open Wire Format for LastPartialCommand + /// + class LastPartialCommandMarshaller : BaseCommandMarshaller + { + + + public override DataStructure CreateObject() + { + return new LastPartialCommand(); + } + + public override byte GetDataStructureType() + { + return LastPartialCommand.ID_LastPartialCommand; + } + + // + // Un-marshal an object instance from the data input stream + // + public override void TightUnmarshal(OpenWireFormat wireFormat, Object o, BinaryReader dataIn, BooleanStream bs) + { + base.TightUnmarshal(wireFormat, o, dataIn, bs); + + } + + // + // Write the booleans that this object uses to a BooleanStream + // + public override int TightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) { + LastPartialCommand info = (LastPartialCommand)o; + + int rc = base.TightMarshal1(wireFormat, info, bs); + + return rc + 0; + } + + // + // Write a object instance to data output stream + // + public override void TightMarshal2(OpenWireFormat wireFormat, Object o, BinaryWriter dataOut, BooleanStream bs) { + base.TightMarshal2(wireFormat, o, dataOut, bs); + + } + + // + // Un-marshal an object instance from the data input stream + // + public override void LooseUnmarshal(OpenWireFormat wireFormat, Object o, BinaryReader dataIn) + { + base.LooseUnmarshal(wireFormat, o, dataIn); + + } + + // + // Write a object instance to data output stream + // + public override void LooseMarshal(OpenWireFormat wireFormat, Object o, BinaryWriter dataOut) { + + base.LooseMarshal(wireFormat, o, dataOut); + + } + + } +} diff --git a/activemq-dotnet/src/main/csharp/ActiveMQ/OpenWire/V1/MessageDispatchNotificationMarshaller.cs b/activemq-dotnet/src/main/csharp/ActiveMQ/OpenWire/V1/MessageDispatchNotificationMarshaller.cs index e7e5710b79..4015c80c8f 100644 --- a/activemq-dotnet/src/main/csharp/ActiveMQ/OpenWire/V1/MessageDispatchNotificationMarshaller.cs +++ b/activemq-dotnet/src/main/csharp/ActiveMQ/OpenWire/V1/MessageDispatchNotificationMarshaller.cs @@ -1 +1,126 @@ -/* * Copyright 2006 The Apache Software Foundation or its licensors, as * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // // NOTE!: This file is autogenerated - do not modify! // if you need to make a change, please see the Groovy scripts in the // activemq-core module // using System; using System.Collections; using System.IO; using ActiveMQ.Commands; using ActiveMQ.OpenWire; using ActiveMQ.OpenWire.V1; namespace ActiveMQ.OpenWire.V1 { /// /// Marshalling code for Open Wire Format for MessageDispatchNotification /// class MessageDispatchNotificationMarshaller : BaseCommandMarshaller { public override DataStructure CreateObject() { return new MessageDispatchNotification(); } public override byte GetDataStructureType() { return MessageDispatchNotification.ID_MessageDispatchNotification; } // // Un-marshal an object instance from the data input stream // public override void TightUnmarshal(OpenWireFormat wireFormat, Object o, BinaryReader dataIn, BooleanStream bs) { base.TightUnmarshal(wireFormat, o, dataIn, bs); MessageDispatchNotification info = (MessageDispatchNotification)o; info.ConsumerId = (ConsumerId) TightUnmarshalCachedObject(wireFormat, dataIn, bs); info.Destination = (ActiveMQDestination) TightUnmarshalCachedObject(wireFormat, dataIn, bs); info.DeliverySequenceId = TightUnmarshalLong(wireFormat, dataIn, bs); info.MessageId = (MessageId) TightUnmarshalNestedObject(wireFormat, dataIn, bs); } // // Write the booleans that this object uses to a BooleanStream // public override int TightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) { MessageDispatchNotification info = (MessageDispatchNotification)o; int rc = base.TightMarshal1(wireFormat, info, bs); rc += TightMarshalCachedObject1(wireFormat, (DataStructure)info.ConsumerId, bs); rc += TightMarshalCachedObject1(wireFormat, (DataStructure)info.Destination, bs); rc += TightMarshalLong1(wireFormat, info.DeliverySequenceId, bs); rc += TightMarshalNestedObject1(wireFormat, (DataStructure)info.MessageId, bs); return rc + 0; } // // Write a object instance to data output stream // public override void TightMarshal2(OpenWireFormat wireFormat, Object o, BinaryWriter dataOut, BooleanStream bs) { base.TightMarshal2(wireFormat, o, dataOut, bs); MessageDispatchNotification info = (MessageDispatchNotification)o; TightMarshalCachedObject2(wireFormat, (DataStructure)info.ConsumerId, dataOut, bs); TightMarshalCachedObject2(wireFormat, (DataStructure)info.Destination, dataOut, bs); TightMarshalLong2(wireFormat, info.DeliverySequenceId, dataOut, bs); TightMarshalNestedObject2(wireFormat, (DataStructure)info.MessageId, dataOut, bs); } // // Un-marshal an object instance from the data input stream // public override void LooseUnmarshal(OpenWireFormat wireFormat, Object o, BinaryReader dataIn) { base.LooseUnmarshal(wireFormat, o, dataIn); MessageDispatchNotification info = (MessageDispatchNotification)o; info.ConsumerId = (ConsumerId) LooseUnmarshalCachedObject(wireFormat, dataIn); info.Destination = (ActiveMQDestination) LooseUnmarshalCachedObject(wireFormat, dataIn); info.DeliverySequenceId = LooseUnmarshalLong(wireFormat, dataIn); info.MessageId = (MessageId) LooseUnmarshalNestedObject(wireFormat, dataIn); } // // Write a object instance to data output stream // public override void LooseMarshal(OpenWireFormat wireFormat, Object o, BinaryWriter dataOut) { MessageDispatchNotification info = (MessageDispatchNotification)o; base.LooseMarshal(wireFormat, o, dataOut); LooseMarshalCachedObject(wireFormat, (DataStructure)info.ConsumerId, dataOut); LooseMarshalCachedObject(wireFormat, (DataStructure)info.Destination, dataOut); LooseMarshalLong(wireFormat, info.DeliverySequenceId, dataOut); LooseMarshalNestedObject(wireFormat, (DataStructure)info.MessageId, dataOut); } } } \ No newline at end of file +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// +// NOTE!: This file is autogenerated - do not modify! +// if you need to make a change, please see the Groovy scripts in the +// activemq-core module +// + +using System; +using System.Collections; +using System.IO; + +using ActiveMQ.Commands; +using ActiveMQ.OpenWire; +using ActiveMQ.OpenWire.V1; + +namespace ActiveMQ.OpenWire.V1 +{ + /// + /// Marshalling code for Open Wire Format for MessageDispatchNotification + /// + class MessageDispatchNotificationMarshaller : BaseCommandMarshaller + { + + + public override DataStructure CreateObject() + { + return new MessageDispatchNotification(); + } + + public override byte GetDataStructureType() + { + return MessageDispatchNotification.ID_MessageDispatchNotification; + } + + // + // Un-marshal an object instance from the data input stream + // + public override void TightUnmarshal(OpenWireFormat wireFormat, Object o, BinaryReader dataIn, BooleanStream bs) + { + base.TightUnmarshal(wireFormat, o, dataIn, bs); + + MessageDispatchNotification info = (MessageDispatchNotification)o; + info.ConsumerId = (ConsumerId) TightUnmarshalCachedObject(wireFormat, dataIn, bs); + info.Destination = (ActiveMQDestination) TightUnmarshalCachedObject(wireFormat, dataIn, bs); + info.DeliverySequenceId = TightUnmarshalLong(wireFormat, dataIn, bs); + info.MessageId = (MessageId) TightUnmarshalNestedObject(wireFormat, dataIn, bs); + + } + + // + // Write the booleans that this object uses to a BooleanStream + // + public override int TightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) { + MessageDispatchNotification info = (MessageDispatchNotification)o; + + int rc = base.TightMarshal1(wireFormat, info, bs); + rc += TightMarshalCachedObject1(wireFormat, (DataStructure)info.ConsumerId, bs); + rc += TightMarshalCachedObject1(wireFormat, (DataStructure)info.Destination, bs); + rc += TightMarshalLong1(wireFormat, info.DeliverySequenceId, bs); + rc += TightMarshalNestedObject1(wireFormat, (DataStructure)info.MessageId, bs); + + return rc + 0; + } + + // + // Write a object instance to data output stream + // + public override void TightMarshal2(OpenWireFormat wireFormat, Object o, BinaryWriter dataOut, BooleanStream bs) { + base.TightMarshal2(wireFormat, o, dataOut, bs); + + MessageDispatchNotification info = (MessageDispatchNotification)o; + TightMarshalCachedObject2(wireFormat, (DataStructure)info.ConsumerId, dataOut, bs); + TightMarshalCachedObject2(wireFormat, (DataStructure)info.Destination, dataOut, bs); + TightMarshalLong2(wireFormat, info.DeliverySequenceId, dataOut, bs); + TightMarshalNestedObject2(wireFormat, (DataStructure)info.MessageId, dataOut, bs); + + } + + // + // Un-marshal an object instance from the data input stream + // + public override void LooseUnmarshal(OpenWireFormat wireFormat, Object o, BinaryReader dataIn) + { + base.LooseUnmarshal(wireFormat, o, dataIn); + + MessageDispatchNotification info = (MessageDispatchNotification)o; + info.ConsumerId = (ConsumerId) LooseUnmarshalCachedObject(wireFormat, dataIn); + info.Destination = (ActiveMQDestination) LooseUnmarshalCachedObject(wireFormat, dataIn); + info.DeliverySequenceId = LooseUnmarshalLong(wireFormat, dataIn); + info.MessageId = (MessageId) LooseUnmarshalNestedObject(wireFormat, dataIn); + + } + + // + // Write a object instance to data output stream + // + public override void LooseMarshal(OpenWireFormat wireFormat, Object o, BinaryWriter dataOut) { + + MessageDispatchNotification info = (MessageDispatchNotification)o; + + base.LooseMarshal(wireFormat, o, dataOut); + LooseMarshalCachedObject(wireFormat, (DataStructure)info.ConsumerId, dataOut); + LooseMarshalCachedObject(wireFormat, (DataStructure)info.Destination, dataOut); + LooseMarshalLong(wireFormat, info.DeliverySequenceId, dataOut); + LooseMarshalNestedObject(wireFormat, (DataStructure)info.MessageId, dataOut); + + } + + } +} diff --git a/activemq-dotnet/src/main/csharp/ActiveMQ/OpenWire/V1/NetworkBridgeFilterMarshaller.cs b/activemq-dotnet/src/main/csharp/ActiveMQ/OpenWire/V1/NetworkBridgeFilterMarshaller.cs index 23f59915bd..fec7b59186 100644 --- a/activemq-dotnet/src/main/csharp/ActiveMQ/OpenWire/V1/NetworkBridgeFilterMarshaller.cs +++ b/activemq-dotnet/src/main/csharp/ActiveMQ/OpenWire/V1/NetworkBridgeFilterMarshaller.cs @@ -1 +1,115 @@ -/* * Copyright 2006 The Apache Software Foundation or its licensors, as * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // // NOTE!: This file is autogenerated - do not modify! // if you need to make a change, please see the Groovy scripts in the // activemq-core module // using System; using System.Collections; using System.IO; using ActiveMQ.Commands; using ActiveMQ.OpenWire; using ActiveMQ.OpenWire.V1; namespace ActiveMQ.OpenWire.V1 { /// /// Marshalling code for Open Wire Format for NetworkBridgeFilter /// class NetworkBridgeFilterMarshaller : BaseDataStreamMarshaller { public override DataStructure CreateObject() { return new NetworkBridgeFilter(); } public override byte GetDataStructureType() { return NetworkBridgeFilter.ID_NetworkBridgeFilter; } // // Un-marshal an object instance from the data input stream // public override void TightUnmarshal(OpenWireFormat wireFormat, Object o, BinaryReader dataIn, BooleanStream bs) { base.TightUnmarshal(wireFormat, o, dataIn, bs); NetworkBridgeFilter info = (NetworkBridgeFilter)o; info.NetworkTTL = dataIn.ReadInt32(); info.NetworkBrokerId = (BrokerId) TightUnmarshalCachedObject(wireFormat, dataIn, bs); } // // Write the booleans that this object uses to a BooleanStream // public override int TightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) { NetworkBridgeFilter info = (NetworkBridgeFilter)o; int rc = base.TightMarshal1(wireFormat, info, bs); rc += TightMarshalCachedObject1(wireFormat, (DataStructure)info.NetworkBrokerId, bs); return rc + 4; } // // Write a object instance to data output stream // public override void TightMarshal2(OpenWireFormat wireFormat, Object o, BinaryWriter dataOut, BooleanStream bs) { base.TightMarshal2(wireFormat, o, dataOut, bs); NetworkBridgeFilter info = (NetworkBridgeFilter)o; dataOut.Write(info.NetworkTTL); TightMarshalCachedObject2(wireFormat, (DataStructure)info.NetworkBrokerId, dataOut, bs); } // // Un-marshal an object instance from the data input stream // public override void LooseUnmarshal(OpenWireFormat wireFormat, Object o, BinaryReader dataIn) { base.LooseUnmarshal(wireFormat, o, dataIn); NetworkBridgeFilter info = (NetworkBridgeFilter)o; info.NetworkTTL = dataIn.ReadInt32(); info.NetworkBrokerId = (BrokerId) LooseUnmarshalCachedObject(wireFormat, dataIn); } // // Write a object instance to data output stream // public override void LooseMarshal(OpenWireFormat wireFormat, Object o, BinaryWriter dataOut) { NetworkBridgeFilter info = (NetworkBridgeFilter)o; base.LooseMarshal(wireFormat, o, dataOut); dataOut.Write(info.NetworkTTL); LooseMarshalCachedObject(wireFormat, (DataStructure)info.NetworkBrokerId, dataOut); } } } \ No newline at end of file +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// +// NOTE!: This file is autogenerated - do not modify! +// if you need to make a change, please see the Groovy scripts in the +// activemq-core module +// + +using System; +using System.Collections; +using System.IO; + +using ActiveMQ.Commands; +using ActiveMQ.OpenWire; +using ActiveMQ.OpenWire.V1; + +namespace ActiveMQ.OpenWire.V1 +{ + /// + /// Marshalling code for Open Wire Format for NetworkBridgeFilter + /// + class NetworkBridgeFilterMarshaller : BaseDataStreamMarshaller + { + + + public override DataStructure CreateObject() + { + return new NetworkBridgeFilter(); + } + + public override byte GetDataStructureType() + { + return NetworkBridgeFilter.ID_NetworkBridgeFilter; + } + + // + // Un-marshal an object instance from the data input stream + // + public override void TightUnmarshal(OpenWireFormat wireFormat, Object o, BinaryReader dataIn, BooleanStream bs) + { + base.TightUnmarshal(wireFormat, o, dataIn, bs); + + NetworkBridgeFilter info = (NetworkBridgeFilter)o; + info.NetworkTTL = dataIn.ReadInt32(); + info.NetworkBrokerId = (BrokerId) TightUnmarshalCachedObject(wireFormat, dataIn, bs); + + } + + // + // Write the booleans that this object uses to a BooleanStream + // + public override int TightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) { + NetworkBridgeFilter info = (NetworkBridgeFilter)o; + + int rc = base.TightMarshal1(wireFormat, info, bs); + rc += TightMarshalCachedObject1(wireFormat, (DataStructure)info.NetworkBrokerId, bs); + + return rc + 4; + } + + // + // Write a object instance to data output stream + // + public override void TightMarshal2(OpenWireFormat wireFormat, Object o, BinaryWriter dataOut, BooleanStream bs) { + base.TightMarshal2(wireFormat, o, dataOut, bs); + + NetworkBridgeFilter info = (NetworkBridgeFilter)o; + dataOut.Write(info.NetworkTTL); + TightMarshalCachedObject2(wireFormat, (DataStructure)info.NetworkBrokerId, dataOut, bs); + + } + + // + // Un-marshal an object instance from the data input stream + // + public override void LooseUnmarshal(OpenWireFormat wireFormat, Object o, BinaryReader dataIn) + { + base.LooseUnmarshal(wireFormat, o, dataIn); + + NetworkBridgeFilter info = (NetworkBridgeFilter)o; + info.NetworkTTL = dataIn.ReadInt32(); + info.NetworkBrokerId = (BrokerId) LooseUnmarshalCachedObject(wireFormat, dataIn); + + } + + // + // Write a object instance to data output stream + // + public override void LooseMarshal(OpenWireFormat wireFormat, Object o, BinaryWriter dataOut) { + + NetworkBridgeFilter info = (NetworkBridgeFilter)o; + + base.LooseMarshal(wireFormat, o, dataOut); + dataOut.Write(info.NetworkTTL); + LooseMarshalCachedObject(wireFormat, (DataStructure)info.NetworkBrokerId, dataOut); + + } + + } +} diff --git a/activemq-dotnet/src/main/csharp/ActiveMQ/OpenWire/V1/PartialCommandMarshaller.cs b/activemq-dotnet/src/main/csharp/ActiveMQ/OpenWire/V1/PartialCommandMarshaller.cs index a58c19f9b4..6e8558011d 100644 --- a/activemq-dotnet/src/main/csharp/ActiveMQ/OpenWire/V1/PartialCommandMarshaller.cs +++ b/activemq-dotnet/src/main/csharp/ActiveMQ/OpenWire/V1/PartialCommandMarshaller.cs @@ -1 +1,123 @@ -/* * Copyright 2006 The Apache Software Foundation or its licensors, as * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // // NOTE!: This file is autogenerated - do not modify! // if you need to make a change, please see the Groovy scripts in the // activemq-core module // using System; using System.Collections; using System.IO; using ActiveMQ.Commands; using ActiveMQ.OpenWire; using ActiveMQ.OpenWire.V1; namespace ActiveMQ.OpenWire.V1 { /// /// Marshalling code for Open Wire Format for PartialCommand /// class PartialCommandMarshaller : BaseDataStreamMarshaller { public override DataStructure CreateObject() { return new PartialCommand(); } public override byte GetDataStructureType() { return PartialCommand.ID_PartialCommand; } // // Un-marshal an object instance from the data input stream // public override void TightUnmarshal(OpenWireFormat wireFormat, Object o, BinaryReader dataIn, BooleanStream bs) { base.TightUnmarshal(wireFormat, o, dataIn, bs); PartialCommand info = (PartialCommand)o; info.CommandId = dataIn.ReadInt32(); info.Data = ReadBytes(dataIn, bs.ReadBoolean()); } // // Write the booleans that this object uses to a BooleanStream // public override int TightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) { PartialCommand info = (PartialCommand)o; int rc = base.TightMarshal1(wireFormat, info, bs); bs.WriteBoolean(info.Data!=null); rc += info.Data==null ? 0 : info.Data.Length+4; return rc + 4; } // // Write a object instance to data output stream // public override void TightMarshal2(OpenWireFormat wireFormat, Object o, BinaryWriter dataOut, BooleanStream bs) { base.TightMarshal2(wireFormat, o, dataOut, bs); PartialCommand info = (PartialCommand)o; dataOut.Write(info.CommandId); if(bs.ReadBoolean()) { dataOut.Write(info.Data.Length); dataOut.Write(info.Data); } } // // Un-marshal an object instance from the data input stream // public override void LooseUnmarshal(OpenWireFormat wireFormat, Object o, BinaryReader dataIn) { base.LooseUnmarshal(wireFormat, o, dataIn); PartialCommand info = (PartialCommand)o; info.CommandId = dataIn.ReadInt32(); info.Data = ReadBytes(dataIn, dataIn.ReadBoolean()); } // // Write a object instance to data output stream // public override void LooseMarshal(OpenWireFormat wireFormat, Object o, BinaryWriter dataOut) { PartialCommand info = (PartialCommand)o; base.LooseMarshal(wireFormat, o, dataOut); dataOut.Write(info.CommandId); dataOut.Write(info.Data!=null); if(info.Data!=null) { dataOut.Write(info.Data.Length); dataOut.Write(info.Data); } } } } \ No newline at end of file +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// +// NOTE!: This file is autogenerated - do not modify! +// if you need to make a change, please see the Groovy scripts in the +// activemq-core module +// + +using System; +using System.Collections; +using System.IO; + +using ActiveMQ.Commands; +using ActiveMQ.OpenWire; +using ActiveMQ.OpenWire.V1; + +namespace ActiveMQ.OpenWire.V1 +{ + /// + /// Marshalling code for Open Wire Format for PartialCommand + /// + class PartialCommandMarshaller : BaseDataStreamMarshaller + { + + + public override DataStructure CreateObject() + { + return new PartialCommand(); + } + + public override byte GetDataStructureType() + { + return PartialCommand.ID_PartialCommand; + } + + // + // Un-marshal an object instance from the data input stream + // + public override void TightUnmarshal(OpenWireFormat wireFormat, Object o, BinaryReader dataIn, BooleanStream bs) + { + base.TightUnmarshal(wireFormat, o, dataIn, bs); + + PartialCommand info = (PartialCommand)o; + info.CommandId = dataIn.ReadInt32(); + info.Data = ReadBytes(dataIn, bs.ReadBoolean()); + + } + + // + // Write the booleans that this object uses to a BooleanStream + // + public override int TightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) { + PartialCommand info = (PartialCommand)o; + + int rc = base.TightMarshal1(wireFormat, info, bs); + bs.WriteBoolean(info.Data!=null); + rc += info.Data==null ? 0 : info.Data.Length+4; + + return rc + 4; + } + + // + // Write a object instance to data output stream + // + public override void TightMarshal2(OpenWireFormat wireFormat, Object o, BinaryWriter dataOut, BooleanStream bs) { + base.TightMarshal2(wireFormat, o, dataOut, bs); + + PartialCommand info = (PartialCommand)o; + dataOut.Write(info.CommandId); + if(bs.ReadBoolean()) { + dataOut.Write(info.Data.Length); + dataOut.Write(info.Data); + } + + } + + // + // Un-marshal an object instance from the data input stream + // + public override void LooseUnmarshal(OpenWireFormat wireFormat, Object o, BinaryReader dataIn) + { + base.LooseUnmarshal(wireFormat, o, dataIn); + + PartialCommand info = (PartialCommand)o; + info.CommandId = dataIn.ReadInt32(); + info.Data = ReadBytes(dataIn, dataIn.ReadBoolean()); + + } + + // + // Write a object instance to data output stream + // + public override void LooseMarshal(OpenWireFormat wireFormat, Object o, BinaryWriter dataOut) { + + PartialCommand info = (PartialCommand)o; + + base.LooseMarshal(wireFormat, o, dataOut); + dataOut.Write(info.CommandId); + dataOut.Write(info.Data!=null); + if(info.Data!=null) { + dataOut.Write(info.Data.Length); + dataOut.Write(info.Data); + } + + } + + } +} diff --git a/activemq-dotnet/src/main/csharp/ActiveMQ/OpenWire/V1/ReplayCommandMarshaller.cs b/activemq-dotnet/src/main/csharp/ActiveMQ/OpenWire/V1/ReplayCommandMarshaller.cs index 7720b08b48..6c8cb48b95 100644 --- a/activemq-dotnet/src/main/csharp/ActiveMQ/OpenWire/V1/ReplayCommandMarshaller.cs +++ b/activemq-dotnet/src/main/csharp/ActiveMQ/OpenWire/V1/ReplayCommandMarshaller.cs @@ -1 +1,114 @@ -/* * Copyright 2006 The Apache Software Foundation or its licensors, as * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // // NOTE!: This file is autogenerated - do not modify! // if you need to make a change, please see the Groovy scripts in the // activemq-core module // using System; using System.Collections; using System.IO; using ActiveMQ.Commands; using ActiveMQ.OpenWire; using ActiveMQ.OpenWire.V1; namespace ActiveMQ.OpenWire.V1 { /// /// Marshalling code for Open Wire Format for ReplayCommand /// class ReplayCommandMarshaller : BaseCommandMarshaller { public override DataStructure CreateObject() { return new ReplayCommand(); } public override byte GetDataStructureType() { return ReplayCommand.ID_ReplayCommand; } // // Un-marshal an object instance from the data input stream // public override void TightUnmarshal(OpenWireFormat wireFormat, Object o, BinaryReader dataIn, BooleanStream bs) { base.TightUnmarshal(wireFormat, o, dataIn, bs); ReplayCommand info = (ReplayCommand)o; info.FirstNakNumber = dataIn.ReadInt32(); info.LastNakNumber = dataIn.ReadInt32(); } // // Write the booleans that this object uses to a BooleanStream // public override int TightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) { ReplayCommand info = (ReplayCommand)o; int rc = base.TightMarshal1(wireFormat, info, bs); return rc + 8; } // // Write a object instance to data output stream // public override void TightMarshal2(OpenWireFormat wireFormat, Object o, BinaryWriter dataOut, BooleanStream bs) { base.TightMarshal2(wireFormat, o, dataOut, bs); ReplayCommand info = (ReplayCommand)o; dataOut.Write(info.FirstNakNumber); dataOut.Write(info.LastNakNumber); } // // Un-marshal an object instance from the data input stream // public override void LooseUnmarshal(OpenWireFormat wireFormat, Object o, BinaryReader dataIn) { base.LooseUnmarshal(wireFormat, o, dataIn); ReplayCommand info = (ReplayCommand)o; info.FirstNakNumber = dataIn.ReadInt32(); info.LastNakNumber = dataIn.ReadInt32(); } // // Write a object instance to data output stream // public override void LooseMarshal(OpenWireFormat wireFormat, Object o, BinaryWriter dataOut) { ReplayCommand info = (ReplayCommand)o; base.LooseMarshal(wireFormat, o, dataOut); dataOut.Write(info.FirstNakNumber); dataOut.Write(info.LastNakNumber); } } } \ No newline at end of file +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// +// NOTE!: This file is autogenerated - do not modify! +// if you need to make a change, please see the Groovy scripts in the +// activemq-core module +// + +using System; +using System.Collections; +using System.IO; + +using ActiveMQ.Commands; +using ActiveMQ.OpenWire; +using ActiveMQ.OpenWire.V1; + +namespace ActiveMQ.OpenWire.V1 +{ + /// + /// Marshalling code for Open Wire Format for ReplayCommand + /// + class ReplayCommandMarshaller : BaseCommandMarshaller + { + + + public override DataStructure CreateObject() + { + return new ReplayCommand(); + } + + public override byte GetDataStructureType() + { + return ReplayCommand.ID_ReplayCommand; + } + + // + // Un-marshal an object instance from the data input stream + // + public override void TightUnmarshal(OpenWireFormat wireFormat, Object o, BinaryReader dataIn, BooleanStream bs) + { + base.TightUnmarshal(wireFormat, o, dataIn, bs); + + ReplayCommand info = (ReplayCommand)o; + info.FirstNakNumber = dataIn.ReadInt32(); + info.LastNakNumber = dataIn.ReadInt32(); + + } + + // + // Write the booleans that this object uses to a BooleanStream + // + public override int TightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) { + ReplayCommand info = (ReplayCommand)o; + + int rc = base.TightMarshal1(wireFormat, info, bs); + + return rc + 8; + } + + // + // Write a object instance to data output stream + // + public override void TightMarshal2(OpenWireFormat wireFormat, Object o, BinaryWriter dataOut, BooleanStream bs) { + base.TightMarshal2(wireFormat, o, dataOut, bs); + + ReplayCommand info = (ReplayCommand)o; + dataOut.Write(info.FirstNakNumber); + dataOut.Write(info.LastNakNumber); + + } + + // + // Un-marshal an object instance from the data input stream + // + public override void LooseUnmarshal(OpenWireFormat wireFormat, Object o, BinaryReader dataIn) + { + base.LooseUnmarshal(wireFormat, o, dataIn); + + ReplayCommand info = (ReplayCommand)o; + info.FirstNakNumber = dataIn.ReadInt32(); + info.LastNakNumber = dataIn.ReadInt32(); + + } + + // + // Write a object instance to data output stream + // + public override void LooseMarshal(OpenWireFormat wireFormat, Object o, BinaryWriter dataOut) { + + ReplayCommand info = (ReplayCommand)o; + + base.LooseMarshal(wireFormat, o, dataOut); + dataOut.Write(info.FirstNakNumber); + dataOut.Write(info.LastNakNumber); + + } + + } +} diff --git a/activemq-dotnet/src/main/csharp/ActiveMQ/TransactionContext.cs b/activemq-dotnet/src/main/csharp/ActiveMQ/TransactionContext.cs index e2bc9561e6..dc24947602 100644 --- a/activemq-dotnet/src/main/csharp/ActiveMQ/TransactionContext.cs +++ b/activemq-dotnet/src/main/csharp/ActiveMQ/TransactionContext.cs @@ -1,118 +1,118 @@ -/* - * Copyright 2006 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -using ActiveMQ; -using ActiveMQ.Commands; -using System.Collections; - - -namespace ActiveMQ -{ - public enum TransactionType - { - Begin = 0, Prepare = 1, CommitOnePhase = 2, CommitTwoPhase = 3, Rollback = 4, Recover=5, Forget = 6, End = 7 - } -} - -namespace ActiveMQ -{ - public class TransactionContext - { - private TransactionId transactionId; - private Session session; - private ArrayList synchronizations = new ArrayList(); - - public TransactionContext(Session session) - { - this.session = session; - } - - public TransactionId TransactionId - { - get { return transactionId; } - } - - /// - /// Method AddSynchronization - /// - public void AddSynchronization(ISynchronization synchronization) - { - synchronizations.Add(synchronization); - } - - - public void Begin() - { - if (transactionId == null) - { - transactionId = session.Connection.CreateLocalTransactionId(); - - TransactionInfo info = new TransactionInfo(); - info.ConnectionId = session.Connection.ConnectionId; - info.TransactionId = transactionId; - info.Type = (int) TransactionType.Begin; - session.Connection.OneWay(info); - } - } - - - public void Rollback() - { - if (transactionId != null) - { - TransactionInfo info = new TransactionInfo(); - info.ConnectionId = session.Connection.ConnectionId; - info.TransactionId = transactionId; - info.Type = (int) TransactionType.Rollback; - - transactionId = null; - session.Connection.OneWay(info); - } - - foreach (ISynchronization synchronization in synchronizations) - { - synchronization.AfterRollback(); - } - synchronizations.Clear(); - } - - public void Commit() - { - foreach (ISynchronization synchronization in synchronizations) - { - synchronization.BeforeCommit(); - } - - if (transactionId != null) - { - TransactionInfo info = new TransactionInfo(); - info.ConnectionId = session.Connection.ConnectionId; - info.TransactionId = transactionId; - info.Type = (int) TransactionType.CommitOnePhase; - - transactionId = null; - session.Connection.OneWay(info); - } - - foreach (ISynchronization synchronization in synchronizations) - { - synchronization.AfterCommit(); - } - synchronizations.Clear(); - } - } -} - +/* + * Copyright 2006 The Apache Software Foundation or its licensors, as + * applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +using ActiveMQ; +using ActiveMQ.Commands; +using System.Collections; + + +namespace ActiveMQ +{ + public enum TransactionType + { + Begin = 0, Prepare = 1, CommitOnePhase = 2, CommitTwoPhase = 3, Rollback = 4, Recover=5, Forget = 6, End = 7 + } +} + +namespace ActiveMQ +{ + public class TransactionContext + { + private TransactionId transactionId; + private Session session; + private ArrayList synchronizations = new ArrayList(); + + public TransactionContext(Session session) + { + this.session = session; + } + + public TransactionId TransactionId + { + get { return transactionId; } + } + + /// + /// Method AddSynchronization + /// + public void AddSynchronization(ISynchronization synchronization) + { + synchronizations.Add(synchronization); + } + + + public void Begin() + { + if (transactionId == null) + { + transactionId = session.Connection.CreateLocalTransactionId(); + + TransactionInfo info = new TransactionInfo(); + info.ConnectionId = session.Connection.ConnectionId; + info.TransactionId = transactionId; + info.Type = (int) TransactionType.Begin; + session.Connection.OneWay(info); + } + } + + + public void Rollback() + { + if (transactionId != null) + { + TransactionInfo info = new TransactionInfo(); + info.ConnectionId = session.Connection.ConnectionId; + info.TransactionId = transactionId; + info.Type = (int) TransactionType.Rollback; + + transactionId = null; + session.Connection.OneWay(info); + } + + foreach (ISynchronization synchronization in synchronizations) + { + synchronization.AfterRollback(); + } + synchronizations.Clear(); + } + + public void Commit() + { + foreach (ISynchronization synchronization in synchronizations) + { + synchronization.BeforeCommit(); + } + + if (transactionId != null) + { + TransactionInfo info = new TransactionInfo(); + info.ConnectionId = session.Connection.ConnectionId; + info.TransactionId = transactionId; + info.Type = (int) TransactionType.CommitOnePhase; + + transactionId = null; + session.Connection.OneWay(info); + } + + foreach (ISynchronization synchronization in synchronizations) + { + synchronization.AfterCommit(); + } + synchronizations.Clear(); + } + } +} + diff --git a/activemq-dotnet/src/main/csharp/ActiveMQ/Transport/ITransportFactory.cs b/activemq-dotnet/src/main/csharp/ActiveMQ/Transport/ITransportFactory.cs index 6fa23fd6d9..850e86fc76 100644 --- a/activemq-dotnet/src/main/csharp/ActiveMQ/Transport/ITransportFactory.cs +++ b/activemq-dotnet/src/main/csharp/ActiveMQ/Transport/ITransportFactory.cs @@ -1,26 +1,26 @@ -/* - * Copyright 2006 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -using System; - -namespace ActiveMQ.Transport -{ - public interface ITransportFactory - { - ITransport CreateTransport(Uri location); - } -} +/* + * Copyright 2006 The Apache Software Foundation or its licensors, as + * applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +using System; + +namespace ActiveMQ.Transport +{ + public interface ITransportFactory + { + ITransport CreateTransport(Uri location); + } +} diff --git a/activemq-dotnet/src/main/csharp/ActiveMQ/Transport/LoggingTransport.cs b/activemq-dotnet/src/main/csharp/ActiveMQ/Transport/LoggingTransport.cs index 27ea947b1d..004a3e57e0 100644 --- a/activemq-dotnet/src/main/csharp/ActiveMQ/Transport/LoggingTransport.cs +++ b/activemq-dotnet/src/main/csharp/ActiveMQ/Transport/LoggingTransport.cs @@ -1,50 +1,50 @@ -/* - * Copyright 2006 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -using ActiveMQ.Commands; -using ActiveMQ.Transport; -using System; - -namespace ActiveMQ.Transport -{ - - /// - /// A Transport filter that is used to log the commands sent and received. - /// - public class LoggingTransport : TransportFilter - { - public LoggingTransport(ITransport next) : base(next) { - } - - protected override void OnCommand(ITransport sender, Command command) { - Console.WriteLine("RECEIVED: " + command); - this.commandHandler(sender, command); - } - - protected override void OnException(ITransport sender, Exception error) { - Console.WriteLine("RECEIVED Exception: " + error); - this.exceptionHandler(sender, error); - } - - public override void Oneway(Command command) - { - Console.WriteLine("SENDING: " + command); - this.next.Oneway(command); - } - - } -} - +/* + * Copyright 2006 The Apache Software Foundation or its licensors, as + * applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +using ActiveMQ.Commands; +using ActiveMQ.Transport; +using System; + +namespace ActiveMQ.Transport +{ + + /// + /// A Transport filter that is used to log the commands sent and received. + /// + public class LoggingTransport : TransportFilter + { + public LoggingTransport(ITransport next) : base(next) { + } + + protected override void OnCommand(ITransport sender, Command command) { + Console.WriteLine("RECEIVED: " + command); + this.commandHandler(sender, command); + } + + protected override void OnException(ITransport sender, Exception error) { + Console.WriteLine("RECEIVED Exception: " + error); + this.exceptionHandler(sender, error); + } + + public override void Oneway(Command command) + { + Console.WriteLine("SENDING: " + command); + this.next.Oneway(command); + } + + } +} + diff --git a/activemq-dotnet/src/main/csharp/ActiveMQ/Transport/MutexTransport.cs b/activemq-dotnet/src/main/csharp/ActiveMQ/Transport/MutexTransport.cs index f1627a06c6..d1df36e910 100644 --- a/activemq-dotnet/src/main/csharp/ActiveMQ/Transport/MutexTransport.cs +++ b/activemq-dotnet/src/main/csharp/ActiveMQ/Transport/MutexTransport.cs @@ -1,70 +1,70 @@ -/* - * Copyright 2006 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -using ActiveMQ.Commands; -using ActiveMQ.Transport; -using System; - -namespace ActiveMQ.Transport -{ - - /// - /// A Transport which gaurds access to the next transport using a mutex. - /// - public class MutexTransport : TransportFilter - { - - private readonly object transmissionLock = new object(); - - public MutexTransport(ITransport next) : base(next) { - } - - - public override void Oneway(Command command) - { - lock (transmissionLock) - { - this.next.Oneway(command); - } - } - - public override FutureResponse AsyncRequest(Command command) - { - lock (transmissionLock) - { - return base.AsyncRequest(command); - } - } - - public override Response Request(Command command) - { - lock (transmissionLock) - { - return base.Request(command); - } - } - - public override void Dispose() - { - lock (transmissionLock) - { - base.Dispose(); - } - } - - } -} - +/* + * Copyright 2006 The Apache Software Foundation or its licensors, as + * applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +using ActiveMQ.Commands; +using ActiveMQ.Transport; +using System; + +namespace ActiveMQ.Transport +{ + + /// + /// A Transport which gaurds access to the next transport using a mutex. + /// + public class MutexTransport : TransportFilter + { + + private readonly object transmissionLock = new object(); + + public MutexTransport(ITransport next) : base(next) { + } + + + public override void Oneway(Command command) + { + lock (transmissionLock) + { + this.next.Oneway(command); + } + } + + public override FutureResponse AsyncRequest(Command command) + { + lock (transmissionLock) + { + return base.AsyncRequest(command); + } + } + + public override Response Request(Command command) + { + lock (transmissionLock) + { + return base.Request(command); + } + } + + public override void Dispose() + { + lock (transmissionLock) + { + base.Dispose(); + } + } + + } +} + diff --git a/activemq-dotnet/src/main/csharp/ActiveMQ/Transport/ResponseCorrelator.cs b/activemq-dotnet/src/main/csharp/ActiveMQ/Transport/ResponseCorrelator.cs index a389c351ef..454f9450ce 100644 --- a/activemq-dotnet/src/main/csharp/ActiveMQ/Transport/ResponseCorrelator.cs +++ b/activemq-dotnet/src/main/csharp/ActiveMQ/Transport/ResponseCorrelator.cs @@ -1,104 +1,104 @@ -/* - * Copyright 2006 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -using System; -using System.Collections; - -using ActiveMQ.Commands; -using ActiveMQ.Transport; - -namespace ActiveMQ.Transport -{ - - /// - /// A Transport which gaurds access to the next transport using a mutex. - /// - public class ResponseCorrelator : TransportFilter - { - - private readonly IDictionary requestMap = Hashtable.Synchronized(new Hashtable()); - private readonly Object mutex = new Object(); - private short nextCommandId; - - public ResponseCorrelator(ITransport next) : base(next) { - } - - short GetNextCommandId() { - lock(mutex) { - return ++nextCommandId; - } - } - - public override void Oneway(Command command) - { - command.CommandId = GetNextCommandId(); - command.ResponseRequired = false; - next.Oneway(command); - } - - public override FutureResponse AsyncRequest(Command command) - { - command.CommandId = GetNextCommandId(); - command.ResponseRequired = true; - FutureResponse future = new FutureResponse(); - requestMap[command.CommandId] = future; - next.Oneway(command); - return future; - - } - - public override Response Request(Command command) - { - FutureResponse future = AsyncRequest(command); - Response response = future.Response; - if (response is ExceptionResponse) - { - ExceptionResponse er = (ExceptionResponse) response; - BrokerError brokerError = er.Exception; - throw new BrokerException(brokerError); - } - return response; - } - - protected override void OnCommand(ITransport sender, Command command) - { - if( command is Response ) { - - Response response = (Response) command; - FutureResponse future = (FutureResponse) requestMap[response.CorrelationId]; - if (future != null) - { - if (response is ExceptionResponse) - { - ExceptionResponse er = (ExceptionResponse) response; - BrokerError brokerError = er.Exception; - this.exceptionHandler(this, new BrokerException(brokerError)); - } - future.Response = response; - } - else - { - Console.WriteLine("ERROR: Unknown response ID: " + response.CommandId + " for response: " + response); - } - } else { - this.commandHandler(sender, command); - } - } - - } -} - +/* + * Copyright 2006 The Apache Software Foundation or its licensors, as + * applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +using System; +using System.Collections; + +using ActiveMQ.Commands; +using ActiveMQ.Transport; + +namespace ActiveMQ.Transport +{ + + /// + /// A Transport which gaurds access to the next transport using a mutex. + /// + public class ResponseCorrelator : TransportFilter + { + + private readonly IDictionary requestMap = Hashtable.Synchronized(new Hashtable()); + private readonly Object mutex = new Object(); + private short nextCommandId; + + public ResponseCorrelator(ITransport next) : base(next) { + } + + short GetNextCommandId() { + lock(mutex) { + return ++nextCommandId; + } + } + + public override void Oneway(Command command) + { + command.CommandId = GetNextCommandId(); + command.ResponseRequired = false; + next.Oneway(command); + } + + public override FutureResponse AsyncRequest(Command command) + { + command.CommandId = GetNextCommandId(); + command.ResponseRequired = true; + FutureResponse future = new FutureResponse(); + requestMap[command.CommandId] = future; + next.Oneway(command); + return future; + + } + + public override Response Request(Command command) + { + FutureResponse future = AsyncRequest(command); + Response response = future.Response; + if (response is ExceptionResponse) + { + ExceptionResponse er = (ExceptionResponse) response; + BrokerError brokerError = er.Exception; + throw new BrokerException(brokerError); + } + return response; + } + + protected override void OnCommand(ITransport sender, Command command) + { + if( command is Response ) { + + Response response = (Response) command; + FutureResponse future = (FutureResponse) requestMap[response.CorrelationId]; + if (future != null) + { + if (response is ExceptionResponse) + { + ExceptionResponse er = (ExceptionResponse) response; + BrokerError brokerError = er.Exception; + this.exceptionHandler(this, new BrokerException(brokerError)); + } + future.Response = response; + } + else + { + Console.WriteLine("ERROR: Unknown response ID: " + response.CommandId + " for response: " + response); + } + } else { + this.commandHandler(sender, command); + } + } + + } +} + diff --git a/activemq-dotnet/src/main/csharp/ActiveMQ/Transport/Tcp/TcpTransport.cs b/activemq-dotnet/src/main/csharp/ActiveMQ/Transport/Tcp/TcpTransport.cs index 54dd194f05..7658e98123 100644 --- a/activemq-dotnet/src/main/csharp/ActiveMQ/Transport/Tcp/TcpTransport.cs +++ b/activemq-dotnet/src/main/csharp/ActiveMQ/Transport/Tcp/TcpTransport.cs @@ -1,152 +1,152 @@ -/* - * Copyright 2006 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -using ActiveMQ; -using ActiveMQ.Commands; -using ActiveMQ.OpenWire; -using ActiveMQ.Transport; -using System; -using System.Collections; -using System.IO; -using System.Net; -using System.Net.Sockets; -using System.Threading; - -namespace ActiveMQ.Transport.Tcp -{ - - /// - /// An implementation of ITransport that uses sockets to communicate with the broker - /// - public class TcpTransport : ITransport - { - private Socket socket; - private OpenWireFormat wireformat = new OpenWireFormat(); - private BinaryReader socketReader; - private BinaryWriter socketWriter; - private Thread readThread; - private bool started; - volatile private bool closed; - - private CommandHandler commandHandler; - private ExceptionHandler exceptionHandler; - - public TcpTransport(Socket socket) - { - this.socket = socket; - } - - /// - /// Method Start - /// - public void Start() - { - if (!started) - { - if( commandHandler == null ) - throw new InvalidOperationException ("command cannot be null when Start is called."); - if( exceptionHandler == null ) - throw new InvalidOperationException ("exception cannot be null when Start is called."); - - started = true; - - NetworkStream networkStream = new NetworkStream(socket); - socketWriter = new OpenWireBinaryWriter(networkStream); - socketReader = new OpenWireBinaryReader(networkStream); - - // now lets create the background read thread - readThread = new Thread(new ThreadStart(ReadLoop)); - readThread.Start(); - - // lets send the wireformat we're using - WireFormatInfo info = new WireFormatInfo(); - info.StackTraceEnabled=false; - info.TightEncodingEnabled=false; - info.TcpNoDelayEnabled=false; - info.CacheEnabled=false; - info.SizePrefixDisabled=false; - - Oneway(info); - } - } - - public void Oneway(Command command) - { - wireformat.Marshal(command, socketWriter); - socketWriter.Flush(); - } - - public FutureResponse AsyncRequest(Command command) - { - throw new NotImplementedException("Use a ResponseCorrelator if you want to issue AsyncRequest calls"); - } - - public Response Request(Command command) - { - throw new NotImplementedException("Use a ResponseCorrelator if you want to issue Request calls"); - } - - public void Dispose() - { - closed = true; - socket.Close(); - readThread.Join(); - socketWriter.Close(); - socketReader.Close(); - } - - public void ReadLoop() - { - while (!closed) - { - try - { - Command command = (Command) wireformat.Unmarshal(socketReader); - this.commandHandler(this, command); - } - catch (ObjectDisposedException) - { - break; - } - catch ( Exception e) { - if( e.GetBaseException() is ObjectDisposedException ) { - break; - } - if( !closed ) { - this.exceptionHandler(this,e); - } - break; - } - } - } - - // Implementation methods - - public CommandHandler Command { - get { return commandHandler; } - set { this.commandHandler = value; } - } - - public ExceptionHandler Exception { - get { return exceptionHandler; } - set { this.exceptionHandler = value; } - } - - } -} - - - +/* + * Copyright 2006 The Apache Software Foundation or its licensors, as + * applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +using ActiveMQ; +using ActiveMQ.Commands; +using ActiveMQ.OpenWire; +using ActiveMQ.Transport; +using System; +using System.Collections; +using System.IO; +using System.Net; +using System.Net.Sockets; +using System.Threading; + +namespace ActiveMQ.Transport.Tcp +{ + + /// + /// An implementation of ITransport that uses sockets to communicate with the broker + /// + public class TcpTransport : ITransport + { + private Socket socket; + private OpenWireFormat wireformat = new OpenWireFormat(); + private BinaryReader socketReader; + private BinaryWriter socketWriter; + private Thread readThread; + private bool started; + volatile private bool closed; + + private CommandHandler commandHandler; + private ExceptionHandler exceptionHandler; + + public TcpTransport(Socket socket) + { + this.socket = socket; + } + + /// + /// Method Start + /// + public void Start() + { + if (!started) + { + if( commandHandler == null ) + throw new InvalidOperationException ("command cannot be null when Start is called."); + if( exceptionHandler == null ) + throw new InvalidOperationException ("exception cannot be null when Start is called."); + + started = true; + + NetworkStream networkStream = new NetworkStream(socket); + socketWriter = new OpenWireBinaryWriter(networkStream); + socketReader = new OpenWireBinaryReader(networkStream); + + // now lets create the background read thread + readThread = new Thread(new ThreadStart(ReadLoop)); + readThread.Start(); + + // lets send the wireformat we're using + WireFormatInfo info = new WireFormatInfo(); + info.StackTraceEnabled=false; + info.TightEncodingEnabled=false; + info.TcpNoDelayEnabled=false; + info.CacheEnabled=false; + info.SizePrefixDisabled=false; + + Oneway(info); + } + } + + public void Oneway(Command command) + { + wireformat.Marshal(command, socketWriter); + socketWriter.Flush(); + } + + public FutureResponse AsyncRequest(Command command) + { + throw new NotImplementedException("Use a ResponseCorrelator if you want to issue AsyncRequest calls"); + } + + public Response Request(Command command) + { + throw new NotImplementedException("Use a ResponseCorrelator if you want to issue Request calls"); + } + + public void Dispose() + { + closed = true; + socket.Close(); + readThread.Join(); + socketWriter.Close(); + socketReader.Close(); + } + + public void ReadLoop() + { + while (!closed) + { + try + { + Command command = (Command) wireformat.Unmarshal(socketReader); + this.commandHandler(this, command); + } + catch (ObjectDisposedException) + { + break; + } + catch ( Exception e) { + if( e.GetBaseException() is ObjectDisposedException ) { + break; + } + if( !closed ) { + this.exceptionHandler(this,e); + } + break; + } + } + } + + // Implementation methods + + public CommandHandler Command { + get { return commandHandler; } + set { this.commandHandler = value; } + } + + public ExceptionHandler Exception { + get { return exceptionHandler; } + set { this.exceptionHandler = value; } + } + + } +} + + + diff --git a/activemq-dotnet/src/main/csharp/ActiveMQ/Transport/Tcp/TcpTransportFactory.cs b/activemq-dotnet/src/main/csharp/ActiveMQ/Transport/Tcp/TcpTransportFactory.cs index 7edff7097e..3b47b620a6 100644 --- a/activemq-dotnet/src/main/csharp/ActiveMQ/Transport/Tcp/TcpTransportFactory.cs +++ b/activemq-dotnet/src/main/csharp/ActiveMQ/Transport/Tcp/TcpTransportFactory.cs @@ -1,62 +1,62 @@ -/* -* Copyright 2006 The Apache Software Foundation or its licensors, as -* applicable. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -using System; -using System.Net; -using System.Net.Sockets; -using ActiveMQ.Transport; - -namespace ActiveMQ.Transport.Tcp -{ - public class TcpTransportFactory : ITransportFactory - { - public ITransport CreateTransport(Uri location) { - - // Console.WriteLine("Opening socket to: " + host + " on port: " + port); - Socket socket = Connect(location.Host, location.Port); - ITransport rc = new TcpTransport(socket); - // TODO: use URI query string to enable the LoggingTransport - rc = new LoggingTransport(rc); - rc = new ResponseCorrelator(rc); - rc = new MutexTransport(rc); - return rc; - - } - - protected Socket Connect(string host, int port) - { - // Looping through the AddressList allows different type of connections to be tried - // (IPv4, IPv6 and whatever else may be available). - IPHostEntry hostEntry = Dns.Resolve(host); - foreach (IPAddress address in hostEntry.AddressList) - { - Socket socket = new Socket( - address.AddressFamily, - SocketType.Stream, - ProtocolType.Tcp); - socket.Connect(new IPEndPoint(address, port)); - if (socket.Connected) - { - return socket; - } - } - throw new SocketException(); - } - - } - -} +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +using System; +using System.Net; +using System.Net.Sockets; +using ActiveMQ.Transport; + +namespace ActiveMQ.Transport.Tcp +{ + public class TcpTransportFactory : ITransportFactory + { + public ITransport CreateTransport(Uri location) { + + // Console.WriteLine("Opening socket to: " + host + " on port: " + port); + Socket socket = Connect(location.Host, location.Port); + ITransport rc = new TcpTransport(socket); + // TODO: use URI query string to enable the LoggingTransport + rc = new LoggingTransport(rc); + rc = new ResponseCorrelator(rc); + rc = new MutexTransport(rc); + return rc; + + } + + protected Socket Connect(string host, int port) + { + // Looping through the AddressList allows different type of connections to be tried + // (IPv4, IPv6 and whatever else may be available). + IPHostEntry hostEntry = Dns.Resolve(host); + foreach (IPAddress address in hostEntry.AddressList) + { + Socket socket = new Socket( + address.AddressFamily, + SocketType.Stream, + ProtocolType.Tcp); + socket.Connect(new IPEndPoint(address, port)); + if (socket.Connected) + { + return socket; + } + } + throw new SocketException(); + } + + } + +} diff --git a/activemq-dotnet/src/main/csharp/ActiveMQ/Transport/TransportFilter.cs b/activemq-dotnet/src/main/csharp/ActiveMQ/Transport/TransportFilter.cs index 8091796709..2528d3ee1a 100644 --- a/activemq-dotnet/src/main/csharp/ActiveMQ/Transport/TransportFilter.cs +++ b/activemq-dotnet/src/main/csharp/ActiveMQ/Transport/TransportFilter.cs @@ -1,109 +1,109 @@ -/* - * Copyright 2006 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -using ActiveMQ.Commands; -using ActiveMQ.Transport; -using System; - -namespace ActiveMQ.Transport -{ - - /// - /// Used to implement a filter on the transport layer. - /// - public class TransportFilter : ITransport - { - protected readonly ITransport next; - protected CommandHandler commandHandler; - protected ExceptionHandler exceptionHandler; - - public TransportFilter(ITransport next) { - this.next = next; - this.next.Command = new CommandHandler(OnCommand); - this.next.Exception = new ExceptionHandler(OnException); - } - - protected virtual void OnCommand(ITransport sender, Command command) { - this.commandHandler(sender, command); - } - - protected virtual void OnException(ITransport sender, Exception command) { - this.exceptionHandler(sender, command); - } - - - /// - /// Method Oneway - /// - /// A Command - public virtual void Oneway(Command command) - { - this.next.Oneway(command); - } - - /// - /// Method AsyncRequest - /// - /// A FutureResponse - /// A Command - public virtual FutureResponse AsyncRequest(Command command) - { - return this.next.AsyncRequest(command); - } - - /// - /// Method Request - /// - /// A Response - /// A Command - public virtual Response Request(Command command) - { - return this.next.Request(command); - } - - /// - /// Method Start - /// - public virtual void Start() - { - if( commandHandler == null ) - throw new InvalidOperationException ("command cannot be null when Start is called."); - if( exceptionHandler == null ) - throw new InvalidOperationException ("exception cannot be null when Start is called."); - this.next.Start(); - } - - /// - /// Method Dispose - /// - public virtual void Dispose() - { - this.next.Dispose(); - } - - public CommandHandler Command { - get { return commandHandler; } - set { this.commandHandler = value; } - } - - public ExceptionHandler Exception { - get { return exceptionHandler; } - set { this.exceptionHandler = value; } - } - - } -} - +/* + * Copyright 2006 The Apache Software Foundation or its licensors, as + * applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +using ActiveMQ.Commands; +using ActiveMQ.Transport; +using System; + +namespace ActiveMQ.Transport +{ + + /// + /// Used to implement a filter on the transport layer. + /// + public class TransportFilter : ITransport + { + protected readonly ITransport next; + protected CommandHandler commandHandler; + protected ExceptionHandler exceptionHandler; + + public TransportFilter(ITransport next) { + this.next = next; + this.next.Command = new CommandHandler(OnCommand); + this.next.Exception = new ExceptionHandler(OnException); + } + + protected virtual void OnCommand(ITransport sender, Command command) { + this.commandHandler(sender, command); + } + + protected virtual void OnException(ITransport sender, Exception command) { + this.exceptionHandler(sender, command); + } + + + /// + /// Method Oneway + /// + /// A Command + public virtual void Oneway(Command command) + { + this.next.Oneway(command); + } + + /// + /// Method AsyncRequest + /// + /// A FutureResponse + /// A Command + public virtual FutureResponse AsyncRequest(Command command) + { + return this.next.AsyncRequest(command); + } + + /// + /// Method Request + /// + /// A Response + /// A Command + public virtual Response Request(Command command) + { + return this.next.Request(command); + } + + /// + /// Method Start + /// + public virtual void Start() + { + if( commandHandler == null ) + throw new InvalidOperationException ("command cannot be null when Start is called."); + if( exceptionHandler == null ) + throw new InvalidOperationException ("exception cannot be null when Start is called."); + this.next.Start(); + } + + /// + /// Method Dispose + /// + public virtual void Dispose() + { + this.next.Dispose(); + } + + public CommandHandler Command { + get { return commandHandler; } + set { this.commandHandler = value; } + } + + public ExceptionHandler Exception { + get { return exceptionHandler; } + set { this.exceptionHandler = value; } + } + + } +} + diff --git a/activemq-dotnet/src/main/csharp/NMS/IBytesMessage.cs b/activemq-dotnet/src/main/csharp/NMS/IBytesMessage.cs index db78acaa44..315ec87833 100644 --- a/activemq-dotnet/src/main/csharp/NMS/IBytesMessage.cs +++ b/activemq-dotnet/src/main/csharp/NMS/IBytesMessage.cs @@ -1,33 +1,33 @@ -/* - * Copyright 2006 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -namespace NMS -{ - /// - /// Represents a binary based message - /// - public interface IBytesMessage : IMessage - { - - byte[] Content - { - get; - set; - } - } -} - - +/* + * Copyright 2006 The Apache Software Foundation or its licensors, as + * applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +namespace NMS +{ + /// + /// Represents a binary based message + /// + public interface IBytesMessage : IMessage + { + + byte[] Content + { + get; + set; + } + } +} + + diff --git a/activemq-dotnet/src/main/csharp/NMS/IConnectionFactory.cs b/activemq-dotnet/src/main/csharp/NMS/IConnectionFactory.cs index 735e08f8f4..461d420567 100644 --- a/activemq-dotnet/src/main/csharp/NMS/IConnectionFactory.cs +++ b/activemq-dotnet/src/main/csharp/NMS/IConnectionFactory.cs @@ -1,38 +1,38 @@ -/* - * Copyright 2006 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -namespace NMS -{ - - /// - /// A Factory of IConnection objects - /// - public interface IConnectionFactory - { - - /// - /// Creates a new connection - /// - IConnection CreateConnection(); - - /// - /// Creates a new connection with the given user name and password - /// - IConnection CreateConnection(string userName, string password); - } -} - - +/* + * Copyright 2006 The Apache Software Foundation or its licensors, as + * applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +namespace NMS +{ + + /// + /// A Factory of IConnection objects + /// + public interface IConnectionFactory + { + + /// + /// Creates a new connection + /// + IConnection CreateConnection(); + + /// + /// Creates a new connection with the given user name and password + /// + IConnection CreateConnection(string userName, string password); + } +} + + diff --git a/activemq-dotnet/src/main/csharp/NMS/IMapMessage.cs b/activemq-dotnet/src/main/csharp/NMS/IMapMessage.cs index c0e08122a1..b43da8ca8b 100644 --- a/activemq-dotnet/src/main/csharp/NMS/IMapMessage.cs +++ b/activemq-dotnet/src/main/csharp/NMS/IMapMessage.cs @@ -1,34 +1,34 @@ -/* - * Copyright 2006 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -namespace NMS -{ - - /// - /// Represents a Map message which contains key and value pairs which are - /// of primitive types - /// - public interface IMapMessage : IMessage - { - IPrimitiveMap Body - { - get; - } - } -} - - - +/* + * Copyright 2006 The Apache Software Foundation or its licensors, as + * applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +namespace NMS +{ + + /// + /// Represents a Map message which contains key and value pairs which are + /// of primitive types + /// + public interface IMapMessage : IMessage + { + IPrimitiveMap Body + { + get; + } + } +} + + + diff --git a/activemq-dotnet/src/main/csharp/NMS/IMessage.cs b/activemq-dotnet/src/main/csharp/NMS/IMessage.cs index a46dec6c14..4db77ef487 100644 --- a/activemq-dotnet/src/main/csharp/NMS/IMessage.cs +++ b/activemq-dotnet/src/main/csharp/NMS/IMessage.cs @@ -1,130 +1,130 @@ -/* - * Copyright 2006 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -namespace NMS -{ - /// - /// Represents a message either to be sent to a message broker or received from a message broker - /// - public interface IMessage - { - - /// - /// If using client acknowledgement mode on the session then this method will acknowledge that the - /// message has been processed correctly. - /// - void Acknowledge(); - - /// - /// Provides access to the message properties (headers) - /// - IPrimitiveMap Properties - { - get; - } - - /// - /// The correlation ID used to correlate messages from conversations or long running business processes - /// - string NMSCorrelationID - { - get; - set; - } - - /// - /// The destination of the message - /// - IDestination NMSDestination - { - get; - } - - /// - /// The time in milliseconds that this message should expire in - /// - long NMSExpiration - { - get; - set; - } - - /// - /// The message ID which is set by the provider - /// - string NMSMessageId - { - get; - } - - /// - /// Whether or not this message is persistent - /// - bool NMSPersistent - { - get; - set; - } - - /// - /// The Priority on this message - /// - byte NMSPriority - { - get; - set; - } - - /// - /// Returns true if this message has been redelivered to this or another consumer before being acknowledged successfully. - /// - bool NMSRedelivered - { - get; - } - - - /// - /// The destination that the consumer of this message should send replies to - /// - IDestination NMSReplyTo - { - get; - set; - } - - - /// - /// The timestamp the broker added to the message - /// - long NMSTimestamp - { - get; - } - - /// - /// The type name of this message - /// - string NMSType - { - get; - set; - } - - } -} - - +/* + * Copyright 2006 The Apache Software Foundation or its licensors, as + * applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +namespace NMS +{ + /// + /// Represents a message either to be sent to a message broker or received from a message broker + /// + public interface IMessage + { + + /// + /// If using client acknowledgement mode on the session then this method will acknowledge that the + /// message has been processed correctly. + /// + void Acknowledge(); + + /// + /// Provides access to the message properties (headers) + /// + IPrimitiveMap Properties + { + get; + } + + /// + /// The correlation ID used to correlate messages from conversations or long running business processes + /// + string NMSCorrelationID + { + get; + set; + } + + /// + /// The destination of the message + /// + IDestination NMSDestination + { + get; + } + + /// + /// The time in milliseconds that this message should expire in + /// + long NMSExpiration + { + get; + set; + } + + /// + /// The message ID which is set by the provider + /// + string NMSMessageId + { + get; + } + + /// + /// Whether or not this message is persistent + /// + bool NMSPersistent + { + get; + set; + } + + /// + /// The Priority on this message + /// + byte NMSPriority + { + get; + set; + } + + /// + /// Returns true if this message has been redelivered to this or another consumer before being acknowledged successfully. + /// + bool NMSRedelivered + { + get; + } + + + /// + /// The destination that the consumer of this message should send replies to + /// + IDestination NMSReplyTo + { + get; + set; + } + + + /// + /// The timestamp the broker added to the message + /// + long NMSTimestamp + { + get; + } + + /// + /// The type name of this message + /// + string NMSType + { + get; + set; + } + + } +} + + diff --git a/activemq-dotnet/src/main/csharp/NMS/IMessageProducer.cs b/activemq-dotnet/src/main/csharp/NMS/IMessageProducer.cs index a2147f0d81..d53b8c18e4 100644 --- a/activemq-dotnet/src/main/csharp/NMS/IMessageProducer.cs +++ b/activemq-dotnet/src/main/csharp/NMS/IMessageProducer.cs @@ -1,69 +1,69 @@ -/* - * Copyright 2006 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -namespace NMS -{ - - /// - /// An object capable of sending messages to some destination - /// - public interface IMessageProducer : System.IDisposable - { - - /// - /// Sends the message to the default destination for this producer - /// - void Send(IMessage message); - - /// - /// Sends the message to the given destination - /// - void Send(IDestination destination, IMessage message); - - bool Persistent - { - get; - set; - } - - long TimeToLive - { - get; - set; - } - - int Priority - { - get; - set; - } - - bool DisableMessageID - { - get; - set; - } - - bool DisableMessageTimestamp - { - get; - set; - } - - } -} - - +/* + * Copyright 2006 The Apache Software Foundation or its licensors, as + * applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +namespace NMS +{ + + /// + /// An object capable of sending messages to some destination + /// + public interface IMessageProducer : System.IDisposable + { + + /// + /// Sends the message to the default destination for this producer + /// + void Send(IMessage message); + + /// + /// Sends the message to the given destination + /// + void Send(IDestination destination, IMessage message); + + bool Persistent + { + get; + set; + } + + long TimeToLive + { + get; + set; + } + + int Priority + { + get; + set; + } + + bool DisableMessageID + { + get; + set; + } + + bool DisableMessageTimestamp + { + get; + set; + } + + } +} + + diff --git a/activemq-dotnet/src/main/csharp/NMS/IQueue.cs b/activemq-dotnet/src/main/csharp/NMS/IQueue.cs index 6a14482568..85ce79aa76 100644 --- a/activemq-dotnet/src/main/csharp/NMS/IQueue.cs +++ b/activemq-dotnet/src/main/csharp/NMS/IQueue.cs @@ -1,32 +1,32 @@ -/* - * Copyright 2006 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -namespace NMS -{ - /// - /// Summary description for IQueue. - /// - public interface IQueue : IDestination - { - - string QueueName - { - get; - } - } -} - - +/* + * Copyright 2006 The Apache Software Foundation or its licensors, as + * applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +namespace NMS +{ + /// + /// Summary description for IQueue. + /// + public interface IQueue : IDestination + { + + string QueueName + { + get; + } + } +} + + diff --git a/activemq-dotnet/src/main/csharp/NMS/ISession.cs b/activemq-dotnet/src/main/csharp/NMS/ISession.cs index 87b9302207..f6e977410a 100644 --- a/activemq-dotnet/src/main/csharp/NMS/ISession.cs +++ b/activemq-dotnet/src/main/csharp/NMS/ISession.cs @@ -1,123 +1,123 @@ -/* - * Copyright 2006 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -namespace NMS -{ - /// - /// Represents a single unit of work on an IConnection. - /// So the ISession can be used to perform transactional receive and sends - /// - public interface ISession : System.IDisposable - { - - /// - /// Creates a producer of messages - /// - IMessageProducer CreateProducer(); - - /// - /// Creates a producer of messages on a given destination - /// - IMessageProducer CreateProducer(IDestination destination); - - /// - /// Creates a consumer of messages on a given destination - /// - IMessageConsumer CreateConsumer(IDestination destination); - - /// - /// Creates a consumer of messages on a given destination with a selector - /// - IMessageConsumer CreateConsumer(IDestination destination, string selector); - - /// - /// Creates a named durable consumer of messages on a given destination with a selector - /// - IMessageConsumer CreateDurableConsumer(ITopic destination, string name, string selector, bool noLocal); - - /// - /// Returns the queue for the given name - /// - IQueue GetQueue(string name); - - /// - /// Returns the topic for the given name - /// - ITopic GetTopic(string name); - - - /// - /// Creates a temporary queue - /// - ITemporaryQueue CreateTemporaryQueue(); - - /// - /// Creates a temporary topic - /// - ITemporaryTopic CreateTemporaryTopic(); - - - // Factory methods to create messages - - /// - /// Creates a new message with an empty body - /// - IMessage CreateMessage(); - - /// - /// Creates a new text message with an empty body - /// - ITextMessage CreateTextMessage(); - - /// - /// Creates a new text message with the given body - /// - ITextMessage CreateTextMessage(string text); - - /// - /// Creates a new Map message which contains primitive key and value pairs - /// - IMapMessage CreateMapMessage(); - - /// - /// Creates a new binary message - /// - IBytesMessage CreateBytesMessage(); - - /// - /// Creates a new binary message with the given body - /// - IBytesMessage CreateBytesMessage(byte[] body); - - - // Transaction methods - - /// - /// If this is a transactional session then commit all message - /// send and acknowledgements for producers and consumers in this session - /// - void Commit(); - - /// - /// If this is a transactional session then rollback all message - /// send and acknowledgements for producers and consumers in this session - /// - void Rollback(); - - } -} - - +/* + * Copyright 2006 The Apache Software Foundation or its licensors, as + * applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +namespace NMS +{ + /// + /// Represents a single unit of work on an IConnection. + /// So the ISession can be used to perform transactional receive and sends + /// + public interface ISession : System.IDisposable + { + + /// + /// Creates a producer of messages + /// + IMessageProducer CreateProducer(); + + /// + /// Creates a producer of messages on a given destination + /// + IMessageProducer CreateProducer(IDestination destination); + + /// + /// Creates a consumer of messages on a given destination + /// + IMessageConsumer CreateConsumer(IDestination destination); + + /// + /// Creates a consumer of messages on a given destination with a selector + /// + IMessageConsumer CreateConsumer(IDestination destination, string selector); + + /// + /// Creates a named durable consumer of messages on a given destination with a selector + /// + IMessageConsumer CreateDurableConsumer(ITopic destination, string name, string selector, bool noLocal); + + /// + /// Returns the queue for the given name + /// + IQueue GetQueue(string name); + + /// + /// Returns the topic for the given name + /// + ITopic GetTopic(string name); + + + /// + /// Creates a temporary queue + /// + ITemporaryQueue CreateTemporaryQueue(); + + /// + /// Creates a temporary topic + /// + ITemporaryTopic CreateTemporaryTopic(); + + + // Factory methods to create messages + + /// + /// Creates a new message with an empty body + /// + IMessage CreateMessage(); + + /// + /// Creates a new text message with an empty body + /// + ITextMessage CreateTextMessage(); + + /// + /// Creates a new text message with the given body + /// + ITextMessage CreateTextMessage(string text); + + /// + /// Creates a new Map message which contains primitive key and value pairs + /// + IMapMessage CreateMapMessage(); + + /// + /// Creates a new binary message + /// + IBytesMessage CreateBytesMessage(); + + /// + /// Creates a new binary message with the given body + /// + IBytesMessage CreateBytesMessage(byte[] body); + + + // Transaction methods + + /// + /// If this is a transactional session then commit all message + /// send and acknowledgements for producers and consumers in this session + /// + void Commit(); + + /// + /// If this is a transactional session then rollback all message + /// send and acknowledgements for producers and consumers in this session + /// + void Rollback(); + + } +} + + diff --git a/activemq-dotnet/src/main/csharp/NMS/IStartable.cs b/activemq-dotnet/src/main/csharp/NMS/IStartable.cs index 63eebaca08..68d6e4ec9e 100644 --- a/activemq-dotnet/src/main/csharp/NMS/IStartable.cs +++ b/activemq-dotnet/src/main/csharp/NMS/IStartable.cs @@ -1,28 +1,28 @@ -/* - * Copyright 2006 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -namespace NMS -{ - /// - /// Implemented by NMS objects that can be started. - /// - public interface IStartable - { - void Start(); - } -} - - +/* + * Copyright 2006 The Apache Software Foundation or its licensors, as + * applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +namespace NMS +{ + /// + /// Implemented by NMS objects that can be started. + /// + public interface IStartable + { + void Start(); + } +} + + diff --git a/activemq-dotnet/src/main/csharp/NMS/IStoppable.cs b/activemq-dotnet/src/main/csharp/NMS/IStoppable.cs index 9e0cca17d1..fcb6102220 100644 --- a/activemq-dotnet/src/main/csharp/NMS/IStoppable.cs +++ b/activemq-dotnet/src/main/csharp/NMS/IStoppable.cs @@ -1,27 +1,27 @@ -/* - * Copyright 2006 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -namespace NMS -{ - /// - /// Implemented by NMS objects that can be started. - /// - public interface IStoppable - { - void Stop(); - } -} - +/* + * Copyright 2006 The Apache Software Foundation or its licensors, as + * applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +namespace NMS +{ + /// + /// Implemented by NMS objects that can be started. + /// + public interface IStoppable + { + void Stop(); + } +} + diff --git a/activemq-dotnet/src/main/csharp/NMS/ITemporaryQueue.cs b/activemq-dotnet/src/main/csharp/NMS/ITemporaryQueue.cs index edbb5e5b06..3af260d3b3 100644 --- a/activemq-dotnet/src/main/csharp/NMS/ITemporaryQueue.cs +++ b/activemq-dotnet/src/main/csharp/NMS/ITemporaryQueue.cs @@ -1,27 +1,27 @@ -/* - * Copyright 2006 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -namespace NMS -{ - /// - /// Summary description for ITemporaryQueue. - /// - public interface ITemporaryQueue : IDestination - { - } -} - - +/* + * Copyright 2006 The Apache Software Foundation or its licensors, as + * applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +namespace NMS +{ + /// + /// Summary description for ITemporaryQueue. + /// + public interface ITemporaryQueue : IDestination + { + } +} + + diff --git a/activemq-dotnet/src/main/csharp/NMS/ITemporaryTopic.cs b/activemq-dotnet/src/main/csharp/NMS/ITemporaryTopic.cs index 8a6a593b48..b473d61530 100644 --- a/activemq-dotnet/src/main/csharp/NMS/ITemporaryTopic.cs +++ b/activemq-dotnet/src/main/csharp/NMS/ITemporaryTopic.cs @@ -1,27 +1,27 @@ -/* - * Copyright 2006 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -namespace NMS -{ - /// - /// Summary description for TemporaryTopic. - /// - public interface ITemporaryTopic : IDestination - { - } -} - - +/* + * Copyright 2006 The Apache Software Foundation or its licensors, as + * applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +namespace NMS +{ + /// + /// Summary description for TemporaryTopic. + /// + public interface ITemporaryTopic : IDestination + { + } +} + + diff --git a/activemq-dotnet/src/main/csharp/NMS/ITextMessage.cs b/activemq-dotnet/src/main/csharp/NMS/ITextMessage.cs index 9f435bcee0..80092fc415 100644 --- a/activemq-dotnet/src/main/csharp/NMS/ITextMessage.cs +++ b/activemq-dotnet/src/main/csharp/NMS/ITextMessage.cs @@ -1,33 +1,33 @@ -/* - * Copyright 2006 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -namespace NMS -{ - /// - /// Represents a text based message - /// - public interface ITextMessage : IMessage - { - - string Text - { - get; - set; - } - } -} - - +/* + * Copyright 2006 The Apache Software Foundation or its licensors, as + * applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +namespace NMS +{ + /// + /// Represents a text based message + /// + public interface ITextMessage : IMessage + { + + string Text + { + get; + set; + } + } +} + + diff --git a/activemq-dotnet/src/main/csharp/NMS/ITopic.cs b/activemq-dotnet/src/main/csharp/NMS/ITopic.cs index 9aeb0e5a60..e14e41bf90 100644 --- a/activemq-dotnet/src/main/csharp/NMS/ITopic.cs +++ b/activemq-dotnet/src/main/csharp/NMS/ITopic.cs @@ -1,32 +1,32 @@ -/* - * Copyright 2006 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -namespace NMS -{ - /// - /// Summary description for ITopic. - /// - public interface ITopic : IDestination - { - - string TopicName - { - get; - } - } -} - - +/* + * Copyright 2006 The Apache Software Foundation or its licensors, as + * applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +namespace NMS +{ + /// + /// Summary description for ITopic. + /// + public interface ITopic : IDestination + { + + string TopicName + { + get; + } + } +} + + diff --git a/activemq-dotnet/src/main/csharp/NMS/NMSConnectionException.cs b/activemq-dotnet/src/main/csharp/NMS/NMSConnectionException.cs index 2cd0cd5ef5..8fd5f15a71 100644 --- a/activemq-dotnet/src/main/csharp/NMS/NMSConnectionException.cs +++ b/activemq-dotnet/src/main/csharp/NMS/NMSConnectionException.cs @@ -1,30 +1,30 @@ -/* - * Copyright 2006 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -namespace NMS -{ - /// - /// Represents a connection failure. - /// - public class NMSConnectionException : NMSException - { - public NMSConnectionException(string message) : base(message) - { - } - } -} - - +/* + * Copyright 2006 The Apache Software Foundation or its licensors, as + * applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +namespace NMS +{ + /// + /// Represents a connection failure. + /// + public class NMSConnectionException : NMSException + { + public NMSConnectionException(string message) : base(message) + { + } + } +} + + diff --git a/activemq-dotnet/src/main/csharp/NMS/NMSException.cs b/activemq-dotnet/src/main/csharp/NMS/NMSException.cs index 717d6bb3ce..1fb9fa1428 100644 --- a/activemq-dotnet/src/main/csharp/NMS/NMSException.cs +++ b/activemq-dotnet/src/main/csharp/NMS/NMSException.cs @@ -1,30 +1,30 @@ -/* - * Copyright 2006 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -namespace NMS -{ - /// - /// Represents a NMS exception - /// - public class NMSException : System.Exception - { - public NMSException(string message) : base(message) - { - } - } -} - - +/* + * Copyright 2006 The Apache Software Foundation or its licensors, as + * applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +namespace NMS +{ + /// + /// Represents a NMS exception + /// + public class NMSException : System.Exception + { + public NMSException(string message) : base(message) + { + } + } +} + + diff --git a/activemq-dotnet/src/test/csharp/ActiveMQ/Commands/CommandTest.cs b/activemq-dotnet/src/test/csharp/ActiveMQ/Commands/CommandTest.cs index 7bb6f6e350..ee0d1bba85 100644 --- a/activemq-dotnet/src/test/csharp/ActiveMQ/Commands/CommandTest.cs +++ b/activemq-dotnet/src/test/csharp/ActiveMQ/Commands/CommandTest.cs @@ -1,63 +1,63 @@ -/* - * Copyright 2006 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -using ActiveMQ.Commands; -using NUnit.Framework; -using System.Collections; - - -namespace ActiveMQ.Commands -{ - [TestFixture] - public class CommandTest - { - - [Test] - public void TestCommand() - { - ConsumerId value1 = new ConsumerId(); - value1.ConnectionId = "abc"; - value1.SessionId = 123; - value1.Value = 456; - - ConsumerId value2 = new ConsumerId(); - value2.ConnectionId = "abc"; - value2.SessionId = 123; - value2.Value = 456; - - ConsumerId value3 = new ConsumerId(); - value3.ConnectionId = "abc"; - value3.SessionId = 123; - value3.Value = 457; - - Assert.AreEqual(value1, value2, "value1 and value2 should be equal"); - Assert.AreEqual(value1.GetHashCode(), value2.GetHashCode(), "value1 and value2 hash codes should be equal"); - - Assert.IsTrue(!value1.Equals(value3), "value1 and value3 should not be equal"); - Assert.IsTrue(!value3.Equals(value2), "value3 and value2 should not be equal"); - - // now lets test an IDictionary - IDictionary dictionary = new Hashtable(); - dictionary[value1] = value3; - - // now lets lookup with a copy - object actual = dictionary[value2]; - - Assert.AreEqual(value3, actual, "Should have found item in Map using value2 as a key"); - } - } -} - +/* + * Copyright 2006 The Apache Software Foundation or its licensors, as + * applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +using ActiveMQ.Commands; +using NUnit.Framework; +using System.Collections; + + +namespace ActiveMQ.Commands +{ + [TestFixture] + public class CommandTest + { + + [Test] + public void TestCommand() + { + ConsumerId value1 = new ConsumerId(); + value1.ConnectionId = "abc"; + value1.SessionId = 123; + value1.Value = 456; + + ConsumerId value2 = new ConsumerId(); + value2.ConnectionId = "abc"; + value2.SessionId = 123; + value2.Value = 456; + + ConsumerId value3 = new ConsumerId(); + value3.ConnectionId = "abc"; + value3.SessionId = 123; + value3.Value = 457; + + Assert.AreEqual(value1, value2, "value1 and value2 should be equal"); + Assert.AreEqual(value1.GetHashCode(), value2.GetHashCode(), "value1 and value2 hash codes should be equal"); + + Assert.IsTrue(!value1.Equals(value3), "value1 and value3 should not be equal"); + Assert.IsTrue(!value3.Equals(value2), "value3 and value2 should not be equal"); + + // now lets test an IDictionary + IDictionary dictionary = new Hashtable(); + dictionary[value1] = value3; + + // now lets lookup with a copy + object actual = dictionary[value2]; + + Assert.AreEqual(value3, actual, "Should have found item in Map using value2 as a key"); + } + } +} + diff --git a/activemq-dotnet/src/test/csharp/ActiveMQ/OpenWire/BooleanStreamTest.cs b/activemq-dotnet/src/test/csharp/ActiveMQ/OpenWire/BooleanStreamTest.cs index 0069f419e4..1dbedcd2cf 100644 --- a/activemq-dotnet/src/test/csharp/ActiveMQ/OpenWire/BooleanStreamTest.cs +++ b/activemq-dotnet/src/test/csharp/ActiveMQ/OpenWire/BooleanStreamTest.cs @@ -1,128 +1,128 @@ -/* - * Copyright 2006 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -using NUnit.Framework; -using System; -using System.IO; - -namespace ActiveMQ.OpenWire -{ - [TestFixture] - public class BooleanStreamTest - { - protected int endOfStreamMarker = 0x12345678; - int numberOfBytes = 8 * 200; - - public delegate bool GetBooleanValueDelegate(int index, int count); - - [Test] - public void TestBooleanMarshallingUsingAllTrue() - { - DoTestBooleanStream(numberOfBytes, new GetBooleanValueDelegate(GetBooleanValueAllTrue)); - } - public bool GetBooleanValueAllTrue(int index, int count) - { - return true; - } - - [Test] - public void TestBooleanMarshallingUsingAllFalse() - { - DoTestBooleanStream(numberOfBytes, new GetBooleanValueDelegate(GetBooleanValueAllFalse)); - } - public bool GetBooleanValueAllFalse(int index, int count) - { - return false; - } - - [Test] - public void TestBooleanMarshallingUsingAlternateTrueFalse() - { - DoTestBooleanStream(numberOfBytes, new GetBooleanValueDelegate(GetBooleanValueAlternateTrueFalse)); - } - public bool GetBooleanValueAlternateTrueFalse(int index, int count) - { - return (index & 1) == 0; - } - - [Test] - public void TestBooleanMarshallingUsingAlternateFalseTrue() - { - DoTestBooleanStream(numberOfBytes, new GetBooleanValueDelegate(GetBooleanValueAlternateFalseTrue)); - } - public bool GetBooleanValueAlternateFalseTrue(int index, int count) - { - return (index & 1) != 0; - } - - protected void DoTestBooleanStream(int numberOfBytes, GetBooleanValueDelegate valueDelegate) - { - for (int i = 1017; i < numberOfBytes; i++) - { - AssertMarshalBooleans(i, valueDelegate); - } - } - - protected void AssertMarshalBooleans(int count, GetBooleanValueDelegate valueDelegate) - { - BooleanStream bs = new BooleanStream(); - for (int i = 0; i < count; i++) - { - bs.WriteBoolean(valueDelegate(i, count)); - } - MemoryStream buffer = new MemoryStream(); - BinaryWriter ds = new OpenWireBinaryWriter(buffer); - bs.Marshal(ds); - ds.Write(endOfStreamMarker); - - // now lets read from the stream - - MemoryStream ins = new MemoryStream(buffer.ToArray()); - BinaryReader dis = new OpenWireBinaryReader(ins); - bs = new BooleanStream(); - bs.Unmarshal(dis); - - for (int i = 0; i < count; i++) - { - bool expected = valueDelegate(i, count); - - try - { - bool actual = bs.ReadBoolean(); - Assert.AreEqual(expected, actual); - } - catch (Exception e) - { - Assert.Fail("Failed to parse bool: " + i + " out of: " + count + " due to: " + e); - } - } - int marker = dis.ReadInt32(); - Assert.AreEqual(endOfStreamMarker, marker, "did not match: "+endOfStreamMarker+" and "+marker); - - // lets try read and we should get an exception - try - { - dis.ReadByte(); - Assert.Fail("Should have reached the end of the stream"); - } - catch (IOException) - { - } - } - - } -} - +/* + * Copyright 2006 The Apache Software Foundation or its licensors, as + * applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +using NUnit.Framework; +using System; +using System.IO; + +namespace ActiveMQ.OpenWire +{ + [TestFixture] + public class BooleanStreamTest + { + protected int endOfStreamMarker = 0x12345678; + int numberOfBytes = 8 * 200; + + public delegate bool GetBooleanValueDelegate(int index, int count); + + [Test] + public void TestBooleanMarshallingUsingAllTrue() + { + DoTestBooleanStream(numberOfBytes, new GetBooleanValueDelegate(GetBooleanValueAllTrue)); + } + public bool GetBooleanValueAllTrue(int index, int count) + { + return true; + } + + [Test] + public void TestBooleanMarshallingUsingAllFalse() + { + DoTestBooleanStream(numberOfBytes, new GetBooleanValueDelegate(GetBooleanValueAllFalse)); + } + public bool GetBooleanValueAllFalse(int index, int count) + { + return false; + } + + [Test] + public void TestBooleanMarshallingUsingAlternateTrueFalse() + { + DoTestBooleanStream(numberOfBytes, new GetBooleanValueDelegate(GetBooleanValueAlternateTrueFalse)); + } + public bool GetBooleanValueAlternateTrueFalse(int index, int count) + { + return (index & 1) == 0; + } + + [Test] + public void TestBooleanMarshallingUsingAlternateFalseTrue() + { + DoTestBooleanStream(numberOfBytes, new GetBooleanValueDelegate(GetBooleanValueAlternateFalseTrue)); + } + public bool GetBooleanValueAlternateFalseTrue(int index, int count) + { + return (index & 1) != 0; + } + + protected void DoTestBooleanStream(int numberOfBytes, GetBooleanValueDelegate valueDelegate) + { + for (int i = 1017; i < numberOfBytes; i++) + { + AssertMarshalBooleans(i, valueDelegate); + } + } + + protected void AssertMarshalBooleans(int count, GetBooleanValueDelegate valueDelegate) + { + BooleanStream bs = new BooleanStream(); + for (int i = 0; i < count; i++) + { + bs.WriteBoolean(valueDelegate(i, count)); + } + MemoryStream buffer = new MemoryStream(); + BinaryWriter ds = new OpenWireBinaryWriter(buffer); + bs.Marshal(ds); + ds.Write(endOfStreamMarker); + + // now lets read from the stream + + MemoryStream ins = new MemoryStream(buffer.ToArray()); + BinaryReader dis = new OpenWireBinaryReader(ins); + bs = new BooleanStream(); + bs.Unmarshal(dis); + + for (int i = 0; i < count; i++) + { + bool expected = valueDelegate(i, count); + + try + { + bool actual = bs.ReadBoolean(); + Assert.AreEqual(expected, actual); + } + catch (Exception e) + { + Assert.Fail("Failed to parse bool: " + i + " out of: " + count + " due to: " + e); + } + } + int marker = dis.ReadInt32(); + Assert.AreEqual(endOfStreamMarker, marker, "did not match: "+endOfStreamMarker+" and "+marker); + + // lets try read and we should get an exception + try + { + dis.ReadByte(); + Assert.Fail("Should have reached the end of the stream"); + } + catch (IOException) + { + } + } + + } +} + diff --git a/activemq-dotnet/src/test/csharp/ActiveMQ/TestMain.cs b/activemq-dotnet/src/test/csharp/ActiveMQ/TestMain.cs index 0bd12a0603..d0aaaa95c0 100644 --- a/activemq-dotnet/src/test/csharp/ActiveMQ/TestMain.cs +++ b/activemq-dotnet/src/test/csharp/ActiveMQ/TestMain.cs @@ -1,77 +1,77 @@ -/* - * Copyright 2006 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -using ActiveMQ.Commands; -using NMS; -using System; - -namespace ActiveMQ -{ - public class TestMain - { - public static void Main(string[] args) - { - try - { - Console.WriteLine("About to connect to ActiveMQ"); - - // START SNIPPET: demo - IConnectionFactory factory = new ConnectionFactory(new Uri("tcp://localhost:61616")); - using (IConnection connection = factory.CreateConnection()) - { - Console.WriteLine("Created a connection!"); - - ISession session = connection.CreateSession(); - - IDestination destination = session.GetQueue("FOO.BAR"); - Console.WriteLine("Using destination: " + destination); - - // lets create a consumer and producer - IMessageConsumer consumer = session.CreateConsumer(destination); - - IMessageProducer producer = session.CreateProducer(destination); - producer.Persistent = true; - - // lets send a message - ITextMessage request = session.CreateTextMessage("Hello World!"); - request.NMSCorrelationID = "abc"; - request.Properties["JMSXGroupID"] = "cheese"; - request.Properties["myHeader"] = "James"; - - producer.Send(request); - - // lets consume a message - ActiveMQTextMessage message = (ActiveMQTextMessage) consumer.Receive(); - if (message == null) - { - Console.WriteLine("No message received!"); - } - else - { - Console.WriteLine("Received message with ID: " + message.NMSMessageId); - Console.WriteLine("Received message with text: " + message.Text); - } - } - // END SNIPPET: demo - } - catch (Exception e) - { - Console.WriteLine("Caught: " + e); - Console.WriteLine("Stack: " + e.StackTrace); - } - } - } -} +/* + * Copyright 2006 The Apache Software Foundation or its licensors, as + * applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +using ActiveMQ.Commands; +using NMS; +using System; + +namespace ActiveMQ +{ + public class TestMain + { + public static void Main(string[] args) + { + try + { + Console.WriteLine("About to connect to ActiveMQ"); + + // START SNIPPET: demo + IConnectionFactory factory = new ConnectionFactory(new Uri("tcp://localhost:61616")); + using (IConnection connection = factory.CreateConnection()) + { + Console.WriteLine("Created a connection!"); + + ISession session = connection.CreateSession(); + + IDestination destination = session.GetQueue("FOO.BAR"); + Console.WriteLine("Using destination: " + destination); + + // lets create a consumer and producer + IMessageConsumer consumer = session.CreateConsumer(destination); + + IMessageProducer producer = session.CreateProducer(destination); + producer.Persistent = true; + + // lets send a message + ITextMessage request = session.CreateTextMessage("Hello World!"); + request.NMSCorrelationID = "abc"; + request.Properties["JMSXGroupID"] = "cheese"; + request.Properties["myHeader"] = "James"; + + producer.Send(request); + + // lets consume a message + ActiveMQTextMessage message = (ActiveMQTextMessage) consumer.Receive(); + if (message == null) + { + Console.WriteLine("No message received!"); + } + else + { + Console.WriteLine("Received message with ID: " + message.NMSMessageId); + Console.WriteLine("Received message with text: " + message.Text); + } + } + // END SNIPPET: demo + } + catch (Exception e) + { + Console.WriteLine("Caught: " + e); + Console.WriteLine("Stack: " + e.StackTrace); + } + } + } +} diff --git a/activemq-optional/src/test/java/org/apache/activemq/transport/http/HttpJmsDurableTopicSendReceiveTest.java b/activemq-optional/src/test/java/org/apache/activemq/transport/http/HttpJmsDurableTopicSendReceiveTest.java index 5adc2cde70..204b00f2db 100644 --- a/activemq-optional/src/test/java/org/apache/activemq/transport/http/HttpJmsDurableTopicSendReceiveTest.java +++ b/activemq-optional/src/test/java/org/apache/activemq/transport/http/HttpJmsDurableTopicSendReceiveTest.java @@ -1,56 +1,56 @@ -/** - * - * Copyright 2005-2006 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.activemq.transport.http; - -import org.apache.activemq.JmsDurableTopicSendReceiveTest; -import org.apache.activemq.ActiveMQConnectionFactory; -import org.apache.activemq.broker.BrokerService; - -public class HttpJmsDurableTopicSendReceiveTest extends JmsDurableTopicSendReceiveTest { - protected BrokerService broker; - - protected void setUp() throws Exception { - if (broker == null) { - broker = createBroker(); - broker.start(); - } - super.setUp(); - } - - protected void tearDown() throws Exception { - super.tearDown(); - if (broker != null) { - broker.stop(); - } - } - - protected ActiveMQConnectionFactory createConnectionFactory() { - ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(getBrokerURL()); - return connectionFactory; - } - - protected String getBrokerURL() { - return "http://localhost:8161"; - } - - protected BrokerService createBroker() throws Exception { - BrokerService answer = new BrokerService(); - answer.setPersistent(false); - answer.addConnector(getBrokerURL()); - return answer; - } -} +/** + * + * Copyright 2005-2006 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.activemq.transport.http; + +import org.apache.activemq.JmsDurableTopicSendReceiveTest; +import org.apache.activemq.ActiveMQConnectionFactory; +import org.apache.activemq.broker.BrokerService; + +public class HttpJmsDurableTopicSendReceiveTest extends JmsDurableTopicSendReceiveTest { + protected BrokerService broker; + + protected void setUp() throws Exception { + if (broker == null) { + broker = createBroker(); + broker.start(); + } + super.setUp(); + } + + protected void tearDown() throws Exception { + super.tearDown(); + if (broker != null) { + broker.stop(); + } + } + + protected ActiveMQConnectionFactory createConnectionFactory() { + ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(getBrokerURL()); + return connectionFactory; + } + + protected String getBrokerURL() { + return "http://localhost:8161"; + } + + protected BrokerService createBroker() throws Exception { + BrokerService answer = new BrokerService(); + answer.setPersistent(false); + answer.addConnector(getBrokerURL()); + return answer; + } +} diff --git a/activemq-optional/src/test/java/org/apache/activemq/transport/http/HttpPersistentSendAndReceiveTest.java b/activemq-optional/src/test/java/org/apache/activemq/transport/http/HttpPersistentSendAndReceiveTest.java index 17af0a0c8a..554b110cc2 100644 --- a/activemq-optional/src/test/java/org/apache/activemq/transport/http/HttpPersistentSendAndReceiveTest.java +++ b/activemq-optional/src/test/java/org/apache/activemq/transport/http/HttpPersistentSendAndReceiveTest.java @@ -1,38 +1,38 @@ -/** - * - * Copyright 2005-2006 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.activemq.transport.http; - -import org.apache.activemq.broker.BrokerService; - -import javax.jms.DeliveryMode; - -public class HttpPersistentSendAndReceiveTest extends HttpJmsSendAndReceiveTest { - protected BrokerService broker; - - protected void setUp() throws Exception { - this.topic = false; - this.deliveryMode = DeliveryMode.PERSISTENT; - super.setUp(); - } - - protected BrokerService createBroker() throws Exception { - BrokerService answer = new BrokerService(); - answer.setPersistent(true); - answer.addConnector(getBrokerURL()); - return answer; - } -} +/** + * + * Copyright 2005-2006 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.activemq.transport.http; + +import org.apache.activemq.broker.BrokerService; + +import javax.jms.DeliveryMode; + +public class HttpPersistentSendAndReceiveTest extends HttpJmsSendAndReceiveTest { + protected BrokerService broker; + + protected void setUp() throws Exception { + this.topic = false; + this.deliveryMode = DeliveryMode.PERSISTENT; + super.setUp(); + } + + protected BrokerService createBroker() throws Exception { + BrokerService answer = new BrokerService(); + answer.setPersistent(true); + answer.addConnector(getBrokerURL()); + return answer; + } +} diff --git a/activemq-optional/src/test/java/org/apache/activemq/transport/https/HttpsJmsSendAndReceiveTest.java b/activemq-optional/src/test/java/org/apache/activemq/transport/https/HttpsJmsSendAndReceiveTest.java index b3154e1702..e8998e2202 100644 --- a/activemq-optional/src/test/java/org/apache/activemq/transport/https/HttpsJmsSendAndReceiveTest.java +++ b/activemq-optional/src/test/java/org/apache/activemq/transport/https/HttpsJmsSendAndReceiveTest.java @@ -1,39 +1,39 @@ -/** - * - * Copyright 2005-2006 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.activemq.transport.https; - -import org.apache.activemq.transport.http.HttpJmsSendAndReceiveTest; - -/** - * @version $Revision$ - */ -public class HttpsJmsSendAndReceiveTest extends HttpJmsSendAndReceiveTest { - - protected void setUp() throws Exception { - System.setProperty("javax.net.ssl.trustStore", "src/test/resources/client.keystore"); - System.setProperty("javax.net.ssl.trustStorePassword", "password"); - System.setProperty("javax.net.ssl.trustStoreType", "jks"); - System.setProperty("javax.net.ssl.keyStore", "src/test/resources/server.keystore"); - System.setProperty("javax.net.ssl.keyStorePassword", "password"); - System.setProperty("javax.net.ssl.keyStoreType", "jks"); - super.setUp(); - } - - protected String getBrokerURL() { - return "https://localhost:8161"; - } -} +/** + * + * Copyright 2005-2006 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.activemq.transport.https; + +import org.apache.activemq.transport.http.HttpJmsSendAndReceiveTest; + +/** + * @version $Revision$ + */ +public class HttpsJmsSendAndReceiveTest extends HttpJmsSendAndReceiveTest { + + protected void setUp() throws Exception { + System.setProperty("javax.net.ssl.trustStore", "src/test/resources/client.keystore"); + System.setProperty("javax.net.ssl.trustStorePassword", "password"); + System.setProperty("javax.net.ssl.trustStoreType", "jks"); + System.setProperty("javax.net.ssl.keyStore", "src/test/resources/server.keystore"); + System.setProperty("javax.net.ssl.keyStorePassword", "password"); + System.setProperty("javax.net.ssl.keyStoreType", "jks"); + super.setUp(); + } + + protected String getBrokerURL() { + return "https://localhost:8161"; + } +} diff --git a/activemq-optional/src/test/java/org/apache/activemq/transport/https/HttpsTransportBrokerTest.java b/activemq-optional/src/test/java/org/apache/activemq/transport/https/HttpsTransportBrokerTest.java index 79743768ef..ef984bcb85 100644 --- a/activemq-optional/src/test/java/org/apache/activemq/transport/https/HttpsTransportBrokerTest.java +++ b/activemq-optional/src/test/java/org/apache/activemq/transport/https/HttpsTransportBrokerTest.java @@ -1,51 +1,51 @@ -/** - * - * Copyright 2005-2006 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.activemq.transport.https; - -import org.apache.activemq.transport.http.HttpTransportBrokerTest; - -import junit.framework.Test; -import junit.textui.TestRunner; - -public class HttpsTransportBrokerTest extends HttpTransportBrokerTest { - - protected String getBindLocation() { - return "https://localhost:8161"; - } - - protected void setUp() throws Exception { - System.setProperty("javax.net.ssl.trustStore", "src/test/resources/client.keystore"); - System.setProperty("javax.net.ssl.trustStorePassword", "password"); - System.setProperty("javax.net.ssl.trustStoreType", "jks"); - System.setProperty("javax.net.ssl.keyStore", "src/test/resources/server.keystore"); - System.setProperty("javax.net.ssl.keyStorePassword", "password"); - System.setProperty("javax.net.ssl.keyStoreType", "jks"); - //System.setProperty("javax.net.debug", "ssl,handshake,data,trustmanager"); - super.setUp(); - - Thread.sleep(5000); - } - - public static Test suite() { - return suite(HttpsTransportBrokerTest.class); - } - - public static void main(String[] args) { - TestRunner.run(suite()); - } - -} +/** + * + * Copyright 2005-2006 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.activemq.transport.https; + +import org.apache.activemq.transport.http.HttpTransportBrokerTest; + +import junit.framework.Test; +import junit.textui.TestRunner; + +public class HttpsTransportBrokerTest extends HttpTransportBrokerTest { + + protected String getBindLocation() { + return "https://localhost:8161"; + } + + protected void setUp() throws Exception { + System.setProperty("javax.net.ssl.trustStore", "src/test/resources/client.keystore"); + System.setProperty("javax.net.ssl.trustStorePassword", "password"); + System.setProperty("javax.net.ssl.trustStoreType", "jks"); + System.setProperty("javax.net.ssl.keyStore", "src/test/resources/server.keystore"); + System.setProperty("javax.net.ssl.keyStorePassword", "password"); + System.setProperty("javax.net.ssl.keyStoreType", "jks"); + //System.setProperty("javax.net.debug", "ssl,handshake,data,trustmanager"); + super.setUp(); + + Thread.sleep(5000); + } + + public static Test suite() { + return suite(HttpsTransportBrokerTest.class); + } + + public static void main(String[] args) { + TestRunner.run(suite()); + } + +} diff --git a/activemq-soaktest/src/test/java/org/apache/activemq/soaktest/MarshallingWithCachingTest.java b/activemq-soaktest/src/test/java/org/apache/activemq/soaktest/MarshallingWithCachingTest.java index f98111af72..62954860ae 100644 --- a/activemq-soaktest/src/test/java/org/apache/activemq/soaktest/MarshallingWithCachingTest.java +++ b/activemq-soaktest/src/test/java/org/apache/activemq/soaktest/MarshallingWithCachingTest.java @@ -1,142 +1,142 @@ -/** - * - * Copyright 2005-2006 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.activemq.soaktest; - -import org.apache.activemq.command.ActiveMQDestination; -import org.apache.activemq.command.ActiveMQQueue; -import org.apache.activemq.command.DataStructure; -import org.apache.activemq.command.ProducerId; -import org.apache.activemq.command.ProducerInfo; -import org.apache.activemq.openwire.OpenWireFormat; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; - -import junit.framework.TestCase; - -/** - * - * @version $Revision: 383541 $ - */ -public class MarshallingWithCachingTest extends TestCase { - - protected long commandCount = Short.MAX_VALUE; - protected String connectionId = "Cheese"; - protected ActiveMQDestination destination = new ActiveMQQueue("Foo"); - protected int endOfStreamMarker = 0x12345678; - - protected ByteArrayOutputStream buffer = new ByteArrayOutputStream(); - protected DataOutputStream ds = new DataOutputStream(buffer); - protected OpenWireFormat openWireformat; - protected long logGroup = 10000; - - - - public void testReadAndWriteLotsOfCommands() throws Exception { - System.out.println("Marshalling: " + commandCount + " objects"); - for (long i = 0; i < commandCount ; i++) { - logProgress("Marshalling", i); - DataStructure object = createDataStructure(i); - writeObject(object); - } - ds.writeInt(endOfStreamMarker); - - // now lets read from the stream - ds.close(); - - System.out.println("Unmarshalling: " + commandCount + " objects"); - - ByteArrayInputStream in = new ByteArrayInputStream(buffer.toByteArray()); - DataInputStream dis = new DataInputStream(in); - for (long i = 0; i < commandCount ; i++) { - logProgress("Unmarshalling", i); - DataStructure command = null; - try { - command = (DataStructure) openWireformat.unmarshal(dis); - } - catch (Exception e) { - e.printStackTrace(); - fail("Failed to unmarshal object: " + i + ". Reason: " + e); - } - assertDataStructureExpected(command, i); - } - - int marker = dis.readInt(); - assertEquals("Marker int", Integer.toHexString(endOfStreamMarker), Integer.toHexString(marker)); - - // lets try read and we should get an exception - try { - dis.readByte(); - fail("Should have reached the end of the stream"); - } - catch (IOException e) { - // worked! - } - } - - protected void logProgress(String message, long i) { - if (i % logGroup == 0) { - System.out.println(message + " at object: " + i); - } - } - - protected void setUp() throws Exception { - super.setUp(); - openWireformat = createOpenWireFormat(); - } - - protected OpenWireFormat createOpenWireFormat() { - OpenWireFormat wf = new OpenWireFormat(); - wf.setCacheEnabled(true); - wf.setStackTraceEnabled(true); - wf.setVersion(1); - return wf; - } - - private void writeObject(Object object) throws IOException { - openWireformat.marshal(object, ds); - } - - protected DataStructure createDataStructure(long index) { - ProducerId id = new ProducerId(); - id.setConnectionId(connectionId); - id.setSessionId(index); - id.setValue(index); - - ProducerInfo object = new ProducerInfo(); - object.setProducerId(id); - object.setDestination(destination); - return object; - } - - protected void assertDataStructureExpected(DataStructure object, long i) { - assertEquals("Type of object for index: " + i, ProducerInfo.class, object.getClass()); - ProducerInfo command = (ProducerInfo) object; - - ProducerId id = command.getProducerId(); - assertNotNull("ProducerID for object at index: " + i, id); - - assertEquals("connection ID in object: "+ i, connectionId, id.getConnectionId()); - String actual = Long.toHexString(id.getValue()); - String expected = Long.toHexString(i); - assertEquals("value of object: "+ i + " was: " + actual, expected, actual); - assertEquals("value of object: "+ i + " was: " + actual, i, id.getSessionId()); - } -} +/** + * + * Copyright 2005-2006 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.activemq.soaktest; + +import org.apache.activemq.command.ActiveMQDestination; +import org.apache.activemq.command.ActiveMQQueue; +import org.apache.activemq.command.DataStructure; +import org.apache.activemq.command.ProducerId; +import org.apache.activemq.command.ProducerInfo; +import org.apache.activemq.openwire.OpenWireFormat; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.IOException; + +import junit.framework.TestCase; + +/** + * + * @version $Revision: 383541 $ + */ +public class MarshallingWithCachingTest extends TestCase { + + protected long commandCount = Short.MAX_VALUE; + protected String connectionId = "Cheese"; + protected ActiveMQDestination destination = new ActiveMQQueue("Foo"); + protected int endOfStreamMarker = 0x12345678; + + protected ByteArrayOutputStream buffer = new ByteArrayOutputStream(); + protected DataOutputStream ds = new DataOutputStream(buffer); + protected OpenWireFormat openWireformat; + protected long logGroup = 10000; + + + + public void testReadAndWriteLotsOfCommands() throws Exception { + System.out.println("Marshalling: " + commandCount + " objects"); + for (long i = 0; i < commandCount ; i++) { + logProgress("Marshalling", i); + DataStructure object = createDataStructure(i); + writeObject(object); + } + ds.writeInt(endOfStreamMarker); + + // now lets read from the stream + ds.close(); + + System.out.println("Unmarshalling: " + commandCount + " objects"); + + ByteArrayInputStream in = new ByteArrayInputStream(buffer.toByteArray()); + DataInputStream dis = new DataInputStream(in); + for (long i = 0; i < commandCount ; i++) { + logProgress("Unmarshalling", i); + DataStructure command = null; + try { + command = (DataStructure) openWireformat.unmarshal(dis); + } + catch (Exception e) { + e.printStackTrace(); + fail("Failed to unmarshal object: " + i + ". Reason: " + e); + } + assertDataStructureExpected(command, i); + } + + int marker = dis.readInt(); + assertEquals("Marker int", Integer.toHexString(endOfStreamMarker), Integer.toHexString(marker)); + + // lets try read and we should get an exception + try { + dis.readByte(); + fail("Should have reached the end of the stream"); + } + catch (IOException e) { + // worked! + } + } + + protected void logProgress(String message, long i) { + if (i % logGroup == 0) { + System.out.println(message + " at object: " + i); + } + } + + protected void setUp() throws Exception { + super.setUp(); + openWireformat = createOpenWireFormat(); + } + + protected OpenWireFormat createOpenWireFormat() { + OpenWireFormat wf = new OpenWireFormat(); + wf.setCacheEnabled(true); + wf.setStackTraceEnabled(true); + wf.setVersion(1); + return wf; + } + + private void writeObject(Object object) throws IOException { + openWireformat.marshal(object, ds); + } + + protected DataStructure createDataStructure(long index) { + ProducerId id = new ProducerId(); + id.setConnectionId(connectionId); + id.setSessionId(index); + id.setValue(index); + + ProducerInfo object = new ProducerInfo(); + object.setProducerId(id); + object.setDestination(destination); + return object; + } + + protected void assertDataStructureExpected(DataStructure object, long i) { + assertEquals("Type of object for index: " + i, ProducerInfo.class, object.getClass()); + ProducerInfo command = (ProducerInfo) object; + + ProducerId id = command.getProducerId(); + assertNotNull("ProducerID for object at index: " + i, id); + + assertEquals("connection ID in object: "+ i, connectionId, id.getConnectionId()); + String actual = Long.toHexString(id.getValue()); + String expected = Long.toHexString(i); + assertEquals("value of object: "+ i + " was: " + actual, expected, actual); + assertEquals("value of object: "+ i + " was: " + actual, i, id.getSessionId()); + } +} diff --git a/activemq-soaktest/src/test/java/org/apache/activemq/soaktest/PublishThenConsumeSoakTest.java b/activemq-soaktest/src/test/java/org/apache/activemq/soaktest/PublishThenConsumeSoakTest.java index 30e49c94e3..4f28a296c6 100644 --- a/activemq-soaktest/src/test/java/org/apache/activemq/soaktest/PublishThenConsumeSoakTest.java +++ b/activemq-soaktest/src/test/java/org/apache/activemq/soaktest/PublishThenConsumeSoakTest.java @@ -1,47 +1,47 @@ -/** - * - * Copyright 2005-2006 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.activemq.soaktest; - - -public class PublishThenConsumeSoakTest extends SoakTestSupport{ - - - public void testPublishThenReceive() throws Exception { - messageCount = 5000000; - - createProducers(); - int counter = 0; - for (int i = 0; i < messageCount; i++) { - - for (int k = 0; k < producers.length; k++) { - producers[k].sendMessage(payload,"counter",counter); - counter++; - } - } - - allMessagesList.setAsParent(true); - - createConsumers(); - allMessagesList.waitForMessagesToArrive(messageCount*producers.length); - allMessagesList.assertMessagesReceived(messageCount*producers.length); - allMessagesList.assertMessagesReceivedAreInOrder(messageCount*producers.length); - - } - - -} +/** + * + * Copyright 2005-2006 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.activemq.soaktest; + + +public class PublishThenConsumeSoakTest extends SoakTestSupport{ + + + public void testPublishThenReceive() throws Exception { + messageCount = 5000000; + + createProducers(); + int counter = 0; + for (int i = 0; i < messageCount; i++) { + + for (int k = 0; k < producers.length; k++) { + producers[k].sendMessage(payload,"counter",counter); + counter++; + } + } + + allMessagesList.setAsParent(true); + + createConsumers(); + allMessagesList.waitForMessagesToArrive(messageCount*producers.length); + allMessagesList.assertMessagesReceived(messageCount*producers.length); + allMessagesList.assertMessagesReceivedAreInOrder(messageCount*producers.length); + + } + + +} diff --git a/activemq-soaktest/src/test/java/org/apache/activemq/soaktest/SoakTestSupport.java b/activemq-soaktest/src/test/java/org/apache/activemq/soaktest/SoakTestSupport.java index 392334543d..082e4cc387 100644 --- a/activemq-soaktest/src/test/java/org/apache/activemq/soaktest/SoakTestSupport.java +++ b/activemq-soaktest/src/test/java/org/apache/activemq/soaktest/SoakTestSupport.java @@ -1,183 +1,183 @@ -/** - * - * Copyright 2005-2006 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.activemq.soaktest; - -import org.apache.activemq.ActiveMQConnectionFactory; -import org.apache.activemq.broker.BrokerService; -import org.apache.activemq.tool.Producer; -import org.apache.activemq.tool.Consumer; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -import javax.jms.*; - -import junit.framework.TestCase; - -import java.io.File; - - -public class SoakTestSupport extends TestCase{ - - private static final Log log = LogFactory.getLog(SoakTestSupport.class); - protected BrokerService broker; - protected String brokerURL = "tcp://localhost:61616"; - protected int consumerCount = 1; - protected int producerCount = 1; - protected int messageSize = 1024; - protected int messageCount = 1000; - - protected Producer[] producers; - protected Consumer[] consumers; - protected String destinationName = "TOOL.DEFAULT"; - protected Message payload; - - protected ConnectionFactory connectionFactory; - protected Destination destination; - protected boolean createConnectionPerClient = true; - protected boolean topic = false; - protected boolean transacted = false; - protected boolean durable = true; - protected boolean useEmbeddedBroker = true; - protected boolean keepOnRunning = true; - protected int duration = 0; //duration in minutes - protected boolean useConsumerListener = true; - protected Consumer allMessagesList = new Consumer(); - private String dataFileRoot = "activemq-data"; - - - protected void setUp() throws Exception { - //clean up db store - File dataFile = new File(dataFileRoot); - recursiveDelete(dataFile); - - if (useEmbeddedBroker) { - if (broker == null) { - broker = createBroker(); - } - } - - connectionFactory = createConnectionFactory(); - Connection con = connectionFactory.createConnection(); - Session session = con.createSession(transacted, Session.AUTO_ACKNOWLEDGE); - - if (topic) { - destination = session.createTopic(destinationName); - } else { - destination = session.createQueue(destinationName); - } - - createPayload(session); - - con.close(); - - } - - - protected void createPayload(Session session) throws JMSException { - - byte[] array = new byte[messageSize]; - for (int i = 0; i < array.length; i++) { - array[i] = (byte) i; - } - - BytesMessage bystePayload = session.createBytesMessage(); - bystePayload.writeBytes(array); - payload = (Message) bystePayload; - } - - - protected void createProducers() throws JMSException { - producers = new Producer[producerCount]; - for (int i = 0; i < producerCount; i++) { - producers[i] = new Producer(connectionFactory, destination); - if (durable) { - producers[i].setDeliveryMode(DeliveryMode.PERSISTENT); - } - else { - producers[i].setDeliveryMode(DeliveryMode.NON_PERSISTENT); - } - producers[i].start(); - } - - } - - protected void createConsumers() throws JMSException { - consumers = new Consumer[consumerCount]; - for (int i = 0; i < consumerCount; i++) { - consumers[i] = new Consumer(connectionFactory, destination); - consumers[i].setParent(allMessagesList); - if(useConsumerListener){ - consumers[i].start(); - } - - - } - } - - protected ActiveMQConnectionFactory createConnectionFactory() throws JMSException { - - if (useEmbeddedBroker) { - return new ActiveMQConnectionFactory("vm://localhost"); - } else { - return new ActiveMQConnectionFactory(brokerURL); - } - } - - protected BrokerService createBroker() throws Exception { - BrokerService broker = new BrokerService(); - configureBroker(broker); - broker.start(); - return broker; - } - - protected void configureBroker(BrokerService broker) throws Exception { - broker.addConnector("vm://localhost"); - broker.setDeleteAllMessagesOnStartup(true); - } - - public void startTimer() { - - Thread timer = new Thread(new Runnable() { - public void run() { - try { - - Thread.sleep(duration * 60 * 1000); - keepOnRunning = true; - } catch (InterruptedException e) { - - } finally { - - } - } - }, "TimerThread"); - - - log.info("Starting timer thread... Duration :" +duration + " minutes"); - timer.start(); - } - - protected void recursiveDelete(File file) { - if( file.isDirectory() ) { - File[] files = file.listFiles(); - for (int i = 0; i < files.length; i++) { - recursiveDelete(files[i]); - } - } - file.delete(); - } -} +/** + * + * Copyright 2005-2006 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.activemq.soaktest; + +import org.apache.activemq.ActiveMQConnectionFactory; +import org.apache.activemq.broker.BrokerService; +import org.apache.activemq.tool.Producer; +import org.apache.activemq.tool.Consumer; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import javax.jms.*; + +import junit.framework.TestCase; + +import java.io.File; + + +public class SoakTestSupport extends TestCase{ + + private static final Log log = LogFactory.getLog(SoakTestSupport.class); + protected BrokerService broker; + protected String brokerURL = "tcp://localhost:61616"; + protected int consumerCount = 1; + protected int producerCount = 1; + protected int messageSize = 1024; + protected int messageCount = 1000; + + protected Producer[] producers; + protected Consumer[] consumers; + protected String destinationName = "TOOL.DEFAULT"; + protected Message payload; + + protected ConnectionFactory connectionFactory; + protected Destination destination; + protected boolean createConnectionPerClient = true; + protected boolean topic = false; + protected boolean transacted = false; + protected boolean durable = true; + protected boolean useEmbeddedBroker = true; + protected boolean keepOnRunning = true; + protected int duration = 0; //duration in minutes + protected boolean useConsumerListener = true; + protected Consumer allMessagesList = new Consumer(); + private String dataFileRoot = "activemq-data"; + + + protected void setUp() throws Exception { + //clean up db store + File dataFile = new File(dataFileRoot); + recursiveDelete(dataFile); + + if (useEmbeddedBroker) { + if (broker == null) { + broker = createBroker(); + } + } + + connectionFactory = createConnectionFactory(); + Connection con = connectionFactory.createConnection(); + Session session = con.createSession(transacted, Session.AUTO_ACKNOWLEDGE); + + if (topic) { + destination = session.createTopic(destinationName); + } else { + destination = session.createQueue(destinationName); + } + + createPayload(session); + + con.close(); + + } + + + protected void createPayload(Session session) throws JMSException { + + byte[] array = new byte[messageSize]; + for (int i = 0; i < array.length; i++) { + array[i] = (byte) i; + } + + BytesMessage bystePayload = session.createBytesMessage(); + bystePayload.writeBytes(array); + payload = (Message) bystePayload; + } + + + protected void createProducers() throws JMSException { + producers = new Producer[producerCount]; + for (int i = 0; i < producerCount; i++) { + producers[i] = new Producer(connectionFactory, destination); + if (durable) { + producers[i].setDeliveryMode(DeliveryMode.PERSISTENT); + } + else { + producers[i].setDeliveryMode(DeliveryMode.NON_PERSISTENT); + } + producers[i].start(); + } + + } + + protected void createConsumers() throws JMSException { + consumers = new Consumer[consumerCount]; + for (int i = 0; i < consumerCount; i++) { + consumers[i] = new Consumer(connectionFactory, destination); + consumers[i].setParent(allMessagesList); + if(useConsumerListener){ + consumers[i].start(); + } + + + } + } + + protected ActiveMQConnectionFactory createConnectionFactory() throws JMSException { + + if (useEmbeddedBroker) { + return new ActiveMQConnectionFactory("vm://localhost"); + } else { + return new ActiveMQConnectionFactory(brokerURL); + } + } + + protected BrokerService createBroker() throws Exception { + BrokerService broker = new BrokerService(); + configureBroker(broker); + broker.start(); + return broker; + } + + protected void configureBroker(BrokerService broker) throws Exception { + broker.addConnector("vm://localhost"); + broker.setDeleteAllMessagesOnStartup(true); + } + + public void startTimer() { + + Thread timer = new Thread(new Runnable() { + public void run() { + try { + + Thread.sleep(duration * 60 * 1000); + keepOnRunning = true; + } catch (InterruptedException e) { + + } finally { + + } + } + }, "TimerThread"); + + + log.info("Starting timer thread... Duration :" +duration + " minutes"); + timer.start(); + } + + protected void recursiveDelete(File file) { + if( file.isDirectory() ) { + File[] files = file.listFiles(); + for (int i = 0; i < files.length; i++) { + recursiveDelete(files[i]); + } + } + file.delete(); + } +} diff --git a/activemq-soaktest/src/test/java/org/apache/activemq/tool/Consumer.java b/activemq-soaktest/src/test/java/org/apache/activemq/tool/Consumer.java index 3445673e3d..bff64c4222 100644 --- a/activemq-soaktest/src/test/java/org/apache/activemq/tool/Consumer.java +++ b/activemq-soaktest/src/test/java/org/apache/activemq/tool/Consumer.java @@ -1,116 +1,116 @@ -/** - * - * Copyright 2005-2006 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.activemq.tool; - -import org.apache.activemq.util.MessageIdList; - -import javax.jms.Connection; -import javax.jms.ConnectionFactory; -import javax.jms.Destination; -import javax.jms.JMSException; -import javax.jms.Message; -import javax.jms.MessageConsumer; -import javax.jms.MessageListener; -import javax.jms.Session; -import javax.jms.Topic; -/** - * @version $Revision: 1.3 $ - */ -public class Consumer extends MessageIdList implements MessageListener{ - protected Connection connection; - protected MessageConsumer consumer; - protected long counter = 0; - protected boolean isParent = false; - protected boolean inOrder = true; - - - public Consumer() { - super(); - } - public Consumer(ConnectionFactory fac,Destination dest,String consumerName) throws JMSException{ - connection=fac.createConnection(); - Session s=connection.createSession(false,Session.AUTO_ACKNOWLEDGE); - if(dest instanceof Topic&&consumerName!=null&&consumerName.length()>0){ - consumer=s.createDurableSubscriber((Topic) dest,consumerName); - }else{ - consumer=s.createConsumer(dest); - } - consumer.setMessageListener(this); - } - public Consumer(ConnectionFactory fac,Destination dest) throws JMSException{ - this(fac,dest,null); - } - public void start() throws JMSException{ - connection.start(); - } - public void stop() throws JMSException{ - connection.stop(); - } - public void shutDown() throws JMSException{ - connection.close(); - } - - - public Message receive() throws JMSException{ - return consumer.receive(); - } - - public Message receive(long wait) throws JMSException{ - return consumer.receive(wait); - } - - public void onMessage(Message msg){ - super.onMessage(msg); - if(isParent) { - try { - long ctr = msg.getLongProperty("counter"); - if (counter != ctr){ - inOrder = false; - } - counter ++; - }catch(Exception e) { - e.printStackTrace(); - } - } - } - - - public boolean isInOrder() { - return inOrder; - } - - - public void setAsParent(boolean isParent) { - this.isParent = isParent; - } - - public boolean isParent() { - return this.isParent; - } - - - /** - * Performs a testing assertion that the correct order of messages have - * been received - * - * @param messageCount - */ - public void assertMessagesReceivedAreInOrder(int messageCount) { - assertEquals("expected number of messages when received", messageCount, getMessageCount()); - } - +/** + * + * Copyright 2005-2006 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.activemq.tool; + +import org.apache.activemq.util.MessageIdList; + +import javax.jms.Connection; +import javax.jms.ConnectionFactory; +import javax.jms.Destination; +import javax.jms.JMSException; +import javax.jms.Message; +import javax.jms.MessageConsumer; +import javax.jms.MessageListener; +import javax.jms.Session; +import javax.jms.Topic; +/** + * @version $Revision: 1.3 $ + */ +public class Consumer extends MessageIdList implements MessageListener{ + protected Connection connection; + protected MessageConsumer consumer; + protected long counter = 0; + protected boolean isParent = false; + protected boolean inOrder = true; + + + public Consumer() { + super(); + } + public Consumer(ConnectionFactory fac,Destination dest,String consumerName) throws JMSException{ + connection=fac.createConnection(); + Session s=connection.createSession(false,Session.AUTO_ACKNOWLEDGE); + if(dest instanceof Topic&&consumerName!=null&&consumerName.length()>0){ + consumer=s.createDurableSubscriber((Topic) dest,consumerName); + }else{ + consumer=s.createConsumer(dest); + } + consumer.setMessageListener(this); + } + public Consumer(ConnectionFactory fac,Destination dest) throws JMSException{ + this(fac,dest,null); + } + public void start() throws JMSException{ + connection.start(); + } + public void stop() throws JMSException{ + connection.stop(); + } + public void shutDown() throws JMSException{ + connection.close(); + } + + + public Message receive() throws JMSException{ + return consumer.receive(); + } + + public Message receive(long wait) throws JMSException{ + return consumer.receive(wait); + } + + public void onMessage(Message msg){ + super.onMessage(msg); + if(isParent) { + try { + long ctr = msg.getLongProperty("counter"); + if (counter != ctr){ + inOrder = false; + } + counter ++; + }catch(Exception e) { + e.printStackTrace(); + } + } + } + + + public boolean isInOrder() { + return inOrder; + } + + + public void setAsParent(boolean isParent) { + this.isParent = isParent; + } + + public boolean isParent() { + return this.isParent; + } + + + /** + * Performs a testing assertion that the correct order of messages have + * been received + * + * @param messageCount + */ + public void assertMessagesReceivedAreInOrder(int messageCount) { + assertEquals("expected number of messages when received", messageCount, getMessageCount()); + } + } \ No newline at end of file diff --git a/activemq-soaktest/src/test/java/org/apache/activemq/tool/Producer.java b/activemq-soaktest/src/test/java/org/apache/activemq/tool/Producer.java index afe4224cdc..dcdab841e8 100644 --- a/activemq-soaktest/src/test/java/org/apache/activemq/tool/Producer.java +++ b/activemq-soaktest/src/test/java/org/apache/activemq/tool/Producer.java @@ -1,68 +1,68 @@ -/** - * - * Copyright 2005-2006 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.activemq.tool; - -import javax.jms.Connection; -import javax.jms.ConnectionFactory; -import javax.jms.DeliveryMode; -import javax.jms.Destination; -import javax.jms.JMSException; -import javax.jms.Message; -import javax.jms.MessageProducer; -import javax.jms.Session; -/** - * @version $Revision: 1.3 $ - */ -public class Producer{ - protected Connection connection; - protected MessageProducer producer; - public Producer(ConnectionFactory fac,Destination dest) throws JMSException{ - connection=fac.createConnection(); - Session s=connection.createSession(false,Session.AUTO_ACKNOWLEDGE); - producer=s.createProducer(dest); - } - public void setDeliveryMode(int mode) throws JMSException{ - producer.setDeliveryMode(mode); - } - public void start() throws JMSException{ - connection.start(); - } - public void stop() throws JMSException{ - connection.stop(); - } - public void shutDown() throws JMSException{ - connection.close(); - } - - public void sendMessage(Message msg) throws JMSException { - sendMessage(msg, null,0); - } - - /* - * allow producer to attach message counter on its header. This will be used to verify message order - * - */ - public void sendMessage(Message msg, String headerName, long headerValue) throws JMSException{ - if(headerName != null) { - msg.setLongProperty(headerName, headerValue); - } - - producer.send(msg); - - } - +/** + * + * Copyright 2005-2006 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.activemq.tool; + +import javax.jms.Connection; +import javax.jms.ConnectionFactory; +import javax.jms.DeliveryMode; +import javax.jms.Destination; +import javax.jms.JMSException; +import javax.jms.Message; +import javax.jms.MessageProducer; +import javax.jms.Session; +/** + * @version $Revision: 1.3 $ + */ +public class Producer{ + protected Connection connection; + protected MessageProducer producer; + public Producer(ConnectionFactory fac,Destination dest) throws JMSException{ + connection=fac.createConnection(); + Session s=connection.createSession(false,Session.AUTO_ACKNOWLEDGE); + producer=s.createProducer(dest); + } + public void setDeliveryMode(int mode) throws JMSException{ + producer.setDeliveryMode(mode); + } + public void start() throws JMSException{ + connection.start(); + } + public void stop() throws JMSException{ + connection.stop(); + } + public void shutDown() throws JMSException{ + connection.close(); + } + + public void sendMessage(Message msg) throws JMSException { + sendMessage(msg, null,0); + } + + /* + * allow producer to attach message counter on its header. This will be used to verify message order + * + */ + public void sendMessage(Message msg, String headerName, long headerValue) throws JMSException{ + if(headerName != null) { + msg.setLongProperty(headerName, headerValue); + } + + producer.send(msg); + + } + } \ No newline at end of file diff --git a/openwire-cpp/src/command/NetworkBridgeFilter.cpp b/openwire-cpp/src/command/NetworkBridgeFilter.cpp index 4625f39121..15c73f30aa 100644 --- a/openwire-cpp/src/command/NetworkBridgeFilter.cpp +++ b/openwire-cpp/src/command/NetworkBridgeFilter.cpp @@ -1 +1,61 @@ -/* * Copyright 2006 The Apache Software Foundation or its licensors, as * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "command/NetworkBridgeFilter.hpp" using namespace apache::activemq::client::command; /* * * Marshalling code for Open Wire Format for NetworkBridgeFilter * * * NOTE!: This file is autogenerated - do not modify! * if you need to make a change, please see the Groovy scripts in the * activemq-core module * */ NetworkBridgeFilter::NetworkBridgeFilter() { this->networkTTL = 0 ; this->networkBrokerId = 0 ; } NetworkBridgeFilter::~NetworkBridgeFilter() { } int NetworkBridgeFilter::getNetworkTTL() { return networkTTL ; } void NetworkBridgeFilter::setNetworkTTL(int networkTTL) { this->networkTTL = networkTTL ; } p NetworkBridgeFilter::getNetworkBrokerId() { return networkBrokerId ; } void NetworkBridgeFilter::setNetworkBrokerId(p networkBrokerId) { this->networkBrokerId = networkBrokerId ; } \ No newline at end of file +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +#include "command/NetworkBridgeFilter.hpp" + +using namespace apache::activemq::client::command; + +/* + * + * Marshalling code for Open Wire Format for NetworkBridgeFilter + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +NetworkBridgeFilter::NetworkBridgeFilter() +{ + this->networkTTL = 0 ; + this->networkBrokerId = 0 ; +} + +NetworkBridgeFilter::~NetworkBridgeFilter() +{ +} + + +int NetworkBridgeFilter::getNetworkTTL() +{ + return networkTTL ; +} + +void NetworkBridgeFilter::setNetworkTTL(int networkTTL) +{ + this->networkTTL = networkTTL ; +} + + +p NetworkBridgeFilter::getNetworkBrokerId() +{ + return networkBrokerId ; +} + +void NetworkBridgeFilter::setNetworkBrokerId(p networkBrokerId) +{ + this->networkBrokerId = networkBrokerId ; +} diff --git a/openwire-cpp/src/marshal/NetworkBridgeFilterMarshaller.cpp b/openwire-cpp/src/marshal/NetworkBridgeFilterMarshaller.cpp index c68e2a5e9a..fe0d407976 100644 --- a/openwire-cpp/src/marshal/NetworkBridgeFilterMarshaller.cpp +++ b/openwire-cpp/src/marshal/NetworkBridgeFilterMarshaller.cpp @@ -1 +1,87 @@ -/* * Copyright 2006 The Apache Software Foundation or its licensors, as * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "marshal/NetworkBridgeFilterMarshaller.hpp" using namespace apache::activemq::client::marshal; /* * Marshalling code for Open Wire Format for NetworkBridgeFilter * * NOTE!: This file is autogenerated - do not modify! * if you need to make a change, please see the Groovy scripts in the * activemq-core module */ NetworkBridgeFilterMarshaller::NetworkBridgeFilterMarshaller() { // no-op } NetworkBridgeFilterMarshaller::~NetworkBridgeFilterMarshaller() { // no-op } IDataStructure* NetworkBridgeFilterMarshaller::createObject() { return new NetworkBridgeFilter(); } char NetworkBridgeFilterMarshaller::getDataStructureType() { return NetworkBridgeFilter.ID_NetworkBridgeFilter; } /* * Un-marshal an object instance from the data input stream */ void NetworkBridgeFilterMarshaller::unmarshal(ProtocolFormat& wireFormat, Object o, BinaryReader& dataIn, BooleanStream& bs) { base.unmarshal(wireFormat, o, dataIn, bs); NetworkBridgeFilter& info = (NetworkBridgeFilter&) o; info.setNetworkTTL(dataIn.readInt()); info.setNetworkBrokerId((org.apache.activemq.command.BrokerId) tightUnmarsalCachedObject(wireFormat, dataIn, bs)); } /* * Write the booleans that this object uses to a BooleanStream */ int NetworkBridgeFilterMarshaller::marshal1(ProtocolFormat& wireFormat, Object& o, BooleanStream& bs) { NetworkBridgeFilter& info = (NetworkBridgeFilter&) o; int rc = base.marshal1(wireFormat, info, bs); rc += marshal1CachedObject(wireFormat, info.getNetworkBrokerId(), bs); return rc + 1; } /* * Write a object instance to data output stream */ void NetworkBridgeFilterMarshaller::marshal2(ProtocolFormat& wireFormat, Object& o, BinaryWriter& dataOut, BooleanStream& bs) { base.marshal2(wireFormat, o, dataOut, bs); NetworkBridgeFilter& info = (NetworkBridgeFilter&) o; DataStreamMarshaller.writeInt(info.getNetworkTTL(), dataOut); marshal2CachedObject(wireFormat, info.getNetworkBrokerId(), dataOut, bs); } \ No newline at end of file +/* + * Copyright 2006 The Apache Software Foundation or its licensors, as + * applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include "marshal/NetworkBridgeFilterMarshaller.hpp" + +using namespace apache::activemq::client::marshal; + +/* + * Marshalling code for Open Wire Format for NetworkBridgeFilter + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + */ + +NetworkBridgeFilterMarshaller::NetworkBridgeFilterMarshaller() +{ + // no-op +} + +NetworkBridgeFilterMarshaller::~NetworkBridgeFilterMarshaller() +{ + // no-op +} + + + +IDataStructure* NetworkBridgeFilterMarshaller::createObject() +{ + return new NetworkBridgeFilter(); +} + +char NetworkBridgeFilterMarshaller::getDataStructureType() +{ + return NetworkBridgeFilter.ID_NetworkBridgeFilter; +} + + /* + * Un-marshal an object instance from the data input stream + */ +void NetworkBridgeFilterMarshaller::unmarshal(ProtocolFormat& wireFormat, Object o, BinaryReader& dataIn, BooleanStream& bs) +{ + base.unmarshal(wireFormat, o, dataIn, bs); + + NetworkBridgeFilter& info = (NetworkBridgeFilter&) o; + info.setNetworkTTL(dataIn.readInt()); + info.setNetworkBrokerId((org.apache.activemq.command.BrokerId) tightUnmarsalCachedObject(wireFormat, dataIn, bs)); + +} + + +/* + * Write the booleans that this object uses to a BooleanStream + */ +int NetworkBridgeFilterMarshaller::marshal1(ProtocolFormat& wireFormat, Object& o, BooleanStream& bs) { + NetworkBridgeFilter& info = (NetworkBridgeFilter&) o; + + int rc = base.marshal1(wireFormat, info, bs); + rc += marshal1CachedObject(wireFormat, info.getNetworkBrokerId(), bs); + + return rc + 1; +} + +/* + * Write a object instance to data output stream + */ +void NetworkBridgeFilterMarshaller::marshal2(ProtocolFormat& wireFormat, Object& o, BinaryWriter& dataOut, BooleanStream& bs) { + base.marshal2(wireFormat, o, dataOut, bs); + + NetworkBridgeFilter& info = (NetworkBridgeFilter&) o; + DataStreamMarshaller.writeInt(info.getNetworkTTL(), dataOut); + marshal2CachedObject(wireFormat, info.getNetworkBrokerId(), dataOut, bs); + +}