mirror of https://github.com/apache/activemq.git
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
This commit is contained in:
parent
261b455078
commit
aecbd1c3f2
|
@ -1,75 +1,75 @@
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Copyright 2005-2006 The Apache Software Foundation
|
* Copyright 2005-2006 The Apache Software Foundation
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*
|
*
|
||||||
**/
|
**/
|
||||||
|
|
||||||
package org.apache.activecluster.impl;
|
package org.apache.activecluster.impl;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import javax.jms.Destination;
|
import javax.jms.Destination;
|
||||||
import javax.jms.JMSException;
|
import javax.jms.JMSException;
|
||||||
import javax.jms.Queue;
|
import javax.jms.Queue;
|
||||||
import javax.jms.Topic;
|
import javax.jms.Topic;
|
||||||
import org.apache.activecluster.DestinationMarshaller;
|
import org.apache.activecluster.DestinationMarshaller;
|
||||||
import org.apache.activemq.command.ActiveMQTopic;
|
import org.apache.activemq.command.ActiveMQTopic;
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A simple marshaller for Destinations
|
* A simple marshaller for Destinations
|
||||||
*
|
*
|
||||||
* @version $Revision: 1.5 $
|
* @version $Revision: 1.5 $
|
||||||
*/
|
*/
|
||||||
public class SimpleDestinationMarshaller implements DestinationMarshaller {
|
public class SimpleDestinationMarshaller implements DestinationMarshaller {
|
||||||
private final static Log log = LogFactory.getLog(SimpleDestinationMarshaller.class);
|
private final static Log log = LogFactory.getLog(SimpleDestinationMarshaller.class);
|
||||||
/**
|
/**
|
||||||
* Builds a destination from a destinationName
|
* Builds a destination from a destinationName
|
||||||
* @param destinationName
|
* @param destinationName
|
||||||
*
|
*
|
||||||
* @return the destination to send messages to all members of the cluster
|
* @return the destination to send messages to all members of the cluster
|
||||||
*/
|
*/
|
||||||
public Destination getDestination(String destinationName){
|
public Destination getDestination(String destinationName){
|
||||||
return new ActiveMQTopic(destinationName);
|
return new ActiveMQTopic(destinationName);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets a destination's physical name
|
* Gets a destination's physical name
|
||||||
* @param destination
|
* @param destination
|
||||||
* @return the destination's physical name
|
* @return the destination's physical name
|
||||||
*/
|
*/
|
||||||
public String getDestinationName(Destination destination){
|
public String getDestinationName(Destination destination){
|
||||||
String result = null;
|
String result = null;
|
||||||
if (destination != null){
|
if (destination != null){
|
||||||
if (destination instanceof Topic){
|
if (destination instanceof Topic){
|
||||||
Topic topic = (Topic) destination;
|
Topic topic = (Topic) destination;
|
||||||
try{
|
try{
|
||||||
result = topic.getTopicName();
|
result = topic.getTopicName();
|
||||||
}catch(JMSException e){
|
}catch(JMSException e){
|
||||||
log.error("Failed to get topic name for " + destination,e);
|
log.error("Failed to get topic name for " + destination,e);
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
Queue queue = (Queue) destination;
|
Queue queue = (Queue) destination;
|
||||||
try{
|
try{
|
||||||
result = queue.getQueueName();
|
result = queue.getQueueName();
|
||||||
}catch(JMSException e){
|
}catch(JMSException e){
|
||||||
log.error("Failed to get queue name for " + destination,e);
|
log.error("Failed to get queue name for " + destination,e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,84 +1,84 @@
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Copyright 2005-2006 The Apache Software Foundation
|
* Copyright 2005-2006 The Apache Software Foundation
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.apache.activemq.broker.jmx;
|
package org.apache.activemq.broker.jmx;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import javax.management.openmbean.CompositeData;
|
import javax.management.openmbean.CompositeData;
|
||||||
import javax.management.openmbean.OpenDataException;
|
import javax.management.openmbean.OpenDataException;
|
||||||
import javax.management.openmbean.TabularData;
|
import javax.management.openmbean.TabularData;
|
||||||
|
|
||||||
|
|
||||||
public interface DestinationViewMBean {
|
public interface DestinationViewMBean {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Resets the managment counters.
|
* Resets the managment counters.
|
||||||
*/
|
*/
|
||||||
public void resetStatistics();
|
public void resetStatistics();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return The number of messages that have been sent to the destination.
|
* @return The number of messages that have been sent to the destination.
|
||||||
*/
|
*/
|
||||||
public long getEnqueueCount();
|
public long getEnqueueCount();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return The number of messages that have been received from the destination.
|
* @return The number of messages that have been received from the destination.
|
||||||
*/
|
*/
|
||||||
public long getDequeueCount();
|
public long getDequeueCount();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return The number of consmers subscribed to messages from this destination.
|
* @return The number of consmers subscribed to messages from this destination.
|
||||||
*/
|
*/
|
||||||
public long getConsumerCount();
|
public long getConsumerCount();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return The number of messages being buffered by this destination
|
* @return The number of messages being buffered by this destination
|
||||||
*/
|
*/
|
||||||
public long getQueueSize();
|
public long getQueueSize();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return An array of all the messages in the destination's queue.
|
* @return An array of all the messages in the destination's queue.
|
||||||
*/
|
*/
|
||||||
public CompositeData[] browse() throws OpenDataException;
|
public CompositeData[] browse() throws OpenDataException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return A list of all the messages in the destination's queue.
|
* @return A list of all the messages in the destination's queue.
|
||||||
*/
|
*/
|
||||||
public TabularData browseAsTable() throws OpenDataException;
|
public TabularData browseAsTable() throws OpenDataException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sends a TextMesage to the destination.
|
* Sends a TextMesage to the destination.
|
||||||
* @param body the text to send
|
* @param body the text to send
|
||||||
* @return the message id of the message sent.
|
* @return the message id of the message sent.
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public String sendTextMessage(String body) throws Exception;
|
public String sendTextMessage(String body) throws Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sends a TextMesage to the destination.
|
* Sends a TextMesage to the destination.
|
||||||
* @param headers the message headers and properties to set. Can only container Strings maped to primitive types.
|
* @param headers the message headers and properties to set. Can only container Strings maped to primitive types.
|
||||||
* @param body the text to send
|
* @param body the text to send
|
||||||
* @return the message id of the message sent.
|
* @return the message id of the message sent.
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public String sendTextMessage(Map headers, String body) throws Exception;
|
public String sendTextMessage(Map headers, String body) throws Exception;
|
||||||
|
|
||||||
public int getMemoryPercentageUsed();
|
public int getMemoryPercentageUsed();
|
||||||
public long getMemoryLimit();
|
public long getMemoryLimit();
|
||||||
public void setMemoryLimit(long limit);
|
public void setMemoryLimit(long limit);
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,47 +1,47 @@
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Copyright 2005-2006 The Apache Software Foundation
|
* 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
|
* 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
|
* the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
|
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
|
||||||
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
||||||
* specific language governing permissions and limitations under the License.
|
* specific language governing permissions and limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.apache.activemq.kaha;
|
package org.apache.activemq.kaha;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import org.apache.activemq.kaha.impl.StoreImpl;
|
import org.apache.activemq.kaha.impl.StoreImpl;
|
||||||
/**
|
/**
|
||||||
* Factory for creating stores
|
* Factory for creating stores
|
||||||
*
|
*
|
||||||
* @version $Revision: 1.2 $
|
* @version $Revision: 1.2 $
|
||||||
*/
|
*/
|
||||||
public class StoreFactory{
|
public class StoreFactory{
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* open or create a Store
|
* open or create a Store
|
||||||
* @param name
|
* @param name
|
||||||
* @param mode
|
* @param mode
|
||||||
* @return the opened/created store
|
* @return the opened/created store
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
*/
|
*/
|
||||||
public static Store open(String name,String mode) throws IOException{
|
public static Store open(String name,String mode) throws IOException{
|
||||||
return new StoreImpl(name,mode);
|
return new StoreImpl(name,mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete a database
|
* Delete a database
|
||||||
* @param name of the database
|
* @param name of the database
|
||||||
* @return true if successful
|
* @return true if successful
|
||||||
*/
|
*/
|
||||||
public static boolean delete(String name){
|
public static boolean delete(String name){
|
||||||
File file = new File(name);
|
File file = new File(name);
|
||||||
return file.delete();
|
return file.delete();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,50 +1,50 @@
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Copyright 2005-2006 The Apache Software Foundation
|
* 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
|
* 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
|
* the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
|
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
|
||||||
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
||||||
* specific language governing permissions and limitations under the License.
|
* specific language governing permissions and limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.apache.activemq.kaha.impl;
|
package org.apache.activemq.kaha.impl;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import org.apache.activemq.kaha.MapContainer;
|
import org.apache.activemq.kaha.MapContainer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Map.Entry implementation for a container
|
* Map.Entry implementation for a container
|
||||||
*
|
*
|
||||||
* @version $Revision: 1.2 $
|
* @version $Revision: 1.2 $
|
||||||
*/
|
*/
|
||||||
class ContainerMapEntry implements Map.Entry {
|
class ContainerMapEntry implements Map.Entry {
|
||||||
|
|
||||||
private MapContainer container;
|
private MapContainer container;
|
||||||
private Object key;
|
private Object key;
|
||||||
|
|
||||||
ContainerMapEntry(MapContainer container,Object key){
|
ContainerMapEntry(MapContainer container,Object key){
|
||||||
this.container = container;
|
this.container = container;
|
||||||
this.key = key;
|
this.key = key;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public Object getKey(){
|
public Object getKey(){
|
||||||
return key;
|
return key;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Object getValue(){
|
public Object getValue(){
|
||||||
return container.get(key);
|
return container.get(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Object setValue(Object value){
|
public Object setValue(Object value){
|
||||||
return container.put(key, value);
|
return container.put(key, value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,162 +1,162 @@
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Copyright 2005-2006 The Apache Software Foundation
|
* 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
|
* 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
|
* the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
|
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
|
||||||
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
||||||
* specific language governing permissions and limitations under the License.
|
* specific language governing permissions and limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.apache.activemq.kaha.impl;
|
package org.apache.activemq.kaha.impl;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.PrintWriter;
|
import java.io.PrintWriter;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
/**
|
/**
|
||||||
* Free space list in the Store
|
* Free space list in the Store
|
||||||
*
|
*
|
||||||
* @version $Revision: 1.2 $
|
* @version $Revision: 1.2 $
|
||||||
*/
|
*/
|
||||||
final class FreeSpaceManager{
|
final class FreeSpaceManager{
|
||||||
private static final Log log = LogFactory.getLog(FreeSpaceManager.class);
|
private static final Log log = LogFactory.getLog(FreeSpaceManager.class);
|
||||||
static final int ROOT_SIZE=64;
|
static final int ROOT_SIZE=64;
|
||||||
static final int RESIZE_INCREMENT=4096*1024;
|
static final int RESIZE_INCREMENT=4096*1024;
|
||||||
private Map map=new HashMap();
|
private Map map=new HashMap();
|
||||||
private Map prevMap=new HashMap();
|
private Map prevMap=new HashMap();
|
||||||
private FreeSpaceTree tree=new FreeSpaceTree();
|
private FreeSpaceTree tree=new FreeSpaceTree();
|
||||||
private StoreWriter writer;
|
private StoreWriter writer;
|
||||||
private StoreReader reader;
|
private StoreReader reader;
|
||||||
private long dataEnd=ROOT_SIZE;
|
private long dataEnd=ROOT_SIZE;
|
||||||
private long fileLength=-1;
|
private long fileLength=-1;
|
||||||
|
|
||||||
FreeSpaceManager(StoreWriter writer,StoreReader reader) throws IOException{
|
FreeSpaceManager(StoreWriter writer,StoreReader reader) throws IOException{
|
||||||
this.writer=writer;
|
this.writer=writer;
|
||||||
this.reader=reader;
|
this.reader=reader;
|
||||||
this.fileLength=reader.length();
|
this.fileLength=reader.length();
|
||||||
}
|
}
|
||||||
|
|
||||||
final Item getFreeSpace(Item item) throws IOException{
|
final Item getFreeSpace(Item item) throws IOException{
|
||||||
Item result=tree.getNextFreeSpace(item);
|
Item result=tree.getNextFreeSpace(item);
|
||||||
if(result==null){
|
if(result==null){
|
||||||
while(dataEnd>=fileLength){
|
while(dataEnd>=fileLength){
|
||||||
writer.allocateSpace(fileLength+RESIZE_INCREMENT);
|
writer.allocateSpace(fileLength+RESIZE_INCREMENT);
|
||||||
fileLength=reader.length();
|
fileLength=reader.length();
|
||||||
}
|
}
|
||||||
result=new Item();
|
result=new Item();
|
||||||
result.setOffset(dataEnd);
|
result.setOffset(dataEnd);
|
||||||
int newSize = ((item.getSize()/8)+1)*8;
|
int newSize = ((item.getSize()/8)+1)*8;
|
||||||
|
|
||||||
result.setSize(newSize);
|
result.setSize(newSize);
|
||||||
dataEnd=dataEnd+result.getSize()+Item.HEAD_SIZE;
|
dataEnd=dataEnd+result.getSize()+Item.HEAD_SIZE;
|
||||||
}else{
|
}else{
|
||||||
removeFreeSpace(result);
|
removeFreeSpace(result);
|
||||||
}
|
}
|
||||||
// reset the item
|
// reset the item
|
||||||
item.setActive(true);
|
item.setActive(true);
|
||||||
item.setOffset(result.getOffset());
|
item.setOffset(result.getOffset());
|
||||||
item.setSize(result.getSize());
|
item.setSize(result.getSize());
|
||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
|
|
||||||
final void addFreeSpace(Item item) throws IOException{
|
final void addFreeSpace(Item item) throws IOException{
|
||||||
long currentOffset=reader.position();
|
long currentOffset=reader.position();
|
||||||
reader.readHeader(item);
|
reader.readHeader(item);
|
||||||
item.setActive(false);
|
item.setActive(false);
|
||||||
// see if we can condense some space together
|
// see if we can condense some space together
|
||||||
// first look for free space adjacent up the disk
|
// first look for free space adjacent up the disk
|
||||||
Long nextKey=new Long(item.getOffset()+item.getSize()+Item.HEAD_SIZE);
|
Long nextKey=new Long(item.getOffset()+item.getSize()+Item.HEAD_SIZE);
|
||||||
Item next=(Item) map.remove(nextKey);
|
Item next=(Item) map.remove(nextKey);
|
||||||
if(next!=null){
|
if(next!=null){
|
||||||
tree.removeItem(next);
|
tree.removeItem(next);
|
||||||
Long prevKey=new Long(next.getOffset()+next.getSize()+Item.HEAD_SIZE);
|
Long prevKey=new Long(next.getOffset()+next.getSize()+Item.HEAD_SIZE);
|
||||||
prevMap.remove(prevKey);
|
prevMap.remove(prevKey);
|
||||||
int newSize=item.getSize()+next.getSize()+Item.HEAD_SIZE;
|
int newSize=item.getSize()+next.getSize()+Item.HEAD_SIZE;
|
||||||
item.setSize(newSize);
|
item.setSize(newSize);
|
||||||
}
|
}
|
||||||
// now see if there was a previous item
|
// now see if there was a previous item
|
||||||
// in the next map
|
// in the next map
|
||||||
Long key=new Long(item.getOffset());
|
Long key=new Long(item.getOffset());
|
||||||
Item prev=(Item) prevMap.remove(key);
|
Item prev=(Item) prevMap.remove(key);
|
||||||
Long prevKey=prev!=null?new Long(prev.getOffset()):null;
|
Long prevKey=prev!=null?new Long(prev.getOffset()):null;
|
||||||
if(prev!=null&&prevKey!=null){
|
if(prev!=null&&prevKey!=null){
|
||||||
// we can condense the free space
|
// we can condense the free space
|
||||||
// first we are about to change the item so remove it from the tree
|
// first we are about to change the item so remove it from the tree
|
||||||
tree.removeItem(prev);
|
tree.removeItem(prev);
|
||||||
int newSize=prev.getSize()+item.getSize()+Item.HEAD_SIZE;
|
int newSize=prev.getSize()+item.getSize()+Item.HEAD_SIZE;
|
||||||
prev.setSize(newSize);
|
prev.setSize(newSize);
|
||||||
// update the header
|
// update the header
|
||||||
writer.updateHeader(prev);
|
writer.updateHeader(prev);
|
||||||
// put back in the tree
|
// put back in the tree
|
||||||
tree.addItem(prev);
|
tree.addItem(prev);
|
||||||
}else{
|
}else{
|
||||||
// update the item header
|
// update the item header
|
||||||
writer.updateHeader(item);
|
writer.updateHeader(item);
|
||||||
tree.addItem(item);
|
tree.addItem(item);
|
||||||
map.put(key,item);
|
map.put(key,item);
|
||||||
prevKey=new Long(item.getOffset()+item.getSize()+Item.HEAD_SIZE);
|
prevKey=new Long(item.getOffset()+item.getSize()+Item.HEAD_SIZE);
|
||||||
prevMap.put(prevKey,item);
|
prevMap.put(prevKey,item);
|
||||||
}
|
}
|
||||||
reader.position(currentOffset);
|
reader.position(currentOffset);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* validates and builds free list
|
* validates and builds free list
|
||||||
*
|
*
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
*/
|
*/
|
||||||
final void scanStoredItems() throws IOException{
|
final void scanStoredItems() throws IOException{
|
||||||
if(reader.length()>ROOT_SIZE){
|
if(reader.length()>ROOT_SIZE){
|
||||||
long offset=ROOT_SIZE;
|
long offset=ROOT_SIZE;
|
||||||
while((offset+Item.HEAD_SIZE)<reader.length()){
|
while((offset+Item.HEAD_SIZE)<reader.length()){
|
||||||
Item item=new Item();
|
Item item=new Item();
|
||||||
try{
|
try{
|
||||||
reader.position(offset);
|
reader.position(offset);
|
||||||
item.setOffset(offset);
|
item.setOffset(offset);
|
||||||
reader.readHeader(item);
|
reader.readHeader(item);
|
||||||
}catch(BadMagicException e){
|
}catch(BadMagicException e){
|
||||||
|
|
||||||
log.error("Got bad magic reading stored items",e);
|
log.error("Got bad magic reading stored items",e);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if(item.getSize()>=0){
|
if(item.getSize()>=0){
|
||||||
if(!item.isActive()){
|
if(!item.isActive()){
|
||||||
addFreeSpace(item);
|
addFreeSpace(item);
|
||||||
}
|
}
|
||||||
offset+=item.getSize()+Item.HEAD_SIZE;
|
offset+=item.getSize()+Item.HEAD_SIZE;
|
||||||
}else{
|
}else{
|
||||||
// we've hit free space or end of file
|
// we've hit free space or end of file
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dataEnd=offset;
|
dataEnd=offset;
|
||||||
}else {
|
}else {
|
||||||
dataEnd = ROOT_SIZE;
|
dataEnd = ROOT_SIZE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void removeFreeSpace(Item item){
|
private void removeFreeSpace(Item item){
|
||||||
if(item!=null){
|
if(item!=null){
|
||||||
long next=item.getOffset()+item.getSize()+Item.HEAD_SIZE;
|
long next=item.getOffset()+item.getSize()+Item.HEAD_SIZE;
|
||||||
Long nextKey=new Long(next);
|
Long nextKey=new Long(next);
|
||||||
prevMap.remove(nextKey);
|
prevMap.remove(nextKey);
|
||||||
Long key=new Long(item.getOffset());
|
Long key=new Long(item.getOffset());
|
||||||
map.remove(key);
|
map.remove(key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void dump(PrintWriter printer){
|
void dump(PrintWriter printer){
|
||||||
printer.println("FreeSpace: map size = "+map.size()+", tree size = "+tree.size()+", prevMap size = "
|
printer.println("FreeSpace: map size = "+map.size()+", tree size = "+tree.size()+", prevMap size = "
|
||||||
+prevMap.size());
|
+prevMap.size());
|
||||||
for(Iterator i=map.entrySet().iterator();i.hasNext();){
|
for(Iterator i=map.entrySet().iterator();i.hasNext();){
|
||||||
printer.println("map = "+i.next());
|
printer.println("map = "+i.next());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,109 +1,109 @@
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Copyright 2005-2006 The Apache Software Foundation
|
* 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
|
* 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
|
* the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
|
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
|
||||||
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
||||||
* specific language governing permissions and limitations under the License.
|
* specific language governing permissions and limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.apache.activemq.kaha.impl;
|
package org.apache.activemq.kaha.impl;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.SortedMap;
|
import java.util.SortedMap;
|
||||||
import java.util.TreeMap;
|
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
|
* 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 $
|
* @version $Revision: 1.2 $
|
||||||
*/
|
*/
|
||||||
class FreeSpaceTree{
|
class FreeSpaceTree{
|
||||||
private Map sizeMap=new HashMap();
|
private Map sizeMap=new HashMap();
|
||||||
private TreeMap tree=new TreeMap();
|
private TreeMap tree=new TreeMap();
|
||||||
|
|
||||||
void addItem(Item item){
|
void addItem(Item item){
|
||||||
Long sizeKey=new Long(item.getSize());
|
Long sizeKey=new Long(item.getSize());
|
||||||
Item old=(Item) tree.put(sizeKey,item);
|
Item old=(Item) tree.put(sizeKey,item);
|
||||||
if(old!=null){
|
if(old!=null){
|
||||||
// We'll preserve old items to reuse
|
// We'll preserve old items to reuse
|
||||||
List list=(List) sizeMap.get(sizeKey);
|
List list=(List) sizeMap.get(sizeKey);
|
||||||
if(list==null){
|
if(list==null){
|
||||||
list=new ArrayList();
|
list=new ArrayList();
|
||||||
sizeMap.put(sizeKey,list);
|
sizeMap.put(sizeKey,list);
|
||||||
}
|
}
|
||||||
list.add(old);
|
list.add(old);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean removeItem(Item item){
|
boolean removeItem(Item item){
|
||||||
boolean result=false;
|
boolean result=false;
|
||||||
Long sizeKey=new Long(item.getSize());
|
Long sizeKey=new Long(item.getSize());
|
||||||
Item retrieved=(Item) tree.get(sizeKey);
|
Item retrieved=(Item) tree.get(sizeKey);
|
||||||
if(retrieved==item){
|
if(retrieved==item){
|
||||||
Object foo=tree.remove(sizeKey);
|
Object foo=tree.remove(sizeKey);
|
||||||
if(foo!=retrieved){
|
if(foo!=retrieved){
|
||||||
Thread.dumpStack();
|
Thread.dumpStack();
|
||||||
System.exit(0);
|
System.exit(0);
|
||||||
}
|
}
|
||||||
result=true;
|
result=true;
|
||||||
reconfigureTree(sizeKey);
|
reconfigureTree(sizeKey);
|
||||||
}else{
|
}else{
|
||||||
List list=(List) sizeMap.get(sizeKey);
|
List list=(List) sizeMap.get(sizeKey);
|
||||||
if(list!=null){
|
if(list!=null){
|
||||||
boolean foo=list.remove(item);
|
boolean foo=list.remove(item);
|
||||||
if(list.isEmpty()){
|
if(list.isEmpty()){
|
||||||
sizeMap.remove(sizeKey);
|
sizeMap.remove(sizeKey);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
Item getNextFreeSpace(Item item){
|
Item getNextFreeSpace(Item item){
|
||||||
Item result=null;
|
Item result=null;
|
||||||
if(!tree.isEmpty()){
|
if(!tree.isEmpty()){
|
||||||
Long sizeKey=new Long(item.getSize());
|
Long sizeKey=new Long(item.getSize());
|
||||||
SortedMap map=tree.tailMap(sizeKey);
|
SortedMap map=tree.tailMap(sizeKey);
|
||||||
if(map!=null&&!map.isEmpty()){
|
if(map!=null&&!map.isEmpty()){
|
||||||
Long resultKey=(Long) map.firstKey();
|
Long resultKey=(Long) map.firstKey();
|
||||||
result=(Item) map.get(resultKey);
|
result=(Item) map.get(resultKey);
|
||||||
if(result!=null){
|
if(result!=null){
|
||||||
// remove from the tree
|
// remove from the tree
|
||||||
tree.remove(resultKey);
|
tree.remove(resultKey);
|
||||||
reconfigureTree(resultKey);
|
reconfigureTree(resultKey);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
void reconfigureTree(Long sizeKey){
|
void reconfigureTree(Long sizeKey){
|
||||||
List list=(List) sizeMap.get(sizeKey);
|
List list=(List) sizeMap.get(sizeKey);
|
||||||
if(list!=null){
|
if(list!=null){
|
||||||
if(!list.isEmpty()){
|
if(!list.isEmpty()){
|
||||||
Object newItem=list.remove(list.size()-1);
|
Object newItem=list.remove(list.size()-1);
|
||||||
tree.put(sizeKey,newItem);
|
tree.put(sizeKey,newItem);
|
||||||
}
|
}
|
||||||
if(list.isEmpty()){
|
if(list.isEmpty()){
|
||||||
sizeMap.remove(sizeKey);
|
sizeMap.remove(sizeKey);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int size(){
|
int size(){
|
||||||
int result=0;
|
int result=0;
|
||||||
for(Iterator i=sizeMap.values().iterator();i.hasNext();){
|
for(Iterator i=sizeMap.values().iterator();i.hasNext();){
|
||||||
List list=(List) i.next();
|
List list=(List) i.next();
|
||||||
result+=list.size();
|
result+=list.size();
|
||||||
}
|
}
|
||||||
return result+tree.size();
|
return result+tree.size();
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,116 +1,116 @@
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Copyright 2005-2006 The Apache Software Foundation
|
* 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
|
* 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
|
* the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
|
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
|
||||||
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
||||||
* specific language governing permissions and limitations under the License.
|
* specific language governing permissions and limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.apache.activemq.kaha.impl;
|
package org.apache.activemq.kaha.impl;
|
||||||
|
|
||||||
import java.io.DataInput;
|
import java.io.DataInput;
|
||||||
import java.io.DataInputStream;
|
import java.io.DataInputStream;
|
||||||
import java.io.DataOutput;
|
import java.io.DataOutput;
|
||||||
import java.io.DataOutputStream;
|
import java.io.DataOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import org.apache.activemq.kaha.Marshaller;
|
import org.apache.activemq.kaha.Marshaller;
|
||||||
/**
|
/**
|
||||||
* A a wrapper for a data in the store
|
* A a wrapper for a data in the store
|
||||||
*
|
*
|
||||||
* @version $Revision: 1.2 $
|
* @version $Revision: 1.2 $
|
||||||
*/
|
*/
|
||||||
public class Item{
|
public class Item{
|
||||||
static final long POSITION_NOT_SET=-1;
|
static final long POSITION_NOT_SET=-1;
|
||||||
static final short MAGIC=31317;
|
static final short MAGIC=31317;
|
||||||
static final int ACTIVE=22;
|
static final int ACTIVE=22;
|
||||||
static final int FREE=33;
|
static final int FREE=33;
|
||||||
static final int HEAD_SIZE=8; // magic + active + len
|
static final int HEAD_SIZE=8; // magic + active + len
|
||||||
static final int LOCATION_SIZE=24;
|
static final int LOCATION_SIZE=24;
|
||||||
private long offset=POSITION_NOT_SET;
|
private long offset=POSITION_NOT_SET;
|
||||||
private int size;
|
private int size;
|
||||||
private boolean active;
|
private boolean active;
|
||||||
|
|
||||||
Item(){}
|
Item(){}
|
||||||
|
|
||||||
void writeHeader(DataOutput dataOut) throws IOException{
|
void writeHeader(DataOutput dataOut) throws IOException{
|
||||||
dataOut.writeShort(MAGIC);
|
dataOut.writeShort(MAGIC);
|
||||||
dataOut.writeByte(active?ACTIVE:FREE);
|
dataOut.writeByte(active?ACTIVE:FREE);
|
||||||
dataOut.writeInt(size);
|
dataOut.writeInt(size);
|
||||||
dataOut.writeByte(0);//padding
|
dataOut.writeByte(0);//padding
|
||||||
}
|
}
|
||||||
|
|
||||||
void readHeader(DataInput dataIn) throws IOException{
|
void readHeader(DataInput dataIn) throws IOException{
|
||||||
int magic=dataIn.readShort();
|
int magic=dataIn.readShort();
|
||||||
if(magic==MAGIC){
|
if(magic==MAGIC){
|
||||||
active=(dataIn.readByte()==ACTIVE);
|
active=(dataIn.readByte()==ACTIVE);
|
||||||
size=dataIn.readInt();
|
size=dataIn.readInt();
|
||||||
}else if (magic == 0){
|
}else if (magic == 0){
|
||||||
size = -999; //end of data
|
size = -999; //end of data
|
||||||
}else{
|
}else{
|
||||||
throw new BadMagicException("Unexpected Magic value: "+magic);
|
throw new BadMagicException("Unexpected Magic value: "+magic);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void writePayload(Marshaller marshaller,Object object,DataOutputStream dataOut) throws IOException{
|
void writePayload(Marshaller marshaller,Object object,DataOutputStream dataOut) throws IOException{
|
||||||
marshaller.writePayload(object,dataOut);
|
marshaller.writePayload(object,dataOut);
|
||||||
}
|
}
|
||||||
|
|
||||||
Object readPayload(Marshaller marshaller,DataInputStream dataIn) throws IOException{
|
Object readPayload(Marshaller marshaller,DataInputStream dataIn) throws IOException{
|
||||||
return marshaller.readPayload(dataIn);
|
return marshaller.readPayload(dataIn);
|
||||||
}
|
}
|
||||||
|
|
||||||
void readLocation(DataInput dataIn) throws IOException{}
|
void readLocation(DataInput dataIn) throws IOException{}
|
||||||
|
|
||||||
void writeLocation(DataOutput dataOut) throws IOException{}
|
void writeLocation(DataOutput dataOut) throws IOException{}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Returns the size.
|
* @return Returns the size.
|
||||||
*/
|
*/
|
||||||
int getSize(){
|
int getSize(){
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param size
|
* @param size
|
||||||
* The size to set.
|
* The size to set.
|
||||||
*/
|
*/
|
||||||
void setSize(int size){
|
void setSize(int size){
|
||||||
this.size=size;
|
this.size=size;
|
||||||
}
|
}
|
||||||
|
|
||||||
void setOffset(long pos){
|
void setOffset(long pos){
|
||||||
offset=pos;
|
offset=pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
long getOffset(){
|
long getOffset(){
|
||||||
return offset;
|
return offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Returns the active.
|
* @return Returns the active.
|
||||||
*/
|
*/
|
||||||
boolean isActive(){
|
boolean isActive(){
|
||||||
return active;
|
return active;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param active
|
* @param active
|
||||||
* The active to set.
|
* The active to set.
|
||||||
*/
|
*/
|
||||||
void setActive(boolean active){
|
void setActive(boolean active){
|
||||||
this.active=active;
|
this.active=active;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return a pretty print
|
* @return a pretty print
|
||||||
*/
|
*/
|
||||||
public String toString(){
|
public String toString(){
|
||||||
String result="offset = "+offset+" ,active = "+active+" , size = "+size;
|
String result="offset = "+offset+" ,active = "+active+" , size = "+size;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,126 +1,126 @@
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Copyright 2005-2006 The Apache Software Foundation
|
* 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
|
* 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
|
* the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
|
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
|
||||||
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
||||||
* specific language governing permissions and limitations under the License.
|
* specific language governing permissions and limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.apache.activemq.kaha.impl;
|
package org.apache.activemq.kaha.impl;
|
||||||
|
|
||||||
import java.io.DataInput;
|
import java.io.DataInput;
|
||||||
import java.io.DataInputStream;
|
import java.io.DataInputStream;
|
||||||
import java.io.DataOutput;
|
import java.io.DataOutput;
|
||||||
import java.io.DataOutputStream;
|
import java.io.DataOutputStream;
|
||||||
import java.io.Externalizable;
|
import java.io.Externalizable;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.ObjectInput;
|
import java.io.ObjectInput;
|
||||||
import java.io.ObjectOutput;
|
import java.io.ObjectOutput;
|
||||||
import org.apache.activemq.kaha.Marshaller;
|
import org.apache.activemq.kaha.Marshaller;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A an Item with a relative postion and location to other Items in the Store
|
* A an Item with a relative postion and location to other Items in the Store
|
||||||
*
|
*
|
||||||
* @version $Revision: 1.2 $
|
* @version $Revision: 1.2 $
|
||||||
*/
|
*/
|
||||||
public final class LocatableItem extends Item implements Externalizable{
|
public final class LocatableItem extends Item implements Externalizable{
|
||||||
|
|
||||||
|
|
||||||
private static final long serialVersionUID=-6888731361600185708L;
|
private static final long serialVersionUID=-6888731361600185708L;
|
||||||
private long previousItem=POSITION_NOT_SET;
|
private long previousItem=POSITION_NOT_SET;
|
||||||
private long nextItem=POSITION_NOT_SET;
|
private long nextItem=POSITION_NOT_SET;
|
||||||
private long referenceItem=POSITION_NOT_SET;
|
private long referenceItem=POSITION_NOT_SET;
|
||||||
|
|
||||||
|
|
||||||
public LocatableItem(){}
|
public LocatableItem(){}
|
||||||
|
|
||||||
public LocatableItem(long prev,long next,long objOffset) throws IOException{
|
public LocatableItem(long prev,long next,long objOffset) throws IOException{
|
||||||
this.previousItem=prev;
|
this.previousItem=prev;
|
||||||
this.nextItem=next;
|
this.nextItem=next;
|
||||||
this.referenceItem=objOffset;
|
this.referenceItem=objOffset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void writePayload(Marshaller marshaller,Object object,DataOutputStream dataOut) throws IOException{
|
public void writePayload(Marshaller marshaller,Object object,DataOutputStream dataOut) throws IOException{
|
||||||
dataOut.writeLong(previousItem);
|
dataOut.writeLong(previousItem);
|
||||||
dataOut.writeLong(nextItem);
|
dataOut.writeLong(nextItem);
|
||||||
dataOut.writeLong(referenceItem);
|
dataOut.writeLong(referenceItem);
|
||||||
super.writePayload(marshaller,object,dataOut);
|
super.writePayload(marshaller,object,dataOut);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Object readPayload(Marshaller marshaller,DataInputStream dataIn) throws IOException{
|
public Object readPayload(Marshaller marshaller,DataInputStream dataIn) throws IOException{
|
||||||
previousItem=dataIn.readLong();
|
previousItem=dataIn.readLong();
|
||||||
nextItem=dataIn.readLong();
|
nextItem=dataIn.readLong();
|
||||||
referenceItem=dataIn.readLong();
|
referenceItem=dataIn.readLong();
|
||||||
return super.readPayload(marshaller, dataIn);
|
return super.readPayload(marshaller, dataIn);
|
||||||
}
|
}
|
||||||
|
|
||||||
void readLocation(DataInput dataIn) throws IOException{
|
void readLocation(DataInput dataIn) throws IOException{
|
||||||
previousItem=dataIn.readLong();
|
previousItem=dataIn.readLong();
|
||||||
nextItem=dataIn.readLong();
|
nextItem=dataIn.readLong();
|
||||||
referenceItem=dataIn.readLong();
|
referenceItem=dataIn.readLong();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void writeLocation(DataOutput dataOut) throws IOException{
|
public void writeLocation(DataOutput dataOut) throws IOException{
|
||||||
dataOut.writeLong(previousItem);
|
dataOut.writeLong(previousItem);
|
||||||
dataOut.writeLong(nextItem);
|
dataOut.writeLong(nextItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPreviousItem(long newPrevEntry){
|
public void setPreviousItem(long newPrevEntry){
|
||||||
previousItem=newPrevEntry;
|
previousItem=newPrevEntry;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getPreviousItem(){
|
public long getPreviousItem(){
|
||||||
return previousItem;
|
return previousItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setNextItem(long newNextEntry){
|
public void setNextItem(long newNextEntry){
|
||||||
nextItem=newNextEntry;
|
nextItem=newNextEntry;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getNextItem(){
|
public long getNextItem(){
|
||||||
return nextItem;
|
return nextItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setReferenceItem(long newObjectOffset){
|
public void setReferenceItem(long newObjectOffset){
|
||||||
referenceItem=newObjectOffset;
|
referenceItem=newObjectOffset;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getReferenceItem(){
|
public long getReferenceItem(){
|
||||||
return referenceItem;
|
return referenceItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.apache.activemq.kaha.impl.Item#toString()
|
* @see org.apache.activemq.kaha.impl.Item#toString()
|
||||||
*/
|
*/
|
||||||
public String toString(){
|
public String toString(){
|
||||||
String result=super.toString();
|
String result=super.toString();
|
||||||
result+=" , referenceItem = "+referenceItem+", previousItem = "+previousItem+" , nextItem = "+nextItem;
|
result+=" , referenceItem = "+referenceItem+", previousItem = "+previousItem+" , nextItem = "+nextItem;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see java.io.Externalizable#writeExternal(java.io.ObjectOutput)
|
* @see java.io.Externalizable#writeExternal(java.io.ObjectOutput)
|
||||||
*/
|
*/
|
||||||
public void writeExternal(ObjectOutput out) throws IOException{
|
public void writeExternal(ObjectOutput out) throws IOException{
|
||||||
out.writeLong(previousItem);
|
out.writeLong(previousItem);
|
||||||
out.writeLong(nextItem);
|
out.writeLong(nextItem);
|
||||||
out.writeLong(referenceItem);
|
out.writeLong(referenceItem);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see java.io.Externalizable#readExternal(java.io.ObjectInput)
|
* @see java.io.Externalizable#readExternal(java.io.ObjectInput)
|
||||||
*/
|
*/
|
||||||
public void readExternal(ObjectInput in) throws IOException,ClassNotFoundException{
|
public void readExternal(ObjectInput in) throws IOException,ClassNotFoundException{
|
||||||
previousItem = in.readLong();
|
previousItem = in.readLong();
|
||||||
nextItem = in.readLong();
|
nextItem = in.readLong();
|
||||||
referenceItem = in.readLong();
|
referenceItem = in.readLong();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,476 +1,476 @@
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Copyright 2005-2006 The Apache Software Foundation
|
* 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
|
* 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
|
* the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
|
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
|
||||||
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
||||||
* specific language governing permissions and limitations under the License.
|
* specific language governing permissions and limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.apache.activemq.kaha.impl;
|
package org.apache.activemq.kaha.impl;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import org.apache.activemq.kaha.MapContainer;
|
import org.apache.activemq.kaha.MapContainer;
|
||||||
import org.apache.activemq.kaha.Marshaller;
|
import org.apache.activemq.kaha.Marshaller;
|
||||||
import org.apache.activemq.kaha.ObjectMarshaller;
|
import org.apache.activemq.kaha.ObjectMarshaller;
|
||||||
import org.apache.activemq.kaha.RuntimeStoreException;
|
import org.apache.activemq.kaha.RuntimeStoreException;
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
/**
|
/**
|
||||||
* Implementation of a MapContainer
|
* Implementation of a MapContainer
|
||||||
*
|
*
|
||||||
* @version $Revision: 1.2 $
|
* @version $Revision: 1.2 $
|
||||||
*/
|
*/
|
||||||
public class MapContainerImpl implements MapContainer{
|
public class MapContainerImpl implements MapContainer{
|
||||||
private static final Log log=LogFactory.getLog(MapContainerImpl.class);
|
private static final Log log=LogFactory.getLog(MapContainerImpl.class);
|
||||||
protected StoreImpl store;
|
protected StoreImpl store;
|
||||||
protected LocatableItem root;
|
protected LocatableItem root;
|
||||||
protected Object id;
|
protected Object id;
|
||||||
protected Map map=new HashMap();
|
protected Map map=new HashMap();
|
||||||
protected Map valueToKeyMap=new HashMap();
|
protected Map valueToKeyMap=new HashMap();
|
||||||
protected LinkedList list=new LinkedList();
|
protected LinkedList list=new LinkedList();
|
||||||
protected boolean loaded=false;
|
protected boolean loaded=false;
|
||||||
protected Marshaller keyMarshaller=new ObjectMarshaller();
|
protected Marshaller keyMarshaller=new ObjectMarshaller();
|
||||||
protected Marshaller valueMarshaller=new ObjectMarshaller();
|
protected Marshaller valueMarshaller=new ObjectMarshaller();
|
||||||
protected final Object mutex=new Object();
|
protected final Object mutex=new Object();
|
||||||
protected boolean closed=false;
|
protected boolean closed=false;
|
||||||
|
|
||||||
protected MapContainerImpl(Object id,StoreImpl rfs,LocatableItem root) throws IOException{
|
protected MapContainerImpl(Object id,StoreImpl rfs,LocatableItem root) throws IOException{
|
||||||
this.id=id;
|
this.id=id;
|
||||||
this.store=rfs;
|
this.store=rfs;
|
||||||
this.root=root;
|
this.root=root;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
*
|
*
|
||||||
* @see org.apache.activemq.kaha.MapContainer#load()
|
* @see org.apache.activemq.kaha.MapContainer#load()
|
||||||
*/
|
*/
|
||||||
public void load(){
|
public void load(){
|
||||||
checkClosed();
|
checkClosed();
|
||||||
if(!loaded){
|
if(!loaded){
|
||||||
loaded=true;
|
loaded=true;
|
||||||
synchronized(mutex){
|
synchronized(mutex){
|
||||||
try{
|
try{
|
||||||
long start=root.getNextItem();
|
long start=root.getNextItem();
|
||||||
if(start!=Item.POSITION_NOT_SET){
|
if(start!=Item.POSITION_NOT_SET){
|
||||||
long nextItem=start;
|
long nextItem=start;
|
||||||
while(nextItem!=Item.POSITION_NOT_SET){
|
while(nextItem!=Item.POSITION_NOT_SET){
|
||||||
LocatableItem item=new LocatableItem();
|
LocatableItem item=new LocatableItem();
|
||||||
item.setOffset(nextItem);
|
item.setOffset(nextItem);
|
||||||
Object key=store.readItem(keyMarshaller,item);
|
Object key=store.readItem(keyMarshaller,item);
|
||||||
map.put(key,item);
|
map.put(key,item);
|
||||||
valueToKeyMap.put(item,key);
|
valueToKeyMap.put(item,key);
|
||||||
list.add(item);
|
list.add(item);
|
||||||
nextItem=item.getNextItem();
|
nextItem=item.getNextItem();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}catch(IOException e){
|
}catch(IOException e){
|
||||||
log.error("Failed to load container "+getId(),e);
|
log.error("Failed to load container "+getId(),e);
|
||||||
throw new RuntimeStoreException(e);
|
throw new RuntimeStoreException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
*
|
*
|
||||||
* @see org.apache.activemq.kaha.MapContainer#unload()
|
* @see org.apache.activemq.kaha.MapContainer#unload()
|
||||||
*/
|
*/
|
||||||
public void unload(){
|
public void unload(){
|
||||||
checkClosed();
|
checkClosed();
|
||||||
if(loaded){
|
if(loaded){
|
||||||
loaded=false;
|
loaded=false;
|
||||||
synchronized(mutex){
|
synchronized(mutex){
|
||||||
map.clear();
|
map.clear();
|
||||||
valueToKeyMap.clear();
|
valueToKeyMap.clear();
|
||||||
list.clear();
|
list.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void close(){
|
public void close(){
|
||||||
unload();
|
unload();
|
||||||
closed=true;
|
closed=true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setKeyMarshaller(Marshaller keyMarshaller){
|
public void setKeyMarshaller(Marshaller keyMarshaller){
|
||||||
checkClosed();
|
checkClosed();
|
||||||
this.keyMarshaller=keyMarshaller;
|
this.keyMarshaller=keyMarshaller;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setValueMarshaller(Marshaller valueMarshaller){
|
public void setValueMarshaller(Marshaller valueMarshaller){
|
||||||
checkClosed();
|
checkClosed();
|
||||||
this.valueMarshaller=valueMarshaller;
|
this.valueMarshaller=valueMarshaller;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
*
|
*
|
||||||
* @see org.apache.activemq.kaha.MapContainer#isLoaded()
|
* @see org.apache.activemq.kaha.MapContainer#isLoaded()
|
||||||
*/
|
*/
|
||||||
public boolean isLoaded(){
|
public boolean isLoaded(){
|
||||||
checkClosed();
|
checkClosed();
|
||||||
return loaded;
|
return loaded;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
*
|
*
|
||||||
* @see org.apache.activemq.kaha.MapContainer#getId()
|
* @see org.apache.activemq.kaha.MapContainer#getId()
|
||||||
*/
|
*/
|
||||||
public Object getId(){
|
public Object getId(){
|
||||||
checkClosed();
|
checkClosed();
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
*
|
*
|
||||||
* @see org.apache.activemq.kaha.MapContainer#size()
|
* @see org.apache.activemq.kaha.MapContainer#size()
|
||||||
*/
|
*/
|
||||||
public int size(){
|
public int size(){
|
||||||
checkClosed();
|
checkClosed();
|
||||||
checkLoaded();
|
checkLoaded();
|
||||||
return map.size();
|
return map.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
*
|
*
|
||||||
* @see org.apache.activemq.kaha.MapContainer#isEmpty()
|
* @see org.apache.activemq.kaha.MapContainer#isEmpty()
|
||||||
*/
|
*/
|
||||||
public boolean isEmpty(){
|
public boolean isEmpty(){
|
||||||
checkClosed();
|
checkClosed();
|
||||||
checkLoaded();
|
checkLoaded();
|
||||||
return map.isEmpty();
|
return map.isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
*
|
*
|
||||||
* @see org.apache.activemq.kaha.MapContainer#containsKey(java.lang.Object)
|
* @see org.apache.activemq.kaha.MapContainer#containsKey(java.lang.Object)
|
||||||
*/
|
*/
|
||||||
public boolean containsKey(Object key){
|
public boolean containsKey(Object key){
|
||||||
checkClosed();
|
checkClosed();
|
||||||
checkLoaded();
|
checkLoaded();
|
||||||
synchronized(mutex){
|
synchronized(mutex){
|
||||||
return map.containsKey(key);
|
return map.containsKey(key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
*
|
*
|
||||||
* @see org.apache.activemq.kaha.MapContainer#get(java.lang.Object)
|
* @see org.apache.activemq.kaha.MapContainer#get(java.lang.Object)
|
||||||
*/
|
*/
|
||||||
public Object get(Object key){
|
public Object get(Object key){
|
||||||
checkClosed();
|
checkClosed();
|
||||||
checkLoaded();
|
checkLoaded();
|
||||||
Object result=null;
|
Object result=null;
|
||||||
LocatableItem item=null;
|
LocatableItem item=null;
|
||||||
synchronized(mutex){
|
synchronized(mutex){
|
||||||
item=(LocatableItem) map.get(key);
|
item=(LocatableItem) map.get(key);
|
||||||
}
|
}
|
||||||
if(item!=null){
|
if(item!=null){
|
||||||
result=getValue(item);
|
result=getValue(item);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
*
|
*
|
||||||
* @see org.apache.activemq.kaha.MapContainer#containsValue(java.lang.Object)
|
* @see org.apache.activemq.kaha.MapContainer#containsValue(java.lang.Object)
|
||||||
*/
|
*/
|
||||||
public boolean containsValue(Object o){
|
public boolean containsValue(Object o){
|
||||||
checkClosed();
|
checkClosed();
|
||||||
checkLoaded();
|
checkLoaded();
|
||||||
boolean result=false;
|
boolean result=false;
|
||||||
if(o!=null){
|
if(o!=null){
|
||||||
synchronized(list){
|
synchronized(list){
|
||||||
for(Iterator i=list.iterator();i.hasNext();){
|
for(Iterator i=list.iterator();i.hasNext();){
|
||||||
LocatableItem item=(LocatableItem) i.next();
|
LocatableItem item=(LocatableItem) i.next();
|
||||||
Object value=getValue(item);
|
Object value=getValue(item);
|
||||||
if(value!=null&&value.equals(o)){
|
if(value!=null&&value.equals(o)){
|
||||||
result=true;
|
result=true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
*
|
*
|
||||||
* @see org.apache.activemq.kaha.MapContainer#putAll(java.util.Map)
|
* @see org.apache.activemq.kaha.MapContainer#putAll(java.util.Map)
|
||||||
*/
|
*/
|
||||||
public void putAll(Map t){
|
public void putAll(Map t){
|
||||||
checkClosed();
|
checkClosed();
|
||||||
checkLoaded();
|
checkLoaded();
|
||||||
if(t!=null){
|
if(t!=null){
|
||||||
synchronized(mutex){
|
synchronized(mutex){
|
||||||
for(Iterator i=t.entrySet().iterator();i.hasNext();){
|
for(Iterator i=t.entrySet().iterator();i.hasNext();){
|
||||||
Map.Entry entry=(Map.Entry) i.next();
|
Map.Entry entry=(Map.Entry) i.next();
|
||||||
put(entry.getKey(),entry.getValue());
|
put(entry.getKey(),entry.getValue());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
*
|
*
|
||||||
* @see org.apache.activemq.kaha.MapContainer#keySet()
|
* @see org.apache.activemq.kaha.MapContainer#keySet()
|
||||||
*/
|
*/
|
||||||
public Set keySet(){
|
public Set keySet(){
|
||||||
checkClosed();
|
checkClosed();
|
||||||
checkLoaded();
|
checkLoaded();
|
||||||
return new ContainerKeySet(this);
|
return new ContainerKeySet(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
*
|
*
|
||||||
* @see org.apache.activemq.kaha.MapContainer#values()
|
* @see org.apache.activemq.kaha.MapContainer#values()
|
||||||
*/
|
*/
|
||||||
public Collection values(){
|
public Collection values(){
|
||||||
checkClosed();
|
checkClosed();
|
||||||
checkLoaded();
|
checkLoaded();
|
||||||
return new ContainerValueCollection(this);
|
return new ContainerValueCollection(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
*
|
*
|
||||||
* @see org.apache.activemq.kaha.MapContainer#entrySet()
|
* @see org.apache.activemq.kaha.MapContainer#entrySet()
|
||||||
*/
|
*/
|
||||||
public Set entrySet(){
|
public Set entrySet(){
|
||||||
checkClosed();
|
checkClosed();
|
||||||
checkLoaded();
|
checkLoaded();
|
||||||
return new ContainerEntrySet(this);
|
return new ContainerEntrySet(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
*
|
*
|
||||||
* @see org.apache.activemq.kaha.MapContainer#put(java.lang.Object, java.lang.Object)
|
* @see org.apache.activemq.kaha.MapContainer#put(java.lang.Object, java.lang.Object)
|
||||||
*/
|
*/
|
||||||
public Object put(Object key,Object value){
|
public Object put(Object key,Object value){
|
||||||
checkClosed();
|
checkClosed();
|
||||||
checkLoaded();
|
checkLoaded();
|
||||||
Object result=null;
|
Object result=null;
|
||||||
synchronized(mutex){
|
synchronized(mutex){
|
||||||
if(map.containsKey(key)){
|
if(map.containsKey(key)){
|
||||||
result=remove(key);
|
result=remove(key);
|
||||||
}
|
}
|
||||||
LocatableItem item=write(key,value);
|
LocatableItem item=write(key,value);
|
||||||
map.put(key,item);
|
map.put(key,item);
|
||||||
valueToKeyMap.put(item,key);
|
valueToKeyMap.put(item,key);
|
||||||
list.add(item);
|
list.add(item);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
*
|
*
|
||||||
* @see org.apache.activemq.kaha.MapContainer#remove(java.lang.Object)
|
* @see org.apache.activemq.kaha.MapContainer#remove(java.lang.Object)
|
||||||
*/
|
*/
|
||||||
public Object remove(Object key){
|
public Object remove(Object key){
|
||||||
checkClosed();
|
checkClosed();
|
||||||
checkLoaded();
|
checkLoaded();
|
||||||
Object result=null;
|
Object result=null;
|
||||||
synchronized(mutex){
|
synchronized(mutex){
|
||||||
LocatableItem item=(LocatableItem) map.get(key);
|
LocatableItem item=(LocatableItem) map.get(key);
|
||||||
if(item!=null){
|
if(item!=null){
|
||||||
map.remove(key);
|
map.remove(key);
|
||||||
valueToKeyMap.remove(item);
|
valueToKeyMap.remove(item);
|
||||||
result=getValue(item);
|
result=getValue(item);
|
||||||
int index=list.indexOf(item);
|
int index=list.indexOf(item);
|
||||||
LocatableItem prev=index>0?(LocatableItem) list.get(index-1):root;
|
LocatableItem prev=index>0?(LocatableItem) list.get(index-1):root;
|
||||||
LocatableItem next=index<(list.size()-1)?(LocatableItem) list.get(index+1):null;
|
LocatableItem next=index<(list.size()-1)?(LocatableItem) list.get(index+1):null;
|
||||||
list.remove(index);
|
list.remove(index);
|
||||||
{
|
{
|
||||||
delete(item,prev,next);
|
delete(item,prev,next);
|
||||||
}
|
}
|
||||||
item=null;
|
item=null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean removeValue(Object o){
|
public boolean removeValue(Object o){
|
||||||
checkClosed();
|
checkClosed();
|
||||||
checkLoaded();
|
checkLoaded();
|
||||||
boolean result=false;
|
boolean result=false;
|
||||||
if(o!=null){
|
if(o!=null){
|
||||||
synchronized(list){
|
synchronized(list){
|
||||||
for(Iterator i=list.iterator();i.hasNext();){
|
for(Iterator i=list.iterator();i.hasNext();){
|
||||||
LocatableItem item=(LocatableItem) i.next();
|
LocatableItem item=(LocatableItem) i.next();
|
||||||
Object value=getValue(item);
|
Object value=getValue(item);
|
||||||
if(value!=null&&value.equals(o)){
|
if(value!=null&&value.equals(o)){
|
||||||
result=true;
|
result=true;
|
||||||
// find the key
|
// find the key
|
||||||
Object key=valueToKeyMap.get(item);
|
Object key=valueToKeyMap.get(item);
|
||||||
if(key!=null){
|
if(key!=null){
|
||||||
remove(key);
|
remove(key);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void remove(LocatableItem item){
|
protected void remove(LocatableItem item){
|
||||||
Object key=valueToKeyMap.get(item);
|
Object key=valueToKeyMap.get(item);
|
||||||
if(key!=null){
|
if(key!=null){
|
||||||
remove(key);
|
remove(key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
*
|
*
|
||||||
* @see org.apache.activemq.kaha.MapContainer#clear()
|
* @see org.apache.activemq.kaha.MapContainer#clear()
|
||||||
*/
|
*/
|
||||||
public void clear(){
|
public void clear(){
|
||||||
checkClosed();
|
checkClosed();
|
||||||
synchronized(mutex){
|
synchronized(mutex){
|
||||||
loaded=true;
|
loaded=true;
|
||||||
synchronized(mutex){
|
synchronized(mutex){
|
||||||
map.clear();
|
map.clear();
|
||||||
valueToKeyMap.clear();
|
valueToKeyMap.clear();
|
||||||
list.clear();// going to re-use this
|
list.clear();// going to re-use this
|
||||||
try{
|
try{
|
||||||
long start=root.getNextItem();
|
long start=root.getNextItem();
|
||||||
if(start!=Item.POSITION_NOT_SET){
|
if(start!=Item.POSITION_NOT_SET){
|
||||||
long nextItem=start;
|
long nextItem=start;
|
||||||
while(nextItem!=Item.POSITION_NOT_SET){
|
while(nextItem!=Item.POSITION_NOT_SET){
|
||||||
LocatableItem item=new LocatableItem();
|
LocatableItem item=new LocatableItem();
|
||||||
item.setOffset(nextItem);
|
item.setOffset(nextItem);
|
||||||
list.add(item);
|
list.add(item);
|
||||||
nextItem=item.getNextItem();
|
nextItem=item.getNextItem();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
root.setNextItem(Item.POSITION_NOT_SET);
|
root.setNextItem(Item.POSITION_NOT_SET);
|
||||||
store.updateItem(root);
|
store.updateItem(root);
|
||||||
for(int i=0;i<list.size();i++){
|
for(int i=0;i<list.size();i++){
|
||||||
LocatableItem item=(LocatableItem) list.get(i);
|
LocatableItem item=(LocatableItem) list.get(i);
|
||||||
if(item.getReferenceItem()!=Item.POSITION_NOT_SET){
|
if(item.getReferenceItem()!=Item.POSITION_NOT_SET){
|
||||||
Item value=new Item();
|
Item value=new Item();
|
||||||
value.setOffset(item.getReferenceItem());
|
value.setOffset(item.getReferenceItem());
|
||||||
store.removeItem(value);
|
store.removeItem(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
store.removeItem(item);
|
store.removeItem(item);
|
||||||
}
|
}
|
||||||
list.clear();
|
list.clear();
|
||||||
}catch(IOException e){
|
}catch(IOException e){
|
||||||
log.error("Failed to clear MapContainer "+getId(),e);
|
log.error("Failed to clear MapContainer "+getId(),e);
|
||||||
throw new RuntimeStoreException(e);
|
throw new RuntimeStoreException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Set getInternalKeySet(){
|
protected Set getInternalKeySet(){
|
||||||
return new HashSet(map.keySet());
|
return new HashSet(map.keySet());
|
||||||
}
|
}
|
||||||
|
|
||||||
protected LinkedList getItemList(){
|
protected LinkedList getItemList(){
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Object getValue(LocatableItem item){
|
protected Object getValue(LocatableItem item){
|
||||||
Object result=null;
|
Object result=null;
|
||||||
if(item!=null&&item.getReferenceItem()!=Item.POSITION_NOT_SET){
|
if(item!=null&&item.getReferenceItem()!=Item.POSITION_NOT_SET){
|
||||||
Item rec=new Item();
|
Item rec=new Item();
|
||||||
rec.setOffset(item.getReferenceItem());
|
rec.setOffset(item.getReferenceItem());
|
||||||
try{
|
try{
|
||||||
result=store.readItem(valueMarshaller,rec);
|
result=store.readItem(valueMarshaller,rec);
|
||||||
}catch(IOException e){
|
}catch(IOException e){
|
||||||
log.error("Failed to get value for "+item,e);
|
log.error("Failed to get value for "+item,e);
|
||||||
throw new RuntimeStoreException(e);
|
throw new RuntimeStoreException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected LocatableItem write(Object key,Object value){
|
protected LocatableItem write(Object key,Object value){
|
||||||
long pos=Item.POSITION_NOT_SET;
|
long pos=Item.POSITION_NOT_SET;
|
||||||
LocatableItem item=null;
|
LocatableItem item=null;
|
||||||
try{
|
try{
|
||||||
if(value!=null){
|
if(value!=null){
|
||||||
Item valueItem=new Item();
|
Item valueItem=new Item();
|
||||||
pos=store.storeItem(valueMarshaller,value,valueItem);
|
pos=store.storeItem(valueMarshaller,value,valueItem);
|
||||||
}
|
}
|
||||||
LocatableItem last=list.isEmpty()?null:(LocatableItem) list.getLast();
|
LocatableItem last=list.isEmpty()?null:(LocatableItem) list.getLast();
|
||||||
last=last==null?root:last;
|
last=last==null?root:last;
|
||||||
long prev=last.getOffset();
|
long prev=last.getOffset();
|
||||||
long next=Item.POSITION_NOT_SET;
|
long next=Item.POSITION_NOT_SET;
|
||||||
item=new LocatableItem(prev,next,pos);
|
item=new LocatableItem(prev,next,pos);
|
||||||
next=store.storeItem(keyMarshaller,key,item);
|
next=store.storeItem(keyMarshaller,key,item);
|
||||||
if(last!=null){
|
if(last!=null){
|
||||||
last.setNextItem(next);
|
last.setNextItem(next);
|
||||||
store.updateItem(last);
|
store.updateItem(last);
|
||||||
}
|
}
|
||||||
}catch(IOException e){
|
}catch(IOException e){
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
log.error("Failed to write "+key+" , "+value,e);
|
log.error("Failed to write "+key+" , "+value,e);
|
||||||
throw new RuntimeStoreException(e);
|
throw new RuntimeStoreException(e);
|
||||||
}
|
}
|
||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void delete(LocatableItem key,LocatableItem prev,LocatableItem next){
|
protected void delete(LocatableItem key,LocatableItem prev,LocatableItem next){
|
||||||
try{
|
try{
|
||||||
prev=prev==null?root:prev;
|
prev=prev==null?root:prev;
|
||||||
if(next!=null){
|
if(next!=null){
|
||||||
prev.setNextItem(next.getOffset());
|
prev.setNextItem(next.getOffset());
|
||||||
next.setPreviousItem(prev.getOffset());
|
next.setPreviousItem(prev.getOffset());
|
||||||
store.updateItem(next);
|
store.updateItem(next);
|
||||||
}else{
|
}else{
|
||||||
prev.setNextItem(Item.POSITION_NOT_SET);
|
prev.setNextItem(Item.POSITION_NOT_SET);
|
||||||
}
|
}
|
||||||
store.updateItem(prev);
|
store.updateItem(prev);
|
||||||
if(key.getReferenceItem()!=Item.POSITION_NOT_SET){
|
if(key.getReferenceItem()!=Item.POSITION_NOT_SET){
|
||||||
Item value=new Item();
|
Item value=new Item();
|
||||||
value.setOffset(key.getReferenceItem());
|
value.setOffset(key.getReferenceItem());
|
||||||
store.removeItem(value);
|
store.removeItem(value);
|
||||||
}
|
}
|
||||||
store.removeItem(key);
|
store.removeItem(key);
|
||||||
}catch(IOException e){
|
}catch(IOException e){
|
||||||
log.error("Failed to delete "+key,e);
|
log.error("Failed to delete "+key,e);
|
||||||
throw new RuntimeStoreException(e);
|
throw new RuntimeStoreException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected final void checkClosed(){
|
protected final void checkClosed(){
|
||||||
if(closed){
|
if(closed){
|
||||||
throw new RuntimeStoreException("The store is closed");
|
throw new RuntimeStoreException("The store is closed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected final void checkLoaded(){
|
protected final void checkLoaded(){
|
||||||
if(!loaded){
|
if(!loaded){
|
||||||
throw new RuntimeStoreException("The container is not loaded");
|
throw new RuntimeStoreException("The container is not loaded");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,97 +1,97 @@
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Copyright 2005-2006 The Apache Software Foundation
|
* 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
|
* 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
|
* the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
|
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
|
||||||
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
||||||
* specific language governing permissions and limitations under the License.
|
* specific language governing permissions and limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.apache.activemq.kaha.impl;
|
package org.apache.activemq.kaha.impl;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import org.apache.activemq.kaha.Marshaller;
|
import org.apache.activemq.kaha.Marshaller;
|
||||||
import org.apache.activemq.kaha.ObjectMarshaller;
|
import org.apache.activemq.kaha.ObjectMarshaller;
|
||||||
import org.apache.activemq.kaha.RuntimeStoreException;
|
import org.apache.activemq.kaha.RuntimeStoreException;
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A container of roots for other Containers
|
* A container of roots for other Containers
|
||||||
*
|
*
|
||||||
* @version $Revision: 1.2 $
|
* @version $Revision: 1.2 $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class RootContainer extends MapContainerImpl{
|
class RootContainer extends MapContainerImpl{
|
||||||
private static final Log log=LogFactory.getLog(RootContainer.class);
|
private static final Log log=LogFactory.getLog(RootContainer.class);
|
||||||
protected static final Marshaller rootMarshaller = new ObjectMarshaller();
|
protected static final Marshaller rootMarshaller = new ObjectMarshaller();
|
||||||
|
|
||||||
protected RootContainer(Object id,StoreImpl rfs,LocatableItem root) throws IOException{
|
protected RootContainer(Object id,StoreImpl rfs,LocatableItem root) throws IOException{
|
||||||
super(id,rfs,root);
|
super(id,rfs,root);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void addRoot(Object key,LocatableItem er) throws IOException{
|
protected void addRoot(Object key,LocatableItem er) throws IOException{
|
||||||
|
|
||||||
if(map.containsKey(key)){
|
if(map.containsKey(key)){
|
||||||
remove(key);
|
remove(key);
|
||||||
}
|
}
|
||||||
LocatableItem entry=writeRoot(key,er);
|
LocatableItem entry=writeRoot(key,er);
|
||||||
map.put(key,entry);
|
map.put(key,entry);
|
||||||
synchronized(list){
|
synchronized(list){
|
||||||
list.add(entry);
|
list.add(entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected LocatableItem writeRoot(Object key,LocatableItem value){
|
protected LocatableItem writeRoot(Object key,LocatableItem value){
|
||||||
long pos=Item.POSITION_NOT_SET;
|
long pos=Item.POSITION_NOT_SET;
|
||||||
LocatableItem item=null;
|
LocatableItem item=null;
|
||||||
try{
|
try{
|
||||||
if(value!=null){
|
if(value!=null){
|
||||||
pos=store.storeItem(rootMarshaller,value,value);
|
pos=store.storeItem(rootMarshaller,value,value);
|
||||||
}
|
}
|
||||||
LocatableItem last=list.isEmpty()?null:(LocatableItem) list.getLast();
|
LocatableItem last=list.isEmpty()?null:(LocatableItem) list.getLast();
|
||||||
last=last==null?root:last;
|
last=last==null?root:last;
|
||||||
long prev=last.getOffset();
|
long prev=last.getOffset();
|
||||||
long next=Item.POSITION_NOT_SET;
|
long next=Item.POSITION_NOT_SET;
|
||||||
item=new LocatableItem(prev,next,pos);
|
item=new LocatableItem(prev,next,pos);
|
||||||
if(log.isDebugEnabled())
|
if(log.isDebugEnabled())
|
||||||
log.debug("writing root ...");
|
log.debug("writing root ...");
|
||||||
if(log.isDebugEnabled())
|
if(log.isDebugEnabled())
|
||||||
log.debug("root = "+value);
|
log.debug("root = "+value);
|
||||||
next=store.storeItem(rootMarshaller,key,item);
|
next=store.storeItem(rootMarshaller,key,item);
|
||||||
if(last!=null){
|
if(last!=null){
|
||||||
last.setNextItem(next);
|
last.setNextItem(next);
|
||||||
store.updateItem(last);
|
store.updateItem(last);
|
||||||
}
|
}
|
||||||
}catch(IOException e){
|
}catch(IOException e){
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
log.error("Failed to write root",e);
|
log.error("Failed to write root",e);
|
||||||
throw new RuntimeStoreException(e);
|
throw new RuntimeStoreException(e);
|
||||||
}
|
}
|
||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Object getValue(LocatableItem item){
|
protected Object getValue(LocatableItem item){
|
||||||
LocatableItem result=null;
|
LocatableItem result=null;
|
||||||
if(item!=null&&item.getReferenceItem()!=Item.POSITION_NOT_SET){
|
if(item!=null&&item.getReferenceItem()!=Item.POSITION_NOT_SET){
|
||||||
LocatableItem value=new LocatableItem();
|
LocatableItem value=new LocatableItem();
|
||||||
value.setOffset(item.getReferenceItem());
|
value.setOffset(item.getReferenceItem());
|
||||||
try{
|
try{
|
||||||
result=(LocatableItem) store.readItem(rootMarshaller,value);
|
result=(LocatableItem) store.readItem(rootMarshaller,value);
|
||||||
//now read the item
|
//now read the item
|
||||||
result.setOffset(item.getReferenceItem());
|
result.setOffset(item.getReferenceItem());
|
||||||
store.readItem(rootMarshaller, result);
|
store.readItem(rootMarshaller, result);
|
||||||
}catch(IOException e){
|
}catch(IOException e){
|
||||||
log.error("Could not read item "+item,e);
|
log.error("Could not read item "+item,e);
|
||||||
throw new RuntimeStoreException(e);
|
throw new RuntimeStoreException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,380 +1,380 @@
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Copyright 2005-2006 The Apache Software Foundation
|
* 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
|
* 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
|
* the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
|
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
|
||||||
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
||||||
* specific language governing permissions and limitations under the License.
|
* specific language governing permissions and limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.apache.activemq.kaha.impl;
|
package org.apache.activemq.kaha.impl;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.PrintWriter;
|
import java.io.PrintWriter;
|
||||||
import java.io.RandomAccessFile;
|
import java.io.RandomAccessFile;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import org.apache.activemq.kaha.ListContainer;
|
import org.apache.activemq.kaha.ListContainer;
|
||||||
import org.apache.activemq.kaha.MapContainer;
|
import org.apache.activemq.kaha.MapContainer;
|
||||||
import org.apache.activemq.kaha.Marshaller;
|
import org.apache.activemq.kaha.Marshaller;
|
||||||
import org.apache.activemq.kaha.RuntimeStoreException;
|
import org.apache.activemq.kaha.RuntimeStoreException;
|
||||||
import org.apache.activemq.kaha.Store;
|
import org.apache.activemq.kaha.Store;
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
import edu.emory.mathcs.backport.java.util.concurrent.ConcurrentHashMap;
|
import edu.emory.mathcs.backport.java.util.concurrent.ConcurrentHashMap;
|
||||||
/**
|
/**
|
||||||
* Implementation of a Store
|
* Implementation of a Store
|
||||||
*
|
*
|
||||||
* @version $Revision: 1.2 $
|
* @version $Revision: 1.2 $
|
||||||
*/
|
*/
|
||||||
public class StoreImpl implements Store{
|
public class StoreImpl implements Store{
|
||||||
private static final Log log = LogFactory.getLog(StoreImpl.class);
|
private static final Log log = LogFactory.getLog(StoreImpl.class);
|
||||||
|
|
||||||
private final Object mutex=new Object();
|
private final Object mutex=new Object();
|
||||||
private RandomAccessFile dataFile;
|
private RandomAccessFile dataFile;
|
||||||
private Map mapContainers=new ConcurrentHashMap();
|
private Map mapContainers=new ConcurrentHashMap();
|
||||||
private Map listContainers=new ConcurrentHashMap();
|
private Map listContainers=new ConcurrentHashMap();
|
||||||
private RootContainer rootMapContainer;
|
private RootContainer rootMapContainer;
|
||||||
private RootContainer rootListContainer;
|
private RootContainer rootListContainer;
|
||||||
private String name;
|
private String name;
|
||||||
private StoreReader reader;
|
private StoreReader reader;
|
||||||
private StoreWriter writer;
|
private StoreWriter writer;
|
||||||
private FreeSpaceManager freeSpaceManager;
|
private FreeSpaceManager freeSpaceManager;
|
||||||
protected boolean closed=false;
|
protected boolean closed=false;
|
||||||
protected Thread shutdownHook;
|
protected Thread shutdownHook;
|
||||||
|
|
||||||
public StoreImpl(String name,String mode) throws IOException{
|
public StoreImpl(String name,String mode) throws IOException{
|
||||||
this.name=name;
|
this.name=name;
|
||||||
this.dataFile=new RandomAccessFile(name,mode);
|
this.dataFile=new RandomAccessFile(name,mode);
|
||||||
this.reader = new StoreReader(this.dataFile);
|
this.reader = new StoreReader(this.dataFile);
|
||||||
this.writer = new StoreWriter(this.dataFile);
|
this.writer = new StoreWriter(this.dataFile);
|
||||||
File file = new File(name);
|
File file = new File(name);
|
||||||
log.info("Kaha Store opened " + file.getAbsolutePath());
|
log.info("Kaha Store opened " + file.getAbsolutePath());
|
||||||
freeSpaceManager=new FreeSpaceManager(this.writer,this.reader);
|
freeSpaceManager=new FreeSpaceManager(this.writer,this.reader);
|
||||||
initialization();
|
initialization();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
*
|
*
|
||||||
* @see org.apache.activemq.kaha.Store#close()
|
* @see org.apache.activemq.kaha.Store#close()
|
||||||
*/
|
*/
|
||||||
public void close() throws IOException{
|
public void close() throws IOException{
|
||||||
synchronized(mutex){
|
synchronized(mutex){
|
||||||
if(!closed){
|
if(!closed){
|
||||||
for(Iterator i=mapContainers.values().iterator();i.hasNext();){
|
for(Iterator i=mapContainers.values().iterator();i.hasNext();){
|
||||||
MapContainerImpl container=(MapContainerImpl) i.next();
|
MapContainerImpl container=(MapContainerImpl) i.next();
|
||||||
container.close();
|
container.close();
|
||||||
}
|
}
|
||||||
for(Iterator i=listContainers.values().iterator();i.hasNext();){
|
for(Iterator i=listContainers.values().iterator();i.hasNext();){
|
||||||
ListContainerImpl container=(ListContainerImpl) i.next();
|
ListContainerImpl container=(ListContainerImpl) i.next();
|
||||||
container.close();
|
container.close();
|
||||||
}
|
}
|
||||||
force();
|
force();
|
||||||
dataFile.close();
|
dataFile.close();
|
||||||
closed=true;
|
closed=true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
*
|
*
|
||||||
* @see org.apache.activemq.kaha.Store#force()
|
* @see org.apache.activemq.kaha.Store#force()
|
||||||
*/
|
*/
|
||||||
public void force() throws IOException{
|
public void force() throws IOException{
|
||||||
checkClosed();
|
checkClosed();
|
||||||
synchronized(mutex){
|
synchronized(mutex){
|
||||||
dataFile.getFD().sync();
|
dataFile.getFD().sync();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
*
|
*
|
||||||
* @see org.apache.activemq.kaha.Store#clear()
|
* @see org.apache.activemq.kaha.Store#clear()
|
||||||
*/
|
*/
|
||||||
public void clear(){
|
public void clear(){
|
||||||
checkClosed();
|
checkClosed();
|
||||||
for(Iterator i=mapContainers.values().iterator();i.hasNext();){
|
for(Iterator i=mapContainers.values().iterator();i.hasNext();){
|
||||||
MapContainer container=(MapContainer) i.next();
|
MapContainer container=(MapContainer) i.next();
|
||||||
container.clear();
|
container.clear();
|
||||||
}
|
}
|
||||||
for(Iterator i=listContainers.values().iterator();i.hasNext();){
|
for(Iterator i=listContainers.values().iterator();i.hasNext();){
|
||||||
ListContainer container=(ListContainer) i.next();
|
ListContainer container=(ListContainer) i.next();
|
||||||
container.clear();
|
container.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
*
|
*
|
||||||
* @see org.apache.activemq.kaha.Store#delete()
|
* @see org.apache.activemq.kaha.Store#delete()
|
||||||
*/
|
*/
|
||||||
public boolean delete() throws IOException{
|
public boolean delete() throws IOException{
|
||||||
checkClosed();
|
checkClosed();
|
||||||
dataFile.close();
|
dataFile.close();
|
||||||
File file=new File(name);
|
File file=new File(name);
|
||||||
return file.delete();
|
return file.delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
*
|
*
|
||||||
* @see org.apache.activemq.kaha.Store#doesMapContainerExist(java.lang.Object)
|
* @see org.apache.activemq.kaha.Store#doesMapContainerExist(java.lang.Object)
|
||||||
*/
|
*/
|
||||||
public boolean doesMapContainerExist(Object id){
|
public boolean doesMapContainerExist(Object id){
|
||||||
return mapContainers.containsKey(id);
|
return mapContainers.containsKey(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
*
|
*
|
||||||
* @see org.apache.activemq.kaha.Store#getContainer(java.lang.Object)
|
* @see org.apache.activemq.kaha.Store#getContainer(java.lang.Object)
|
||||||
*/
|
*/
|
||||||
public MapContainer getMapContainer(Object id) throws IOException{
|
public MapContainer getMapContainer(Object id) throws IOException{
|
||||||
checkClosed();
|
checkClosed();
|
||||||
synchronized(mutex){
|
synchronized(mutex){
|
||||||
MapContainer result=(MapContainerImpl) mapContainers.get(id);
|
MapContainer result=(MapContainerImpl) mapContainers.get(id);
|
||||||
if(result==null){
|
if(result==null){
|
||||||
LocatableItem root=new LocatableItem();
|
LocatableItem root=new LocatableItem();
|
||||||
rootMapContainer.addRoot(id,root);
|
rootMapContainer.addRoot(id,root);
|
||||||
result=new MapContainerImpl(id,this,root);
|
result=new MapContainerImpl(id,this,root);
|
||||||
mapContainers.put(id,result);
|
mapContainers.put(id,result);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
*
|
*
|
||||||
* @see org.apache.activemq.kaha.Store#deleteContainer(java.lang.Object)
|
* @see org.apache.activemq.kaha.Store#deleteContainer(java.lang.Object)
|
||||||
*/
|
*/
|
||||||
public void deleteMapContainer(Object id) throws IOException{
|
public void deleteMapContainer(Object id) throws IOException{
|
||||||
checkClosed();
|
checkClosed();
|
||||||
synchronized(mutex){
|
synchronized(mutex){
|
||||||
if(doesMapContainerExist(id)){
|
if(doesMapContainerExist(id)){
|
||||||
MapContainer container=getMapContainer(id);
|
MapContainer container=getMapContainer(id);
|
||||||
if(container!=null){
|
if(container!=null){
|
||||||
container.load();
|
container.load();
|
||||||
container.clear();
|
container.clear();
|
||||||
rootMapContainer.remove(id);
|
rootMapContainer.remove(id);
|
||||||
mapContainers.remove(id);
|
mapContainers.remove(id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
*
|
*
|
||||||
* @see org.apache.activemq.kaha.Store#getContainerKeys()
|
* @see org.apache.activemq.kaha.Store#getContainerKeys()
|
||||||
*/
|
*/
|
||||||
public Set getMapContainerIds(){
|
public Set getMapContainerIds(){
|
||||||
checkClosed();
|
checkClosed();
|
||||||
return java.util.Collections.unmodifiableSet(mapContainers.keySet());
|
return java.util.Collections.unmodifiableSet(mapContainers.keySet());
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
*
|
*
|
||||||
* @see org.apache.activemq.kaha.Store#doesListContainerExist(java.lang.Object)
|
* @see org.apache.activemq.kaha.Store#doesListContainerExist(java.lang.Object)
|
||||||
*/
|
*/
|
||||||
public boolean doesListContainerExist(Object id){
|
public boolean doesListContainerExist(Object id){
|
||||||
return listContainers.containsKey(id);
|
return listContainers.containsKey(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
*
|
*
|
||||||
* @see org.apache.activemq.kaha.Store#getListContainer(java.lang.Object)
|
* @see org.apache.activemq.kaha.Store#getListContainer(java.lang.Object)
|
||||||
*/
|
*/
|
||||||
public ListContainer getListContainer(Object id) throws IOException{
|
public ListContainer getListContainer(Object id) throws IOException{
|
||||||
checkClosed();
|
checkClosed();
|
||||||
synchronized(mutex){
|
synchronized(mutex){
|
||||||
ListContainer result=(ListContainerImpl) listContainers.get(id);
|
ListContainer result=(ListContainerImpl) listContainers.get(id);
|
||||||
if(result==null){
|
if(result==null){
|
||||||
LocatableItem root=new LocatableItem();
|
LocatableItem root=new LocatableItem();
|
||||||
rootListContainer.addRoot(id,root);
|
rootListContainer.addRoot(id,root);
|
||||||
result=new ListContainerImpl(id,this,root);
|
result=new ListContainerImpl(id,this,root);
|
||||||
listContainers.put(id,result);
|
listContainers.put(id,result);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
*
|
*
|
||||||
* @see org.apache.activemq.kaha.Store#deleteListContainer(java.lang.Object)
|
* @see org.apache.activemq.kaha.Store#deleteListContainer(java.lang.Object)
|
||||||
*/
|
*/
|
||||||
public void deleteListContainer(Object id) throws IOException{
|
public void deleteListContainer(Object id) throws IOException{
|
||||||
checkClosed();
|
checkClosed();
|
||||||
synchronized(mutex){
|
synchronized(mutex){
|
||||||
if(doesListContainerExist(id)){
|
if(doesListContainerExist(id)){
|
||||||
ListContainer container=getListContainer(id);
|
ListContainer container=getListContainer(id);
|
||||||
if(container!=null){
|
if(container!=null){
|
||||||
container.load();
|
container.load();
|
||||||
container.clear();
|
container.clear();
|
||||||
rootListContainer.remove(id);
|
rootListContainer.remove(id);
|
||||||
listContainers.remove(id);
|
listContainers.remove(id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
*
|
*
|
||||||
* @see org.apache.activemq.kaha.Store#getListContainerIds()
|
* @see org.apache.activemq.kaha.Store#getListContainerIds()
|
||||||
*/
|
*/
|
||||||
public Set getListContainerIds(){
|
public Set getListContainerIds(){
|
||||||
checkClosed();
|
checkClosed();
|
||||||
return java.util.Collections.unmodifiableSet(listContainers.keySet());
|
return java.util.Collections.unmodifiableSet(listContainers.keySet());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void dumpFreeSpace(PrintWriter printer){
|
public void dumpFreeSpace(PrintWriter printer){
|
||||||
checkClosed();
|
checkClosed();
|
||||||
synchronized(mutex){
|
synchronized(mutex){
|
||||||
freeSpaceManager.dump(printer);
|
freeSpaceManager.dump(printer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected long storeItem(Marshaller marshaller,Object payload,Item item) throws IOException{
|
protected long storeItem(Marshaller marshaller,Object payload,Item item) throws IOException{
|
||||||
synchronized(mutex){
|
synchronized(mutex){
|
||||||
int payloadSize = writer.loadPayload(marshaller, payload, item);
|
int payloadSize = writer.loadPayload(marshaller, payload, item);
|
||||||
item.setSize(payloadSize);
|
item.setSize(payloadSize);
|
||||||
// free space manager will set offset and write any headers required
|
// free space manager will set offset and write any headers required
|
||||||
// so the position should now be correct for writing
|
// so the position should now be correct for writing
|
||||||
item=freeSpaceManager.getFreeSpace(item);
|
item=freeSpaceManager.getFreeSpace(item);
|
||||||
writer.storeItem(item,payloadSize);
|
writer.storeItem(item,payloadSize);
|
||||||
}
|
}
|
||||||
return item.getOffset();
|
return item.getOffset();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Object readItem(Marshaller marshaller,Item item) throws IOException{
|
protected Object readItem(Marshaller marshaller,Item item) throws IOException{
|
||||||
synchronized(mutex){
|
synchronized(mutex){
|
||||||
return reader.readItem(marshaller, item);
|
return reader.readItem(marshaller, item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void readHeader(Item item) throws IOException{
|
protected void readHeader(Item item) throws IOException{
|
||||||
synchronized(mutex){
|
synchronized(mutex){
|
||||||
reader.readHeader(item);
|
reader.readHeader(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void readLocation(Item item) throws IOException{
|
protected void readLocation(Item item) throws IOException{
|
||||||
synchronized(mutex){
|
synchronized(mutex){
|
||||||
reader.readLocation(item);
|
reader.readLocation(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void updateItem(Item item) throws IOException{
|
protected void updateItem(Item item) throws IOException{
|
||||||
synchronized(mutex){
|
synchronized(mutex){
|
||||||
writer.updatePayload(item);
|
writer.updatePayload(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void removeItem(Item item) throws IOException{
|
protected void removeItem(Item item) throws IOException{
|
||||||
synchronized(mutex){
|
synchronized(mutex){
|
||||||
freeSpaceManager.addFreeSpace(item);
|
freeSpaceManager.addFreeSpace(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initialization() throws IOException{
|
private void initialization() throws IOException{
|
||||||
//add shutdown hook
|
//add shutdown hook
|
||||||
addShutdownHook();
|
addShutdownHook();
|
||||||
// check for new file
|
// check for new file
|
||||||
LocatableItem mapRoot=new LocatableItem();
|
LocatableItem mapRoot=new LocatableItem();
|
||||||
LocatableItem listRoot=new LocatableItem();
|
LocatableItem listRoot=new LocatableItem();
|
||||||
if(dataFile.length()==0){
|
if(dataFile.length()==0){
|
||||||
writer.allocateSpace(FreeSpaceManager.RESIZE_INCREMENT);
|
writer.allocateSpace(FreeSpaceManager.RESIZE_INCREMENT);
|
||||||
storeItem(RootContainer.rootMarshaller,"mapRoot",mapRoot);
|
storeItem(RootContainer.rootMarshaller,"mapRoot",mapRoot);
|
||||||
storeItem(RootContainer.rootMarshaller,"listRoot",listRoot);
|
storeItem(RootContainer.rootMarshaller,"listRoot",listRoot);
|
||||||
}else{
|
}else{
|
||||||
freeSpaceManager.scanStoredItems();
|
freeSpaceManager.scanStoredItems();
|
||||||
dataFile.seek(FreeSpaceManager.ROOT_SIZE);
|
dataFile.seek(FreeSpaceManager.ROOT_SIZE);
|
||||||
mapRoot.setOffset(FreeSpaceManager.ROOT_SIZE);
|
mapRoot.setOffset(FreeSpaceManager.ROOT_SIZE);
|
||||||
readItem(RootContainer.rootMarshaller,mapRoot);
|
readItem(RootContainer.rootMarshaller,mapRoot);
|
||||||
listRoot.setOffset(dataFile.getFilePointer());
|
listRoot.setOffset(dataFile.getFilePointer());
|
||||||
readItem(RootContainer.rootMarshaller,listRoot);
|
readItem(RootContainer.rootMarshaller,listRoot);
|
||||||
}
|
}
|
||||||
rootMapContainer=new RootContainer("root",this,mapRoot);
|
rootMapContainer=new RootContainer("root",this,mapRoot);
|
||||||
rootMapContainer.load();
|
rootMapContainer.load();
|
||||||
Set keys=rootMapContainer.keySet();
|
Set keys=rootMapContainer.keySet();
|
||||||
for(Iterator i=keys.iterator();i.hasNext();){
|
for(Iterator i=keys.iterator();i.hasNext();){
|
||||||
Object id=i.next();
|
Object id=i.next();
|
||||||
if(id!=null){
|
if(id!=null){
|
||||||
LocatableItem item=(LocatableItem) rootMapContainer.get(id);
|
LocatableItem item=(LocatableItem) rootMapContainer.get(id);
|
||||||
if(item!=null){
|
if(item!=null){
|
||||||
MapContainer container=new MapContainerImpl(id,this,item);
|
MapContainer container=new MapContainerImpl(id,this,item);
|
||||||
mapContainers.put(id,container);
|
mapContainers.put(id,container);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
rootListContainer=new RootContainer("root",this,listRoot);
|
rootListContainer=new RootContainer("root",this,listRoot);
|
||||||
rootListContainer.load();
|
rootListContainer.load();
|
||||||
keys=rootListContainer.keySet();
|
keys=rootListContainer.keySet();
|
||||||
for(Iterator i=keys.iterator();i.hasNext();){
|
for(Iterator i=keys.iterator();i.hasNext();){
|
||||||
Object id=i.next();
|
Object id=i.next();
|
||||||
if(id!=null){
|
if(id!=null){
|
||||||
LocatableItem item=(LocatableItem) rootListContainer.get(id);
|
LocatableItem item=(LocatableItem) rootListContainer.get(id);
|
||||||
if(item!=null){
|
if(item!=null){
|
||||||
ListContainer container=new ListContainerImpl(id,this,item);
|
ListContainer container=new ListContainerImpl(id,this,item);
|
||||||
listContainers.put(id,container);
|
listContainers.put(id,container);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
protected void checkClosed(){
|
protected void checkClosed(){
|
||||||
if(closed){
|
if(closed){
|
||||||
throw new RuntimeStoreException("The store is closed");
|
throw new RuntimeStoreException("The store is closed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected void addShutdownHook() {
|
protected void addShutdownHook() {
|
||||||
|
|
||||||
shutdownHook = new Thread("Kaha Store implementation is shutting down") {
|
shutdownHook = new Thread("Kaha Store implementation is shutting down") {
|
||||||
public void run() {
|
public void run() {
|
||||||
if (!closed){
|
if (!closed){
|
||||||
try{
|
try{
|
||||||
//this needs to be really quick so ...
|
//this needs to be really quick so ...
|
||||||
closed = true;
|
closed = true;
|
||||||
dataFile.close();
|
dataFile.close();
|
||||||
}catch(Throwable e){
|
}catch(Throwable e){
|
||||||
log.error("Failed to close data file",e);
|
log.error("Failed to close data file",e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
Runtime.getRuntime().addShutdownHook(shutdownHook);
|
Runtime.getRuntime().addShutdownHook(shutdownHook);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void removeShutdownHook() {
|
protected void removeShutdownHook() {
|
||||||
if (shutdownHook != null) {
|
if (shutdownHook != null) {
|
||||||
try {
|
try {
|
||||||
Runtime.getRuntime().removeShutdownHook(shutdownHook);
|
Runtime.getRuntime().removeShutdownHook(shutdownHook);
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
log.warn("Failed to run shutdown hook",e);
|
log.warn("Failed to run shutdown hook",e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1 +1,132 @@
|
||||||
/**
*
* 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.openwire.v1;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import org.apache.activemq.openwire.*;
import org.apache.activemq.command.*;
/**
* Marshalling code for Open Wire Format for NetworkBridgeFilterMarshaller
*
*
* NOTE!: This file is auto generated - do not modify!
* if you need to make a change, please see the modify the groovy scripts in the
* under src/gram/script and then use maven openwire:generate to regenerate
* this file.
*
* @version $Revision$
*/
public class NetworkBridgeFilterMarshaller extends BaseDataStreamMarshaller {
/**
* Return the type of Data Structure we marshal
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return NetworkBridgeFilter.DATA_STRUCTURE_TYPE;
}
/**
* @return a new object instance
*/
public DataStructure createObject() {
return new NetworkBridgeFilter();
}
/**
* Un-marshal an object instance from the data input stream
*
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
*/
public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException {
super.tightUnmarshal(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
*/
public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException {
NetworkBridgeFilter info = (NetworkBridgeFilter)o;
int rc = super.tightMarshal1(wireFormat, o, bs);
rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getNetworkBrokerId(), bs);
return rc + 4;
}
/**
* Write a object instance to data output stream
*
* @param o the instance to be marshaled
* @param dataOut the output stream
* @throws IOException thrown if an error occurs
*/
public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException {
super.tightMarshal2(wireFormat, o, dataOut, bs);
NetworkBridgeFilter info = (NetworkBridgeFilter)o;
dataOut.writeInt(info.getNetworkTTL());
tightMarshalCachedObject2(wireFormat, (DataStructure)info.getNetworkBrokerId(), dataOut, bs);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException {
super.looseUnmarshal(wireFormat, o, dataIn);
NetworkBridgeFilter info = (NetworkBridgeFilter)o;
info.setNetworkTTL(dataIn.readInt());
info.setNetworkBrokerId((org.apache.activemq.command.BrokerId) looseUnmarsalCachedObject(wireFormat, dataIn));
}
/**
* Write the booleans that this object uses to a BooleanStream
*/
public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException {
NetworkBridgeFilter info = (NetworkBridgeFilter)o;
super.looseMarshal(wireFormat, o, dataOut);
dataOut.writeInt(info.getNetworkTTL());
looseMarshalCachedObject(wireFormat, (DataStructure)info.getNetworkBrokerId(), dataOut);
}
}
|
/**
|
||||||
|
*
|
||||||
|
* 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.openwire.v1;
|
||||||
|
|
||||||
|
import java.io.DataInputStream;
|
||||||
|
import java.io.DataOutputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import org.apache.activemq.openwire.*;
|
||||||
|
import org.apache.activemq.command.*;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Marshalling code for Open Wire Format for NetworkBridgeFilterMarshaller
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE!: This file is auto generated - do not modify!
|
||||||
|
* if you need to make a change, please see the modify the groovy scripts in the
|
||||||
|
* under src/gram/script and then use maven openwire:generate to regenerate
|
||||||
|
* this file.
|
||||||
|
*
|
||||||
|
* @version $Revision$
|
||||||
|
*/
|
||||||
|
public class NetworkBridgeFilterMarshaller extends BaseDataStreamMarshaller {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the type of Data Structure we marshal
|
||||||
|
* @return short representation of the type data structure
|
||||||
|
*/
|
||||||
|
public byte getDataStructureType() {
|
||||||
|
return NetworkBridgeFilter.DATA_STRUCTURE_TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return a new object instance
|
||||||
|
*/
|
||||||
|
public DataStructure createObject() {
|
||||||
|
return new NetworkBridgeFilter();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Un-marshal an object instance from the data input stream
|
||||||
|
*
|
||||||
|
* @param o the object to un-marshal
|
||||||
|
* @param dataIn the data input stream to build the object from
|
||||||
|
* @throws IOException
|
||||||
|
*/
|
||||||
|
public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException {
|
||||||
|
super.tightUnmarshal(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
|
||||||
|
*/
|
||||||
|
public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException {
|
||||||
|
|
||||||
|
NetworkBridgeFilter info = (NetworkBridgeFilter)o;
|
||||||
|
|
||||||
|
int rc = super.tightMarshal1(wireFormat, o, bs);
|
||||||
|
rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getNetworkBrokerId(), bs);
|
||||||
|
|
||||||
|
return rc + 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Write a object instance to data output stream
|
||||||
|
*
|
||||||
|
* @param o the instance to be marshaled
|
||||||
|
* @param dataOut the output stream
|
||||||
|
* @throws IOException thrown if an error occurs
|
||||||
|
*/
|
||||||
|
public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException {
|
||||||
|
super.tightMarshal2(wireFormat, o, dataOut, bs);
|
||||||
|
|
||||||
|
NetworkBridgeFilter info = (NetworkBridgeFilter)o;
|
||||||
|
dataOut.writeInt(info.getNetworkTTL());
|
||||||
|
tightMarshalCachedObject2(wireFormat, (DataStructure)info.getNetworkBrokerId(), dataOut, bs);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Un-marshal an object instance from the data input stream
|
||||||
|
*
|
||||||
|
* @param o the object to un-marshal
|
||||||
|
* @param dataIn the data input stream to build the object from
|
||||||
|
* @throws IOException
|
||||||
|
*/
|
||||||
|
public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException {
|
||||||
|
super.looseUnmarshal(wireFormat, o, dataIn);
|
||||||
|
|
||||||
|
NetworkBridgeFilter info = (NetworkBridgeFilter)o;
|
||||||
|
info.setNetworkTTL(dataIn.readInt());
|
||||||
|
info.setNetworkBrokerId((org.apache.activemq.command.BrokerId) looseUnmarsalCachedObject(wireFormat, dataIn));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Write the booleans that this object uses to a BooleanStream
|
||||||
|
*/
|
||||||
|
public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException {
|
||||||
|
|
||||||
|
NetworkBridgeFilter info = (NetworkBridgeFilter)o;
|
||||||
|
|
||||||
|
super.looseMarshal(wireFormat, o, dataOut);
|
||||||
|
dataOut.writeInt(info.getNetworkTTL());
|
||||||
|
looseMarshalCachedObject(wireFormat, (DataStructure)info.getNetworkBrokerId(), dataOut);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -61,7 +61,7 @@ public class JmsQueueCompositeSendReceiveTest extends JmsTopicSendReceiveTest {
|
||||||
protected String getProducerSubject() {
|
protected String getProducerSubject() {
|
||||||
return "FOO.BAR.HUMBUG,FOO.BAR.HUMBUG2";
|
return "FOO.BAR.HUMBUG,FOO.BAR.HUMBUG2";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test if all the messages sent are being received.
|
* Test if all the messages sent are being received.
|
||||||
*
|
*
|
||||||
|
|
|
@ -1 +1,57 @@
|
||||||
/**
*
* 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.openwire.v1;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import org.apache.activemq.openwire.*;
import org.apache.activemq.command.*;
/**
* Test case for the OpenWire marshalling for NetworkBridgeFilter
*
*
* NOTE!: This file is auto generated - do not modify!
* if you need to make a change, please see the modify the groovy scripts in the
* under src/gram/script and then use maven openwire:generate to regenerate
* this file.
*
* @version $Revision: $
*/
public class NetworkBridgeFilterTest extends DataFileGeneratorTestSupport {
public static NetworkBridgeFilterTest SINGLETON = new NetworkBridgeFilterTest();
public Object createObject() throws Exception {
NetworkBridgeFilter info = new NetworkBridgeFilter();
populateObject(info);
return info;
}
protected void populateObject(Object object) throws Exception {
super.populateObject(object);
NetworkBridgeFilter info = (NetworkBridgeFilter) object;
info.setNetworkTTL(1);
info.setNetworkBrokerId(createBrokerId("NetworkBrokerId:1"));
}
}
|
/**
|
||||||
|
*
|
||||||
|
* 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.openwire.v1;
|
||||||
|
|
||||||
|
import java.io.DataInputStream;
|
||||||
|
import java.io.DataOutputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import org.apache.activemq.openwire.*;
|
||||||
|
import org.apache.activemq.command.*;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test case for the OpenWire marshalling for NetworkBridgeFilter
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE!: This file is auto generated - do not modify!
|
||||||
|
* if you need to make a change, please see the modify the groovy scripts in the
|
||||||
|
* under src/gram/script and then use maven openwire:generate to regenerate
|
||||||
|
* this file.
|
||||||
|
*
|
||||||
|
* @version $Revision: $
|
||||||
|
*/
|
||||||
|
public class NetworkBridgeFilterTest extends DataFileGeneratorTestSupport {
|
||||||
|
|
||||||
|
|
||||||
|
public static NetworkBridgeFilterTest SINGLETON = new NetworkBridgeFilterTest();
|
||||||
|
|
||||||
|
public Object createObject() throws Exception {
|
||||||
|
NetworkBridgeFilter info = new NetworkBridgeFilter();
|
||||||
|
populateObject(info);
|
||||||
|
return info;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
protected void populateObject(Object object) throws Exception {
|
||||||
|
super.populateObject(object);
|
||||||
|
NetworkBridgeFilter info = (NetworkBridgeFilter) object;
|
||||||
|
info.setNetworkTTL(1);
|
||||||
|
info.setNetworkBrokerId(createBrokerId("NetworkBrokerId:1"));
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -1,54 +1,54 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2006 The Apache Software Foundation or its licensors, as
|
* Copyright 2006 The Apache Software Foundation or its licensors, as
|
||||||
* applicable.
|
* applicable.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
using ActiveMQ.Commands;
|
using ActiveMQ.Commands;
|
||||||
using NMS;
|
using NMS;
|
||||||
|
|
||||||
namespace ActiveMQ
|
namespace ActiveMQ
|
||||||
{
|
{
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Exception thrown when the broker returns an error
|
/// Exception thrown when the broker returns an error
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class BrokerException : NMSException
|
public class BrokerException : NMSException
|
||||||
{
|
{
|
||||||
|
|
||||||
private BrokerError brokerError;
|
private BrokerError brokerError;
|
||||||
|
|
||||||
public BrokerException(BrokerError brokerError) : base(
|
public BrokerException(BrokerError brokerError) : base(
|
||||||
brokerError.ExceptionClass + " : " + brokerError.Message)
|
brokerError.ExceptionClass + " : " + brokerError.Message)
|
||||||
{
|
{
|
||||||
this.brokerError = brokerError;
|
this.brokerError = brokerError;
|
||||||
}
|
}
|
||||||
|
|
||||||
public BrokerError BrokerError
|
public BrokerError BrokerError
|
||||||
{
|
{
|
||||||
get {
|
get {
|
||||||
return brokerError;
|
return brokerError;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual string JavaStackTrace
|
public virtual string JavaStackTrace
|
||||||
{
|
{
|
||||||
get {
|
get {
|
||||||
return brokerError.StackTrace;
|
return brokerError.StackTrace;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,33 +1,33 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2006 The Apache Software Foundation or its licensors, as
|
* Copyright 2006 The Apache Software Foundation or its licensors, as
|
||||||
* applicable.
|
* applicable.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
using NMS;
|
using NMS;
|
||||||
|
|
||||||
|
|
||||||
namespace ActiveMQ.Commands
|
namespace ActiveMQ.Commands
|
||||||
{
|
{
|
||||||
public class ActiveMQBytesMessage : ActiveMQMessage, IBytesMessage
|
public class ActiveMQBytesMessage : ActiveMQMessage, IBytesMessage
|
||||||
{
|
{
|
||||||
public const byte ID_ActiveMQBytesMessage = 24;
|
public const byte ID_ActiveMQBytesMessage = 24;
|
||||||
|
|
||||||
|
|
||||||
public override byte GetDataStructureType()
|
public override byte GetDataStructureType()
|
||||||
{
|
{
|
||||||
return ID_ActiveMQBytesMessage;
|
return ID_ActiveMQBytesMessage;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,65 +1,65 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2006 The Apache Software Foundation or its licensors, as
|
* Copyright 2006 The Apache Software Foundation or its licensors, as
|
||||||
* applicable.
|
* applicable.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
using ActiveMQ.OpenWire;
|
using ActiveMQ.OpenWire;
|
||||||
using NMS;
|
using NMS;
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
|
|
||||||
namespace ActiveMQ.Commands
|
namespace ActiveMQ.Commands
|
||||||
{
|
{
|
||||||
public class ActiveMQMapMessage : ActiveMQMessage, IMapMessage
|
public class ActiveMQMapMessage : ActiveMQMessage, IMapMessage
|
||||||
{
|
{
|
||||||
public const byte ID_ActiveMQMapMessage = 25;
|
public const byte ID_ActiveMQMapMessage = 25;
|
||||||
|
|
||||||
private PrimitiveMap body;
|
private PrimitiveMap body;
|
||||||
|
|
||||||
|
|
||||||
public override byte GetDataStructureType()
|
public override byte GetDataStructureType()
|
||||||
{
|
{
|
||||||
return ID_ActiveMQMapMessage;
|
return ID_ActiveMQMapMessage;
|
||||||
}
|
}
|
||||||
|
|
||||||
public IPrimitiveMap Body
|
public IPrimitiveMap Body
|
||||||
{
|
{
|
||||||
get {
|
get {
|
||||||
if (body == null)
|
if (body == null)
|
||||||
{
|
{
|
||||||
body = PrimitiveMap.Unmarshal(Content);
|
body = PrimitiveMap.Unmarshal(Content);
|
||||||
}
|
}
|
||||||
return body;
|
return body;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void BeforeMarshall(OpenWireFormat wireFormat)
|
public override void BeforeMarshall(OpenWireFormat wireFormat)
|
||||||
{
|
{
|
||||||
if (body == null)
|
if (body == null)
|
||||||
{
|
{
|
||||||
Content = null;
|
Content = null;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Content = body.Marshal();
|
Content = body.Marshal();
|
||||||
}
|
}
|
||||||
|
|
||||||
Console.WriteLine("BeforeMarshalling, content is: " + Content);
|
Console.WriteLine("BeforeMarshalling, content is: " + Content);
|
||||||
|
|
||||||
base.BeforeMarshall(wireFormat);
|
base.BeforeMarshall(wireFormat);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,295 +1,295 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2006 The Apache Software Foundation or its licensors, as
|
* Copyright 2006 The Apache Software Foundation or its licensors, as
|
||||||
* applicable.
|
* applicable.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
using ActiveMQ.OpenWire;
|
using ActiveMQ.OpenWire;
|
||||||
using NMS;
|
using NMS;
|
||||||
|
|
||||||
|
|
||||||
namespace ActiveMQ.Commands
|
namespace ActiveMQ.Commands
|
||||||
{
|
{
|
||||||
public delegate void AcknowledgeHandler(ActiveMQMessage message);
|
public delegate void AcknowledgeHandler(ActiveMQMessage message);
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace ActiveMQ.Commands
|
namespace ActiveMQ.Commands
|
||||||
{
|
{
|
||||||
public class ActiveMQMessage : Message, IMessage, MarshallAware
|
public class ActiveMQMessage : Message, IMessage, MarshallAware
|
||||||
{
|
{
|
||||||
public const byte ID_ActiveMQMessage = 23;
|
public const byte ID_ActiveMQMessage = 23;
|
||||||
|
|
||||||
protected static MessagePropertyHelper propertyHelper = new MessagePropertyHelper();
|
protected static MessagePropertyHelper propertyHelper = new MessagePropertyHelper();
|
||||||
|
|
||||||
private PrimitiveMap properties;
|
private PrimitiveMap properties;
|
||||||
|
|
||||||
public event AcknowledgeHandler Acknowledger;
|
public event AcknowledgeHandler Acknowledger;
|
||||||
|
|
||||||
public static ActiveMQMessage Transform(IMessage message)
|
public static ActiveMQMessage Transform(IMessage message)
|
||||||
{
|
{
|
||||||
return (ActiveMQMessage) message;
|
return (ActiveMQMessage) message;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO generate Equals method
|
// TODO generate Equals method
|
||||||
// TODO generate GetHashCode method
|
// TODO generate GetHashCode method
|
||||||
|
|
||||||
|
|
||||||
public override byte GetDataStructureType()
|
public override byte GetDataStructureType()
|
||||||
{
|
{
|
||||||
return ID_ActiveMQMessage;
|
return ID_ActiveMQMessage;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Acknowledge()
|
public void Acknowledge()
|
||||||
{
|
{
|
||||||
if (Acknowledger == null)
|
if (Acknowledger == null)
|
||||||
{
|
{
|
||||||
throw new NMSException("No Acknowledger has been associated with this message: " + this);
|
throw new NMSException("No Acknowledger has been associated with this message: " + this);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Acknowledger(this);
|
Acknowledger(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Properties
|
// Properties
|
||||||
|
|
||||||
public IPrimitiveMap Properties
|
public IPrimitiveMap Properties
|
||||||
{
|
{
|
||||||
get {
|
get {
|
||||||
if (properties == null)
|
if (properties == null)
|
||||||
{
|
{
|
||||||
properties = PrimitiveMap.Unmarshal(MarshalledProperties);
|
properties = PrimitiveMap.Unmarshal(MarshalledProperties);
|
||||||
}
|
}
|
||||||
return properties;
|
return properties;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public IDestination FromDestination
|
public IDestination FromDestination
|
||||||
{
|
{
|
||||||
get { return Destination; }
|
get { return Destination; }
|
||||||
set { this.Destination = ActiveMQDestination.Transform(value); }
|
set { this.Destination = ActiveMQDestination.Transform(value); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// IMessage interface
|
// IMessage interface
|
||||||
|
|
||||||
// JMS headers
|
// JMS headers
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The correlation ID used to correlate messages with conversations or long running business processes
|
/// The correlation ID used to correlate messages with conversations or long running business processes
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string NMSCorrelationID
|
public string NMSCorrelationID
|
||||||
{
|
{
|
||||||
get {
|
get {
|
||||||
return CorrelationId;
|
return CorrelationId;
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
CorrelationId = value;
|
CorrelationId = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The destination of the message
|
/// The destination of the message
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public IDestination NMSDestination
|
public IDestination NMSDestination
|
||||||
{
|
{
|
||||||
get {
|
get {
|
||||||
return OriginalDestination;
|
return OriginalDestination;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The time in milliseconds that this message should expire in
|
/// The time in milliseconds that this message should expire in
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public long NMSExpiration
|
public long NMSExpiration
|
||||||
{
|
{
|
||||||
get {
|
get {
|
||||||
return Expiration;
|
return Expiration;
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
Expiration = value;
|
Expiration = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The message ID which is set by the provider
|
/// The message ID which is set by the provider
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string NMSMessageId
|
public string NMSMessageId
|
||||||
{
|
{
|
||||||
get {
|
get {
|
||||||
return BaseDataStreamMarshaller.ToString(MessageId);
|
return BaseDataStreamMarshaller.ToString(MessageId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Whether or not this message is persistent
|
/// Whether or not this message is persistent
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool NMSPersistent
|
public bool NMSPersistent
|
||||||
{
|
{
|
||||||
get {
|
get {
|
||||||
return Persistent;
|
return Persistent;
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
Persistent = value;
|
Persistent = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The Priority on this message
|
/// The Priority on this message
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public byte NMSPriority
|
public byte NMSPriority
|
||||||
{
|
{
|
||||||
get {
|
get {
|
||||||
return Priority;
|
return Priority;
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
Priority = value;
|
Priority = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns true if this message has been redelivered to this or another consumer before being acknowledged successfully.
|
/// Returns true if this message has been redelivered to this or another consumer before being acknowledged successfully.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool NMSRedelivered
|
public bool NMSRedelivered
|
||||||
{
|
{
|
||||||
get {
|
get {
|
||||||
return RedeliveryCounter > 0;
|
return RedeliveryCounter > 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The destination that the consumer of this message should send replies to
|
/// The destination that the consumer of this message should send replies to
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public IDestination NMSReplyTo
|
public IDestination NMSReplyTo
|
||||||
{
|
{
|
||||||
get {
|
get {
|
||||||
return ReplyTo;
|
return ReplyTo;
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
ReplyTo = ActiveMQDestination.Transform(value);
|
ReplyTo = ActiveMQDestination.Transform(value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The timestamp the broker added to the message
|
/// The timestamp the broker added to the message
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public long NMSTimestamp
|
public long NMSTimestamp
|
||||||
{
|
{
|
||||||
get {
|
get {
|
||||||
return Timestamp;
|
return Timestamp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The type name of this message
|
/// The type name of this message
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string NMSType
|
public string NMSType
|
||||||
{
|
{
|
||||||
get {
|
get {
|
||||||
return Type;
|
return Type;
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
Type = value;
|
Type = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// JMS Extension headers
|
// JMS Extension headers
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the number of times this message has been redelivered to other consumers without being acknowledged successfully.
|
/// Returns the number of times this message has been redelivered to other consumers without being acknowledged successfully.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int JMSXDeliveryCount
|
public int JMSXDeliveryCount
|
||||||
{
|
{
|
||||||
get {
|
get {
|
||||||
return RedeliveryCounter + 1;
|
return RedeliveryCounter + 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The Message Group ID used to group messages together to the same consumer for the same group ID value
|
/// The Message Group ID used to group messages together to the same consumer for the same group ID value
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string JMSXGroupID
|
public string JMSXGroupID
|
||||||
{
|
{
|
||||||
get {
|
get {
|
||||||
return GroupID;
|
return GroupID;
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
GroupID = value;
|
GroupID = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The Message Group Sequence counter to indicate the position in a group
|
/// The Message Group Sequence counter to indicate the position in a group
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int JMSXGroupSeq
|
public int JMSXGroupSeq
|
||||||
{
|
{
|
||||||
get {
|
get {
|
||||||
return GroupSequence;
|
return GroupSequence;
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
GroupSequence = value;
|
GroupSequence = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the ID of the producers transaction
|
/// Returns the ID of the producers transaction
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string JMSXProducerTXID
|
public string JMSXProducerTXID
|
||||||
{
|
{
|
||||||
get {
|
get {
|
||||||
TransactionId txnId = OriginalTransactionId;
|
TransactionId txnId = OriginalTransactionId;
|
||||||
if (txnId == null)
|
if (txnId == null)
|
||||||
{
|
{
|
||||||
txnId = TransactionId;
|
txnId = TransactionId;
|
||||||
}
|
}
|
||||||
if (txnId != null)
|
if (txnId != null)
|
||||||
{
|
{
|
||||||
return BaseDataStreamMarshaller.ToString(txnId);
|
return BaseDataStreamMarshaller.ToString(txnId);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public object GetObjectProperty(string name)
|
public object GetObjectProperty(string name)
|
||||||
{
|
{
|
||||||
return propertyHelper.GetObjectProperty(this, name);
|
return propertyHelper.GetObjectProperty(this, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetObjectProperty(string name, object value)
|
public void SetObjectProperty(string name, object value)
|
||||||
{
|
{
|
||||||
propertyHelper.SetObjectProperty(this, name, value);
|
propertyHelper.SetObjectProperty(this, name, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
// MarshallAware interface
|
// MarshallAware interface
|
||||||
public override bool IsMarshallAware()
|
public override bool IsMarshallAware()
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void BeforeMarshall(OpenWireFormat wireFormat)
|
public override void BeforeMarshall(OpenWireFormat wireFormat)
|
||||||
{
|
{
|
||||||
MarshalledProperties = null;
|
MarshalledProperties = null;
|
||||||
if (properties != null)
|
if (properties != null)
|
||||||
{
|
{
|
||||||
MarshalledProperties = properties.Marshal();
|
MarshalledProperties = properties.Marshal();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,55 +1,55 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2006 The Apache Software Foundation or its licensors, as
|
* Copyright 2006 The Apache Software Foundation or its licensors, as
|
||||||
* applicable.
|
* applicable.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
|
|
||||||
using ActiveMQ.OpenWire;
|
using ActiveMQ.OpenWire;
|
||||||
using ActiveMQ.Commands;
|
using ActiveMQ.Commands;
|
||||||
|
|
||||||
namespace ActiveMQ.Commands
|
namespace ActiveMQ.Commands
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
// Marshalling code for Open Wire Format for ActiveMQObjectMessage
|
// Marshalling code for Open Wire Format for ActiveMQObjectMessage
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
// NOTE!: This file is autogenerated - do not modify!
|
// NOTE!: This file is autogenerated - do not modify!
|
||||||
// if you need to make a change, please see the Groovy scripts in the
|
// if you need to make a change, please see the Groovy scripts in the
|
||||||
// activemq-core module
|
// activemq-core module
|
||||||
//
|
//
|
||||||
public class ActiveMQObjectMessage : ActiveMQMessage
|
public class ActiveMQObjectMessage : ActiveMQMessage
|
||||||
{
|
{
|
||||||
public const byte ID_ActiveMQObjectMessage = 26;
|
public const byte ID_ActiveMQObjectMessage = 26;
|
||||||
|
|
||||||
|
|
||||||
public override string ToString() {
|
public override string ToString() {
|
||||||
return GetType().Name + "["
|
return GetType().Name + "["
|
||||||
+ " ]";
|
+ " ]";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public override byte GetDataStructureType() {
|
public override byte GetDataStructureType() {
|
||||||
return ID_ActiveMQObjectMessage;
|
return ID_ActiveMQObjectMessage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Properties
|
// Properties
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,44 +1,44 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2006 The Apache Software Foundation or its licensors, as
|
* Copyright 2006 The Apache Software Foundation or its licensors, as
|
||||||
* applicable.
|
* applicable.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
using ActiveMQ.Commands;
|
using ActiveMQ.Commands;
|
||||||
|
|
||||||
|
|
||||||
namespace ActiveMQ.Commands
|
namespace ActiveMQ.Commands
|
||||||
{
|
{
|
||||||
public class ActiveMQStreamMessage : ActiveMQMessage
|
public class ActiveMQStreamMessage : ActiveMQMessage
|
||||||
{
|
{
|
||||||
public const byte ID_ActiveMQStreamMessage = 27;
|
public const byte ID_ActiveMQStreamMessage = 27;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// TODO generate Equals method
|
// TODO generate Equals method
|
||||||
// TODO generate GetHashCode method
|
// TODO generate GetHashCode method
|
||||||
// TODO generate ToString method
|
// TODO generate ToString method
|
||||||
|
|
||||||
|
|
||||||
public override byte GetDataStructureType()
|
public override byte GetDataStructureType()
|
||||||
{
|
{
|
||||||
return ID_ActiveMQStreamMessage;
|
return ID_ActiveMQStreamMessage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Properties
|
// Properties
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,93 +1,93 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2006 The Apache Software Foundation or its licensors, as
|
* Copyright 2006 The Apache Software Foundation or its licensors, as
|
||||||
* applicable.
|
* applicable.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
using NMS;
|
using NMS;
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
|
|
||||||
namespace ActiveMQ.Commands
|
namespace ActiveMQ.Commands
|
||||||
{
|
{
|
||||||
public class ActiveMQTextMessage : ActiveMQMessage, ITextMessage
|
public class ActiveMQTextMessage : ActiveMQMessage, ITextMessage
|
||||||
{
|
{
|
||||||
public const byte ID_ActiveMQTextMessage = 28;
|
public const byte ID_ActiveMQTextMessage = 28;
|
||||||
|
|
||||||
private String text;
|
private String text;
|
||||||
|
|
||||||
public ActiveMQTextMessage()
|
public ActiveMQTextMessage()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public ActiveMQTextMessage(String text)
|
public ActiveMQTextMessage(String text)
|
||||||
{
|
{
|
||||||
this.Text = text;
|
this.Text = text;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO generate Equals method
|
// TODO generate Equals method
|
||||||
// TODO generate GetHashCode method
|
// TODO generate GetHashCode method
|
||||||
// TODO generate ToString method
|
// TODO generate ToString method
|
||||||
|
|
||||||
|
|
||||||
public override byte GetDataStructureType()
|
public override byte GetDataStructureType()
|
||||||
{
|
{
|
||||||
return ID_ActiveMQTextMessage;
|
return ID_ActiveMQTextMessage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Properties
|
// Properties
|
||||||
|
|
||||||
public string Text
|
public string Text
|
||||||
{
|
{
|
||||||
get {
|
get {
|
||||||
if (text == null)
|
if (text == null)
|
||||||
{
|
{
|
||||||
// now lets read the content
|
// now lets read the content
|
||||||
|
|
||||||
byte[] data = this.Content;
|
byte[] data = this.Content;
|
||||||
if (data != null)
|
if (data != null)
|
||||||
{
|
{
|
||||||
// TODO assume that the text is ASCII
|
// TODO assume that the text is ASCII
|
||||||
char[] chars = new char[data.Length];
|
char[] chars = new char[data.Length];
|
||||||
for (int i = 0; i < chars.Length; i++)
|
for (int i = 0; i < chars.Length; i++)
|
||||||
{
|
{
|
||||||
chars[i] = (char) data[i];
|
chars[i] = (char) data[i];
|
||||||
}
|
}
|
||||||
text = new String(chars);
|
text = new String(chars);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return text;
|
return text;
|
||||||
}
|
}
|
||||||
|
|
||||||
set {
|
set {
|
||||||
this.text = value;
|
this.text = value;
|
||||||
byte[] data = null;
|
byte[] data = null;
|
||||||
if (text != null)
|
if (text != null)
|
||||||
{
|
{
|
||||||
// TODO assume that the text is ASCII
|
// TODO assume that the text is ASCII
|
||||||
data = new byte[text.Length];
|
data = new byte[text.Length];
|
||||||
|
|
||||||
// now lets write the bytes
|
// now lets write the bytes
|
||||||
char[] chars = text.ToCharArray();
|
char[] chars = text.ToCharArray();
|
||||||
for (int i = 0; i < chars.Length; i++)
|
for (int i = 0; i < chars.Length; i++)
|
||||||
{
|
{
|
||||||
data[i] = (byte) chars[i];
|
data[i] = (byte) chars[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.Content = data;
|
this.Content = data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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
{
/// <summary>
/// The ActiveMQ BrokerId Command
/// </summary>
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; }
}
}
}
|
/*
|
||||||
|
* 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
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The ActiveMQ BrokerId Command
|
||||||
|
/// </summary>
|
||||||
|
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; }
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -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
{
/// <summary>
/// The ActiveMQ BrokerInfo Command
/// </summary>
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; }
}
}
}
|
/*
|
||||||
|
* 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
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The ActiveMQ BrokerInfo Command
|
||||||
|
/// </summary>
|
||||||
|
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; }
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -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
{
/// <summary>
/// The ActiveMQ ConnectionError Command
/// </summary>
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; }
}
}
}
|
/*
|
||||||
|
* 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
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The ActiveMQ ConnectionError Command
|
||||||
|
/// </summary>
|
||||||
|
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; }
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -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
{
/// <summary>
/// The ActiveMQ ConnectionId Command
/// </summary>
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; }
}
}
}
|
/*
|
||||||
|
* 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
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The ActiveMQ ConnectionId Command
|
||||||
|
/// </summary>
|
||||||
|
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; }
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -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
{
/// <summary>
/// The ActiveMQ ConnectionInfo Command
/// </summary>
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; }
}
}
}
|
/*
|
||||||
|
* 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
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The ActiveMQ ConnectionInfo Command
|
||||||
|
/// </summary>
|
||||||
|
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; }
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -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
{
/// <summary>
/// The ActiveMQ ConsumerId Command
/// </summary>
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; }
}
}
}
|
/*
|
||||||
|
* 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
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The ActiveMQ ConsumerId Command
|
||||||
|
/// </summary>
|
||||||
|
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; }
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -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
{
/// <summary>
/// The ActiveMQ ConsumerInfo Command
/// </summary>
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; }
}
}
}
|
/*
|
||||||
|
* 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
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The ActiveMQ ConsumerInfo Command
|
||||||
|
/// </summary>
|
||||||
|
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; }
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -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
{
/// <summary>
/// The ActiveMQ ControlCommand Command
/// </summary>
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; }
}
}
}
|
/*
|
||||||
|
* 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
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The ActiveMQ ControlCommand Command
|
||||||
|
/// </summary>
|
||||||
|
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; }
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -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
{
/// <summary>
/// The ActiveMQ DataArrayResponse Command
/// </summary>
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; }
}
}
}
|
/*
|
||||||
|
* 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
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The ActiveMQ DataArrayResponse Command
|
||||||
|
/// </summary>
|
||||||
|
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; }
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -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
{
/// <summary>
/// The ActiveMQ DataResponse Command
/// </summary>
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; }
}
}
}
|
/*
|
||||||
|
* 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
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The ActiveMQ DataResponse Command
|
||||||
|
/// </summary>
|
||||||
|
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; }
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -1,43 +1,43 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2006 The Apache Software Foundation or its licensors, as
|
* Copyright 2006 The Apache Software Foundation or its licensors, as
|
||||||
* applicable.
|
* applicable.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
using ActiveMQ.Commands;
|
using ActiveMQ.Commands;
|
||||||
|
|
||||||
namespace ActiveMQ.Commands
|
namespace ActiveMQ.Commands
|
||||||
{
|
{
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Summary description for DataStructureSupport.
|
/// Summary description for DataStructureSupport.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public abstract class DataStructureSupport : DataStructure
|
public abstract class DataStructureSupport : DataStructure
|
||||||
{
|
{
|
||||||
|
|
||||||
protected DataStructureSupport()
|
protected DataStructureSupport()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual byte GetDataStructureType()
|
public virtual byte GetDataStructureType()
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual bool IsMarshallAware()
|
public virtual bool IsMarshallAware()
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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
{
/// <summary>
/// The ActiveMQ DestinationInfo Command
/// </summary>
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; }
}
}
}
|
/*
|
||||||
|
* 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
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The ActiveMQ DestinationInfo Command
|
||||||
|
/// </summary>
|
||||||
|
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; }
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -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
{
/// <summary>
/// The ActiveMQ DiscoveryEvent Command
/// </summary>
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; }
}
}
}
|
/*
|
||||||
|
* 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
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The ActiveMQ DiscoveryEvent Command
|
||||||
|
/// </summary>
|
||||||
|
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; }
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -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
{
/// <summary>
/// The ActiveMQ ExceptionResponse Command
/// </summary>
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; }
}
}
}
|
/*
|
||||||
|
* 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
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The ActiveMQ ExceptionResponse Command
|
||||||
|
/// </summary>
|
||||||
|
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; }
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -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
{
/// <summary>
/// The ActiveMQ FlushCommand Command
/// </summary>
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
}
}
|
/*
|
||||||
|
* 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
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The ActiveMQ FlushCommand Command
|
||||||
|
/// </summary>
|
||||||
|
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
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -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
{
/// <summary>
/// The ActiveMQ IntegerResponse Command
/// </summary>
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; }
}
}
}
|
/*
|
||||||
|
* 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
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The ActiveMQ IntegerResponse Command
|
||||||
|
/// </summary>
|
||||||
|
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; }
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -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
{
/// <summary>
/// The ActiveMQ JournalQueueAck Command
/// </summary>
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; }
}
}
}
|
/*
|
||||||
|
* 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
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The ActiveMQ JournalQueueAck Command
|
||||||
|
/// </summary>
|
||||||
|
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; }
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -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
{
/// <summary>
/// The ActiveMQ JournalTopicAck Command
/// </summary>
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; }
}
}
}
|
/*
|
||||||
|
* 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
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The ActiveMQ JournalTopicAck Command
|
||||||
|
/// </summary>
|
||||||
|
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; }
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -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
{
/// <summary>
/// The ActiveMQ JournalTrace Command
/// </summary>
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; }
}
}
}
|
/*
|
||||||
|
* 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
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The ActiveMQ JournalTrace Command
|
||||||
|
/// </summary>
|
||||||
|
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; }
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -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
{
/// <summary>
/// The ActiveMQ JournalTransaction Command
/// </summary>
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; }
}
}
}
|
/*
|
||||||
|
* 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
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The ActiveMQ JournalTransaction Command
|
||||||
|
/// </summary>
|
||||||
|
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; }
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -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
{
/// <summary>
/// The ActiveMQ LastPartialCommand Command
/// </summary>
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
}
}
|
/*
|
||||||
|
* 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
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The ActiveMQ LastPartialCommand Command
|
||||||
|
/// </summary>
|
||||||
|
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
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -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
{
/// <summary>
/// The ActiveMQ LocalTransactionId Command
/// </summary>
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; }
}
}
}
|
/*
|
||||||
|
* 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
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The ActiveMQ LocalTransactionId Command
|
||||||
|
/// </summary>
|
||||||
|
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; }
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -1,38 +1,38 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2006 The Apache Software Foundation or its licensors, as
|
* Copyright 2006 The Apache Software Foundation or its licensors, as
|
||||||
* applicable.
|
* applicable.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
using ActiveMQ.OpenWire;
|
using ActiveMQ.OpenWire;
|
||||||
|
|
||||||
namespace ActiveMQ.Commands
|
namespace ActiveMQ.Commands
|
||||||
{
|
{
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a marshallable entity
|
/// Represents a marshallable entity
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface MarshallAware
|
public interface MarshallAware
|
||||||
{
|
{
|
||||||
|
|
||||||
void BeforeMarshall(OpenWireFormat wireFormat);
|
void BeforeMarshall(OpenWireFormat wireFormat);
|
||||||
void AfterMarshall(OpenWireFormat wireFormat);
|
void AfterMarshall(OpenWireFormat wireFormat);
|
||||||
|
|
||||||
void BeforeUnmarshall(OpenWireFormat wireFormat);
|
void BeforeUnmarshall(OpenWireFormat wireFormat);
|
||||||
void AfterUnmarshall(OpenWireFormat wireFormat);
|
void AfterUnmarshall(OpenWireFormat wireFormat);
|
||||||
|
|
||||||
void SetMarshalledForm(OpenWireFormat wireFormat, byte[] data);
|
void SetMarshalledForm(OpenWireFormat wireFormat, byte[] data);
|
||||||
byte[] GetMarshalledForm(OpenWireFormat wireFormat);
|
byte[] GetMarshalledForm(OpenWireFormat wireFormat);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -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
{
/// <summary>
/// The ActiveMQ MessageAck Command
/// </summary>
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; }
}
}
}
|
/*
|
||||||
|
* 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
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The ActiveMQ MessageAck Command
|
||||||
|
/// </summary>
|
||||||
|
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; }
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -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
{
/// <summary>
/// The ActiveMQ MessageDispatch Command
/// </summary>
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; }
}
}
}
|
/*
|
||||||
|
* 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
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The ActiveMQ MessageDispatch Command
|
||||||
|
/// </summary>
|
||||||
|
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; }
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -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
{
/// <summary>
/// The ActiveMQ MessageDispatchNotification Command
/// </summary>
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; }
}
}
}
|
/*
|
||||||
|
* 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
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The ActiveMQ MessageDispatchNotification Command
|
||||||
|
/// </summary>
|
||||||
|
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; }
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -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
{
/// <summary>
/// The ActiveMQ MessageId Command
/// </summary>
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; }
}
}
}
|
/*
|
||||||
|
* 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
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The ActiveMQ MessageId Command
|
||||||
|
/// </summary>
|
||||||
|
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; }
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -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
{
/// <summary>
/// The ActiveMQ NetworkBridgeFilter Command
/// </summary>
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; }
}
}
}
|
/*
|
||||||
|
* 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
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The ActiveMQ NetworkBridgeFilter Command
|
||||||
|
/// </summary>
|
||||||
|
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; }
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -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
{
/// <summary>
/// The ActiveMQ PartialCommand Command
/// </summary>
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; }
}
}
}
|
/*
|
||||||
|
* 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
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The ActiveMQ PartialCommand Command
|
||||||
|
/// </summary>
|
||||||
|
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; }
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -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
{
/// <summary>
/// The ActiveMQ ProducerId Command
/// </summary>
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; }
}
}
}
|
/*
|
||||||
|
* 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
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The ActiveMQ ProducerId Command
|
||||||
|
/// </summary>
|
||||||
|
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; }
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -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
{
/// <summary>
/// The ActiveMQ ProducerInfo Command
/// </summary>
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; }
}
}
}
|
/*
|
||||||
|
* 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
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The ActiveMQ ProducerInfo Command
|
||||||
|
/// </summary>
|
||||||
|
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; }
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -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
{
/// <summary>
/// The ActiveMQ RemoveInfo Command
/// </summary>
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; }
}
}
}
|
/*
|
||||||
|
* 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
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The ActiveMQ RemoveInfo Command
|
||||||
|
/// </summary>
|
||||||
|
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; }
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -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
{
/// <summary>
/// The ActiveMQ RemoveSubscriptionInfo Command
/// </summary>
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; }
}
}
}
|
/*
|
||||||
|
* 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
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The ActiveMQ RemoveSubscriptionInfo Command
|
||||||
|
/// </summary>
|
||||||
|
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; }
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -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
{
/// <summary>
/// The ActiveMQ ReplayCommand Command
/// </summary>
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; }
}
}
}
|
/*
|
||||||
|
* 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
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The ActiveMQ ReplayCommand Command
|
||||||
|
/// </summary>
|
||||||
|
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; }
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -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
{
/// <summary>
/// The ActiveMQ Response Command
/// </summary>
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; }
}
}
}
|
/*
|
||||||
|
* 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
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The ActiveMQ Response Command
|
||||||
|
/// </summary>
|
||||||
|
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; }
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -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
{
/// <summary>
/// The ActiveMQ SessionId Command
/// </summary>
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; }
}
}
}
|
/*
|
||||||
|
* 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
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The ActiveMQ SessionId Command
|
||||||
|
/// </summary>
|
||||||
|
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; }
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -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
{
/// <summary>
/// The ActiveMQ SessionInfo Command
/// </summary>
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; }
}
}
}
|
/*
|
||||||
|
* 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
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The ActiveMQ SessionInfo Command
|
||||||
|
/// </summary>
|
||||||
|
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; }
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -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
{
/// <summary>
/// The ActiveMQ ShutdownInfo Command
/// </summary>
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
}
}
|
/*
|
||||||
|
* 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
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The ActiveMQ ShutdownInfo Command
|
||||||
|
/// </summary>
|
||||||
|
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
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -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
{
/// <summary>
/// The ActiveMQ SubscriptionInfo Command
/// </summary>
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; }
}
}
}
|
/*
|
||||||
|
* 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
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The ActiveMQ SubscriptionInfo Command
|
||||||
|
/// </summary>
|
||||||
|
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; }
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -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
{
/// <summary>
/// The ActiveMQ TransactionId Command
/// </summary>
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
}
}
|
/*
|
||||||
|
* 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
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The ActiveMQ TransactionId Command
|
||||||
|
/// </summary>
|
||||||
|
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
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -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
{
/// <summary>
/// The ActiveMQ TransactionInfo Command
/// </summary>
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; }
}
}
}
|
/*
|
||||||
|
* 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
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The ActiveMQ TransactionInfo Command
|
||||||
|
/// </summary>
|
||||||
|
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; }
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -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
{
/// <summary>
/// The ActiveMQ XATransactionId Command
/// </summary>
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; }
}
}
}
|
/*
|
||||||
|
* 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
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The ActiveMQ XATransactionId Command
|
||||||
|
/// </summary>
|
||||||
|
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; }
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -1,38 +1,38 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2006 The Apache Software Foundation or its licensors, as
|
* Copyright 2006 The Apache Software Foundation or its licensors, as
|
||||||
* applicable.
|
* applicable.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace ActiveMQ
|
namespace ActiveMQ
|
||||||
{
|
{
|
||||||
public interface ISynchronization
|
public interface ISynchronization
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Called before a commit
|
/// Called before a commit
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void BeforeCommit();
|
void BeforeCommit();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Called after a commit
|
/// Called after a commit
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void AfterCommit();
|
void AfterCommit();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Called after a transaction rollback
|
/// Called after a transaction rollback
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void AfterRollback();
|
void AfterRollback();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,122 +1,122 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2006 The Apache Software Foundation or its licensors, as
|
* Copyright 2006 The Apache Software Foundation or its licensors, as
|
||||||
* applicable.
|
* applicable.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
|
||||||
using ActiveMQ.OpenWire;
|
using ActiveMQ.OpenWire;
|
||||||
|
|
||||||
namespace ActiveMQ.OpenWire
|
namespace ActiveMQ.OpenWire
|
||||||
|
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a stream of boolean flags
|
/// Represents a stream of boolean flags
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class BooleanStream
|
public class BooleanStream
|
||||||
{
|
{
|
||||||
byte[] data = new byte[48];
|
byte[] data = new byte[48];
|
||||||
short arrayLimit;
|
short arrayLimit;
|
||||||
short arrayPos;
|
short arrayPos;
|
||||||
byte bytePos;
|
byte bytePos;
|
||||||
|
|
||||||
public bool ReadBoolean()
|
public bool ReadBoolean()
|
||||||
{
|
{
|
||||||
byte b = data[arrayPos];
|
byte b = data[arrayPos];
|
||||||
bool rc = ((b >> bytePos) & 0x01) != 0;
|
bool rc = ((b >> bytePos) & 0x01) != 0;
|
||||||
bytePos++;
|
bytePos++;
|
||||||
if (bytePos >= 8)
|
if (bytePos >= 8)
|
||||||
{
|
{
|
||||||
bytePos = 0;
|
bytePos = 0;
|
||||||
arrayPos++;
|
arrayPos++;
|
||||||
}
|
}
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void WriteBoolean(bool value)
|
public void WriteBoolean(bool value)
|
||||||
{
|
{
|
||||||
if (bytePos == 0)
|
if (bytePos == 0)
|
||||||
{
|
{
|
||||||
arrayLimit++;
|
arrayLimit++;
|
||||||
if (arrayLimit >= data.Length)
|
if (arrayLimit >= data.Length)
|
||||||
{
|
{
|
||||||
// re-grow the array.
|
// re-grow the array.
|
||||||
byte[] d = new byte[data.Length * 2];
|
byte[] d = new byte[data.Length * 2];
|
||||||
Array.Copy(data, d, data.Length);
|
Array.Copy(data, d, data.Length);
|
||||||
data = d;
|
data = d;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (value)
|
if (value)
|
||||||
{
|
{
|
||||||
data[arrayPos] |= (byte) (0x01 << bytePos);
|
data[arrayPos] |= (byte) (0x01 << bytePos);
|
||||||
}
|
}
|
||||||
bytePos++;
|
bytePos++;
|
||||||
if (bytePos >= 8)
|
if (bytePos >= 8)
|
||||||
{
|
{
|
||||||
bytePos = 0;
|
bytePos = 0;
|
||||||
arrayPos++;
|
arrayPos++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Marshal(BinaryWriter dataOut)
|
public void Marshal(BinaryWriter dataOut)
|
||||||
{
|
{
|
||||||
if( arrayLimit < 64 ) {
|
if( arrayLimit < 64 ) {
|
||||||
dataOut.Write((byte)arrayLimit);
|
dataOut.Write((byte)arrayLimit);
|
||||||
} else if( arrayLimit < 256 ) { // max value of unsigned byte
|
} else if( arrayLimit < 256 ) { // max value of unsigned byte
|
||||||
dataOut.Write((byte)0xC0);
|
dataOut.Write((byte)0xC0);
|
||||||
dataOut.Write((byte)arrayLimit);
|
dataOut.Write((byte)arrayLimit);
|
||||||
} else {
|
} else {
|
||||||
dataOut.Write((byte)0x80);
|
dataOut.Write((byte)0x80);
|
||||||
dataOut.Write(arrayLimit);
|
dataOut.Write(arrayLimit);
|
||||||
}
|
}
|
||||||
dataOut.Write(data, 0, arrayLimit);
|
dataOut.Write(data, 0, arrayLimit);
|
||||||
Clear();
|
Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Unmarshal(BinaryReader dataIn)
|
public void Unmarshal(BinaryReader dataIn)
|
||||||
{
|
{
|
||||||
arrayLimit = (short)(dataIn.ReadByte() & 0xFF);
|
arrayLimit = (short)(dataIn.ReadByte() & 0xFF);
|
||||||
if ( arrayLimit == 0xC0 ) {
|
if ( arrayLimit == 0xC0 ) {
|
||||||
arrayLimit = (short)(dataIn.ReadByte() & 0xFF);
|
arrayLimit = (short)(dataIn.ReadByte() & 0xFF);
|
||||||
} else if( arrayLimit == 0x80 ) {
|
} else if( arrayLimit == 0x80 ) {
|
||||||
arrayLimit = dataIn.ReadInt16();
|
arrayLimit = dataIn.ReadInt16();
|
||||||
}
|
}
|
||||||
if( data.Length < arrayLimit ) {
|
if( data.Length < arrayLimit ) {
|
||||||
data = new byte[arrayLimit];
|
data = new byte[arrayLimit];
|
||||||
}
|
}
|
||||||
|
|
||||||
dataIn.Read(data, 0, arrayLimit);
|
dataIn.Read(data, 0, arrayLimit);
|
||||||
Clear();
|
Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Clear()
|
public void Clear()
|
||||||
{
|
{
|
||||||
arrayPos = 0;
|
arrayPos = 0;
|
||||||
bytePos = 0;
|
bytePos = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int MarshalledSize()
|
public int MarshalledSize()
|
||||||
{
|
{
|
||||||
if( arrayLimit < 64 ) {
|
if( arrayLimit < 64 ) {
|
||||||
return 1+arrayLimit;
|
return 1+arrayLimit;
|
||||||
} else if (arrayLimit < 256) {
|
} else if (arrayLimit < 256) {
|
||||||
return 2+arrayLimit;
|
return 2+arrayLimit;
|
||||||
} else {
|
} else {
|
||||||
return 3+arrayLimit;
|
return 3+arrayLimit;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,53 +1,53 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2006 The Apache Software Foundation or its licensors, as
|
* Copyright 2006 The Apache Software Foundation or its licensors, as
|
||||||
* applicable.
|
* applicable.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
using ActiveMQ.Commands;
|
using ActiveMQ.Commands;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
|
|
||||||
namespace ActiveMQ.OpenWire
|
namespace ActiveMQ.OpenWire
|
||||||
{
|
{
|
||||||
public delegate object PropertyGetter(ActiveMQMessage message);
|
public delegate object PropertyGetter(ActiveMQMessage message);
|
||||||
public delegate void PropertySetter(ActiveMQMessage message, object value);
|
public delegate void PropertySetter(ActiveMQMessage message, object value);
|
||||||
|
|
||||||
public class MessagePropertyHelper
|
public class MessagePropertyHelper
|
||||||
{
|
{
|
||||||
private IDictionary setters = new Hashtable();
|
private IDictionary setters = new Hashtable();
|
||||||
private IDictionary getters = new Hashtable();
|
private IDictionary getters = new Hashtable();
|
||||||
|
|
||||||
public MessagePropertyHelper()
|
public MessagePropertyHelper()
|
||||||
{
|
{
|
||||||
// TODO find all of the JMS properties via introspection
|
// TODO find all of the JMS properties via introspection
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public object GetObjectProperty(ActiveMQMessage message, string name) {
|
public object GetObjectProperty(ActiveMQMessage message, string name) {
|
||||||
object getter = getters[name];
|
object getter = getters[name];
|
||||||
if (getter != null) {
|
if (getter != null) {
|
||||||
}
|
}
|
||||||
return message.Properties[name];
|
return message.Properties[name];
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetObjectProperty(ActiveMQMessage message, string name, object value) {
|
public void SetObjectProperty(ActiveMQMessage message, string name, object value) {
|
||||||
PropertySetter setter = (PropertySetter) setters[name];
|
PropertySetter setter = (PropertySetter) setters[name];
|
||||||
if (setter != null) {
|
if (setter != null) {
|
||||||
setter(message, value);
|
setter(message, value);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
message.Properties[name] = value;
|
message.Properties[name] = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,279 +1,279 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2006 The Apache Software Foundation or its licensors, as
|
* Copyright 2006 The Apache Software Foundation or its licensors, as
|
||||||
* applicable.
|
* applicable.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
using ActiveMQ.Commands;
|
using ActiveMQ.Commands;
|
||||||
using ActiveMQ.OpenWire.V1;
|
using ActiveMQ.OpenWire.V1;
|
||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
|
||||||
namespace ActiveMQ.OpenWire
|
namespace ActiveMQ.OpenWire
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents the wire format
|
/// Represents the wire format
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class OpenWireFormat
|
public class OpenWireFormat
|
||||||
{
|
{
|
||||||
|
|
||||||
private BaseDataStreamMarshaller[] dataMarshallers;
|
private BaseDataStreamMarshaller[] dataMarshallers;
|
||||||
private const byte NULL_TYPE = 0;
|
private const byte NULL_TYPE = 0;
|
||||||
|
|
||||||
private int version=1;
|
private int version=1;
|
||||||
private bool stackTraceEnabled=false;
|
private bool stackTraceEnabled=false;
|
||||||
private bool tightEncodingEnabled=false;
|
private bool tightEncodingEnabled=false;
|
||||||
private bool sizePrefixDisabled=false;
|
private bool sizePrefixDisabled=false;
|
||||||
|
|
||||||
public OpenWireFormat()
|
public OpenWireFormat()
|
||||||
{
|
{
|
||||||
dataMarshallers = new BaseDataStreamMarshaller[256];
|
dataMarshallers = new BaseDataStreamMarshaller[256];
|
||||||
MarshallerFactory factory = new MarshallerFactory();
|
MarshallerFactory factory = new MarshallerFactory();
|
||||||
factory.configure(this);
|
factory.configure(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool StackTraceEnabled {
|
public bool StackTraceEnabled {
|
||||||
get { return stackTraceEnabled; }
|
get { return stackTraceEnabled; }
|
||||||
set { stackTraceEnabled = value; }
|
set { stackTraceEnabled = value; }
|
||||||
}
|
}
|
||||||
public int Version {
|
public int Version {
|
||||||
get { return version; }
|
get { return version; }
|
||||||
set { version = value; }
|
set { version = value; }
|
||||||
}
|
}
|
||||||
public bool SizePrefixDisabled {
|
public bool SizePrefixDisabled {
|
||||||
get { return sizePrefixDisabled; }
|
get { return sizePrefixDisabled; }
|
||||||
set { sizePrefixDisabled = value; }
|
set { sizePrefixDisabled = value; }
|
||||||
}
|
}
|
||||||
public bool TightEncodingEnabled {
|
public bool TightEncodingEnabled {
|
||||||
get { return tightEncodingEnabled; }
|
get { return tightEncodingEnabled; }
|
||||||
set { tightEncodingEnabled = value; }
|
set { tightEncodingEnabled = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addMarshaller(BaseDataStreamMarshaller marshaller)
|
public void addMarshaller(BaseDataStreamMarshaller marshaller)
|
||||||
{
|
{
|
||||||
byte type = marshaller.GetDataStructureType();
|
byte type = marshaller.GetDataStructureType();
|
||||||
dataMarshallers[type & 0xFF] = marshaller;
|
dataMarshallers[type & 0xFF] = marshaller;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Marshal(Object o, BinaryWriter ds)
|
public void Marshal(Object o, BinaryWriter ds)
|
||||||
{
|
{
|
||||||
int size = 1;
|
int size = 1;
|
||||||
if (o != null)
|
if (o != null)
|
||||||
{
|
{
|
||||||
DataStructure c = (DataStructure) o;
|
DataStructure c = (DataStructure) o;
|
||||||
byte type = c.GetDataStructureType();
|
byte type = c.GetDataStructureType();
|
||||||
BaseDataStreamMarshaller dsm = dataMarshallers[type & 0xFF];
|
BaseDataStreamMarshaller dsm = dataMarshallers[type & 0xFF];
|
||||||
if (dsm == null)
|
if (dsm == null)
|
||||||
throw new IOException("Unknown data type: " + type);
|
throw new IOException("Unknown data type: " + type);
|
||||||
|
|
||||||
if(tightEncodingEnabled) {
|
if(tightEncodingEnabled) {
|
||||||
|
|
||||||
BooleanStream bs = new BooleanStream();
|
BooleanStream bs = new BooleanStream();
|
||||||
size += dsm.TightMarshal1(this, c, bs);
|
size += dsm.TightMarshal1(this, c, bs);
|
||||||
size += bs.MarshalledSize();
|
size += bs.MarshalledSize();
|
||||||
|
|
||||||
if( !sizePrefixDisabled ) {
|
if( !sizePrefixDisabled ) {
|
||||||
ds.Write(size);
|
ds.Write(size);
|
||||||
}
|
}
|
||||||
|
|
||||||
ds.Write(type);
|
ds.Write(type);
|
||||||
bs.Marshal(ds);
|
bs.Marshal(ds);
|
||||||
dsm.TightMarshal2(this, c, ds, bs);
|
dsm.TightMarshal2(this, c, ds, bs);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
BinaryWriter looseOut = ds;
|
BinaryWriter looseOut = ds;
|
||||||
MemoryStream ms = null;
|
MemoryStream ms = null;
|
||||||
// If we are prefixing then we need to first write it to memory,
|
// If we are prefixing then we need to first write it to memory,
|
||||||
// otherwise we can write direct to the stream.
|
// otherwise we can write direct to the stream.
|
||||||
if( !sizePrefixDisabled ) {
|
if( !sizePrefixDisabled ) {
|
||||||
ms= new MemoryStream();
|
ms= new MemoryStream();
|
||||||
looseOut = new OpenWireBinaryWriter(ms);
|
looseOut = new OpenWireBinaryWriter(ms);
|
||||||
looseOut.Write(size);
|
looseOut.Write(size);
|
||||||
}
|
}
|
||||||
|
|
||||||
looseOut.Write(type);
|
looseOut.Write(type);
|
||||||
dsm.LooseMarshal(this, c, looseOut);
|
dsm.LooseMarshal(this, c, looseOut);
|
||||||
|
|
||||||
if( !sizePrefixDisabled ) {
|
if( !sizePrefixDisabled ) {
|
||||||
ms.Position=0;
|
ms.Position=0;
|
||||||
looseOut.Write( (int)ms.Length-4 );
|
looseOut.Write( (int)ms.Length-4 );
|
||||||
ds.Write(ms.GetBuffer(), 0, (int)ms.Length);
|
ds.Write(ms.GetBuffer(), 0, (int)ms.Length);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ds.Write(size);
|
ds.Write(size);
|
||||||
ds.Write(NULL_TYPE);
|
ds.Write(NULL_TYPE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Object Unmarshal(BinaryReader dis)
|
public Object Unmarshal(BinaryReader dis)
|
||||||
{
|
{
|
||||||
// lets ignore the size of the packet
|
// lets ignore the size of the packet
|
||||||
if( !sizePrefixDisabled ) {
|
if( !sizePrefixDisabled ) {
|
||||||
dis.ReadInt32();
|
dis.ReadInt32();
|
||||||
}
|
}
|
||||||
|
|
||||||
// first byte is the type of the packet
|
// first byte is the type of the packet
|
||||||
byte dataType = dis.ReadByte();
|
byte dataType = dis.ReadByte();
|
||||||
if (dataType != NULL_TYPE)
|
if (dataType != NULL_TYPE)
|
||||||
{
|
{
|
||||||
BaseDataStreamMarshaller dsm = dataMarshallers[dataType & 0xFF];
|
BaseDataStreamMarshaller dsm = dataMarshallers[dataType & 0xFF];
|
||||||
if (dsm == null)
|
if (dsm == null)
|
||||||
throw new IOException("Unknown data type: " + dataType);
|
throw new IOException("Unknown data type: " + dataType);
|
||||||
//Console.WriteLine("Parsing type: " + dataType + " with: " + dsm);
|
//Console.WriteLine("Parsing type: " + dataType + " with: " + dsm);
|
||||||
Object data = dsm.CreateObject();
|
Object data = dsm.CreateObject();
|
||||||
|
|
||||||
if(tightEncodingEnabled) {
|
if(tightEncodingEnabled) {
|
||||||
BooleanStream bs = new BooleanStream();
|
BooleanStream bs = new BooleanStream();
|
||||||
bs.Unmarshal(dis);
|
bs.Unmarshal(dis);
|
||||||
dsm.TightUnmarshal(this, data, dis, bs);
|
dsm.TightUnmarshal(this, data, dis, bs);
|
||||||
return data;
|
return data;
|
||||||
} else {
|
} else {
|
||||||
dsm.LooseUnmarshal(this, data, dis);
|
dsm.LooseUnmarshal(this, data, dis);
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public int TightMarshalNestedObject1(DataStructure o, BooleanStream bs)
|
public int TightMarshalNestedObject1(DataStructure o, BooleanStream bs)
|
||||||
{
|
{
|
||||||
bs.WriteBoolean(o != null);
|
bs.WriteBoolean(o != null);
|
||||||
if (o == null)
|
if (o == null)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (o.IsMarshallAware())
|
if (o.IsMarshallAware())
|
||||||
{
|
{
|
||||||
MarshallAware ma = (MarshallAware) o;
|
MarshallAware ma = (MarshallAware) o;
|
||||||
byte[] sequence = ma.GetMarshalledForm(this);
|
byte[] sequence = ma.GetMarshalledForm(this);
|
||||||
bs.WriteBoolean(sequence != null);
|
bs.WriteBoolean(sequence != null);
|
||||||
if (sequence != null)
|
if (sequence != null)
|
||||||
{
|
{
|
||||||
return 1 + sequence.Length;
|
return 1 + sequence.Length;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
byte type = o.GetDataStructureType();
|
byte type = o.GetDataStructureType();
|
||||||
if (type == 0) {
|
if (type == 0) {
|
||||||
throw new IOException("No valid data structure type for: " + o + " of type: " + o.GetType());
|
throw new IOException("No valid data structure type for: " + o + " of type: " + o.GetType());
|
||||||
}
|
}
|
||||||
BaseDataStreamMarshaller dsm = (BaseDataStreamMarshaller) dataMarshallers[type & 0xFF];
|
BaseDataStreamMarshaller dsm = (BaseDataStreamMarshaller) dataMarshallers[type & 0xFF];
|
||||||
if (dsm == null)
|
if (dsm == null)
|
||||||
throw new IOException("Unknown data type: " + type);
|
throw new IOException("Unknown data type: " + type);
|
||||||
//Console.WriteLine("Marshalling type: " + type + " with structure: " + o);
|
//Console.WriteLine("Marshalling type: " + type + " with structure: " + o);
|
||||||
return 1 + dsm.TightMarshal1(this, o, bs);
|
return 1 + dsm.TightMarshal1(this, o, bs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void TightMarshalNestedObject2(DataStructure o, BinaryWriter ds, BooleanStream bs)
|
public void TightMarshalNestedObject2(DataStructure o, BinaryWriter ds, BooleanStream bs)
|
||||||
{
|
{
|
||||||
if (!bs.ReadBoolean())
|
if (!bs.ReadBoolean())
|
||||||
return ;
|
return ;
|
||||||
|
|
||||||
byte type = o.GetDataStructureType();
|
byte type = o.GetDataStructureType();
|
||||||
ds.Write(type);
|
ds.Write(type);
|
||||||
|
|
||||||
if (o.IsMarshallAware() && bs.ReadBoolean())
|
if (o.IsMarshallAware() && bs.ReadBoolean())
|
||||||
{
|
{
|
||||||
MarshallAware ma = (MarshallAware) o;
|
MarshallAware ma = (MarshallAware) o;
|
||||||
byte[] sequence = ma.GetMarshalledForm(this);
|
byte[] sequence = ma.GetMarshalledForm(this);
|
||||||
ds.Write(sequence, 0, sequence.Length);
|
ds.Write(sequence, 0, sequence.Length);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
BaseDataStreamMarshaller dsm = (BaseDataStreamMarshaller) dataMarshallers[type & 0xFF];
|
BaseDataStreamMarshaller dsm = (BaseDataStreamMarshaller) dataMarshallers[type & 0xFF];
|
||||||
if (dsm == null)
|
if (dsm == null)
|
||||||
throw new IOException("Unknown data type: " + type);
|
throw new IOException("Unknown data type: " + type);
|
||||||
dsm.TightMarshal2(this, o, ds, bs);
|
dsm.TightMarshal2(this, o, ds, bs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public DataStructure TightUnmarshalNestedObject(BinaryReader dis, BooleanStream bs)
|
public DataStructure TightUnmarshalNestedObject(BinaryReader dis, BooleanStream bs)
|
||||||
{
|
{
|
||||||
if (bs.ReadBoolean())
|
if (bs.ReadBoolean())
|
||||||
{
|
{
|
||||||
|
|
||||||
byte dataType = dis.ReadByte();
|
byte dataType = dis.ReadByte();
|
||||||
BaseDataStreamMarshaller dsm = (BaseDataStreamMarshaller) dataMarshallers[dataType & 0xFF];
|
BaseDataStreamMarshaller dsm = (BaseDataStreamMarshaller) dataMarshallers[dataType & 0xFF];
|
||||||
if (dsm == null)
|
if (dsm == null)
|
||||||
throw new IOException("Unknown data type: " + dataType);
|
throw new IOException("Unknown data type: " + dataType);
|
||||||
DataStructure data = dsm.CreateObject();
|
DataStructure data = dsm.CreateObject();
|
||||||
|
|
||||||
if (data.IsMarshallAware() && bs.ReadBoolean())
|
if (data.IsMarshallAware() && bs.ReadBoolean())
|
||||||
{
|
{
|
||||||
dis.ReadInt32();
|
dis.ReadInt32();
|
||||||
dis.ReadByte();
|
dis.ReadByte();
|
||||||
|
|
||||||
BooleanStream bs2 = new BooleanStream();
|
BooleanStream bs2 = new BooleanStream();
|
||||||
bs2.Unmarshal(dis);
|
bs2.Unmarshal(dis);
|
||||||
dsm.TightUnmarshal(this, data, dis, bs2);
|
dsm.TightUnmarshal(this, data, dis, bs2);
|
||||||
|
|
||||||
// TODO: extract the sequence from the dis and associate it.
|
// TODO: extract the sequence from the dis and associate it.
|
||||||
// MarshallAware ma = (MarshallAware)data
|
// MarshallAware ma = (MarshallAware)data
|
||||||
// ma.setCachedMarshalledForm(this, sequence);
|
// ma.setCachedMarshalledForm(this, sequence);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dsm.TightUnmarshal(this, data, dis, bs);
|
dsm.TightUnmarshal(this, data, dis, bs);
|
||||||
}
|
}
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void LooseMarshalNestedObject(DataStructure o, BinaryWriter dataOut)
|
public void LooseMarshalNestedObject(DataStructure o, BinaryWriter dataOut)
|
||||||
{
|
{
|
||||||
dataOut.Write(o!=null);
|
dataOut.Write(o!=null);
|
||||||
if( o!=null ) {
|
if( o!=null ) {
|
||||||
byte type = o.GetDataStructureType();
|
byte type = o.GetDataStructureType();
|
||||||
dataOut.Write(type);
|
dataOut.Write(type);
|
||||||
BaseDataStreamMarshaller dsm = (BaseDataStreamMarshaller) dataMarshallers[type & 0xFF];
|
BaseDataStreamMarshaller dsm = (BaseDataStreamMarshaller) dataMarshallers[type & 0xFF];
|
||||||
if( dsm == null )
|
if( dsm == null )
|
||||||
throw new IOException("Unknown data type: "+type);
|
throw new IOException("Unknown data type: "+type);
|
||||||
dsm.LooseMarshal(this, o, dataOut);
|
dsm.LooseMarshal(this, o, dataOut);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public DataStructure LooseUnmarshalNestedObject(BinaryReader dis)
|
public DataStructure LooseUnmarshalNestedObject(BinaryReader dis)
|
||||||
{
|
{
|
||||||
if (dis.ReadBoolean())
|
if (dis.ReadBoolean())
|
||||||
{
|
{
|
||||||
|
|
||||||
byte dataType = dis.ReadByte();
|
byte dataType = dis.ReadByte();
|
||||||
BaseDataStreamMarshaller dsm = (BaseDataStreamMarshaller) dataMarshallers[dataType & 0xFF];
|
BaseDataStreamMarshaller dsm = (BaseDataStreamMarshaller) dataMarshallers[dataType & 0xFF];
|
||||||
if (dsm == null)
|
if (dsm == null)
|
||||||
throw new IOException("Unknown data type: " + dataType);
|
throw new IOException("Unknown data type: " + dataType);
|
||||||
DataStructure data = dsm.CreateObject();
|
DataStructure data = dsm.CreateObject();
|
||||||
dsm.LooseUnmarshal(this, data, dis);
|
dsm.LooseUnmarshal(this, data, dis);
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,64 +1,64 @@
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
// Copyright 2005-2006 The Apache Software Foundation
|
// Copyright 2005-2006 The Apache Software Foundation
|
||||||
//
|
//
|
||||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
// you may not use this file except in compliance with the License.
|
// you may not use this file except in compliance with the License.
|
||||||
// You may obtain a copy of the License at
|
// You may obtain a copy of the License at
|
||||||
//
|
//
|
||||||
// http://www.apache.org/licenses/LICENSE-2.0
|
// http://www.apache.org/licenses/LICENSE-2.0
|
||||||
//
|
//
|
||||||
// Unless required by applicable law or agreed to in writing, software
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
//
|
//
|
||||||
|
|
||||||
using ActiveMQ.Commands;
|
using ActiveMQ.Commands;
|
||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
|
||||||
namespace ActiveMQ.OpenWire.V1
|
namespace ActiveMQ.OpenWire.V1
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
// Marshalling code for Open Wire Format for DataStructureSupport
|
// Marshalling code for Open Wire Format for DataStructureSupport
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
// NOTE!: This file is autogenerated - do not modify!
|
// NOTE!: This file is autogenerated - do not modify!
|
||||||
// if you need to make a change, please see the Groovy scripts in the
|
// if you need to make a change, please see the Groovy scripts in the
|
||||||
// activemq-core module
|
// activemq-core module
|
||||||
//
|
//
|
||||||
public abstract class DataStructureSupportMarshaller : BaseDataStreamMarshaller
|
public abstract class DataStructureSupportMarshaller : BaseDataStreamMarshaller
|
||||||
{
|
{
|
||||||
|
|
||||||
//
|
//
|
||||||
// Un-marshal an object instance from the data input stream
|
// Un-marshal an object instance from the data input stream
|
||||||
//
|
//
|
||||||
public override void TightUnmarshal(OpenWireFormat wireFormat, Object o, BinaryReader dataIn, BooleanStream bs)
|
public override void TightUnmarshal(OpenWireFormat wireFormat, Object o, BinaryReader dataIn, BooleanStream bs)
|
||||||
{
|
{
|
||||||
base.TightUnmarshal(wireFormat, o, dataIn, bs);
|
base.TightUnmarshal(wireFormat, o, dataIn, bs);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Write the booleans that this object uses to a BooleanStream
|
// Write the booleans that this object uses to a BooleanStream
|
||||||
//
|
//
|
||||||
public override int TightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) {
|
public override int TightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) {
|
||||||
DataStructureSupport info = (DataStructureSupport)o;
|
DataStructureSupport info = (DataStructureSupport)o;
|
||||||
|
|
||||||
int rc = base.TightMarshal1(wireFormat, info, bs);
|
int rc = base.TightMarshal1(wireFormat, info, bs);
|
||||||
|
|
||||||
return rc + 0;
|
return rc + 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Write a object instance to data output stream
|
// Write a object instance to data output stream
|
||||||
//
|
//
|
||||||
public override void TightMarshal2(OpenWireFormat wireFormat, Object o, BinaryWriter dataOut, BooleanStream bs) {
|
public override void TightMarshal2(OpenWireFormat wireFormat, Object o, BinaryWriter dataOut, BooleanStream bs) {
|
||||||
base.TightMarshal2(wireFormat, o, dataOut, bs);
|
base.TightMarshal2(wireFormat, o, dataOut, bs);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
{
/// <summary>
/// Marshalling code for Open Wire Format for LastPartialCommand
/// </summary>
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);
}
}
}
|
/*
|
||||||
|
* 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
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Marshalling code for Open Wire Format for LastPartialCommand
|
||||||
|
/// </summary>
|
||||||
|
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);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -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
{
/// <summary>
/// Marshalling code for Open Wire Format for MessageDispatchNotification
/// </summary>
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);
}
}
}
|
/*
|
||||||
|
* 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
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Marshalling code for Open Wire Format for MessageDispatchNotification
|
||||||
|
/// </summary>
|
||||||
|
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);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -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
{
/// <summary>
/// Marshalling code for Open Wire Format for NetworkBridgeFilter
/// </summary>
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);
}
}
}
|
/*
|
||||||
|
* 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
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Marshalling code for Open Wire Format for NetworkBridgeFilter
|
||||||
|
/// </summary>
|
||||||
|
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);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -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
{
/// <summary>
/// Marshalling code for Open Wire Format for PartialCommand
/// </summary>
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);
}
}
}
}
|
/*
|
||||||
|
* 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
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Marshalling code for Open Wire Format for PartialCommand
|
||||||
|
/// </summary>
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -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
{
/// <summary>
/// Marshalling code for Open Wire Format for ReplayCommand
/// </summary>
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);
}
}
}
|
/*
|
||||||
|
* 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
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Marshalling code for Open Wire Format for ReplayCommand
|
||||||
|
/// </summary>
|
||||||
|
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);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -1,118 +1,118 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2006 The Apache Software Foundation or its licensors, as
|
* Copyright 2006 The Apache Software Foundation or its licensors, as
|
||||||
* applicable.
|
* applicable.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
using ActiveMQ;
|
using ActiveMQ;
|
||||||
using ActiveMQ.Commands;
|
using ActiveMQ.Commands;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
|
|
||||||
|
|
||||||
namespace ActiveMQ
|
namespace ActiveMQ
|
||||||
{
|
{
|
||||||
public enum TransactionType
|
public enum TransactionType
|
||||||
{
|
{
|
||||||
Begin = 0, Prepare = 1, CommitOnePhase = 2, CommitTwoPhase = 3, Rollback = 4, Recover=5, Forget = 6, End = 7
|
Begin = 0, Prepare = 1, CommitOnePhase = 2, CommitTwoPhase = 3, Rollback = 4, Recover=5, Forget = 6, End = 7
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace ActiveMQ
|
namespace ActiveMQ
|
||||||
{
|
{
|
||||||
public class TransactionContext
|
public class TransactionContext
|
||||||
{
|
{
|
||||||
private TransactionId transactionId;
|
private TransactionId transactionId;
|
||||||
private Session session;
|
private Session session;
|
||||||
private ArrayList synchronizations = new ArrayList();
|
private ArrayList synchronizations = new ArrayList();
|
||||||
|
|
||||||
public TransactionContext(Session session)
|
public TransactionContext(Session session)
|
||||||
{
|
{
|
||||||
this.session = session;
|
this.session = session;
|
||||||
}
|
}
|
||||||
|
|
||||||
public TransactionId TransactionId
|
public TransactionId TransactionId
|
||||||
{
|
{
|
||||||
get { return transactionId; }
|
get { return transactionId; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Method AddSynchronization
|
/// Method AddSynchronization
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void AddSynchronization(ISynchronization synchronization)
|
public void AddSynchronization(ISynchronization synchronization)
|
||||||
{
|
{
|
||||||
synchronizations.Add(synchronization);
|
synchronizations.Add(synchronization);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void Begin()
|
public void Begin()
|
||||||
{
|
{
|
||||||
if (transactionId == null)
|
if (transactionId == null)
|
||||||
{
|
{
|
||||||
transactionId = session.Connection.CreateLocalTransactionId();
|
transactionId = session.Connection.CreateLocalTransactionId();
|
||||||
|
|
||||||
TransactionInfo info = new TransactionInfo();
|
TransactionInfo info = new TransactionInfo();
|
||||||
info.ConnectionId = session.Connection.ConnectionId;
|
info.ConnectionId = session.Connection.ConnectionId;
|
||||||
info.TransactionId = transactionId;
|
info.TransactionId = transactionId;
|
||||||
info.Type = (int) TransactionType.Begin;
|
info.Type = (int) TransactionType.Begin;
|
||||||
session.Connection.OneWay(info);
|
session.Connection.OneWay(info);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void Rollback()
|
public void Rollback()
|
||||||
{
|
{
|
||||||
if (transactionId != null)
|
if (transactionId != null)
|
||||||
{
|
{
|
||||||
TransactionInfo info = new TransactionInfo();
|
TransactionInfo info = new TransactionInfo();
|
||||||
info.ConnectionId = session.Connection.ConnectionId;
|
info.ConnectionId = session.Connection.ConnectionId;
|
||||||
info.TransactionId = transactionId;
|
info.TransactionId = transactionId;
|
||||||
info.Type = (int) TransactionType.Rollback;
|
info.Type = (int) TransactionType.Rollback;
|
||||||
|
|
||||||
transactionId = null;
|
transactionId = null;
|
||||||
session.Connection.OneWay(info);
|
session.Connection.OneWay(info);
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (ISynchronization synchronization in synchronizations)
|
foreach (ISynchronization synchronization in synchronizations)
|
||||||
{
|
{
|
||||||
synchronization.AfterRollback();
|
synchronization.AfterRollback();
|
||||||
}
|
}
|
||||||
synchronizations.Clear();
|
synchronizations.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Commit()
|
public void Commit()
|
||||||
{
|
{
|
||||||
foreach (ISynchronization synchronization in synchronizations)
|
foreach (ISynchronization synchronization in synchronizations)
|
||||||
{
|
{
|
||||||
synchronization.BeforeCommit();
|
synchronization.BeforeCommit();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (transactionId != null)
|
if (transactionId != null)
|
||||||
{
|
{
|
||||||
TransactionInfo info = new TransactionInfo();
|
TransactionInfo info = new TransactionInfo();
|
||||||
info.ConnectionId = session.Connection.ConnectionId;
|
info.ConnectionId = session.Connection.ConnectionId;
|
||||||
info.TransactionId = transactionId;
|
info.TransactionId = transactionId;
|
||||||
info.Type = (int) TransactionType.CommitOnePhase;
|
info.Type = (int) TransactionType.CommitOnePhase;
|
||||||
|
|
||||||
transactionId = null;
|
transactionId = null;
|
||||||
session.Connection.OneWay(info);
|
session.Connection.OneWay(info);
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (ISynchronization synchronization in synchronizations)
|
foreach (ISynchronization synchronization in synchronizations)
|
||||||
{
|
{
|
||||||
synchronization.AfterCommit();
|
synchronization.AfterCommit();
|
||||||
}
|
}
|
||||||
synchronizations.Clear();
|
synchronizations.Clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,26 +1,26 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2006 The Apache Software Foundation or its licensors, as
|
* Copyright 2006 The Apache Software Foundation or its licensors, as
|
||||||
* applicable.
|
* applicable.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace ActiveMQ.Transport
|
namespace ActiveMQ.Transport
|
||||||
{
|
{
|
||||||
public interface ITransportFactory
|
public interface ITransportFactory
|
||||||
{
|
{
|
||||||
ITransport CreateTransport(Uri location);
|
ITransport CreateTransport(Uri location);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,50 +1,50 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2006 The Apache Software Foundation or its licensors, as
|
* Copyright 2006 The Apache Software Foundation or its licensors, as
|
||||||
* applicable.
|
* applicable.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
using ActiveMQ.Commands;
|
using ActiveMQ.Commands;
|
||||||
using ActiveMQ.Transport;
|
using ActiveMQ.Transport;
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace ActiveMQ.Transport
|
namespace ActiveMQ.Transport
|
||||||
{
|
{
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Transport filter that is used to log the commands sent and received.
|
/// A Transport filter that is used to log the commands sent and received.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class LoggingTransport : TransportFilter
|
public class LoggingTransport : TransportFilter
|
||||||
{
|
{
|
||||||
public LoggingTransport(ITransport next) : base(next) {
|
public LoggingTransport(ITransport next) : base(next) {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnCommand(ITransport sender, Command command) {
|
protected override void OnCommand(ITransport sender, Command command) {
|
||||||
Console.WriteLine("RECEIVED: " + command);
|
Console.WriteLine("RECEIVED: " + command);
|
||||||
this.commandHandler(sender, command);
|
this.commandHandler(sender, command);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnException(ITransport sender, Exception error) {
|
protected override void OnException(ITransport sender, Exception error) {
|
||||||
Console.WriteLine("RECEIVED Exception: " + error);
|
Console.WriteLine("RECEIVED Exception: " + error);
|
||||||
this.exceptionHandler(sender, error);
|
this.exceptionHandler(sender, error);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Oneway(Command command)
|
public override void Oneway(Command command)
|
||||||
{
|
{
|
||||||
Console.WriteLine("SENDING: " + command);
|
Console.WriteLine("SENDING: " + command);
|
||||||
this.next.Oneway(command);
|
this.next.Oneway(command);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,70 +1,70 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2006 The Apache Software Foundation or its licensors, as
|
* Copyright 2006 The Apache Software Foundation or its licensors, as
|
||||||
* applicable.
|
* applicable.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
using ActiveMQ.Commands;
|
using ActiveMQ.Commands;
|
||||||
using ActiveMQ.Transport;
|
using ActiveMQ.Transport;
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace ActiveMQ.Transport
|
namespace ActiveMQ.Transport
|
||||||
{
|
{
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Transport which gaurds access to the next transport using a mutex.
|
/// A Transport which gaurds access to the next transport using a mutex.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class MutexTransport : TransportFilter
|
public class MutexTransport : TransportFilter
|
||||||
{
|
{
|
||||||
|
|
||||||
private readonly object transmissionLock = new object();
|
private readonly object transmissionLock = new object();
|
||||||
|
|
||||||
public MutexTransport(ITransport next) : base(next) {
|
public MutexTransport(ITransport next) : base(next) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public override void Oneway(Command command)
|
public override void Oneway(Command command)
|
||||||
{
|
{
|
||||||
lock (transmissionLock)
|
lock (transmissionLock)
|
||||||
{
|
{
|
||||||
this.next.Oneway(command);
|
this.next.Oneway(command);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override FutureResponse AsyncRequest(Command command)
|
public override FutureResponse AsyncRequest(Command command)
|
||||||
{
|
{
|
||||||
lock (transmissionLock)
|
lock (transmissionLock)
|
||||||
{
|
{
|
||||||
return base.AsyncRequest(command);
|
return base.AsyncRequest(command);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override Response Request(Command command)
|
public override Response Request(Command command)
|
||||||
{
|
{
|
||||||
lock (transmissionLock)
|
lock (transmissionLock)
|
||||||
{
|
{
|
||||||
return base.Request(command);
|
return base.Request(command);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Dispose()
|
public override void Dispose()
|
||||||
{
|
{
|
||||||
lock (transmissionLock)
|
lock (transmissionLock)
|
||||||
{
|
{
|
||||||
base.Dispose();
|
base.Dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,104 +1,104 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2006 The Apache Software Foundation or its licensors, as
|
* Copyright 2006 The Apache Software Foundation or its licensors, as
|
||||||
* applicable.
|
* applicable.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
|
|
||||||
using ActiveMQ.Commands;
|
using ActiveMQ.Commands;
|
||||||
using ActiveMQ.Transport;
|
using ActiveMQ.Transport;
|
||||||
|
|
||||||
namespace ActiveMQ.Transport
|
namespace ActiveMQ.Transport
|
||||||
{
|
{
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Transport which gaurds access to the next transport using a mutex.
|
/// A Transport which gaurds access to the next transport using a mutex.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class ResponseCorrelator : TransportFilter
|
public class ResponseCorrelator : TransportFilter
|
||||||
{
|
{
|
||||||
|
|
||||||
private readonly IDictionary requestMap = Hashtable.Synchronized(new Hashtable());
|
private readonly IDictionary requestMap = Hashtable.Synchronized(new Hashtable());
|
||||||
private readonly Object mutex = new Object();
|
private readonly Object mutex = new Object();
|
||||||
private short nextCommandId;
|
private short nextCommandId;
|
||||||
|
|
||||||
public ResponseCorrelator(ITransport next) : base(next) {
|
public ResponseCorrelator(ITransport next) : base(next) {
|
||||||
}
|
}
|
||||||
|
|
||||||
short GetNextCommandId() {
|
short GetNextCommandId() {
|
||||||
lock(mutex) {
|
lock(mutex) {
|
||||||
return ++nextCommandId;
|
return ++nextCommandId;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Oneway(Command command)
|
public override void Oneway(Command command)
|
||||||
{
|
{
|
||||||
command.CommandId = GetNextCommandId();
|
command.CommandId = GetNextCommandId();
|
||||||
command.ResponseRequired = false;
|
command.ResponseRequired = false;
|
||||||
next.Oneway(command);
|
next.Oneway(command);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override FutureResponse AsyncRequest(Command command)
|
public override FutureResponse AsyncRequest(Command command)
|
||||||
{
|
{
|
||||||
command.CommandId = GetNextCommandId();
|
command.CommandId = GetNextCommandId();
|
||||||
command.ResponseRequired = true;
|
command.ResponseRequired = true;
|
||||||
FutureResponse future = new FutureResponse();
|
FutureResponse future = new FutureResponse();
|
||||||
requestMap[command.CommandId] = future;
|
requestMap[command.CommandId] = future;
|
||||||
next.Oneway(command);
|
next.Oneway(command);
|
||||||
return future;
|
return future;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override Response Request(Command command)
|
public override Response Request(Command command)
|
||||||
{
|
{
|
||||||
FutureResponse future = AsyncRequest(command);
|
FutureResponse future = AsyncRequest(command);
|
||||||
Response response = future.Response;
|
Response response = future.Response;
|
||||||
if (response is ExceptionResponse)
|
if (response is ExceptionResponse)
|
||||||
{
|
{
|
||||||
ExceptionResponse er = (ExceptionResponse) response;
|
ExceptionResponse er = (ExceptionResponse) response;
|
||||||
BrokerError brokerError = er.Exception;
|
BrokerError brokerError = er.Exception;
|
||||||
throw new BrokerException(brokerError);
|
throw new BrokerException(brokerError);
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnCommand(ITransport sender, Command command)
|
protected override void OnCommand(ITransport sender, Command command)
|
||||||
{
|
{
|
||||||
if( command is Response ) {
|
if( command is Response ) {
|
||||||
|
|
||||||
Response response = (Response) command;
|
Response response = (Response) command;
|
||||||
FutureResponse future = (FutureResponse) requestMap[response.CorrelationId];
|
FutureResponse future = (FutureResponse) requestMap[response.CorrelationId];
|
||||||
if (future != null)
|
if (future != null)
|
||||||
{
|
{
|
||||||
if (response is ExceptionResponse)
|
if (response is ExceptionResponse)
|
||||||
{
|
{
|
||||||
ExceptionResponse er = (ExceptionResponse) response;
|
ExceptionResponse er = (ExceptionResponse) response;
|
||||||
BrokerError brokerError = er.Exception;
|
BrokerError brokerError = er.Exception;
|
||||||
this.exceptionHandler(this, new BrokerException(brokerError));
|
this.exceptionHandler(this, new BrokerException(brokerError));
|
||||||
}
|
}
|
||||||
future.Response = response;
|
future.Response = response;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Console.WriteLine("ERROR: Unknown response ID: " + response.CommandId + " for response: " + response);
|
Console.WriteLine("ERROR: Unknown response ID: " + response.CommandId + " for response: " + response);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.commandHandler(sender, command);
|
this.commandHandler(sender, command);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,152 +1,152 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2006 The Apache Software Foundation or its licensors, as
|
* Copyright 2006 The Apache Software Foundation or its licensors, as
|
||||||
* applicable.
|
* applicable.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
using ActiveMQ;
|
using ActiveMQ;
|
||||||
using ActiveMQ.Commands;
|
using ActiveMQ.Commands;
|
||||||
using ActiveMQ.OpenWire;
|
using ActiveMQ.OpenWire;
|
||||||
using ActiveMQ.Transport;
|
using ActiveMQ.Transport;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Net.Sockets;
|
using System.Net.Sockets;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
|
||||||
namespace ActiveMQ.Transport.Tcp
|
namespace ActiveMQ.Transport.Tcp
|
||||||
{
|
{
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// An implementation of ITransport that uses sockets to communicate with the broker
|
/// An implementation of ITransport that uses sockets to communicate with the broker
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class TcpTransport : ITransport
|
public class TcpTransport : ITransport
|
||||||
{
|
{
|
||||||
private Socket socket;
|
private Socket socket;
|
||||||
private OpenWireFormat wireformat = new OpenWireFormat();
|
private OpenWireFormat wireformat = new OpenWireFormat();
|
||||||
private BinaryReader socketReader;
|
private BinaryReader socketReader;
|
||||||
private BinaryWriter socketWriter;
|
private BinaryWriter socketWriter;
|
||||||
private Thread readThread;
|
private Thread readThread;
|
||||||
private bool started;
|
private bool started;
|
||||||
volatile private bool closed;
|
volatile private bool closed;
|
||||||
|
|
||||||
private CommandHandler commandHandler;
|
private CommandHandler commandHandler;
|
||||||
private ExceptionHandler exceptionHandler;
|
private ExceptionHandler exceptionHandler;
|
||||||
|
|
||||||
public TcpTransport(Socket socket)
|
public TcpTransport(Socket socket)
|
||||||
{
|
{
|
||||||
this.socket = socket;
|
this.socket = socket;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Method Start
|
/// Method Start
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void Start()
|
public void Start()
|
||||||
{
|
{
|
||||||
if (!started)
|
if (!started)
|
||||||
{
|
{
|
||||||
if( commandHandler == null )
|
if( commandHandler == null )
|
||||||
throw new InvalidOperationException ("command cannot be null when Start is called.");
|
throw new InvalidOperationException ("command cannot be null when Start is called.");
|
||||||
if( exceptionHandler == null )
|
if( exceptionHandler == null )
|
||||||
throw new InvalidOperationException ("exception cannot be null when Start is called.");
|
throw new InvalidOperationException ("exception cannot be null when Start is called.");
|
||||||
|
|
||||||
started = true;
|
started = true;
|
||||||
|
|
||||||
NetworkStream networkStream = new NetworkStream(socket);
|
NetworkStream networkStream = new NetworkStream(socket);
|
||||||
socketWriter = new OpenWireBinaryWriter(networkStream);
|
socketWriter = new OpenWireBinaryWriter(networkStream);
|
||||||
socketReader = new OpenWireBinaryReader(networkStream);
|
socketReader = new OpenWireBinaryReader(networkStream);
|
||||||
|
|
||||||
// now lets create the background read thread
|
// now lets create the background read thread
|
||||||
readThread = new Thread(new ThreadStart(ReadLoop));
|
readThread = new Thread(new ThreadStart(ReadLoop));
|
||||||
readThread.Start();
|
readThread.Start();
|
||||||
|
|
||||||
// lets send the wireformat we're using
|
// lets send the wireformat we're using
|
||||||
WireFormatInfo info = new WireFormatInfo();
|
WireFormatInfo info = new WireFormatInfo();
|
||||||
info.StackTraceEnabled=false;
|
info.StackTraceEnabled=false;
|
||||||
info.TightEncodingEnabled=false;
|
info.TightEncodingEnabled=false;
|
||||||
info.TcpNoDelayEnabled=false;
|
info.TcpNoDelayEnabled=false;
|
||||||
info.CacheEnabled=false;
|
info.CacheEnabled=false;
|
||||||
info.SizePrefixDisabled=false;
|
info.SizePrefixDisabled=false;
|
||||||
|
|
||||||
Oneway(info);
|
Oneway(info);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Oneway(Command command)
|
public void Oneway(Command command)
|
||||||
{
|
{
|
||||||
wireformat.Marshal(command, socketWriter);
|
wireformat.Marshal(command, socketWriter);
|
||||||
socketWriter.Flush();
|
socketWriter.Flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
public FutureResponse AsyncRequest(Command command)
|
public FutureResponse AsyncRequest(Command command)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException("Use a ResponseCorrelator if you want to issue AsyncRequest calls");
|
throw new NotImplementedException("Use a ResponseCorrelator if you want to issue AsyncRequest calls");
|
||||||
}
|
}
|
||||||
|
|
||||||
public Response Request(Command command)
|
public Response Request(Command command)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException("Use a ResponseCorrelator if you want to issue Request calls");
|
throw new NotImplementedException("Use a ResponseCorrelator if you want to issue Request calls");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
closed = true;
|
closed = true;
|
||||||
socket.Close();
|
socket.Close();
|
||||||
readThread.Join();
|
readThread.Join();
|
||||||
socketWriter.Close();
|
socketWriter.Close();
|
||||||
socketReader.Close();
|
socketReader.Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ReadLoop()
|
public void ReadLoop()
|
||||||
{
|
{
|
||||||
while (!closed)
|
while (!closed)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Command command = (Command) wireformat.Unmarshal(socketReader);
|
Command command = (Command) wireformat.Unmarshal(socketReader);
|
||||||
this.commandHandler(this, command);
|
this.commandHandler(this, command);
|
||||||
}
|
}
|
||||||
catch (ObjectDisposedException)
|
catch (ObjectDisposedException)
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
catch ( Exception e) {
|
catch ( Exception e) {
|
||||||
if( e.GetBaseException() is ObjectDisposedException ) {
|
if( e.GetBaseException() is ObjectDisposedException ) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if( !closed ) {
|
if( !closed ) {
|
||||||
this.exceptionHandler(this,e);
|
this.exceptionHandler(this,e);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Implementation methods
|
// Implementation methods
|
||||||
|
|
||||||
public CommandHandler Command {
|
public CommandHandler Command {
|
||||||
get { return commandHandler; }
|
get { return commandHandler; }
|
||||||
set { this.commandHandler = value; }
|
set { this.commandHandler = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public ExceptionHandler Exception {
|
public ExceptionHandler Exception {
|
||||||
get { return exceptionHandler; }
|
get { return exceptionHandler; }
|
||||||
set { this.exceptionHandler = value; }
|
set { this.exceptionHandler = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,62 +1,62 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2006 The Apache Software Foundation or its licensors, as
|
* Copyright 2006 The Apache Software Foundation or its licensors, as
|
||||||
* applicable.
|
* applicable.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Net.Sockets;
|
using System.Net.Sockets;
|
||||||
using ActiveMQ.Transport;
|
using ActiveMQ.Transport;
|
||||||
|
|
||||||
namespace ActiveMQ.Transport.Tcp
|
namespace ActiveMQ.Transport.Tcp
|
||||||
{
|
{
|
||||||
public class TcpTransportFactory : ITransportFactory
|
public class TcpTransportFactory : ITransportFactory
|
||||||
{
|
{
|
||||||
public ITransport CreateTransport(Uri location) {
|
public ITransport CreateTransport(Uri location) {
|
||||||
|
|
||||||
// Console.WriteLine("Opening socket to: " + host + " on port: " + port);
|
// Console.WriteLine("Opening socket to: " + host + " on port: " + port);
|
||||||
Socket socket = Connect(location.Host, location.Port);
|
Socket socket = Connect(location.Host, location.Port);
|
||||||
ITransport rc = new TcpTransport(socket);
|
ITransport rc = new TcpTransport(socket);
|
||||||
// TODO: use URI query string to enable the LoggingTransport
|
// TODO: use URI query string to enable the LoggingTransport
|
||||||
rc = new LoggingTransport(rc);
|
rc = new LoggingTransport(rc);
|
||||||
rc = new ResponseCorrelator(rc);
|
rc = new ResponseCorrelator(rc);
|
||||||
rc = new MutexTransport(rc);
|
rc = new MutexTransport(rc);
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Socket Connect(string host, int port)
|
protected Socket Connect(string host, int port)
|
||||||
{
|
{
|
||||||
// Looping through the AddressList allows different type of connections to be tried
|
// Looping through the AddressList allows different type of connections to be tried
|
||||||
// (IPv4, IPv6 and whatever else may be available).
|
// (IPv4, IPv6 and whatever else may be available).
|
||||||
IPHostEntry hostEntry = Dns.Resolve(host);
|
IPHostEntry hostEntry = Dns.Resolve(host);
|
||||||
foreach (IPAddress address in hostEntry.AddressList)
|
foreach (IPAddress address in hostEntry.AddressList)
|
||||||
{
|
{
|
||||||
Socket socket = new Socket(
|
Socket socket = new Socket(
|
||||||
address.AddressFamily,
|
address.AddressFamily,
|
||||||
SocketType.Stream,
|
SocketType.Stream,
|
||||||
ProtocolType.Tcp);
|
ProtocolType.Tcp);
|
||||||
socket.Connect(new IPEndPoint(address, port));
|
socket.Connect(new IPEndPoint(address, port));
|
||||||
if (socket.Connected)
|
if (socket.Connected)
|
||||||
{
|
{
|
||||||
return socket;
|
return socket;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
throw new SocketException();
|
throw new SocketException();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,109 +1,109 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2006 The Apache Software Foundation or its licensors, as
|
* Copyright 2006 The Apache Software Foundation or its licensors, as
|
||||||
* applicable.
|
* applicable.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
using ActiveMQ.Commands;
|
using ActiveMQ.Commands;
|
||||||
using ActiveMQ.Transport;
|
using ActiveMQ.Transport;
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace ActiveMQ.Transport
|
namespace ActiveMQ.Transport
|
||||||
{
|
{
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Used to implement a filter on the transport layer.
|
/// Used to implement a filter on the transport layer.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class TransportFilter : ITransport
|
public class TransportFilter : ITransport
|
||||||
{
|
{
|
||||||
protected readonly ITransport next;
|
protected readonly ITransport next;
|
||||||
protected CommandHandler commandHandler;
|
protected CommandHandler commandHandler;
|
||||||
protected ExceptionHandler exceptionHandler;
|
protected ExceptionHandler exceptionHandler;
|
||||||
|
|
||||||
public TransportFilter(ITransport next) {
|
public TransportFilter(ITransport next) {
|
||||||
this.next = next;
|
this.next = next;
|
||||||
this.next.Command = new CommandHandler(OnCommand);
|
this.next.Command = new CommandHandler(OnCommand);
|
||||||
this.next.Exception = new ExceptionHandler(OnException);
|
this.next.Exception = new ExceptionHandler(OnException);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void OnCommand(ITransport sender, Command command) {
|
protected virtual void OnCommand(ITransport sender, Command command) {
|
||||||
this.commandHandler(sender, command);
|
this.commandHandler(sender, command);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void OnException(ITransport sender, Exception command) {
|
protected virtual void OnException(ITransport sender, Exception command) {
|
||||||
this.exceptionHandler(sender, command);
|
this.exceptionHandler(sender, command);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Method Oneway
|
/// Method Oneway
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="command">A Command</param>
|
/// <param name="command">A Command</param>
|
||||||
public virtual void Oneway(Command command)
|
public virtual void Oneway(Command command)
|
||||||
{
|
{
|
||||||
this.next.Oneway(command);
|
this.next.Oneway(command);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Method AsyncRequest
|
/// Method AsyncRequest
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>A FutureResponse</returns>
|
/// <returns>A FutureResponse</returns>
|
||||||
/// <param name="command">A Command</param>
|
/// <param name="command">A Command</param>
|
||||||
public virtual FutureResponse AsyncRequest(Command command)
|
public virtual FutureResponse AsyncRequest(Command command)
|
||||||
{
|
{
|
||||||
return this.next.AsyncRequest(command);
|
return this.next.AsyncRequest(command);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Method Request
|
/// Method Request
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>A Response</returns>
|
/// <returns>A Response</returns>
|
||||||
/// <param name="command">A Command</param>
|
/// <param name="command">A Command</param>
|
||||||
public virtual Response Request(Command command)
|
public virtual Response Request(Command command)
|
||||||
{
|
{
|
||||||
return this.next.Request(command);
|
return this.next.Request(command);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Method Start
|
/// Method Start
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public virtual void Start()
|
public virtual void Start()
|
||||||
{
|
{
|
||||||
if( commandHandler == null )
|
if( commandHandler == null )
|
||||||
throw new InvalidOperationException ("command cannot be null when Start is called.");
|
throw new InvalidOperationException ("command cannot be null when Start is called.");
|
||||||
if( exceptionHandler == null )
|
if( exceptionHandler == null )
|
||||||
throw new InvalidOperationException ("exception cannot be null when Start is called.");
|
throw new InvalidOperationException ("exception cannot be null when Start is called.");
|
||||||
this.next.Start();
|
this.next.Start();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Method Dispose
|
/// Method Dispose
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public virtual void Dispose()
|
public virtual void Dispose()
|
||||||
{
|
{
|
||||||
this.next.Dispose();
|
this.next.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
public CommandHandler Command {
|
public CommandHandler Command {
|
||||||
get { return commandHandler; }
|
get { return commandHandler; }
|
||||||
set { this.commandHandler = value; }
|
set { this.commandHandler = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public ExceptionHandler Exception {
|
public ExceptionHandler Exception {
|
||||||
get { return exceptionHandler; }
|
get { return exceptionHandler; }
|
||||||
set { this.exceptionHandler = value; }
|
set { this.exceptionHandler = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,33 +1,33 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2006 The Apache Software Foundation or its licensors, as
|
* Copyright 2006 The Apache Software Foundation or its licensors, as
|
||||||
* applicable.
|
* applicable.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
namespace NMS
|
namespace NMS
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a binary based message
|
/// Represents a binary based message
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IBytesMessage : IMessage
|
public interface IBytesMessage : IMessage
|
||||||
{
|
{
|
||||||
|
|
||||||
byte[] Content
|
byte[] Content
|
||||||
{
|
{
|
||||||
get;
|
get;
|
||||||
set;
|
set;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,38 +1,38 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2006 The Apache Software Foundation or its licensors, as
|
* Copyright 2006 The Apache Software Foundation or its licensors, as
|
||||||
* applicable.
|
* applicable.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
namespace NMS
|
namespace NMS
|
||||||
{
|
{
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Factory of IConnection objects
|
/// A Factory of IConnection objects
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IConnectionFactory
|
public interface IConnectionFactory
|
||||||
{
|
{
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a new connection
|
/// Creates a new connection
|
||||||
/// </summary>
|
/// </summary>
|
||||||
IConnection CreateConnection();
|
IConnection CreateConnection();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a new connection with the given user name and password
|
/// Creates a new connection with the given user name and password
|
||||||
/// </summary>
|
/// </summary>
|
||||||
IConnection CreateConnection(string userName, string password);
|
IConnection CreateConnection(string userName, string password);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,34 +1,34 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2006 The Apache Software Foundation or its licensors, as
|
* Copyright 2006 The Apache Software Foundation or its licensors, as
|
||||||
* applicable.
|
* applicable.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
namespace NMS
|
namespace NMS
|
||||||
{
|
{
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a Map message which contains key and value pairs which are
|
/// Represents a Map message which contains key and value pairs which are
|
||||||
/// of primitive types
|
/// of primitive types
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IMapMessage : IMessage
|
public interface IMapMessage : IMessage
|
||||||
{
|
{
|
||||||
IPrimitiveMap Body
|
IPrimitiveMap Body
|
||||||
{
|
{
|
||||||
get;
|
get;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,130 +1,130 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2006 The Apache Software Foundation or its licensors, as
|
* Copyright 2006 The Apache Software Foundation or its licensors, as
|
||||||
* applicable.
|
* applicable.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
namespace NMS
|
namespace NMS
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a message either to be sent to a message broker or received from a message broker
|
/// Represents a message either to be sent to a message broker or received from a message broker
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IMessage
|
public interface IMessage
|
||||||
{
|
{
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// If using client acknowledgement mode on the session then this method will acknowledge that the
|
/// If using client acknowledgement mode on the session then this method will acknowledge that the
|
||||||
/// message has been processed correctly.
|
/// message has been processed correctly.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void Acknowledge();
|
void Acknowledge();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Provides access to the message properties (headers)
|
/// Provides access to the message properties (headers)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
IPrimitiveMap Properties
|
IPrimitiveMap Properties
|
||||||
{
|
{
|
||||||
get;
|
get;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The correlation ID used to correlate messages from conversations or long running business processes
|
/// The correlation ID used to correlate messages from conversations or long running business processes
|
||||||
/// </summary>
|
/// </summary>
|
||||||
string NMSCorrelationID
|
string NMSCorrelationID
|
||||||
{
|
{
|
||||||
get;
|
get;
|
||||||
set;
|
set;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The destination of the message
|
/// The destination of the message
|
||||||
/// </summary>
|
/// </summary>
|
||||||
IDestination NMSDestination
|
IDestination NMSDestination
|
||||||
{
|
{
|
||||||
get;
|
get;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The time in milliseconds that this message should expire in
|
/// The time in milliseconds that this message should expire in
|
||||||
/// </summary>
|
/// </summary>
|
||||||
long NMSExpiration
|
long NMSExpiration
|
||||||
{
|
{
|
||||||
get;
|
get;
|
||||||
set;
|
set;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The message ID which is set by the provider
|
/// The message ID which is set by the provider
|
||||||
/// </summary>
|
/// </summary>
|
||||||
string NMSMessageId
|
string NMSMessageId
|
||||||
{
|
{
|
||||||
get;
|
get;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Whether or not this message is persistent
|
/// Whether or not this message is persistent
|
||||||
/// </summary>
|
/// </summary>
|
||||||
bool NMSPersistent
|
bool NMSPersistent
|
||||||
{
|
{
|
||||||
get;
|
get;
|
||||||
set;
|
set;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The Priority on this message
|
/// The Priority on this message
|
||||||
/// </summary>
|
/// </summary>
|
||||||
byte NMSPriority
|
byte NMSPriority
|
||||||
{
|
{
|
||||||
get;
|
get;
|
||||||
set;
|
set;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns true if this message has been redelivered to this or another consumer before being acknowledged successfully.
|
/// Returns true if this message has been redelivered to this or another consumer before being acknowledged successfully.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
bool NMSRedelivered
|
bool NMSRedelivered
|
||||||
{
|
{
|
||||||
get;
|
get;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The destination that the consumer of this message should send replies to
|
/// The destination that the consumer of this message should send replies to
|
||||||
/// </summary>
|
/// </summary>
|
||||||
IDestination NMSReplyTo
|
IDestination NMSReplyTo
|
||||||
{
|
{
|
||||||
get;
|
get;
|
||||||
set;
|
set;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The timestamp the broker added to the message
|
/// The timestamp the broker added to the message
|
||||||
/// </summary>
|
/// </summary>
|
||||||
long NMSTimestamp
|
long NMSTimestamp
|
||||||
{
|
{
|
||||||
get;
|
get;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The type name of this message
|
/// The type name of this message
|
||||||
/// </summary>
|
/// </summary>
|
||||||
string NMSType
|
string NMSType
|
||||||
{
|
{
|
||||||
get;
|
get;
|
||||||
set;
|
set;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,69 +1,69 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2006 The Apache Software Foundation or its licensors, as
|
* Copyright 2006 The Apache Software Foundation or its licensors, as
|
||||||
* applicable.
|
* applicable.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
namespace NMS
|
namespace NMS
|
||||||
{
|
{
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// An object capable of sending messages to some destination
|
/// An object capable of sending messages to some destination
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IMessageProducer : System.IDisposable
|
public interface IMessageProducer : System.IDisposable
|
||||||
{
|
{
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Sends the message to the default destination for this producer
|
/// Sends the message to the default destination for this producer
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void Send(IMessage message);
|
void Send(IMessage message);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Sends the message to the given destination
|
/// Sends the message to the given destination
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void Send(IDestination destination, IMessage message);
|
void Send(IDestination destination, IMessage message);
|
||||||
|
|
||||||
bool Persistent
|
bool Persistent
|
||||||
{
|
{
|
||||||
get;
|
get;
|
||||||
set;
|
set;
|
||||||
}
|
}
|
||||||
|
|
||||||
long TimeToLive
|
long TimeToLive
|
||||||
{
|
{
|
||||||
get;
|
get;
|
||||||
set;
|
set;
|
||||||
}
|
}
|
||||||
|
|
||||||
int Priority
|
int Priority
|
||||||
{
|
{
|
||||||
get;
|
get;
|
||||||
set;
|
set;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DisableMessageID
|
bool DisableMessageID
|
||||||
{
|
{
|
||||||
get;
|
get;
|
||||||
set;
|
set;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DisableMessageTimestamp
|
bool DisableMessageTimestamp
|
||||||
{
|
{
|
||||||
get;
|
get;
|
||||||
set;
|
set;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,32 +1,32 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2006 The Apache Software Foundation or its licensors, as
|
* Copyright 2006 The Apache Software Foundation or its licensors, as
|
||||||
* applicable.
|
* applicable.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
namespace NMS
|
namespace NMS
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Summary description for IQueue.
|
/// Summary description for IQueue.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IQueue : IDestination
|
public interface IQueue : IDestination
|
||||||
{
|
{
|
||||||
|
|
||||||
string QueueName
|
string QueueName
|
||||||
{
|
{
|
||||||
get;
|
get;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,123 +1,123 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2006 The Apache Software Foundation or its licensors, as
|
* Copyright 2006 The Apache Software Foundation or its licensors, as
|
||||||
* applicable.
|
* applicable.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
namespace NMS
|
namespace NMS
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a single unit of work on an IConnection.
|
/// Represents a single unit of work on an IConnection.
|
||||||
/// So the ISession can be used to perform transactional receive and sends
|
/// So the ISession can be used to perform transactional receive and sends
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface ISession : System.IDisposable
|
public interface ISession : System.IDisposable
|
||||||
{
|
{
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a producer of messages
|
/// Creates a producer of messages
|
||||||
/// </summary>
|
/// </summary>
|
||||||
IMessageProducer CreateProducer();
|
IMessageProducer CreateProducer();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a producer of messages on a given destination
|
/// Creates a producer of messages on a given destination
|
||||||
/// </summary>
|
/// </summary>
|
||||||
IMessageProducer CreateProducer(IDestination destination);
|
IMessageProducer CreateProducer(IDestination destination);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a consumer of messages on a given destination
|
/// Creates a consumer of messages on a given destination
|
||||||
/// </summary>
|
/// </summary>
|
||||||
IMessageConsumer CreateConsumer(IDestination destination);
|
IMessageConsumer CreateConsumer(IDestination destination);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a consumer of messages on a given destination with a selector
|
/// Creates a consumer of messages on a given destination with a selector
|
||||||
/// </summary>
|
/// </summary>
|
||||||
IMessageConsumer CreateConsumer(IDestination destination, string selector);
|
IMessageConsumer CreateConsumer(IDestination destination, string selector);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a named durable consumer of messages on a given destination with a selector
|
/// Creates a named durable consumer of messages on a given destination with a selector
|
||||||
/// </summary>
|
/// </summary>
|
||||||
IMessageConsumer CreateDurableConsumer(ITopic destination, string name, string selector, bool noLocal);
|
IMessageConsumer CreateDurableConsumer(ITopic destination, string name, string selector, bool noLocal);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the queue for the given name
|
/// Returns the queue for the given name
|
||||||
/// </summary>
|
/// </summary>
|
||||||
IQueue GetQueue(string name);
|
IQueue GetQueue(string name);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the topic for the given name
|
/// Returns the topic for the given name
|
||||||
/// </summary>
|
/// </summary>
|
||||||
ITopic GetTopic(string name);
|
ITopic GetTopic(string name);
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a temporary queue
|
/// Creates a temporary queue
|
||||||
/// </summary>
|
/// </summary>
|
||||||
ITemporaryQueue CreateTemporaryQueue();
|
ITemporaryQueue CreateTemporaryQueue();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a temporary topic
|
/// Creates a temporary topic
|
||||||
/// </summary>
|
/// </summary>
|
||||||
ITemporaryTopic CreateTemporaryTopic();
|
ITemporaryTopic CreateTemporaryTopic();
|
||||||
|
|
||||||
|
|
||||||
// Factory methods to create messages
|
// Factory methods to create messages
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a new message with an empty body
|
/// Creates a new message with an empty body
|
||||||
/// </summary>
|
/// </summary>
|
||||||
IMessage CreateMessage();
|
IMessage CreateMessage();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a new text message with an empty body
|
/// Creates a new text message with an empty body
|
||||||
/// </summary>
|
/// </summary>
|
||||||
ITextMessage CreateTextMessage();
|
ITextMessage CreateTextMessage();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a new text message with the given body
|
/// Creates a new text message with the given body
|
||||||
/// </summary>
|
/// </summary>
|
||||||
ITextMessage CreateTextMessage(string text);
|
ITextMessage CreateTextMessage(string text);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a new Map message which contains primitive key and value pairs
|
/// Creates a new Map message which contains primitive key and value pairs
|
||||||
/// </summary>
|
/// </summary>
|
||||||
IMapMessage CreateMapMessage();
|
IMapMessage CreateMapMessage();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a new binary message
|
/// Creates a new binary message
|
||||||
/// </summary>
|
/// </summary>
|
||||||
IBytesMessage CreateBytesMessage();
|
IBytesMessage CreateBytesMessage();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a new binary message with the given body
|
/// Creates a new binary message with the given body
|
||||||
/// </summary>
|
/// </summary>
|
||||||
IBytesMessage CreateBytesMessage(byte[] body);
|
IBytesMessage CreateBytesMessage(byte[] body);
|
||||||
|
|
||||||
|
|
||||||
// Transaction methods
|
// Transaction methods
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// If this is a transactional session then commit all message
|
/// If this is a transactional session then commit all message
|
||||||
/// send and acknowledgements for producers and consumers in this session
|
/// send and acknowledgements for producers and consumers in this session
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void Commit();
|
void Commit();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// If this is a transactional session then rollback all message
|
/// If this is a transactional session then rollback all message
|
||||||
/// send and acknowledgements for producers and consumers in this session
|
/// send and acknowledgements for producers and consumers in this session
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void Rollback();
|
void Rollback();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,28 +1,28 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2006 The Apache Software Foundation or its licensors, as
|
* Copyright 2006 The Apache Software Foundation or its licensors, as
|
||||||
* applicable.
|
* applicable.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
namespace NMS
|
namespace NMS
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Implemented by NMS objects that can be started.
|
/// Implemented by NMS objects that can be started.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IStartable
|
public interface IStartable
|
||||||
{
|
{
|
||||||
void Start();
|
void Start();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,27 +1,27 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2006 The Apache Software Foundation or its licensors, as
|
* Copyright 2006 The Apache Software Foundation or its licensors, as
|
||||||
* applicable.
|
* applicable.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
namespace NMS
|
namespace NMS
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Implemented by NMS objects that can be started.
|
/// Implemented by NMS objects that can be started.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IStoppable
|
public interface IStoppable
|
||||||
{
|
{
|
||||||
void Stop();
|
void Stop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,27 +1,27 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2006 The Apache Software Foundation or its licensors, as
|
* Copyright 2006 The Apache Software Foundation or its licensors, as
|
||||||
* applicable.
|
* applicable.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
namespace NMS
|
namespace NMS
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Summary description for ITemporaryQueue.
|
/// Summary description for ITemporaryQueue.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface ITemporaryQueue : IDestination
|
public interface ITemporaryQueue : IDestination
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,27 +1,27 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2006 The Apache Software Foundation or its licensors, as
|
* Copyright 2006 The Apache Software Foundation or its licensors, as
|
||||||
* applicable.
|
* applicable.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
namespace NMS
|
namespace NMS
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Summary description for TemporaryTopic.
|
/// Summary description for TemporaryTopic.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface ITemporaryTopic : IDestination
|
public interface ITemporaryTopic : IDestination
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,33 +1,33 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2006 The Apache Software Foundation or its licensors, as
|
* Copyright 2006 The Apache Software Foundation or its licensors, as
|
||||||
* applicable.
|
* applicable.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
namespace NMS
|
namespace NMS
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a text based message
|
/// Represents a text based message
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface ITextMessage : IMessage
|
public interface ITextMessage : IMessage
|
||||||
{
|
{
|
||||||
|
|
||||||
string Text
|
string Text
|
||||||
{
|
{
|
||||||
get;
|
get;
|
||||||
set;
|
set;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,32 +1,32 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2006 The Apache Software Foundation or its licensors, as
|
* Copyright 2006 The Apache Software Foundation or its licensors, as
|
||||||
* applicable.
|
* applicable.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
namespace NMS
|
namespace NMS
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Summary description for ITopic.
|
/// Summary description for ITopic.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface ITopic : IDestination
|
public interface ITopic : IDestination
|
||||||
{
|
{
|
||||||
|
|
||||||
string TopicName
|
string TopicName
|
||||||
{
|
{
|
||||||
get;
|
get;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,30 +1,30 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2006 The Apache Software Foundation or its licensors, as
|
* Copyright 2006 The Apache Software Foundation or its licensors, as
|
||||||
* applicable.
|
* applicable.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
namespace NMS
|
namespace NMS
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a connection failure.
|
/// Represents a connection failure.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class NMSConnectionException : NMSException
|
public class NMSConnectionException : NMSException
|
||||||
{
|
{
|
||||||
public NMSConnectionException(string message) : base(message)
|
public NMSConnectionException(string message) : base(message)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,30 +1,30 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2006 The Apache Software Foundation or its licensors, as
|
* Copyright 2006 The Apache Software Foundation or its licensors, as
|
||||||
* applicable.
|
* applicable.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
namespace NMS
|
namespace NMS
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a NMS exception
|
/// Represents a NMS exception
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class NMSException : System.Exception
|
public class NMSException : System.Exception
|
||||||
{
|
{
|
||||||
public NMSException(string message) : base(message)
|
public NMSException(string message) : base(message)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,63 +1,63 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2006 The Apache Software Foundation or its licensors, as
|
* Copyright 2006 The Apache Software Foundation or its licensors, as
|
||||||
* applicable.
|
* applicable.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
using ActiveMQ.Commands;
|
using ActiveMQ.Commands;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
|
|
||||||
|
|
||||||
namespace ActiveMQ.Commands
|
namespace ActiveMQ.Commands
|
||||||
{
|
{
|
||||||
[TestFixture]
|
[TestFixture]
|
||||||
public class CommandTest
|
public class CommandTest
|
||||||
{
|
{
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestCommand()
|
public void TestCommand()
|
||||||
{
|
{
|
||||||
ConsumerId value1 = new ConsumerId();
|
ConsumerId value1 = new ConsumerId();
|
||||||
value1.ConnectionId = "abc";
|
value1.ConnectionId = "abc";
|
||||||
value1.SessionId = 123;
|
value1.SessionId = 123;
|
||||||
value1.Value = 456;
|
value1.Value = 456;
|
||||||
|
|
||||||
ConsumerId value2 = new ConsumerId();
|
ConsumerId value2 = new ConsumerId();
|
||||||
value2.ConnectionId = "abc";
|
value2.ConnectionId = "abc";
|
||||||
value2.SessionId = 123;
|
value2.SessionId = 123;
|
||||||
value2.Value = 456;
|
value2.Value = 456;
|
||||||
|
|
||||||
ConsumerId value3 = new ConsumerId();
|
ConsumerId value3 = new ConsumerId();
|
||||||
value3.ConnectionId = "abc";
|
value3.ConnectionId = "abc";
|
||||||
value3.SessionId = 123;
|
value3.SessionId = 123;
|
||||||
value3.Value = 457;
|
value3.Value = 457;
|
||||||
|
|
||||||
Assert.AreEqual(value1, value2, "value1 and value2 should be equal");
|
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.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(!value1.Equals(value3), "value1 and value3 should not be equal");
|
||||||
Assert.IsTrue(!value3.Equals(value2), "value3 and value2 should not be equal");
|
Assert.IsTrue(!value3.Equals(value2), "value3 and value2 should not be equal");
|
||||||
|
|
||||||
// now lets test an IDictionary
|
// now lets test an IDictionary
|
||||||
IDictionary dictionary = new Hashtable();
|
IDictionary dictionary = new Hashtable();
|
||||||
dictionary[value1] = value3;
|
dictionary[value1] = value3;
|
||||||
|
|
||||||
// now lets lookup with a copy
|
// now lets lookup with a copy
|
||||||
object actual = dictionary[value2];
|
object actual = dictionary[value2];
|
||||||
|
|
||||||
Assert.AreEqual(value3, actual, "Should have found item in Map using value2 as a key");
|
Assert.AreEqual(value3, actual, "Should have found item in Map using value2 as a key");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,128 +1,128 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2006 The Apache Software Foundation or its licensors, as
|
* Copyright 2006 The Apache Software Foundation or its licensors, as
|
||||||
* applicable.
|
* applicable.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
|
||||||
namespace ActiveMQ.OpenWire
|
namespace ActiveMQ.OpenWire
|
||||||
{
|
{
|
||||||
[TestFixture]
|
[TestFixture]
|
||||||
public class BooleanStreamTest
|
public class BooleanStreamTest
|
||||||
{
|
{
|
||||||
protected int endOfStreamMarker = 0x12345678;
|
protected int endOfStreamMarker = 0x12345678;
|
||||||
int numberOfBytes = 8 * 200;
|
int numberOfBytes = 8 * 200;
|
||||||
|
|
||||||
public delegate bool GetBooleanValueDelegate(int index, int count);
|
public delegate bool GetBooleanValueDelegate(int index, int count);
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestBooleanMarshallingUsingAllTrue()
|
public void TestBooleanMarshallingUsingAllTrue()
|
||||||
{
|
{
|
||||||
DoTestBooleanStream(numberOfBytes, new GetBooleanValueDelegate(GetBooleanValueAllTrue));
|
DoTestBooleanStream(numberOfBytes, new GetBooleanValueDelegate(GetBooleanValueAllTrue));
|
||||||
}
|
}
|
||||||
public bool GetBooleanValueAllTrue(int index, int count)
|
public bool GetBooleanValueAllTrue(int index, int count)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestBooleanMarshallingUsingAllFalse()
|
public void TestBooleanMarshallingUsingAllFalse()
|
||||||
{
|
{
|
||||||
DoTestBooleanStream(numberOfBytes, new GetBooleanValueDelegate(GetBooleanValueAllFalse));
|
DoTestBooleanStream(numberOfBytes, new GetBooleanValueDelegate(GetBooleanValueAllFalse));
|
||||||
}
|
}
|
||||||
public bool GetBooleanValueAllFalse(int index, int count)
|
public bool GetBooleanValueAllFalse(int index, int count)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestBooleanMarshallingUsingAlternateTrueFalse()
|
public void TestBooleanMarshallingUsingAlternateTrueFalse()
|
||||||
{
|
{
|
||||||
DoTestBooleanStream(numberOfBytes, new GetBooleanValueDelegate(GetBooleanValueAlternateTrueFalse));
|
DoTestBooleanStream(numberOfBytes, new GetBooleanValueDelegate(GetBooleanValueAlternateTrueFalse));
|
||||||
}
|
}
|
||||||
public bool GetBooleanValueAlternateTrueFalse(int index, int count)
|
public bool GetBooleanValueAlternateTrueFalse(int index, int count)
|
||||||
{
|
{
|
||||||
return (index & 1) == 0;
|
return (index & 1) == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestBooleanMarshallingUsingAlternateFalseTrue()
|
public void TestBooleanMarshallingUsingAlternateFalseTrue()
|
||||||
{
|
{
|
||||||
DoTestBooleanStream(numberOfBytes, new GetBooleanValueDelegate(GetBooleanValueAlternateFalseTrue));
|
DoTestBooleanStream(numberOfBytes, new GetBooleanValueDelegate(GetBooleanValueAlternateFalseTrue));
|
||||||
}
|
}
|
||||||
public bool GetBooleanValueAlternateFalseTrue(int index, int count)
|
public bool GetBooleanValueAlternateFalseTrue(int index, int count)
|
||||||
{
|
{
|
||||||
return (index & 1) != 0;
|
return (index & 1) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void DoTestBooleanStream(int numberOfBytes, GetBooleanValueDelegate valueDelegate)
|
protected void DoTestBooleanStream(int numberOfBytes, GetBooleanValueDelegate valueDelegate)
|
||||||
{
|
{
|
||||||
for (int i = 1017; i < numberOfBytes; i++)
|
for (int i = 1017; i < numberOfBytes; i++)
|
||||||
{
|
{
|
||||||
AssertMarshalBooleans(i, valueDelegate);
|
AssertMarshalBooleans(i, valueDelegate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void AssertMarshalBooleans(int count, GetBooleanValueDelegate valueDelegate)
|
protected void AssertMarshalBooleans(int count, GetBooleanValueDelegate valueDelegate)
|
||||||
{
|
{
|
||||||
BooleanStream bs = new BooleanStream();
|
BooleanStream bs = new BooleanStream();
|
||||||
for (int i = 0; i < count; i++)
|
for (int i = 0; i < count; i++)
|
||||||
{
|
{
|
||||||
bs.WriteBoolean(valueDelegate(i, count));
|
bs.WriteBoolean(valueDelegate(i, count));
|
||||||
}
|
}
|
||||||
MemoryStream buffer = new MemoryStream();
|
MemoryStream buffer = new MemoryStream();
|
||||||
BinaryWriter ds = new OpenWireBinaryWriter(buffer);
|
BinaryWriter ds = new OpenWireBinaryWriter(buffer);
|
||||||
bs.Marshal(ds);
|
bs.Marshal(ds);
|
||||||
ds.Write(endOfStreamMarker);
|
ds.Write(endOfStreamMarker);
|
||||||
|
|
||||||
// now lets read from the stream
|
// now lets read from the stream
|
||||||
|
|
||||||
MemoryStream ins = new MemoryStream(buffer.ToArray());
|
MemoryStream ins = new MemoryStream(buffer.ToArray());
|
||||||
BinaryReader dis = new OpenWireBinaryReader(ins);
|
BinaryReader dis = new OpenWireBinaryReader(ins);
|
||||||
bs = new BooleanStream();
|
bs = new BooleanStream();
|
||||||
bs.Unmarshal(dis);
|
bs.Unmarshal(dis);
|
||||||
|
|
||||||
for (int i = 0; i < count; i++)
|
for (int i = 0; i < count; i++)
|
||||||
{
|
{
|
||||||
bool expected = valueDelegate(i, count);
|
bool expected = valueDelegate(i, count);
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
bool actual = bs.ReadBoolean();
|
bool actual = bs.ReadBoolean();
|
||||||
Assert.AreEqual(expected, actual);
|
Assert.AreEqual(expected, actual);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Assert.Fail("Failed to parse bool: " + i + " out of: " + count + " due to: " + e);
|
Assert.Fail("Failed to parse bool: " + i + " out of: " + count + " due to: " + e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int marker = dis.ReadInt32();
|
int marker = dis.ReadInt32();
|
||||||
Assert.AreEqual(endOfStreamMarker, marker, "did not match: "+endOfStreamMarker+" and "+marker);
|
Assert.AreEqual(endOfStreamMarker, marker, "did not match: "+endOfStreamMarker+" and "+marker);
|
||||||
|
|
||||||
// lets try read and we should get an exception
|
// lets try read and we should get an exception
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
dis.ReadByte();
|
dis.ReadByte();
|
||||||
Assert.Fail("Should have reached the end of the stream");
|
Assert.Fail("Should have reached the end of the stream");
|
||||||
}
|
}
|
||||||
catch (IOException)
|
catch (IOException)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,77 +1,77 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2006 The Apache Software Foundation or its licensors, as
|
* Copyright 2006 The Apache Software Foundation or its licensors, as
|
||||||
* applicable.
|
* applicable.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
using ActiveMQ.Commands;
|
using ActiveMQ.Commands;
|
||||||
using NMS;
|
using NMS;
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace ActiveMQ
|
namespace ActiveMQ
|
||||||
{
|
{
|
||||||
public class TestMain
|
public class TestMain
|
||||||
{
|
{
|
||||||
public static void Main(string[] args)
|
public static void Main(string[] args)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Console.WriteLine("About to connect to ActiveMQ");
|
Console.WriteLine("About to connect to ActiveMQ");
|
||||||
|
|
||||||
// START SNIPPET: demo
|
// START SNIPPET: demo
|
||||||
IConnectionFactory factory = new ConnectionFactory(new Uri("tcp://localhost:61616"));
|
IConnectionFactory factory = new ConnectionFactory(new Uri("tcp://localhost:61616"));
|
||||||
using (IConnection connection = factory.CreateConnection())
|
using (IConnection connection = factory.CreateConnection())
|
||||||
{
|
{
|
||||||
Console.WriteLine("Created a connection!");
|
Console.WriteLine("Created a connection!");
|
||||||
|
|
||||||
ISession session = connection.CreateSession();
|
ISession session = connection.CreateSession();
|
||||||
|
|
||||||
IDestination destination = session.GetQueue("FOO.BAR");
|
IDestination destination = session.GetQueue("FOO.BAR");
|
||||||
Console.WriteLine("Using destination: " + destination);
|
Console.WriteLine("Using destination: " + destination);
|
||||||
|
|
||||||
// lets create a consumer and producer
|
// lets create a consumer and producer
|
||||||
IMessageConsumer consumer = session.CreateConsumer(destination);
|
IMessageConsumer consumer = session.CreateConsumer(destination);
|
||||||
|
|
||||||
IMessageProducer producer = session.CreateProducer(destination);
|
IMessageProducer producer = session.CreateProducer(destination);
|
||||||
producer.Persistent = true;
|
producer.Persistent = true;
|
||||||
|
|
||||||
// lets send a message
|
// lets send a message
|
||||||
ITextMessage request = session.CreateTextMessage("Hello World!");
|
ITextMessage request = session.CreateTextMessage("Hello World!");
|
||||||
request.NMSCorrelationID = "abc";
|
request.NMSCorrelationID = "abc";
|
||||||
request.Properties["JMSXGroupID"] = "cheese";
|
request.Properties["JMSXGroupID"] = "cheese";
|
||||||
request.Properties["myHeader"] = "James";
|
request.Properties["myHeader"] = "James";
|
||||||
|
|
||||||
producer.Send(request);
|
producer.Send(request);
|
||||||
|
|
||||||
// lets consume a message
|
// lets consume a message
|
||||||
ActiveMQTextMessage message = (ActiveMQTextMessage) consumer.Receive();
|
ActiveMQTextMessage message = (ActiveMQTextMessage) consumer.Receive();
|
||||||
if (message == null)
|
if (message == null)
|
||||||
{
|
{
|
||||||
Console.WriteLine("No message received!");
|
Console.WriteLine("No message received!");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Console.WriteLine("Received message with ID: " + message.NMSMessageId);
|
Console.WriteLine("Received message with ID: " + message.NMSMessageId);
|
||||||
Console.WriteLine("Received message with text: " + message.Text);
|
Console.WriteLine("Received message with text: " + message.Text);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// END SNIPPET: demo
|
// END SNIPPET: demo
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Console.WriteLine("Caught: " + e);
|
Console.WriteLine("Caught: " + e);
|
||||||
Console.WriteLine("Stack: " + e.StackTrace);
|
Console.WriteLine("Stack: " + e.StackTrace);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue