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:
Hiram R. Chirino 2006-03-21 23:20:55 +00:00
parent 261b455078
commit aecbd1c3f2
111 changed files with 9855 additions and 5432 deletions

View File

@ -1,75 +1,75 @@
/**
*
* Copyright 2005-2006 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
**/
package org.apache.activecluster.impl;
import javax.jms.Destination;
import javax.jms.JMSException;
import javax.jms.Queue;
import javax.jms.Topic;
import org.apache.activecluster.DestinationMarshaller;
import org.apache.activemq.command.ActiveMQTopic;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
* A simple marshaller for Destinations
*
* @version $Revision: 1.5 $
*/
public class SimpleDestinationMarshaller implements DestinationMarshaller {
private final static Log log = LogFactory.getLog(SimpleDestinationMarshaller.class);
/**
* Builds a destination from a destinationName
* @param destinationName
*
* @return the destination to send messages to all members of the cluster
*/
public Destination getDestination(String destinationName){
return new ActiveMQTopic(destinationName);
}
/**
* Gets a destination's physical name
* @param destination
* @return the destination's physical name
*/
public String getDestinationName(Destination destination){
String result = null;
if (destination != null){
if (destination instanceof Topic){
Topic topic = (Topic) destination;
try{
result = topic.getTopicName();
}catch(JMSException e){
log.error("Failed to get topic name for " + destination,e);
}
}else{
Queue queue = (Queue) destination;
try{
result = queue.getQueueName();
}catch(JMSException e){
log.error("Failed to get queue name for " + destination,e);
}
}
}
return result;
}
/**
*
* Copyright 2005-2006 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
**/
package org.apache.activecluster.impl;
import javax.jms.Destination;
import javax.jms.JMSException;
import javax.jms.Queue;
import javax.jms.Topic;
import org.apache.activecluster.DestinationMarshaller;
import org.apache.activemq.command.ActiveMQTopic;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
* A simple marshaller for Destinations
*
* @version $Revision: 1.5 $
*/
public class SimpleDestinationMarshaller implements DestinationMarshaller {
private final static Log log = LogFactory.getLog(SimpleDestinationMarshaller.class);
/**
* Builds a destination from a destinationName
* @param destinationName
*
* @return the destination to send messages to all members of the cluster
*/
public Destination getDestination(String destinationName){
return new ActiveMQTopic(destinationName);
}
/**
* Gets a destination's physical name
* @param destination
* @return the destination's physical name
*/
public String getDestinationName(Destination destination){
String result = null;
if (destination != null){
if (destination instanceof Topic){
Topic topic = (Topic) destination;
try{
result = topic.getTopicName();
}catch(JMSException e){
log.error("Failed to get topic name for " + destination,e);
}
}else{
Queue queue = (Queue) destination;
try{
result = queue.getQueueName();
}catch(JMSException e){
log.error("Failed to get queue name for " + destination,e);
}
}
}
return result;
}
}

View File

@ -1,84 +1,84 @@
/**
*
* Copyright 2005-2006 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.activemq.broker.jmx;
import java.util.Map;
import javax.management.openmbean.CompositeData;
import javax.management.openmbean.OpenDataException;
import javax.management.openmbean.TabularData;
public interface DestinationViewMBean {
/**
* Resets the managment counters.
*/
public void resetStatistics();
/**
* @return The number of messages that have been sent to the destination.
*/
public long getEnqueueCount();
/**
* @return The number of messages that have been received from the destination.
*/
public long getDequeueCount();
/**
* @return The number of consmers subscribed to messages from this destination.
*/
public long getConsumerCount();
/**
* @return The number of messages being buffered by this destination
*/
public long getQueueSize();
/**
* @return An array of all the messages in the destination's queue.
*/
public CompositeData[] browse() throws OpenDataException;
/**
* @return A list of all the messages in the destination's queue.
*/
public TabularData browseAsTable() throws OpenDataException;
/**
* Sends a TextMesage to the destination.
* @param body the text to send
* @return the message id of the message sent.
* @throws Exception
*/
public String sendTextMessage(String body) throws Exception;
/**
* Sends a TextMesage to the destination.
* @param headers the message headers and properties to set. Can only container Strings maped to primitive types.
* @param body the text to send
* @return the message id of the message sent.
* @throws Exception
*/
public String sendTextMessage(Map headers, String body) throws Exception;
public int getMemoryPercentageUsed();
public long getMemoryLimit();
public void setMemoryLimit(long limit);
/**
*
* Copyright 2005-2006 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.activemq.broker.jmx;
import java.util.Map;
import javax.management.openmbean.CompositeData;
import javax.management.openmbean.OpenDataException;
import javax.management.openmbean.TabularData;
public interface DestinationViewMBean {
/**
* Resets the managment counters.
*/
public void resetStatistics();
/**
* @return The number of messages that have been sent to the destination.
*/
public long getEnqueueCount();
/**
* @return The number of messages that have been received from the destination.
*/
public long getDequeueCount();
/**
* @return The number of consmers subscribed to messages from this destination.
*/
public long getConsumerCount();
/**
* @return The number of messages being buffered by this destination
*/
public long getQueueSize();
/**
* @return An array of all the messages in the destination's queue.
*/
public CompositeData[] browse() throws OpenDataException;
/**
* @return A list of all the messages in the destination's queue.
*/
public TabularData browseAsTable() throws OpenDataException;
/**
* Sends a TextMesage to the destination.
* @param body the text to send
* @return the message id of the message sent.
* @throws Exception
*/
public String sendTextMessage(String body) throws Exception;
/**
* Sends a TextMesage to the destination.
* @param headers the message headers and properties to set. Can only container Strings maped to primitive types.
* @param body the text to send
* @return the message id of the message sent.
* @throws Exception
*/
public String sendTextMessage(Map headers, String body) throws Exception;
public int getMemoryPercentageUsed();
public long getMemoryLimit();
public void setMemoryLimit(long limit);
}

View File

@ -1,47 +1,47 @@
/**
*
* Copyright 2005-2006 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package org.apache.activemq.kaha;
import java.io.File;
import java.io.IOException;
import org.apache.activemq.kaha.impl.StoreImpl;
/**
* Factory for creating stores
*
* @version $Revision: 1.2 $
*/
public class StoreFactory{
/**
* open or create a Store
* @param name
* @param mode
* @return the opened/created store
* @throws IOException
*/
public static Store open(String name,String mode) throws IOException{
return new StoreImpl(name,mode);
}
/**
* Delete a database
* @param name of the database
* @return true if successful
*/
public static boolean delete(String name){
File file = new File(name);
return file.delete();
}
}
/**
*
* Copyright 2005-2006 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package org.apache.activemq.kaha;
import java.io.File;
import java.io.IOException;
import org.apache.activemq.kaha.impl.StoreImpl;
/**
* Factory for creating stores
*
* @version $Revision: 1.2 $
*/
public class StoreFactory{
/**
* open or create a Store
* @param name
* @param mode
* @return the opened/created store
* @throws IOException
*/
public static Store open(String name,String mode) throws IOException{
return new StoreImpl(name,mode);
}
/**
* Delete a database
* @param name of the database
* @return true if successful
*/
public static boolean delete(String name){
File file = new File(name);
return file.delete();
}
}

View File

@ -1,50 +1,50 @@
/**
*
* Copyright 2005-2006 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package org.apache.activemq.kaha.impl;
import java.util.Map;
import org.apache.activemq.kaha.MapContainer;
/**
* Map.Entry implementation for a container
*
* @version $Revision: 1.2 $
*/
class ContainerMapEntry implements Map.Entry {
private MapContainer container;
private Object key;
ContainerMapEntry(MapContainer container,Object key){
this.container = container;
this.key = key;
}
public Object getKey(){
return key;
}
public Object getValue(){
return container.get(key);
}
public Object setValue(Object value){
return container.put(key, value);
}
}
/**
*
* Copyright 2005-2006 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package org.apache.activemq.kaha.impl;
import java.util.Map;
import org.apache.activemq.kaha.MapContainer;
/**
* Map.Entry implementation for a container
*
* @version $Revision: 1.2 $
*/
class ContainerMapEntry implements Map.Entry {
private MapContainer container;
private Object key;
ContainerMapEntry(MapContainer container,Object key){
this.container = container;
this.key = key;
}
public Object getKey(){
return key;
}
public Object getValue(){
return container.get(key);
}
public Object setValue(Object value){
return container.put(key, value);
}
}

View File

@ -1,162 +1,162 @@
/**
*
* Copyright 2005-2006 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package org.apache.activemq.kaha.impl;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
* Free space list in the Store
*
* @version $Revision: 1.2 $
*/
final class FreeSpaceManager{
private static final Log log = LogFactory.getLog(FreeSpaceManager.class);
static final int ROOT_SIZE=64;
static final int RESIZE_INCREMENT=4096*1024;
private Map map=new HashMap();
private Map prevMap=new HashMap();
private FreeSpaceTree tree=new FreeSpaceTree();
private StoreWriter writer;
private StoreReader reader;
private long dataEnd=ROOT_SIZE;
private long fileLength=-1;
FreeSpaceManager(StoreWriter writer,StoreReader reader) throws IOException{
this.writer=writer;
this.reader=reader;
this.fileLength=reader.length();
}
final Item getFreeSpace(Item item) throws IOException{
Item result=tree.getNextFreeSpace(item);
if(result==null){
while(dataEnd>=fileLength){
writer.allocateSpace(fileLength+RESIZE_INCREMENT);
fileLength=reader.length();
}
result=new Item();
result.setOffset(dataEnd);
int newSize = ((item.getSize()/8)+1)*8;
result.setSize(newSize);
dataEnd=dataEnd+result.getSize()+Item.HEAD_SIZE;
}else{
removeFreeSpace(result);
}
// reset the item
item.setActive(true);
item.setOffset(result.getOffset());
item.setSize(result.getSize());
return item;
}
final void addFreeSpace(Item item) throws IOException{
long currentOffset=reader.position();
reader.readHeader(item);
item.setActive(false);
// see if we can condense some space together
// first look for free space adjacent up the disk
Long nextKey=new Long(item.getOffset()+item.getSize()+Item.HEAD_SIZE);
Item next=(Item) map.remove(nextKey);
if(next!=null){
tree.removeItem(next);
Long prevKey=new Long(next.getOffset()+next.getSize()+Item.HEAD_SIZE);
prevMap.remove(prevKey);
int newSize=item.getSize()+next.getSize()+Item.HEAD_SIZE;
item.setSize(newSize);
}
// now see if there was a previous item
// in the next map
Long key=new Long(item.getOffset());
Item prev=(Item) prevMap.remove(key);
Long prevKey=prev!=null?new Long(prev.getOffset()):null;
if(prev!=null&&prevKey!=null){
// we can condense the free space
// first we are about to change the item so remove it from the tree
tree.removeItem(prev);
int newSize=prev.getSize()+item.getSize()+Item.HEAD_SIZE;
prev.setSize(newSize);
// update the header
writer.updateHeader(prev);
// put back in the tree
tree.addItem(prev);
}else{
// update the item header
writer.updateHeader(item);
tree.addItem(item);
map.put(key,item);
prevKey=new Long(item.getOffset()+item.getSize()+Item.HEAD_SIZE);
prevMap.put(prevKey,item);
}
reader.position(currentOffset);
}
/**
* validates and builds free list
*
* @throws IOException
*/
final void scanStoredItems() throws IOException{
if(reader.length()>ROOT_SIZE){
long offset=ROOT_SIZE;
while((offset+Item.HEAD_SIZE)<reader.length()){
Item item=new Item();
try{
reader.position(offset);
item.setOffset(offset);
reader.readHeader(item);
}catch(BadMagicException e){
log.error("Got bad magic reading stored items",e);
break;
}
if(item.getSize()>=0){
if(!item.isActive()){
addFreeSpace(item);
}
offset+=item.getSize()+Item.HEAD_SIZE;
}else{
// we've hit free space or end of file
break;
}
}
dataEnd=offset;
}else {
dataEnd = ROOT_SIZE;
}
}
private void removeFreeSpace(Item item){
if(item!=null){
long next=item.getOffset()+item.getSize()+Item.HEAD_SIZE;
Long nextKey=new Long(next);
prevMap.remove(nextKey);
Long key=new Long(item.getOffset());
map.remove(key);
}
}
void dump(PrintWriter printer){
printer.println("FreeSpace: map size = "+map.size()+", tree size = "+tree.size()+", prevMap size = "
+prevMap.size());
for(Iterator i=map.entrySet().iterator();i.hasNext();){
printer.println("map = "+i.next());
}
}
}
/**
*
* Copyright 2005-2006 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package org.apache.activemq.kaha.impl;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
* Free space list in the Store
*
* @version $Revision: 1.2 $
*/
final class FreeSpaceManager{
private static final Log log = LogFactory.getLog(FreeSpaceManager.class);
static final int ROOT_SIZE=64;
static final int RESIZE_INCREMENT=4096*1024;
private Map map=new HashMap();
private Map prevMap=new HashMap();
private FreeSpaceTree tree=new FreeSpaceTree();
private StoreWriter writer;
private StoreReader reader;
private long dataEnd=ROOT_SIZE;
private long fileLength=-1;
FreeSpaceManager(StoreWriter writer,StoreReader reader) throws IOException{
this.writer=writer;
this.reader=reader;
this.fileLength=reader.length();
}
final Item getFreeSpace(Item item) throws IOException{
Item result=tree.getNextFreeSpace(item);
if(result==null){
while(dataEnd>=fileLength){
writer.allocateSpace(fileLength+RESIZE_INCREMENT);
fileLength=reader.length();
}
result=new Item();
result.setOffset(dataEnd);
int newSize = ((item.getSize()/8)+1)*8;
result.setSize(newSize);
dataEnd=dataEnd+result.getSize()+Item.HEAD_SIZE;
}else{
removeFreeSpace(result);
}
// reset the item
item.setActive(true);
item.setOffset(result.getOffset());
item.setSize(result.getSize());
return item;
}
final void addFreeSpace(Item item) throws IOException{
long currentOffset=reader.position();
reader.readHeader(item);
item.setActive(false);
// see if we can condense some space together
// first look for free space adjacent up the disk
Long nextKey=new Long(item.getOffset()+item.getSize()+Item.HEAD_SIZE);
Item next=(Item) map.remove(nextKey);
if(next!=null){
tree.removeItem(next);
Long prevKey=new Long(next.getOffset()+next.getSize()+Item.HEAD_SIZE);
prevMap.remove(prevKey);
int newSize=item.getSize()+next.getSize()+Item.HEAD_SIZE;
item.setSize(newSize);
}
// now see if there was a previous item
// in the next map
Long key=new Long(item.getOffset());
Item prev=(Item) prevMap.remove(key);
Long prevKey=prev!=null?new Long(prev.getOffset()):null;
if(prev!=null&&prevKey!=null){
// we can condense the free space
// first we are about to change the item so remove it from the tree
tree.removeItem(prev);
int newSize=prev.getSize()+item.getSize()+Item.HEAD_SIZE;
prev.setSize(newSize);
// update the header
writer.updateHeader(prev);
// put back in the tree
tree.addItem(prev);
}else{
// update the item header
writer.updateHeader(item);
tree.addItem(item);
map.put(key,item);
prevKey=new Long(item.getOffset()+item.getSize()+Item.HEAD_SIZE);
prevMap.put(prevKey,item);
}
reader.position(currentOffset);
}
/**
* validates and builds free list
*
* @throws IOException
*/
final void scanStoredItems() throws IOException{
if(reader.length()>ROOT_SIZE){
long offset=ROOT_SIZE;
while((offset+Item.HEAD_SIZE)<reader.length()){
Item item=new Item();
try{
reader.position(offset);
item.setOffset(offset);
reader.readHeader(item);
}catch(BadMagicException e){
log.error("Got bad magic reading stored items",e);
break;
}
if(item.getSize()>=0){
if(!item.isActive()){
addFreeSpace(item);
}
offset+=item.getSize()+Item.HEAD_SIZE;
}else{
// we've hit free space or end of file
break;
}
}
dataEnd=offset;
}else {
dataEnd = ROOT_SIZE;
}
}
private void removeFreeSpace(Item item){
if(item!=null){
long next=item.getOffset()+item.getSize()+Item.HEAD_SIZE;
Long nextKey=new Long(next);
prevMap.remove(nextKey);
Long key=new Long(item.getOffset());
map.remove(key);
}
}
void dump(PrintWriter printer){
printer.println("FreeSpace: map size = "+map.size()+", tree size = "+tree.size()+", prevMap size = "
+prevMap.size());
for(Iterator i=map.entrySet().iterator();i.hasNext();){
printer.println("map = "+i.next());
}
}
}

View File

@ -1,109 +1,109 @@
/**
*
* Copyright 2005-2006 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package org.apache.activemq.kaha.impl;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.SortedMap;
import java.util.TreeMap;
/**
* A a wrapper for a TreeMap of free Items - sorted by size This enables us to re-use free Items on disk
*
* @version $Revision: 1.2 $
*/
class FreeSpaceTree{
private Map sizeMap=new HashMap();
private TreeMap tree=new TreeMap();
void addItem(Item item){
Long sizeKey=new Long(item.getSize());
Item old=(Item) tree.put(sizeKey,item);
if(old!=null){
// We'll preserve old items to reuse
List list=(List) sizeMap.get(sizeKey);
if(list==null){
list=new ArrayList();
sizeMap.put(sizeKey,list);
}
list.add(old);
}
}
boolean removeItem(Item item){
boolean result=false;
Long sizeKey=new Long(item.getSize());
Item retrieved=(Item) tree.get(sizeKey);
if(retrieved==item){
Object foo=tree.remove(sizeKey);
if(foo!=retrieved){
Thread.dumpStack();
System.exit(0);
}
result=true;
reconfigureTree(sizeKey);
}else{
List list=(List) sizeMap.get(sizeKey);
if(list!=null){
boolean foo=list.remove(item);
if(list.isEmpty()){
sizeMap.remove(sizeKey);
}
}
}
return result;
}
Item getNextFreeSpace(Item item){
Item result=null;
if(!tree.isEmpty()){
Long sizeKey=new Long(item.getSize());
SortedMap map=tree.tailMap(sizeKey);
if(map!=null&&!map.isEmpty()){
Long resultKey=(Long) map.firstKey();
result=(Item) map.get(resultKey);
if(result!=null){
// remove from the tree
tree.remove(resultKey);
reconfigureTree(resultKey);
}
}
}
return result;
}
void reconfigureTree(Long sizeKey){
List list=(List) sizeMap.get(sizeKey);
if(list!=null){
if(!list.isEmpty()){
Object newItem=list.remove(list.size()-1);
tree.put(sizeKey,newItem);
}
if(list.isEmpty()){
sizeMap.remove(sizeKey);
}
}
}
int size(){
int result=0;
for(Iterator i=sizeMap.values().iterator();i.hasNext();){
List list=(List) i.next();
result+=list.size();
}
return result+tree.size();
}
/**
*
* Copyright 2005-2006 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package org.apache.activemq.kaha.impl;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.SortedMap;
import java.util.TreeMap;
/**
* A a wrapper for a TreeMap of free Items - sorted by size This enables us to re-use free Items on disk
*
* @version $Revision: 1.2 $
*/
class FreeSpaceTree{
private Map sizeMap=new HashMap();
private TreeMap tree=new TreeMap();
void addItem(Item item){
Long sizeKey=new Long(item.getSize());
Item old=(Item) tree.put(sizeKey,item);
if(old!=null){
// We'll preserve old items to reuse
List list=(List) sizeMap.get(sizeKey);
if(list==null){
list=new ArrayList();
sizeMap.put(sizeKey,list);
}
list.add(old);
}
}
boolean removeItem(Item item){
boolean result=false;
Long sizeKey=new Long(item.getSize());
Item retrieved=(Item) tree.get(sizeKey);
if(retrieved==item){
Object foo=tree.remove(sizeKey);
if(foo!=retrieved){
Thread.dumpStack();
System.exit(0);
}
result=true;
reconfigureTree(sizeKey);
}else{
List list=(List) sizeMap.get(sizeKey);
if(list!=null){
boolean foo=list.remove(item);
if(list.isEmpty()){
sizeMap.remove(sizeKey);
}
}
}
return result;
}
Item getNextFreeSpace(Item item){
Item result=null;
if(!tree.isEmpty()){
Long sizeKey=new Long(item.getSize());
SortedMap map=tree.tailMap(sizeKey);
if(map!=null&&!map.isEmpty()){
Long resultKey=(Long) map.firstKey();
result=(Item) map.get(resultKey);
if(result!=null){
// remove from the tree
tree.remove(resultKey);
reconfigureTree(resultKey);
}
}
}
return result;
}
void reconfigureTree(Long sizeKey){
List list=(List) sizeMap.get(sizeKey);
if(list!=null){
if(!list.isEmpty()){
Object newItem=list.remove(list.size()-1);
tree.put(sizeKey,newItem);
}
if(list.isEmpty()){
sizeMap.remove(sizeKey);
}
}
}
int size(){
int result=0;
for(Iterator i=sizeMap.values().iterator();i.hasNext();){
List list=(List) i.next();
result+=list.size();
}
return result+tree.size();
}
}

View File

@ -1,116 +1,116 @@
/**
*
* Copyright 2005-2006 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package org.apache.activemq.kaha.impl;
import java.io.DataInput;
import java.io.DataInputStream;
import java.io.DataOutput;
import java.io.DataOutputStream;
import java.io.IOException;
import org.apache.activemq.kaha.Marshaller;
/**
* A a wrapper for a data in the store
*
* @version $Revision: 1.2 $
*/
public class Item{
static final long POSITION_NOT_SET=-1;
static final short MAGIC=31317;
static final int ACTIVE=22;
static final int FREE=33;
static final int HEAD_SIZE=8; // magic + active + len
static final int LOCATION_SIZE=24;
private long offset=POSITION_NOT_SET;
private int size;
private boolean active;
Item(){}
void writeHeader(DataOutput dataOut) throws IOException{
dataOut.writeShort(MAGIC);
dataOut.writeByte(active?ACTIVE:FREE);
dataOut.writeInt(size);
dataOut.writeByte(0);//padding
}
void readHeader(DataInput dataIn) throws IOException{
int magic=dataIn.readShort();
if(magic==MAGIC){
active=(dataIn.readByte()==ACTIVE);
size=dataIn.readInt();
}else if (magic == 0){
size = -999; //end of data
}else{
throw new BadMagicException("Unexpected Magic value: "+magic);
}
}
void writePayload(Marshaller marshaller,Object object,DataOutputStream dataOut) throws IOException{
marshaller.writePayload(object,dataOut);
}
Object readPayload(Marshaller marshaller,DataInputStream dataIn) throws IOException{
return marshaller.readPayload(dataIn);
}
void readLocation(DataInput dataIn) throws IOException{}
void writeLocation(DataOutput dataOut) throws IOException{}
/**
* @return Returns the size.
*/
int getSize(){
return size;
}
/**
* @param size
* The size to set.
*/
void setSize(int size){
this.size=size;
}
void setOffset(long pos){
offset=pos;
}
long getOffset(){
return offset;
}
/**
* @return Returns the active.
*/
boolean isActive(){
return active;
}
/**
* @param active
* The active to set.
*/
void setActive(boolean active){
this.active=active;
}
/**
* @return a pretty print
*/
public String toString(){
String result="offset = "+offset+" ,active = "+active+" , size = "+size;
return result;
}
/**
*
* Copyright 2005-2006 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package org.apache.activemq.kaha.impl;
import java.io.DataInput;
import java.io.DataInputStream;
import java.io.DataOutput;
import java.io.DataOutputStream;
import java.io.IOException;
import org.apache.activemq.kaha.Marshaller;
/**
* A a wrapper for a data in the store
*
* @version $Revision: 1.2 $
*/
public class Item{
static final long POSITION_NOT_SET=-1;
static final short MAGIC=31317;
static final int ACTIVE=22;
static final int FREE=33;
static final int HEAD_SIZE=8; // magic + active + len
static final int LOCATION_SIZE=24;
private long offset=POSITION_NOT_SET;
private int size;
private boolean active;
Item(){}
void writeHeader(DataOutput dataOut) throws IOException{
dataOut.writeShort(MAGIC);
dataOut.writeByte(active?ACTIVE:FREE);
dataOut.writeInt(size);
dataOut.writeByte(0);//padding
}
void readHeader(DataInput dataIn) throws IOException{
int magic=dataIn.readShort();
if(magic==MAGIC){
active=(dataIn.readByte()==ACTIVE);
size=dataIn.readInt();
}else if (magic == 0){
size = -999; //end of data
}else{
throw new BadMagicException("Unexpected Magic value: "+magic);
}
}
void writePayload(Marshaller marshaller,Object object,DataOutputStream dataOut) throws IOException{
marshaller.writePayload(object,dataOut);
}
Object readPayload(Marshaller marshaller,DataInputStream dataIn) throws IOException{
return marshaller.readPayload(dataIn);
}
void readLocation(DataInput dataIn) throws IOException{}
void writeLocation(DataOutput dataOut) throws IOException{}
/**
* @return Returns the size.
*/
int getSize(){
return size;
}
/**
* @param size
* The size to set.
*/
void setSize(int size){
this.size=size;
}
void setOffset(long pos){
offset=pos;
}
long getOffset(){
return offset;
}
/**
* @return Returns the active.
*/
boolean isActive(){
return active;
}
/**
* @param active
* The active to set.
*/
void setActive(boolean active){
this.active=active;
}
/**
* @return a pretty print
*/
public String toString(){
String result="offset = "+offset+" ,active = "+active+" , size = "+size;
return result;
}
}

View File

@ -1,126 +1,126 @@
/**
*
* Copyright 2005-2006 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package org.apache.activemq.kaha.impl;
import java.io.DataInput;
import java.io.DataInputStream;
import java.io.DataOutput;
import java.io.DataOutputStream;
import java.io.Externalizable;
import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;
import org.apache.activemq.kaha.Marshaller;
/**
* A an Item with a relative postion and location to other Items in the Store
*
* @version $Revision: 1.2 $
*/
public final class LocatableItem extends Item implements Externalizable{
private static final long serialVersionUID=-6888731361600185708L;
private long previousItem=POSITION_NOT_SET;
private long nextItem=POSITION_NOT_SET;
private long referenceItem=POSITION_NOT_SET;
public LocatableItem(){}
public LocatableItem(long prev,long next,long objOffset) throws IOException{
this.previousItem=prev;
this.nextItem=next;
this.referenceItem=objOffset;
}
public void writePayload(Marshaller marshaller,Object object,DataOutputStream dataOut) throws IOException{
dataOut.writeLong(previousItem);
dataOut.writeLong(nextItem);
dataOut.writeLong(referenceItem);
super.writePayload(marshaller,object,dataOut);
}
public Object readPayload(Marshaller marshaller,DataInputStream dataIn) throws IOException{
previousItem=dataIn.readLong();
nextItem=dataIn.readLong();
referenceItem=dataIn.readLong();
return super.readPayload(marshaller, dataIn);
}
void readLocation(DataInput dataIn) throws IOException{
previousItem=dataIn.readLong();
nextItem=dataIn.readLong();
referenceItem=dataIn.readLong();
}
public void writeLocation(DataOutput dataOut) throws IOException{
dataOut.writeLong(previousItem);
dataOut.writeLong(nextItem);
}
public void setPreviousItem(long newPrevEntry){
previousItem=newPrevEntry;
}
public long getPreviousItem(){
return previousItem;
}
public void setNextItem(long newNextEntry){
nextItem=newNextEntry;
}
public long getNextItem(){
return nextItem;
}
public void setReferenceItem(long newObjectOffset){
referenceItem=newObjectOffset;
}
public long getReferenceItem(){
return referenceItem;
}
/* (non-Javadoc)
* @see org.apache.activemq.kaha.impl.Item#toString()
*/
public String toString(){
String result=super.toString();
result+=" , referenceItem = "+referenceItem+", previousItem = "+previousItem+" , nextItem = "+nextItem;
return result;
}
/* (non-Javadoc)
* @see java.io.Externalizable#writeExternal(java.io.ObjectOutput)
*/
public void writeExternal(ObjectOutput out) throws IOException{
out.writeLong(previousItem);
out.writeLong(nextItem);
out.writeLong(referenceItem);
}
/* (non-Javadoc)
* @see java.io.Externalizable#readExternal(java.io.ObjectInput)
*/
public void readExternal(ObjectInput in) throws IOException,ClassNotFoundException{
previousItem = in.readLong();
nextItem = in.readLong();
referenceItem = in.readLong();
}
/**
*
* Copyright 2005-2006 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package org.apache.activemq.kaha.impl;
import java.io.DataInput;
import java.io.DataInputStream;
import java.io.DataOutput;
import java.io.DataOutputStream;
import java.io.Externalizable;
import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;
import org.apache.activemq.kaha.Marshaller;
/**
* A an Item with a relative postion and location to other Items in the Store
*
* @version $Revision: 1.2 $
*/
public final class LocatableItem extends Item implements Externalizable{
private static final long serialVersionUID=-6888731361600185708L;
private long previousItem=POSITION_NOT_SET;
private long nextItem=POSITION_NOT_SET;
private long referenceItem=POSITION_NOT_SET;
public LocatableItem(){}
public LocatableItem(long prev,long next,long objOffset) throws IOException{
this.previousItem=prev;
this.nextItem=next;
this.referenceItem=objOffset;
}
public void writePayload(Marshaller marshaller,Object object,DataOutputStream dataOut) throws IOException{
dataOut.writeLong(previousItem);
dataOut.writeLong(nextItem);
dataOut.writeLong(referenceItem);
super.writePayload(marshaller,object,dataOut);
}
public Object readPayload(Marshaller marshaller,DataInputStream dataIn) throws IOException{
previousItem=dataIn.readLong();
nextItem=dataIn.readLong();
referenceItem=dataIn.readLong();
return super.readPayload(marshaller, dataIn);
}
void readLocation(DataInput dataIn) throws IOException{
previousItem=dataIn.readLong();
nextItem=dataIn.readLong();
referenceItem=dataIn.readLong();
}
public void writeLocation(DataOutput dataOut) throws IOException{
dataOut.writeLong(previousItem);
dataOut.writeLong(nextItem);
}
public void setPreviousItem(long newPrevEntry){
previousItem=newPrevEntry;
}
public long getPreviousItem(){
return previousItem;
}
public void setNextItem(long newNextEntry){
nextItem=newNextEntry;
}
public long getNextItem(){
return nextItem;
}
public void setReferenceItem(long newObjectOffset){
referenceItem=newObjectOffset;
}
public long getReferenceItem(){
return referenceItem;
}
/* (non-Javadoc)
* @see org.apache.activemq.kaha.impl.Item#toString()
*/
public String toString(){
String result=super.toString();
result+=" , referenceItem = "+referenceItem+", previousItem = "+previousItem+" , nextItem = "+nextItem;
return result;
}
/* (non-Javadoc)
* @see java.io.Externalizable#writeExternal(java.io.ObjectOutput)
*/
public void writeExternal(ObjectOutput out) throws IOException{
out.writeLong(previousItem);
out.writeLong(nextItem);
out.writeLong(referenceItem);
}
/* (non-Javadoc)
* @see java.io.Externalizable#readExternal(java.io.ObjectInput)
*/
public void readExternal(ObjectInput in) throws IOException,ClassNotFoundException{
previousItem = in.readLong();
nextItem = in.readLong();
referenceItem = in.readLong();
}
}

View File

@ -1,476 +1,476 @@
/**
*
* Copyright 2005-2006 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package org.apache.activemq.kaha.impl;
import java.io.IOException;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.Map;
import java.util.Set;
import org.apache.activemq.kaha.MapContainer;
import org.apache.activemq.kaha.Marshaller;
import org.apache.activemq.kaha.ObjectMarshaller;
import org.apache.activemq.kaha.RuntimeStoreException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
* Implementation of a MapContainer
*
* @version $Revision: 1.2 $
*/
public class MapContainerImpl implements MapContainer{
private static final Log log=LogFactory.getLog(MapContainerImpl.class);
protected StoreImpl store;
protected LocatableItem root;
protected Object id;
protected Map map=new HashMap();
protected Map valueToKeyMap=new HashMap();
protected LinkedList list=new LinkedList();
protected boolean loaded=false;
protected Marshaller keyMarshaller=new ObjectMarshaller();
protected Marshaller valueMarshaller=new ObjectMarshaller();
protected final Object mutex=new Object();
protected boolean closed=false;
protected MapContainerImpl(Object id,StoreImpl rfs,LocatableItem root) throws IOException{
this.id=id;
this.store=rfs;
this.root=root;
}
/*
* (non-Javadoc)
*
* @see org.apache.activemq.kaha.MapContainer#load()
*/
public void load(){
checkClosed();
if(!loaded){
loaded=true;
synchronized(mutex){
try{
long start=root.getNextItem();
if(start!=Item.POSITION_NOT_SET){
long nextItem=start;
while(nextItem!=Item.POSITION_NOT_SET){
LocatableItem item=new LocatableItem();
item.setOffset(nextItem);
Object key=store.readItem(keyMarshaller,item);
map.put(key,item);
valueToKeyMap.put(item,key);
list.add(item);
nextItem=item.getNextItem();
}
}
}catch(IOException e){
log.error("Failed to load container "+getId(),e);
throw new RuntimeStoreException(e);
}
}
}
}
/*
* (non-Javadoc)
*
* @see org.apache.activemq.kaha.MapContainer#unload()
*/
public void unload(){
checkClosed();
if(loaded){
loaded=false;
synchronized(mutex){
map.clear();
valueToKeyMap.clear();
list.clear();
}
}
}
public void close(){
unload();
closed=true;
}
public void setKeyMarshaller(Marshaller keyMarshaller){
checkClosed();
this.keyMarshaller=keyMarshaller;
}
public void setValueMarshaller(Marshaller valueMarshaller){
checkClosed();
this.valueMarshaller=valueMarshaller;
}
/*
* (non-Javadoc)
*
* @see org.apache.activemq.kaha.MapContainer#isLoaded()
*/
public boolean isLoaded(){
checkClosed();
return loaded;
}
/*
* (non-Javadoc)
*
* @see org.apache.activemq.kaha.MapContainer#getId()
*/
public Object getId(){
checkClosed();
return id;
}
/*
* (non-Javadoc)
*
* @see org.apache.activemq.kaha.MapContainer#size()
*/
public int size(){
checkClosed();
checkLoaded();
return map.size();
}
/*
* (non-Javadoc)
*
* @see org.apache.activemq.kaha.MapContainer#isEmpty()
*/
public boolean isEmpty(){
checkClosed();
checkLoaded();
return map.isEmpty();
}
/*
* (non-Javadoc)
*
* @see org.apache.activemq.kaha.MapContainer#containsKey(java.lang.Object)
*/
public boolean containsKey(Object key){
checkClosed();
checkLoaded();
synchronized(mutex){
return map.containsKey(key);
}
}
/*
* (non-Javadoc)
*
* @see org.apache.activemq.kaha.MapContainer#get(java.lang.Object)
*/
public Object get(Object key){
checkClosed();
checkLoaded();
Object result=null;
LocatableItem item=null;
synchronized(mutex){
item=(LocatableItem) map.get(key);
}
if(item!=null){
result=getValue(item);
}
return result;
}
/*
* (non-Javadoc)
*
* @see org.apache.activemq.kaha.MapContainer#containsValue(java.lang.Object)
*/
public boolean containsValue(Object o){
checkClosed();
checkLoaded();
boolean result=false;
if(o!=null){
synchronized(list){
for(Iterator i=list.iterator();i.hasNext();){
LocatableItem item=(LocatableItem) i.next();
Object value=getValue(item);
if(value!=null&&value.equals(o)){
result=true;
break;
}
}
}
}
return result;
}
/*
* (non-Javadoc)
*
* @see org.apache.activemq.kaha.MapContainer#putAll(java.util.Map)
*/
public void putAll(Map t){
checkClosed();
checkLoaded();
if(t!=null){
synchronized(mutex){
for(Iterator i=t.entrySet().iterator();i.hasNext();){
Map.Entry entry=(Map.Entry) i.next();
put(entry.getKey(),entry.getValue());
}
}
}
}
/*
* (non-Javadoc)
*
* @see org.apache.activemq.kaha.MapContainer#keySet()
*/
public Set keySet(){
checkClosed();
checkLoaded();
return new ContainerKeySet(this);
}
/*
* (non-Javadoc)
*
* @see org.apache.activemq.kaha.MapContainer#values()
*/
public Collection values(){
checkClosed();
checkLoaded();
return new ContainerValueCollection(this);
}
/*
* (non-Javadoc)
*
* @see org.apache.activemq.kaha.MapContainer#entrySet()
*/
public Set entrySet(){
checkClosed();
checkLoaded();
return new ContainerEntrySet(this);
}
/*
* (non-Javadoc)
*
* @see org.apache.activemq.kaha.MapContainer#put(java.lang.Object, java.lang.Object)
*/
public Object put(Object key,Object value){
checkClosed();
checkLoaded();
Object result=null;
synchronized(mutex){
if(map.containsKey(key)){
result=remove(key);
}
LocatableItem item=write(key,value);
map.put(key,item);
valueToKeyMap.put(item,key);
list.add(item);
}
return result;
}
/*
* (non-Javadoc)
*
* @see org.apache.activemq.kaha.MapContainer#remove(java.lang.Object)
*/
public Object remove(Object key){
checkClosed();
checkLoaded();
Object result=null;
synchronized(mutex){
LocatableItem item=(LocatableItem) map.get(key);
if(item!=null){
map.remove(key);
valueToKeyMap.remove(item);
result=getValue(item);
int index=list.indexOf(item);
LocatableItem prev=index>0?(LocatableItem) list.get(index-1):root;
LocatableItem next=index<(list.size()-1)?(LocatableItem) list.get(index+1):null;
list.remove(index);
{
delete(item,prev,next);
}
item=null;
}
}
return result;
}
public boolean removeValue(Object o){
checkClosed();
checkLoaded();
boolean result=false;
if(o!=null){
synchronized(list){
for(Iterator i=list.iterator();i.hasNext();){
LocatableItem item=(LocatableItem) i.next();
Object value=getValue(item);
if(value!=null&&value.equals(o)){
result=true;
// find the key
Object key=valueToKeyMap.get(item);
if(key!=null){
remove(key);
}
break;
}
}
}
}
return result;
}
protected void remove(LocatableItem item){
Object key=valueToKeyMap.get(item);
if(key!=null){
remove(key);
}
}
/*
* (non-Javadoc)
*
* @see org.apache.activemq.kaha.MapContainer#clear()
*/
public void clear(){
checkClosed();
synchronized(mutex){
loaded=true;
synchronized(mutex){
map.clear();
valueToKeyMap.clear();
list.clear();// going to re-use this
try{
long start=root.getNextItem();
if(start!=Item.POSITION_NOT_SET){
long nextItem=start;
while(nextItem!=Item.POSITION_NOT_SET){
LocatableItem item=new LocatableItem();
item.setOffset(nextItem);
list.add(item);
nextItem=item.getNextItem();
}
}
root.setNextItem(Item.POSITION_NOT_SET);
store.updateItem(root);
for(int i=0;i<list.size();i++){
LocatableItem item=(LocatableItem) list.get(i);
if(item.getReferenceItem()!=Item.POSITION_NOT_SET){
Item value=new Item();
value.setOffset(item.getReferenceItem());
store.removeItem(value);
}
store.removeItem(item);
}
list.clear();
}catch(IOException e){
log.error("Failed to clear MapContainer "+getId(),e);
throw new RuntimeStoreException(e);
}
}
}
}
protected Set getInternalKeySet(){
return new HashSet(map.keySet());
}
protected LinkedList getItemList(){
return list;
}
protected Object getValue(LocatableItem item){
Object result=null;
if(item!=null&&item.getReferenceItem()!=Item.POSITION_NOT_SET){
Item rec=new Item();
rec.setOffset(item.getReferenceItem());
try{
result=store.readItem(valueMarshaller,rec);
}catch(IOException e){
log.error("Failed to get value for "+item,e);
throw new RuntimeStoreException(e);
}
}
return result;
}
protected LocatableItem write(Object key,Object value){
long pos=Item.POSITION_NOT_SET;
LocatableItem item=null;
try{
if(value!=null){
Item valueItem=new Item();
pos=store.storeItem(valueMarshaller,value,valueItem);
}
LocatableItem last=list.isEmpty()?null:(LocatableItem) list.getLast();
last=last==null?root:last;
long prev=last.getOffset();
long next=Item.POSITION_NOT_SET;
item=new LocatableItem(prev,next,pos);
next=store.storeItem(keyMarshaller,key,item);
if(last!=null){
last.setNextItem(next);
store.updateItem(last);
}
}catch(IOException e){
e.printStackTrace();
log.error("Failed to write "+key+" , "+value,e);
throw new RuntimeStoreException(e);
}
return item;
}
protected void delete(LocatableItem key,LocatableItem prev,LocatableItem next){
try{
prev=prev==null?root:prev;
if(next!=null){
prev.setNextItem(next.getOffset());
next.setPreviousItem(prev.getOffset());
store.updateItem(next);
}else{
prev.setNextItem(Item.POSITION_NOT_SET);
}
store.updateItem(prev);
if(key.getReferenceItem()!=Item.POSITION_NOT_SET){
Item value=new Item();
value.setOffset(key.getReferenceItem());
store.removeItem(value);
}
store.removeItem(key);
}catch(IOException e){
log.error("Failed to delete "+key,e);
throw new RuntimeStoreException(e);
}
}
protected final void checkClosed(){
if(closed){
throw new RuntimeStoreException("The store is closed");
}
}
protected final void checkLoaded(){
if(!loaded){
throw new RuntimeStoreException("The container is not loaded");
}
}
/**
*
* Copyright 2005-2006 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package org.apache.activemq.kaha.impl;
import java.io.IOException;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.Map;
import java.util.Set;
import org.apache.activemq.kaha.MapContainer;
import org.apache.activemq.kaha.Marshaller;
import org.apache.activemq.kaha.ObjectMarshaller;
import org.apache.activemq.kaha.RuntimeStoreException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
* Implementation of a MapContainer
*
* @version $Revision: 1.2 $
*/
public class MapContainerImpl implements MapContainer{
private static final Log log=LogFactory.getLog(MapContainerImpl.class);
protected StoreImpl store;
protected LocatableItem root;
protected Object id;
protected Map map=new HashMap();
protected Map valueToKeyMap=new HashMap();
protected LinkedList list=new LinkedList();
protected boolean loaded=false;
protected Marshaller keyMarshaller=new ObjectMarshaller();
protected Marshaller valueMarshaller=new ObjectMarshaller();
protected final Object mutex=new Object();
protected boolean closed=false;
protected MapContainerImpl(Object id,StoreImpl rfs,LocatableItem root) throws IOException{
this.id=id;
this.store=rfs;
this.root=root;
}
/*
* (non-Javadoc)
*
* @see org.apache.activemq.kaha.MapContainer#load()
*/
public void load(){
checkClosed();
if(!loaded){
loaded=true;
synchronized(mutex){
try{
long start=root.getNextItem();
if(start!=Item.POSITION_NOT_SET){
long nextItem=start;
while(nextItem!=Item.POSITION_NOT_SET){
LocatableItem item=new LocatableItem();
item.setOffset(nextItem);
Object key=store.readItem(keyMarshaller,item);
map.put(key,item);
valueToKeyMap.put(item,key);
list.add(item);
nextItem=item.getNextItem();
}
}
}catch(IOException e){
log.error("Failed to load container "+getId(),e);
throw new RuntimeStoreException(e);
}
}
}
}
/*
* (non-Javadoc)
*
* @see org.apache.activemq.kaha.MapContainer#unload()
*/
public void unload(){
checkClosed();
if(loaded){
loaded=false;
synchronized(mutex){
map.clear();
valueToKeyMap.clear();
list.clear();
}
}
}
public void close(){
unload();
closed=true;
}
public void setKeyMarshaller(Marshaller keyMarshaller){
checkClosed();
this.keyMarshaller=keyMarshaller;
}
public void setValueMarshaller(Marshaller valueMarshaller){
checkClosed();
this.valueMarshaller=valueMarshaller;
}
/*
* (non-Javadoc)
*
* @see org.apache.activemq.kaha.MapContainer#isLoaded()
*/
public boolean isLoaded(){
checkClosed();
return loaded;
}
/*
* (non-Javadoc)
*
* @see org.apache.activemq.kaha.MapContainer#getId()
*/
public Object getId(){
checkClosed();
return id;
}
/*
* (non-Javadoc)
*
* @see org.apache.activemq.kaha.MapContainer#size()
*/
public int size(){
checkClosed();
checkLoaded();
return map.size();
}
/*
* (non-Javadoc)
*
* @see org.apache.activemq.kaha.MapContainer#isEmpty()
*/
public boolean isEmpty(){
checkClosed();
checkLoaded();
return map.isEmpty();
}
/*
* (non-Javadoc)
*
* @see org.apache.activemq.kaha.MapContainer#containsKey(java.lang.Object)
*/
public boolean containsKey(Object key){
checkClosed();
checkLoaded();
synchronized(mutex){
return map.containsKey(key);
}
}
/*
* (non-Javadoc)
*
* @see org.apache.activemq.kaha.MapContainer#get(java.lang.Object)
*/
public Object get(Object key){
checkClosed();
checkLoaded();
Object result=null;
LocatableItem item=null;
synchronized(mutex){
item=(LocatableItem) map.get(key);
}
if(item!=null){
result=getValue(item);
}
return result;
}
/*
* (non-Javadoc)
*
* @see org.apache.activemq.kaha.MapContainer#containsValue(java.lang.Object)
*/
public boolean containsValue(Object o){
checkClosed();
checkLoaded();
boolean result=false;
if(o!=null){
synchronized(list){
for(Iterator i=list.iterator();i.hasNext();){
LocatableItem item=(LocatableItem) i.next();
Object value=getValue(item);
if(value!=null&&value.equals(o)){
result=true;
break;
}
}
}
}
return result;
}
/*
* (non-Javadoc)
*
* @see org.apache.activemq.kaha.MapContainer#putAll(java.util.Map)
*/
public void putAll(Map t){
checkClosed();
checkLoaded();
if(t!=null){
synchronized(mutex){
for(Iterator i=t.entrySet().iterator();i.hasNext();){
Map.Entry entry=(Map.Entry) i.next();
put(entry.getKey(),entry.getValue());
}
}
}
}
/*
* (non-Javadoc)
*
* @see org.apache.activemq.kaha.MapContainer#keySet()
*/
public Set keySet(){
checkClosed();
checkLoaded();
return new ContainerKeySet(this);
}
/*
* (non-Javadoc)
*
* @see org.apache.activemq.kaha.MapContainer#values()
*/
public Collection values(){
checkClosed();
checkLoaded();
return new ContainerValueCollection(this);
}
/*
* (non-Javadoc)
*
* @see org.apache.activemq.kaha.MapContainer#entrySet()
*/
public Set entrySet(){
checkClosed();
checkLoaded();
return new ContainerEntrySet(this);
}
/*
* (non-Javadoc)
*
* @see org.apache.activemq.kaha.MapContainer#put(java.lang.Object, java.lang.Object)
*/
public Object put(Object key,Object value){
checkClosed();
checkLoaded();
Object result=null;
synchronized(mutex){
if(map.containsKey(key)){
result=remove(key);
}
LocatableItem item=write(key,value);
map.put(key,item);
valueToKeyMap.put(item,key);
list.add(item);
}
return result;
}
/*
* (non-Javadoc)
*
* @see org.apache.activemq.kaha.MapContainer#remove(java.lang.Object)
*/
public Object remove(Object key){
checkClosed();
checkLoaded();
Object result=null;
synchronized(mutex){
LocatableItem item=(LocatableItem) map.get(key);
if(item!=null){
map.remove(key);
valueToKeyMap.remove(item);
result=getValue(item);
int index=list.indexOf(item);
LocatableItem prev=index>0?(LocatableItem) list.get(index-1):root;
LocatableItem next=index<(list.size()-1)?(LocatableItem) list.get(index+1):null;
list.remove(index);
{
delete(item,prev,next);
}
item=null;
}
}
return result;
}
public boolean removeValue(Object o){
checkClosed();
checkLoaded();
boolean result=false;
if(o!=null){
synchronized(list){
for(Iterator i=list.iterator();i.hasNext();){
LocatableItem item=(LocatableItem) i.next();
Object value=getValue(item);
if(value!=null&&value.equals(o)){
result=true;
// find the key
Object key=valueToKeyMap.get(item);
if(key!=null){
remove(key);
}
break;
}
}
}
}
return result;
}
protected void remove(LocatableItem item){
Object key=valueToKeyMap.get(item);
if(key!=null){
remove(key);
}
}
/*
* (non-Javadoc)
*
* @see org.apache.activemq.kaha.MapContainer#clear()
*/
public void clear(){
checkClosed();
synchronized(mutex){
loaded=true;
synchronized(mutex){
map.clear();
valueToKeyMap.clear();
list.clear();// going to re-use this
try{
long start=root.getNextItem();
if(start!=Item.POSITION_NOT_SET){
long nextItem=start;
while(nextItem!=Item.POSITION_NOT_SET){
LocatableItem item=new LocatableItem();
item.setOffset(nextItem);
list.add(item);
nextItem=item.getNextItem();
}
}
root.setNextItem(Item.POSITION_NOT_SET);
store.updateItem(root);
for(int i=0;i<list.size();i++){
LocatableItem item=(LocatableItem) list.get(i);
if(item.getReferenceItem()!=Item.POSITION_NOT_SET){
Item value=new Item();
value.setOffset(item.getReferenceItem());
store.removeItem(value);
}
store.removeItem(item);
}
list.clear();
}catch(IOException e){
log.error("Failed to clear MapContainer "+getId(),e);
throw new RuntimeStoreException(e);
}
}
}
}
protected Set getInternalKeySet(){
return new HashSet(map.keySet());
}
protected LinkedList getItemList(){
return list;
}
protected Object getValue(LocatableItem item){
Object result=null;
if(item!=null&&item.getReferenceItem()!=Item.POSITION_NOT_SET){
Item rec=new Item();
rec.setOffset(item.getReferenceItem());
try{
result=store.readItem(valueMarshaller,rec);
}catch(IOException e){
log.error("Failed to get value for "+item,e);
throw new RuntimeStoreException(e);
}
}
return result;
}
protected LocatableItem write(Object key,Object value){
long pos=Item.POSITION_NOT_SET;
LocatableItem item=null;
try{
if(value!=null){
Item valueItem=new Item();
pos=store.storeItem(valueMarshaller,value,valueItem);
}
LocatableItem last=list.isEmpty()?null:(LocatableItem) list.getLast();
last=last==null?root:last;
long prev=last.getOffset();
long next=Item.POSITION_NOT_SET;
item=new LocatableItem(prev,next,pos);
next=store.storeItem(keyMarshaller,key,item);
if(last!=null){
last.setNextItem(next);
store.updateItem(last);
}
}catch(IOException e){
e.printStackTrace();
log.error("Failed to write "+key+" , "+value,e);
throw new RuntimeStoreException(e);
}
return item;
}
protected void delete(LocatableItem key,LocatableItem prev,LocatableItem next){
try{
prev=prev==null?root:prev;
if(next!=null){
prev.setNextItem(next.getOffset());
next.setPreviousItem(prev.getOffset());
store.updateItem(next);
}else{
prev.setNextItem(Item.POSITION_NOT_SET);
}
store.updateItem(prev);
if(key.getReferenceItem()!=Item.POSITION_NOT_SET){
Item value=new Item();
value.setOffset(key.getReferenceItem());
store.removeItem(value);
}
store.removeItem(key);
}catch(IOException e){
log.error("Failed to delete "+key,e);
throw new RuntimeStoreException(e);
}
}
protected final void checkClosed(){
if(closed){
throw new RuntimeStoreException("The store is closed");
}
}
protected final void checkLoaded(){
if(!loaded){
throw new RuntimeStoreException("The container is not loaded");
}
}
}

View File

@ -1,97 +1,97 @@
/**
*
* Copyright 2005-2006 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package org.apache.activemq.kaha.impl;
import java.io.IOException;
import org.apache.activemq.kaha.Marshaller;
import org.apache.activemq.kaha.ObjectMarshaller;
import org.apache.activemq.kaha.RuntimeStoreException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
* A container of roots for other Containers
*
* @version $Revision: 1.2 $
*/
class RootContainer extends MapContainerImpl{
private static final Log log=LogFactory.getLog(RootContainer.class);
protected static final Marshaller rootMarshaller = new ObjectMarshaller();
protected RootContainer(Object id,StoreImpl rfs,LocatableItem root) throws IOException{
super(id,rfs,root);
}
protected void addRoot(Object key,LocatableItem er) throws IOException{
if(map.containsKey(key)){
remove(key);
}
LocatableItem entry=writeRoot(key,er);
map.put(key,entry);
synchronized(list){
list.add(entry);
}
}
protected LocatableItem writeRoot(Object key,LocatableItem value){
long pos=Item.POSITION_NOT_SET;
LocatableItem item=null;
try{
if(value!=null){
pos=store.storeItem(rootMarshaller,value,value);
}
LocatableItem last=list.isEmpty()?null:(LocatableItem) list.getLast();
last=last==null?root:last;
long prev=last.getOffset();
long next=Item.POSITION_NOT_SET;
item=new LocatableItem(prev,next,pos);
if(log.isDebugEnabled())
log.debug("writing root ...");
if(log.isDebugEnabled())
log.debug("root = "+value);
next=store.storeItem(rootMarshaller,key,item);
if(last!=null){
last.setNextItem(next);
store.updateItem(last);
}
}catch(IOException e){
e.printStackTrace();
log.error("Failed to write root",e);
throw new RuntimeStoreException(e);
}
return item;
}
protected Object getValue(LocatableItem item){
LocatableItem result=null;
if(item!=null&&item.getReferenceItem()!=Item.POSITION_NOT_SET){
LocatableItem value=new LocatableItem();
value.setOffset(item.getReferenceItem());
try{
result=(LocatableItem) store.readItem(rootMarshaller,value);
//now read the item
result.setOffset(item.getReferenceItem());
store.readItem(rootMarshaller, result);
}catch(IOException e){
log.error("Could not read item "+item,e);
throw new RuntimeStoreException(e);
}
}
return result;
}
/**
*
* Copyright 2005-2006 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package org.apache.activemq.kaha.impl;
import java.io.IOException;
import org.apache.activemq.kaha.Marshaller;
import org.apache.activemq.kaha.ObjectMarshaller;
import org.apache.activemq.kaha.RuntimeStoreException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
* A container of roots for other Containers
*
* @version $Revision: 1.2 $
*/
class RootContainer extends MapContainerImpl{
private static final Log log=LogFactory.getLog(RootContainer.class);
protected static final Marshaller rootMarshaller = new ObjectMarshaller();
protected RootContainer(Object id,StoreImpl rfs,LocatableItem root) throws IOException{
super(id,rfs,root);
}
protected void addRoot(Object key,LocatableItem er) throws IOException{
if(map.containsKey(key)){
remove(key);
}
LocatableItem entry=writeRoot(key,er);
map.put(key,entry);
synchronized(list){
list.add(entry);
}
}
protected LocatableItem writeRoot(Object key,LocatableItem value){
long pos=Item.POSITION_NOT_SET;
LocatableItem item=null;
try{
if(value!=null){
pos=store.storeItem(rootMarshaller,value,value);
}
LocatableItem last=list.isEmpty()?null:(LocatableItem) list.getLast();
last=last==null?root:last;
long prev=last.getOffset();
long next=Item.POSITION_NOT_SET;
item=new LocatableItem(prev,next,pos);
if(log.isDebugEnabled())
log.debug("writing root ...");
if(log.isDebugEnabled())
log.debug("root = "+value);
next=store.storeItem(rootMarshaller,key,item);
if(last!=null){
last.setNextItem(next);
store.updateItem(last);
}
}catch(IOException e){
e.printStackTrace();
log.error("Failed to write root",e);
throw new RuntimeStoreException(e);
}
return item;
}
protected Object getValue(LocatableItem item){
LocatableItem result=null;
if(item!=null&&item.getReferenceItem()!=Item.POSITION_NOT_SET){
LocatableItem value=new LocatableItem();
value.setOffset(item.getReferenceItem());
try{
result=(LocatableItem) store.readItem(rootMarshaller,value);
//now read the item
result.setOffset(item.getReferenceItem());
store.readItem(rootMarshaller, result);
}catch(IOException e){
log.error("Could not read item "+item,e);
throw new RuntimeStoreException(e);
}
}
return result;
}
}

View File

@ -1,380 +1,380 @@
/**
*
* Copyright 2005-2006 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package org.apache.activemq.kaha.impl;
import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.RandomAccessFile;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import org.apache.activemq.kaha.ListContainer;
import org.apache.activemq.kaha.MapContainer;
import org.apache.activemq.kaha.Marshaller;
import org.apache.activemq.kaha.RuntimeStoreException;
import org.apache.activemq.kaha.Store;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import edu.emory.mathcs.backport.java.util.concurrent.ConcurrentHashMap;
/**
* Implementation of a Store
*
* @version $Revision: 1.2 $
*/
public class StoreImpl implements Store{
private static final Log log = LogFactory.getLog(StoreImpl.class);
private final Object mutex=new Object();
private RandomAccessFile dataFile;
private Map mapContainers=new ConcurrentHashMap();
private Map listContainers=new ConcurrentHashMap();
private RootContainer rootMapContainer;
private RootContainer rootListContainer;
private String name;
private StoreReader reader;
private StoreWriter writer;
private FreeSpaceManager freeSpaceManager;
protected boolean closed=false;
protected Thread shutdownHook;
public StoreImpl(String name,String mode) throws IOException{
this.name=name;
this.dataFile=new RandomAccessFile(name,mode);
this.reader = new StoreReader(this.dataFile);
this.writer = new StoreWriter(this.dataFile);
File file = new File(name);
log.info("Kaha Store opened " + file.getAbsolutePath());
freeSpaceManager=new FreeSpaceManager(this.writer,this.reader);
initialization();
}
/*
* (non-Javadoc)
*
* @see org.apache.activemq.kaha.Store#close()
*/
public void close() throws IOException{
synchronized(mutex){
if(!closed){
for(Iterator i=mapContainers.values().iterator();i.hasNext();){
MapContainerImpl container=(MapContainerImpl) i.next();
container.close();
}
for(Iterator i=listContainers.values().iterator();i.hasNext();){
ListContainerImpl container=(ListContainerImpl) i.next();
container.close();
}
force();
dataFile.close();
closed=true;
}
}
}
/*
* (non-Javadoc)
*
* @see org.apache.activemq.kaha.Store#force()
*/
public void force() throws IOException{
checkClosed();
synchronized(mutex){
dataFile.getFD().sync();
}
}
/*
* (non-Javadoc)
*
* @see org.apache.activemq.kaha.Store#clear()
*/
public void clear(){
checkClosed();
for(Iterator i=mapContainers.values().iterator();i.hasNext();){
MapContainer container=(MapContainer) i.next();
container.clear();
}
for(Iterator i=listContainers.values().iterator();i.hasNext();){
ListContainer container=(ListContainer) i.next();
container.clear();
}
}
/*
* (non-Javadoc)
*
* @see org.apache.activemq.kaha.Store#delete()
*/
public boolean delete() throws IOException{
checkClosed();
dataFile.close();
File file=new File(name);
return file.delete();
}
/*
* (non-Javadoc)
*
* @see org.apache.activemq.kaha.Store#doesMapContainerExist(java.lang.Object)
*/
public boolean doesMapContainerExist(Object id){
return mapContainers.containsKey(id);
}
/*
* (non-Javadoc)
*
* @see org.apache.activemq.kaha.Store#getContainer(java.lang.Object)
*/
public MapContainer getMapContainer(Object id) throws IOException{
checkClosed();
synchronized(mutex){
MapContainer result=(MapContainerImpl) mapContainers.get(id);
if(result==null){
LocatableItem root=new LocatableItem();
rootMapContainer.addRoot(id,root);
result=new MapContainerImpl(id,this,root);
mapContainers.put(id,result);
}
return result;
}
}
/*
* (non-Javadoc)
*
* @see org.apache.activemq.kaha.Store#deleteContainer(java.lang.Object)
*/
public void deleteMapContainer(Object id) throws IOException{
checkClosed();
synchronized(mutex){
if(doesMapContainerExist(id)){
MapContainer container=getMapContainer(id);
if(container!=null){
container.load();
container.clear();
rootMapContainer.remove(id);
mapContainers.remove(id);
}
}
}
}
/*
* (non-Javadoc)
*
* @see org.apache.activemq.kaha.Store#getContainerKeys()
*/
public Set getMapContainerIds(){
checkClosed();
return java.util.Collections.unmodifiableSet(mapContainers.keySet());
}
/*
* (non-Javadoc)
*
* @see org.apache.activemq.kaha.Store#doesListContainerExist(java.lang.Object)
*/
public boolean doesListContainerExist(Object id){
return listContainers.containsKey(id);
}
/*
* (non-Javadoc)
*
* @see org.apache.activemq.kaha.Store#getListContainer(java.lang.Object)
*/
public ListContainer getListContainer(Object id) throws IOException{
checkClosed();
synchronized(mutex){
ListContainer result=(ListContainerImpl) listContainers.get(id);
if(result==null){
LocatableItem root=new LocatableItem();
rootListContainer.addRoot(id,root);
result=new ListContainerImpl(id,this,root);
listContainers.put(id,result);
}
return result;
}
}
/*
* (non-Javadoc)
*
* @see org.apache.activemq.kaha.Store#deleteListContainer(java.lang.Object)
*/
public void deleteListContainer(Object id) throws IOException{
checkClosed();
synchronized(mutex){
if(doesListContainerExist(id)){
ListContainer container=getListContainer(id);
if(container!=null){
container.load();
container.clear();
rootListContainer.remove(id);
listContainers.remove(id);
}
}
}
}
/*
* (non-Javadoc)
*
* @see org.apache.activemq.kaha.Store#getListContainerIds()
*/
public Set getListContainerIds(){
checkClosed();
return java.util.Collections.unmodifiableSet(listContainers.keySet());
}
public void dumpFreeSpace(PrintWriter printer){
checkClosed();
synchronized(mutex){
freeSpaceManager.dump(printer);
}
}
protected long storeItem(Marshaller marshaller,Object payload,Item item) throws IOException{
synchronized(mutex){
int payloadSize = writer.loadPayload(marshaller, payload, item);
item.setSize(payloadSize);
// free space manager will set offset and write any headers required
// so the position should now be correct for writing
item=freeSpaceManager.getFreeSpace(item);
writer.storeItem(item,payloadSize);
}
return item.getOffset();
}
protected Object readItem(Marshaller marshaller,Item item) throws IOException{
synchronized(mutex){
return reader.readItem(marshaller, item);
}
}
protected void readHeader(Item item) throws IOException{
synchronized(mutex){
reader.readHeader(item);
}
}
protected void readLocation(Item item) throws IOException{
synchronized(mutex){
reader.readLocation(item);
}
}
protected void updateItem(Item item) throws IOException{
synchronized(mutex){
writer.updatePayload(item);
}
}
protected void removeItem(Item item) throws IOException{
synchronized(mutex){
freeSpaceManager.addFreeSpace(item);
}
}
private void initialization() throws IOException{
//add shutdown hook
addShutdownHook();
// check for new file
LocatableItem mapRoot=new LocatableItem();
LocatableItem listRoot=new LocatableItem();
if(dataFile.length()==0){
writer.allocateSpace(FreeSpaceManager.RESIZE_INCREMENT);
storeItem(RootContainer.rootMarshaller,"mapRoot",mapRoot);
storeItem(RootContainer.rootMarshaller,"listRoot",listRoot);
}else{
freeSpaceManager.scanStoredItems();
dataFile.seek(FreeSpaceManager.ROOT_SIZE);
mapRoot.setOffset(FreeSpaceManager.ROOT_SIZE);
readItem(RootContainer.rootMarshaller,mapRoot);
listRoot.setOffset(dataFile.getFilePointer());
readItem(RootContainer.rootMarshaller,listRoot);
}
rootMapContainer=new RootContainer("root",this,mapRoot);
rootMapContainer.load();
Set keys=rootMapContainer.keySet();
for(Iterator i=keys.iterator();i.hasNext();){
Object id=i.next();
if(id!=null){
LocatableItem item=(LocatableItem) rootMapContainer.get(id);
if(item!=null){
MapContainer container=new MapContainerImpl(id,this,item);
mapContainers.put(id,container);
}
}
}
rootListContainer=new RootContainer("root",this,listRoot);
rootListContainer.load();
keys=rootListContainer.keySet();
for(Iterator i=keys.iterator();i.hasNext();){
Object id=i.next();
if(id!=null){
LocatableItem item=(LocatableItem) rootListContainer.get(id);
if(item!=null){
ListContainer container=new ListContainerImpl(id,this,item);
listContainers.put(id,container);
}
}
}
}
protected void checkClosed(){
if(closed){
throw new RuntimeStoreException("The store is closed");
}
}
protected void addShutdownHook() {
shutdownHook = new Thread("Kaha Store implementation is shutting down") {
public void run() {
if (!closed){
try{
//this needs to be really quick so ...
closed = true;
dataFile.close();
}catch(Throwable e){
log.error("Failed to close data file",e);
}
}
}
};
Runtime.getRuntime().addShutdownHook(shutdownHook);
}
protected void removeShutdownHook() {
if (shutdownHook != null) {
try {
Runtime.getRuntime().removeShutdownHook(shutdownHook);
}
catch (Exception e) {
log.warn("Failed to run shutdown hook",e);
}
}
}
}
/**
*
* Copyright 2005-2006 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package org.apache.activemq.kaha.impl;
import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.RandomAccessFile;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import org.apache.activemq.kaha.ListContainer;
import org.apache.activemq.kaha.MapContainer;
import org.apache.activemq.kaha.Marshaller;
import org.apache.activemq.kaha.RuntimeStoreException;
import org.apache.activemq.kaha.Store;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import edu.emory.mathcs.backport.java.util.concurrent.ConcurrentHashMap;
/**
* Implementation of a Store
*
* @version $Revision: 1.2 $
*/
public class StoreImpl implements Store{
private static final Log log = LogFactory.getLog(StoreImpl.class);
private final Object mutex=new Object();
private RandomAccessFile dataFile;
private Map mapContainers=new ConcurrentHashMap();
private Map listContainers=new ConcurrentHashMap();
private RootContainer rootMapContainer;
private RootContainer rootListContainer;
private String name;
private StoreReader reader;
private StoreWriter writer;
private FreeSpaceManager freeSpaceManager;
protected boolean closed=false;
protected Thread shutdownHook;
public StoreImpl(String name,String mode) throws IOException{
this.name=name;
this.dataFile=new RandomAccessFile(name,mode);
this.reader = new StoreReader(this.dataFile);
this.writer = new StoreWriter(this.dataFile);
File file = new File(name);
log.info("Kaha Store opened " + file.getAbsolutePath());
freeSpaceManager=new FreeSpaceManager(this.writer,this.reader);
initialization();
}
/*
* (non-Javadoc)
*
* @see org.apache.activemq.kaha.Store#close()
*/
public void close() throws IOException{
synchronized(mutex){
if(!closed){
for(Iterator i=mapContainers.values().iterator();i.hasNext();){
MapContainerImpl container=(MapContainerImpl) i.next();
container.close();
}
for(Iterator i=listContainers.values().iterator();i.hasNext();){
ListContainerImpl container=(ListContainerImpl) i.next();
container.close();
}
force();
dataFile.close();
closed=true;
}
}
}
/*
* (non-Javadoc)
*
* @see org.apache.activemq.kaha.Store#force()
*/
public void force() throws IOException{
checkClosed();
synchronized(mutex){
dataFile.getFD().sync();
}
}
/*
* (non-Javadoc)
*
* @see org.apache.activemq.kaha.Store#clear()
*/
public void clear(){
checkClosed();
for(Iterator i=mapContainers.values().iterator();i.hasNext();){
MapContainer container=(MapContainer) i.next();
container.clear();
}
for(Iterator i=listContainers.values().iterator();i.hasNext();){
ListContainer container=(ListContainer) i.next();
container.clear();
}
}
/*
* (non-Javadoc)
*
* @see org.apache.activemq.kaha.Store#delete()
*/
public boolean delete() throws IOException{
checkClosed();
dataFile.close();
File file=new File(name);
return file.delete();
}
/*
* (non-Javadoc)
*
* @see org.apache.activemq.kaha.Store#doesMapContainerExist(java.lang.Object)
*/
public boolean doesMapContainerExist(Object id){
return mapContainers.containsKey(id);
}
/*
* (non-Javadoc)
*
* @see org.apache.activemq.kaha.Store#getContainer(java.lang.Object)
*/
public MapContainer getMapContainer(Object id) throws IOException{
checkClosed();
synchronized(mutex){
MapContainer result=(MapContainerImpl) mapContainers.get(id);
if(result==null){
LocatableItem root=new LocatableItem();
rootMapContainer.addRoot(id,root);
result=new MapContainerImpl(id,this,root);
mapContainers.put(id,result);
}
return result;
}
}
/*
* (non-Javadoc)
*
* @see org.apache.activemq.kaha.Store#deleteContainer(java.lang.Object)
*/
public void deleteMapContainer(Object id) throws IOException{
checkClosed();
synchronized(mutex){
if(doesMapContainerExist(id)){
MapContainer container=getMapContainer(id);
if(container!=null){
container.load();
container.clear();
rootMapContainer.remove(id);
mapContainers.remove(id);
}
}
}
}
/*
* (non-Javadoc)
*
* @see org.apache.activemq.kaha.Store#getContainerKeys()
*/
public Set getMapContainerIds(){
checkClosed();
return java.util.Collections.unmodifiableSet(mapContainers.keySet());
}
/*
* (non-Javadoc)
*
* @see org.apache.activemq.kaha.Store#doesListContainerExist(java.lang.Object)
*/
public boolean doesListContainerExist(Object id){
return listContainers.containsKey(id);
}
/*
* (non-Javadoc)
*
* @see org.apache.activemq.kaha.Store#getListContainer(java.lang.Object)
*/
public ListContainer getListContainer(Object id) throws IOException{
checkClosed();
synchronized(mutex){
ListContainer result=(ListContainerImpl) listContainers.get(id);
if(result==null){
LocatableItem root=new LocatableItem();
rootListContainer.addRoot(id,root);
result=new ListContainerImpl(id,this,root);
listContainers.put(id,result);
}
return result;
}
}
/*
* (non-Javadoc)
*
* @see org.apache.activemq.kaha.Store#deleteListContainer(java.lang.Object)
*/
public void deleteListContainer(Object id) throws IOException{
checkClosed();
synchronized(mutex){
if(doesListContainerExist(id)){
ListContainer container=getListContainer(id);
if(container!=null){
container.load();
container.clear();
rootListContainer.remove(id);
listContainers.remove(id);
}
}
}
}
/*
* (non-Javadoc)
*
* @see org.apache.activemq.kaha.Store#getListContainerIds()
*/
public Set getListContainerIds(){
checkClosed();
return java.util.Collections.unmodifiableSet(listContainers.keySet());
}
public void dumpFreeSpace(PrintWriter printer){
checkClosed();
synchronized(mutex){
freeSpaceManager.dump(printer);
}
}
protected long storeItem(Marshaller marshaller,Object payload,Item item) throws IOException{
synchronized(mutex){
int payloadSize = writer.loadPayload(marshaller, payload, item);
item.setSize(payloadSize);
// free space manager will set offset and write any headers required
// so the position should now be correct for writing
item=freeSpaceManager.getFreeSpace(item);
writer.storeItem(item,payloadSize);
}
return item.getOffset();
}
protected Object readItem(Marshaller marshaller,Item item) throws IOException{
synchronized(mutex){
return reader.readItem(marshaller, item);
}
}
protected void readHeader(Item item) throws IOException{
synchronized(mutex){
reader.readHeader(item);
}
}
protected void readLocation(Item item) throws IOException{
synchronized(mutex){
reader.readLocation(item);
}
}
protected void updateItem(Item item) throws IOException{
synchronized(mutex){
writer.updatePayload(item);
}
}
protected void removeItem(Item item) throws IOException{
synchronized(mutex){
freeSpaceManager.addFreeSpace(item);
}
}
private void initialization() throws IOException{
//add shutdown hook
addShutdownHook();
// check for new file
LocatableItem mapRoot=new LocatableItem();
LocatableItem listRoot=new LocatableItem();
if(dataFile.length()==0){
writer.allocateSpace(FreeSpaceManager.RESIZE_INCREMENT);
storeItem(RootContainer.rootMarshaller,"mapRoot",mapRoot);
storeItem(RootContainer.rootMarshaller,"listRoot",listRoot);
}else{
freeSpaceManager.scanStoredItems();
dataFile.seek(FreeSpaceManager.ROOT_SIZE);
mapRoot.setOffset(FreeSpaceManager.ROOT_SIZE);
readItem(RootContainer.rootMarshaller,mapRoot);
listRoot.setOffset(dataFile.getFilePointer());
readItem(RootContainer.rootMarshaller,listRoot);
}
rootMapContainer=new RootContainer("root",this,mapRoot);
rootMapContainer.load();
Set keys=rootMapContainer.keySet();
for(Iterator i=keys.iterator();i.hasNext();){
Object id=i.next();
if(id!=null){
LocatableItem item=(LocatableItem) rootMapContainer.get(id);
if(item!=null){
MapContainer container=new MapContainerImpl(id,this,item);
mapContainers.put(id,container);
}
}
}
rootListContainer=new RootContainer("root",this,listRoot);
rootListContainer.load();
keys=rootListContainer.keySet();
for(Iterator i=keys.iterator();i.hasNext();){
Object id=i.next();
if(id!=null){
LocatableItem item=(LocatableItem) rootListContainer.get(id);
if(item!=null){
ListContainer container=new ListContainerImpl(id,this,item);
listContainers.put(id,container);
}
}
}
}
protected void checkClosed(){
if(closed){
throw new RuntimeStoreException("The store is closed");
}
}
protected void addShutdownHook() {
shutdownHook = new Thread("Kaha Store implementation is shutting down") {
public void run() {
if (!closed){
try{
//this needs to be really quick so ...
closed = true;
dataFile.close();
}catch(Throwable e){
log.error("Failed to close data file",e);
}
}
}
};
Runtime.getRuntime().addShutdownHook(shutdownHook);
}
protected void removeShutdownHook() {
if (shutdownHook != null) {
try {
Runtime.getRuntime().removeShutdownHook(shutdownHook);
}
catch (Exception e) {
log.warn("Failed to run shutdown hook",e);
}
}
}
}

View File

@ -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);
}
}

View File

@ -61,7 +61,7 @@ public class JmsQueueCompositeSendReceiveTest extends JmsTopicSendReceiveTest {
protected String getProducerSubject() {
return "FOO.BAR.HUMBUG,FOO.BAR.HUMBUG2";
}
/**
* Test if all the messages sent are being received.
*

View File

@ -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"));
}
}

View File

@ -1,54 +1,54 @@
/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
using ActiveMQ.Commands;
using NMS;
namespace ActiveMQ
{
/// <summary>
/// Exception thrown when the broker returns an error
/// </summary>
public class BrokerException : NMSException
{
private BrokerError brokerError;
public BrokerException(BrokerError brokerError) : base(
brokerError.ExceptionClass + " : " + brokerError.Message)
{
this.brokerError = brokerError;
}
public BrokerError BrokerError
{
get {
return brokerError;
}
}
public virtual string JavaStackTrace
{
get {
return brokerError.StackTrace;
}
}
}
}
/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
using ActiveMQ.Commands;
using NMS;
namespace ActiveMQ
{
/// <summary>
/// Exception thrown when the broker returns an error
/// </summary>
public class BrokerException : NMSException
{
private BrokerError brokerError;
public BrokerException(BrokerError brokerError) : base(
brokerError.ExceptionClass + " : " + brokerError.Message)
{
this.brokerError = brokerError;
}
public BrokerError BrokerError
{
get {
return brokerError;
}
}
public virtual string JavaStackTrace
{
get {
return brokerError.StackTrace;
}
}
}
}

View File

@ -1,33 +1,33 @@
/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
using NMS;
namespace ActiveMQ.Commands
{
public class ActiveMQBytesMessage : ActiveMQMessage, IBytesMessage
{
public const byte ID_ActiveMQBytesMessage = 24;
public override byte GetDataStructureType()
{
return ID_ActiveMQBytesMessage;
}
}
}
/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
using NMS;
namespace ActiveMQ.Commands
{
public class ActiveMQBytesMessage : ActiveMQMessage, IBytesMessage
{
public const byte ID_ActiveMQBytesMessage = 24;
public override byte GetDataStructureType()
{
return ID_ActiveMQBytesMessage;
}
}
}

View File

@ -1,65 +1,65 @@
/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
using ActiveMQ.OpenWire;
using NMS;
using System;
namespace ActiveMQ.Commands
{
public class ActiveMQMapMessage : ActiveMQMessage, IMapMessage
{
public const byte ID_ActiveMQMapMessage = 25;
private PrimitiveMap body;
public override byte GetDataStructureType()
{
return ID_ActiveMQMapMessage;
}
public IPrimitiveMap Body
{
get {
if (body == null)
{
body = PrimitiveMap.Unmarshal(Content);
}
return body;
}
}
public override void BeforeMarshall(OpenWireFormat wireFormat)
{
if (body == null)
{
Content = null;
}
else
{
Content = body.Marshal();
}
Console.WriteLine("BeforeMarshalling, content is: " + Content);
base.BeforeMarshall(wireFormat);
}
}
}
/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
using ActiveMQ.OpenWire;
using NMS;
using System;
namespace ActiveMQ.Commands
{
public class ActiveMQMapMessage : ActiveMQMessage, IMapMessage
{
public const byte ID_ActiveMQMapMessage = 25;
private PrimitiveMap body;
public override byte GetDataStructureType()
{
return ID_ActiveMQMapMessage;
}
public IPrimitiveMap Body
{
get {
if (body == null)
{
body = PrimitiveMap.Unmarshal(Content);
}
return body;
}
}
public override void BeforeMarshall(OpenWireFormat wireFormat)
{
if (body == null)
{
Content = null;
}
else
{
Content = body.Marshal();
}
Console.WriteLine("BeforeMarshalling, content is: " + Content);
base.BeforeMarshall(wireFormat);
}
}
}

View File

@ -1,295 +1,295 @@
/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
using ActiveMQ.OpenWire;
using NMS;
namespace ActiveMQ.Commands
{
public delegate void AcknowledgeHandler(ActiveMQMessage message);
}
namespace ActiveMQ.Commands
{
public class ActiveMQMessage : Message, IMessage, MarshallAware
{
public const byte ID_ActiveMQMessage = 23;
protected static MessagePropertyHelper propertyHelper = new MessagePropertyHelper();
private PrimitiveMap properties;
public event AcknowledgeHandler Acknowledger;
public static ActiveMQMessage Transform(IMessage message)
{
return (ActiveMQMessage) message;
}
// TODO generate Equals method
// TODO generate GetHashCode method
public override byte GetDataStructureType()
{
return ID_ActiveMQMessage;
}
public void Acknowledge()
{
if (Acknowledger == null)
{
throw new NMSException("No Acknowledger has been associated with this message: " + this);
}
else
{
Acknowledger(this);
}
}
// Properties
public IPrimitiveMap Properties
{
get {
if (properties == null)
{
properties = PrimitiveMap.Unmarshal(MarshalledProperties);
}
return properties;
}
}
public IDestination FromDestination
{
get { return Destination; }
set { this.Destination = ActiveMQDestination.Transform(value); }
}
// IMessage interface
// JMS headers
/// <summary>
/// The correlation ID used to correlate messages with conversations or long running business processes
/// </summary>
public string NMSCorrelationID
{
get {
return CorrelationId;
}
set {
CorrelationId = value;
}
}
/// <summary>
/// The destination of the message
/// </summary>
public IDestination NMSDestination
{
get {
return OriginalDestination;
}
}
/// <summary>
/// The time in milliseconds that this message should expire in
/// </summary>
public long NMSExpiration
{
get {
return Expiration;
}
set {
Expiration = value;
}
}
/// <summary>
/// The message ID which is set by the provider
/// </summary>
public string NMSMessageId
{
get {
return BaseDataStreamMarshaller.ToString(MessageId);
}
}
/// <summary>
/// Whether or not this message is persistent
/// </summary>
public bool NMSPersistent
{
get {
return Persistent;
}
set {
Persistent = value;
}
}
/// <summary>
/// The Priority on this message
/// </summary>
public byte NMSPriority
{
get {
return Priority;
}
set {
Priority = value;
}
}
/// <summary>
/// Returns true if this message has been redelivered to this or another consumer before being acknowledged successfully.
/// </summary>
public bool NMSRedelivered
{
get {
return RedeliveryCounter > 0;
}
}
/// <summary>
/// The destination that the consumer of this message should send replies to
/// </summary>
public IDestination NMSReplyTo
{
get {
return ReplyTo;
}
set {
ReplyTo = ActiveMQDestination.Transform(value);
}
}
/// <summary>
/// The timestamp the broker added to the message
/// </summary>
public long NMSTimestamp
{
get {
return Timestamp;
}
}
/// <summary>
/// The type name of this message
/// </summary>
public string NMSType
{
get {
return Type;
}
set {
Type = value;
}
}
// JMS Extension headers
/// <summary>
/// Returns the number of times this message has been redelivered to other consumers without being acknowledged successfully.
/// </summary>
public int JMSXDeliveryCount
{
get {
return RedeliveryCounter + 1;
}
}
/// <summary>
/// The Message Group ID used to group messages together to the same consumer for the same group ID value
/// </summary>
public string JMSXGroupID
{
get {
return GroupID;
}
set {
GroupID = value;
}
}
/// <summary>
/// The Message Group Sequence counter to indicate the position in a group
/// </summary>
public int JMSXGroupSeq
{
get {
return GroupSequence;
}
set {
GroupSequence = value;
}
}
/// <summary>
/// Returns the ID of the producers transaction
/// </summary>
public string JMSXProducerTXID
{
get {
TransactionId txnId = OriginalTransactionId;
if (txnId == null)
{
txnId = TransactionId;
}
if (txnId != null)
{
return BaseDataStreamMarshaller.ToString(txnId);
}
return null;
}
}
public object GetObjectProperty(string name)
{
return propertyHelper.GetObjectProperty(this, name);
}
public void SetObjectProperty(string name, object value)
{
propertyHelper.SetObjectProperty(this, name, value);
}
// MarshallAware interface
public override bool IsMarshallAware()
{
return true;
}
public override void BeforeMarshall(OpenWireFormat wireFormat)
{
MarshalledProperties = null;
if (properties != null)
{
MarshalledProperties = properties.Marshal();
}
}
}
}
/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
using ActiveMQ.OpenWire;
using NMS;
namespace ActiveMQ.Commands
{
public delegate void AcknowledgeHandler(ActiveMQMessage message);
}
namespace ActiveMQ.Commands
{
public class ActiveMQMessage : Message, IMessage, MarshallAware
{
public const byte ID_ActiveMQMessage = 23;
protected static MessagePropertyHelper propertyHelper = new MessagePropertyHelper();
private PrimitiveMap properties;
public event AcknowledgeHandler Acknowledger;
public static ActiveMQMessage Transform(IMessage message)
{
return (ActiveMQMessage) message;
}
// TODO generate Equals method
// TODO generate GetHashCode method
public override byte GetDataStructureType()
{
return ID_ActiveMQMessage;
}
public void Acknowledge()
{
if (Acknowledger == null)
{
throw new NMSException("No Acknowledger has been associated with this message: " + this);
}
else
{
Acknowledger(this);
}
}
// Properties
public IPrimitiveMap Properties
{
get {
if (properties == null)
{
properties = PrimitiveMap.Unmarshal(MarshalledProperties);
}
return properties;
}
}
public IDestination FromDestination
{
get { return Destination; }
set { this.Destination = ActiveMQDestination.Transform(value); }
}
// IMessage interface
// JMS headers
/// <summary>
/// The correlation ID used to correlate messages with conversations or long running business processes
/// </summary>
public string NMSCorrelationID
{
get {
return CorrelationId;
}
set {
CorrelationId = value;
}
}
/// <summary>
/// The destination of the message
/// </summary>
public IDestination NMSDestination
{
get {
return OriginalDestination;
}
}
/// <summary>
/// The time in milliseconds that this message should expire in
/// </summary>
public long NMSExpiration
{
get {
return Expiration;
}
set {
Expiration = value;
}
}
/// <summary>
/// The message ID which is set by the provider
/// </summary>
public string NMSMessageId
{
get {
return BaseDataStreamMarshaller.ToString(MessageId);
}
}
/// <summary>
/// Whether or not this message is persistent
/// </summary>
public bool NMSPersistent
{
get {
return Persistent;
}
set {
Persistent = value;
}
}
/// <summary>
/// The Priority on this message
/// </summary>
public byte NMSPriority
{
get {
return Priority;
}
set {
Priority = value;
}
}
/// <summary>
/// Returns true if this message has been redelivered to this or another consumer before being acknowledged successfully.
/// </summary>
public bool NMSRedelivered
{
get {
return RedeliveryCounter > 0;
}
}
/// <summary>
/// The destination that the consumer of this message should send replies to
/// </summary>
public IDestination NMSReplyTo
{
get {
return ReplyTo;
}
set {
ReplyTo = ActiveMQDestination.Transform(value);
}
}
/// <summary>
/// The timestamp the broker added to the message
/// </summary>
public long NMSTimestamp
{
get {
return Timestamp;
}
}
/// <summary>
/// The type name of this message
/// </summary>
public string NMSType
{
get {
return Type;
}
set {
Type = value;
}
}
// JMS Extension headers
/// <summary>
/// Returns the number of times this message has been redelivered to other consumers without being acknowledged successfully.
/// </summary>
public int JMSXDeliveryCount
{
get {
return RedeliveryCounter + 1;
}
}
/// <summary>
/// The Message Group ID used to group messages together to the same consumer for the same group ID value
/// </summary>
public string JMSXGroupID
{
get {
return GroupID;
}
set {
GroupID = value;
}
}
/// <summary>
/// The Message Group Sequence counter to indicate the position in a group
/// </summary>
public int JMSXGroupSeq
{
get {
return GroupSequence;
}
set {
GroupSequence = value;
}
}
/// <summary>
/// Returns the ID of the producers transaction
/// </summary>
public string JMSXProducerTXID
{
get {
TransactionId txnId = OriginalTransactionId;
if (txnId == null)
{
txnId = TransactionId;
}
if (txnId != null)
{
return BaseDataStreamMarshaller.ToString(txnId);
}
return null;
}
}
public object GetObjectProperty(string name)
{
return propertyHelper.GetObjectProperty(this, name);
}
public void SetObjectProperty(string name, object value)
{
propertyHelper.SetObjectProperty(this, name, value);
}
// MarshallAware interface
public override bool IsMarshallAware()
{
return true;
}
public override void BeforeMarshall(OpenWireFormat wireFormat)
{
MarshalledProperties = null;
if (properties != null)
{
MarshalledProperties = properties.Marshal();
}
}
}
}

View File

@ -1,55 +1,55 @@
/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
using System;
using System.Collections;
using ActiveMQ.OpenWire;
using ActiveMQ.Commands;
namespace ActiveMQ.Commands
{
//
// Marshalling code for Open Wire Format for ActiveMQObjectMessage
//
//
// NOTE!: This file is autogenerated - do not modify!
// if you need to make a change, please see the Groovy scripts in the
// activemq-core module
//
public class ActiveMQObjectMessage : ActiveMQMessage
{
public const byte ID_ActiveMQObjectMessage = 26;
public override string ToString() {
return GetType().Name + "["
+ " ]";
}
public override byte GetDataStructureType() {
return ID_ActiveMQObjectMessage;
}
// Properties
}
}
/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
using System;
using System.Collections;
using ActiveMQ.OpenWire;
using ActiveMQ.Commands;
namespace ActiveMQ.Commands
{
//
// Marshalling code for Open Wire Format for ActiveMQObjectMessage
//
//
// NOTE!: This file is autogenerated - do not modify!
// if you need to make a change, please see the Groovy scripts in the
// activemq-core module
//
public class ActiveMQObjectMessage : ActiveMQMessage
{
public const byte ID_ActiveMQObjectMessage = 26;
public override string ToString() {
return GetType().Name + "["
+ " ]";
}
public override byte GetDataStructureType() {
return ID_ActiveMQObjectMessage;
}
// Properties
}
}

View File

@ -1,44 +1,44 @@
/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
using ActiveMQ.Commands;
namespace ActiveMQ.Commands
{
public class ActiveMQStreamMessage : ActiveMQMessage
{
public const byte ID_ActiveMQStreamMessage = 27;
// TODO generate Equals method
// TODO generate GetHashCode method
// TODO generate ToString method
public override byte GetDataStructureType()
{
return ID_ActiveMQStreamMessage;
}
// Properties
}
}
/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
using ActiveMQ.Commands;
namespace ActiveMQ.Commands
{
public class ActiveMQStreamMessage : ActiveMQMessage
{
public const byte ID_ActiveMQStreamMessage = 27;
// TODO generate Equals method
// TODO generate GetHashCode method
// TODO generate ToString method
public override byte GetDataStructureType()
{
return ID_ActiveMQStreamMessage;
}
// Properties
}
}

View File

@ -1,93 +1,93 @@
/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
using NMS;
using System;
namespace ActiveMQ.Commands
{
public class ActiveMQTextMessage : ActiveMQMessage, ITextMessage
{
public const byte ID_ActiveMQTextMessage = 28;
private String text;
public ActiveMQTextMessage()
{
}
public ActiveMQTextMessage(String text)
{
this.Text = text;
}
// TODO generate Equals method
// TODO generate GetHashCode method
// TODO generate ToString method
public override byte GetDataStructureType()
{
return ID_ActiveMQTextMessage;
}
// Properties
public string Text
{
get {
if (text == null)
{
// now lets read the content
byte[] data = this.Content;
if (data != null)
{
// TODO assume that the text is ASCII
char[] chars = new char[data.Length];
for (int i = 0; i < chars.Length; i++)
{
chars[i] = (char) data[i];
}
text = new String(chars);
}
}
return text;
}
set {
this.text = value;
byte[] data = null;
if (text != null)
{
// TODO assume that the text is ASCII
data = new byte[text.Length];
// now lets write the bytes
char[] chars = text.ToCharArray();
for (int i = 0; i < chars.Length; i++)
{
data[i] = (byte) chars[i];
}
}
this.Content = data;
}
}
}
}
/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
using NMS;
using System;
namespace ActiveMQ.Commands
{
public class ActiveMQTextMessage : ActiveMQMessage, ITextMessage
{
public const byte ID_ActiveMQTextMessage = 28;
private String text;
public ActiveMQTextMessage()
{
}
public ActiveMQTextMessage(String text)
{
this.Text = text;
}
// TODO generate Equals method
// TODO generate GetHashCode method
// TODO generate ToString method
public override byte GetDataStructureType()
{
return ID_ActiveMQTextMessage;
}
// Properties
public string Text
{
get {
if (text == null)
{
// now lets read the content
byte[] data = this.Content;
if (data != null)
{
// TODO assume that the text is ASCII
char[] chars = new char[data.Length];
for (int i = 0; i < chars.Length; i++)
{
chars[i] = (char) data[i];
}
text = new String(chars);
}
}
return text;
}
set {
this.text = value;
byte[] data = null;
if (text != null)
{
// TODO assume that the text is ASCII
data = new byte[text.Length];
// now lets write the bytes
char[] chars = text.ToCharArray();
for (int i = 0; i < chars.Length; i++)
{
data[i] = (byte) chars[i];
}
}
this.Content = data;
}
}
}
}

View File

@ -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; }
}
}
}

View File

@ -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; }
}
}
}

View File

@ -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; }
}
}
}

View File

@ -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; }
}
}
}

View File

@ -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; }
}
}
}

View File

@ -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; }
}
}
}

View File

@ -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; }
}
}
}

View File

@ -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; }
}
}
}

View File

@ -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; }
}
}
}

View File

@ -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; }
}
}
}

View File

@ -1,43 +1,43 @@
/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
using ActiveMQ.Commands;
namespace ActiveMQ.Commands
{
/// <summary>
/// Summary description for DataStructureSupport.
/// </summary>
public abstract class DataStructureSupport : DataStructure
{
protected DataStructureSupport()
{
}
public virtual byte GetDataStructureType()
{
return 0;
}
public virtual bool IsMarshallAware()
{
return false;
}
}
}
/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
using ActiveMQ.Commands;
namespace ActiveMQ.Commands
{
/// <summary>
/// Summary description for DataStructureSupport.
/// </summary>
public abstract class DataStructureSupport : DataStructure
{
protected DataStructureSupport()
{
}
public virtual byte GetDataStructureType()
{
return 0;
}
public virtual bool IsMarshallAware()
{
return false;
}
}
}

View File

@ -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; }
}
}
}

View File

@ -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; }
}
}
}

View File

@ -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; }
}
}
}

View File

@ -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
}
}

View File

@ -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; }
}
}
}

View File

@ -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; }
}
}
}

View File

@ -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; }
}
}
}

View File

@ -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; }
}
}
}

View File

@ -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; }
}
}
}

View File

@ -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
}
}

View File

@ -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; }
}
}
}

View File

@ -1,38 +1,38 @@
/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
using ActiveMQ.OpenWire;
namespace ActiveMQ.Commands
{
/// <summary>
/// Represents a marshallable entity
/// </summary>
public interface MarshallAware
{
void BeforeMarshall(OpenWireFormat wireFormat);
void AfterMarshall(OpenWireFormat wireFormat);
void BeforeUnmarshall(OpenWireFormat wireFormat);
void AfterUnmarshall(OpenWireFormat wireFormat);
void SetMarshalledForm(OpenWireFormat wireFormat, byte[] data);
byte[] GetMarshalledForm(OpenWireFormat wireFormat);
}
}
/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
using ActiveMQ.OpenWire;
namespace ActiveMQ.Commands
{
/// <summary>
/// Represents a marshallable entity
/// </summary>
public interface MarshallAware
{
void BeforeMarshall(OpenWireFormat wireFormat);
void AfterMarshall(OpenWireFormat wireFormat);
void BeforeUnmarshall(OpenWireFormat wireFormat);
void AfterUnmarshall(OpenWireFormat wireFormat);
void SetMarshalledForm(OpenWireFormat wireFormat, byte[] data);
byte[] GetMarshalledForm(OpenWireFormat wireFormat);
}
}

File diff suppressed because one or more lines are too long

View File

@ -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; }
}
}
}

View File

@ -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; }
}
}
}

View File

@ -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; }
}
}
}

View File

@ -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; }
}
}
}

View File

@ -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; }
}
}
}

View File

@ -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; }
}
}
}

View File

@ -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; }
}
}
}

View File

@ -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; }
}
}
}

View File

@ -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; }
}
}
}

View File

@ -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; }
}
}
}

View File

@ -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; }
}
}
}

View File

@ -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; }
}
}
}

View File

@ -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; }
}
}
}

View File

@ -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; }
}
}
}

View File

@ -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
}
}

View File

@ -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; }
}
}
}

View File

@ -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
}
}

View File

@ -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; }
}
}
}

View File

@ -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; }
}
}
}

View File

@ -1,38 +1,38 @@
/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace ActiveMQ
{
public interface ISynchronization
{
/// <summary>
/// Called before a commit
/// </summary>
void BeforeCommit();
/// <summary>
/// Called after a commit
/// </summary>
void AfterCommit();
/// <summary>
/// Called after a transaction rollback
/// </summary>
void AfterRollback();
}
}
/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace ActiveMQ
{
public interface ISynchronization
{
/// <summary>
/// Called before a commit
/// </summary>
void BeforeCommit();
/// <summary>
/// Called after a commit
/// </summary>
void AfterCommit();
/// <summary>
/// Called after a transaction rollback
/// </summary>
void AfterRollback();
}
}

View File

@ -1,122 +1,122 @@
/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
using System;
using System.IO;
using ActiveMQ.OpenWire;
namespace ActiveMQ.OpenWire
{
/// <summary>
/// Represents a stream of boolean flags
/// </summary>
public class BooleanStream
{
byte[] data = new byte[48];
short arrayLimit;
short arrayPos;
byte bytePos;
public bool ReadBoolean()
{
byte b = data[arrayPos];
bool rc = ((b >> bytePos) & 0x01) != 0;
bytePos++;
if (bytePos >= 8)
{
bytePos = 0;
arrayPos++;
}
return rc;
}
public void WriteBoolean(bool value)
{
if (bytePos == 0)
{
arrayLimit++;
if (arrayLimit >= data.Length)
{
// re-grow the array.
byte[] d = new byte[data.Length * 2];
Array.Copy(data, d, data.Length);
data = d;
}
}
if (value)
{
data[arrayPos] |= (byte) (0x01 << bytePos);
}
bytePos++;
if (bytePos >= 8)
{
bytePos = 0;
arrayPos++;
}
}
public void Marshal(BinaryWriter dataOut)
{
if( arrayLimit < 64 ) {
dataOut.Write((byte)arrayLimit);
} else if( arrayLimit < 256 ) { // max value of unsigned byte
dataOut.Write((byte)0xC0);
dataOut.Write((byte)arrayLimit);
} else {
dataOut.Write((byte)0x80);
dataOut.Write(arrayLimit);
}
dataOut.Write(data, 0, arrayLimit);
Clear();
}
public void Unmarshal(BinaryReader dataIn)
{
arrayLimit = (short)(dataIn.ReadByte() & 0xFF);
if ( arrayLimit == 0xC0 ) {
arrayLimit = (short)(dataIn.ReadByte() & 0xFF);
} else if( arrayLimit == 0x80 ) {
arrayLimit = dataIn.ReadInt16();
}
if( data.Length < arrayLimit ) {
data = new byte[arrayLimit];
}
dataIn.Read(data, 0, arrayLimit);
Clear();
}
public void Clear()
{
arrayPos = 0;
bytePos = 0;
}
public int MarshalledSize()
{
if( arrayLimit < 64 ) {
return 1+arrayLimit;
} else if (arrayLimit < 256) {
return 2+arrayLimit;
} else {
return 3+arrayLimit;
}
}
}
}
/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
using System;
using System.IO;
using ActiveMQ.OpenWire;
namespace ActiveMQ.OpenWire
{
/// <summary>
/// Represents a stream of boolean flags
/// </summary>
public class BooleanStream
{
byte[] data = new byte[48];
short arrayLimit;
short arrayPos;
byte bytePos;
public bool ReadBoolean()
{
byte b = data[arrayPos];
bool rc = ((b >> bytePos) & 0x01) != 0;
bytePos++;
if (bytePos >= 8)
{
bytePos = 0;
arrayPos++;
}
return rc;
}
public void WriteBoolean(bool value)
{
if (bytePos == 0)
{
arrayLimit++;
if (arrayLimit >= data.Length)
{
// re-grow the array.
byte[] d = new byte[data.Length * 2];
Array.Copy(data, d, data.Length);
data = d;
}
}
if (value)
{
data[arrayPos] |= (byte) (0x01 << bytePos);
}
bytePos++;
if (bytePos >= 8)
{
bytePos = 0;
arrayPos++;
}
}
public void Marshal(BinaryWriter dataOut)
{
if( arrayLimit < 64 ) {
dataOut.Write((byte)arrayLimit);
} else if( arrayLimit < 256 ) { // max value of unsigned byte
dataOut.Write((byte)0xC0);
dataOut.Write((byte)arrayLimit);
} else {
dataOut.Write((byte)0x80);
dataOut.Write(arrayLimit);
}
dataOut.Write(data, 0, arrayLimit);
Clear();
}
public void Unmarshal(BinaryReader dataIn)
{
arrayLimit = (short)(dataIn.ReadByte() & 0xFF);
if ( arrayLimit == 0xC0 ) {
arrayLimit = (short)(dataIn.ReadByte() & 0xFF);
} else if( arrayLimit == 0x80 ) {
arrayLimit = dataIn.ReadInt16();
}
if( data.Length < arrayLimit ) {
data = new byte[arrayLimit];
}
dataIn.Read(data, 0, arrayLimit);
Clear();
}
public void Clear()
{
arrayPos = 0;
bytePos = 0;
}
public int MarshalledSize()
{
if( arrayLimit < 64 ) {
return 1+arrayLimit;
} else if (arrayLimit < 256) {
return 2+arrayLimit;
} else {
return 3+arrayLimit;
}
}
}
}

View File

@ -1,53 +1,53 @@
/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
using ActiveMQ.Commands;
using System.Collections;
namespace ActiveMQ.OpenWire
{
public delegate object PropertyGetter(ActiveMQMessage message);
public delegate void PropertySetter(ActiveMQMessage message, object value);
public class MessagePropertyHelper
{
private IDictionary setters = new Hashtable();
private IDictionary getters = new Hashtable();
public MessagePropertyHelper()
{
// TODO find all of the JMS properties via introspection
}
public object GetObjectProperty(ActiveMQMessage message, string name) {
object getter = getters[name];
if (getter != null) {
}
return message.Properties[name];
}
public void SetObjectProperty(ActiveMQMessage message, string name, object value) {
PropertySetter setter = (PropertySetter) setters[name];
if (setter != null) {
setter(message, value);
}
else {
message.Properties[name] = value;
}
}
}
}
/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
using ActiveMQ.Commands;
using System.Collections;
namespace ActiveMQ.OpenWire
{
public delegate object PropertyGetter(ActiveMQMessage message);
public delegate void PropertySetter(ActiveMQMessage message, object value);
public class MessagePropertyHelper
{
private IDictionary setters = new Hashtable();
private IDictionary getters = new Hashtable();
public MessagePropertyHelper()
{
// TODO find all of the JMS properties via introspection
}
public object GetObjectProperty(ActiveMQMessage message, string name) {
object getter = getters[name];
if (getter != null) {
}
return message.Properties[name];
}
public void SetObjectProperty(ActiveMQMessage message, string name, object value) {
PropertySetter setter = (PropertySetter) setters[name];
if (setter != null) {
setter(message, value);
}
else {
message.Properties[name] = value;
}
}
}
}

View File

@ -1,279 +1,279 @@
/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
using ActiveMQ.Commands;
using ActiveMQ.OpenWire.V1;
using System;
using System.IO;
namespace ActiveMQ.OpenWire
{
/// <summary>
/// Represents the wire format
/// </summary>
public class OpenWireFormat
{
private BaseDataStreamMarshaller[] dataMarshallers;
private const byte NULL_TYPE = 0;
private int version=1;
private bool stackTraceEnabled=false;
private bool tightEncodingEnabled=false;
private bool sizePrefixDisabled=false;
public OpenWireFormat()
{
dataMarshallers = new BaseDataStreamMarshaller[256];
MarshallerFactory factory = new MarshallerFactory();
factory.configure(this);
}
public bool StackTraceEnabled {
get { return stackTraceEnabled; }
set { stackTraceEnabled = value; }
}
public int Version {
get { return version; }
set { version = value; }
}
public bool SizePrefixDisabled {
get { return sizePrefixDisabled; }
set { sizePrefixDisabled = value; }
}
public bool TightEncodingEnabled {
get { return tightEncodingEnabled; }
set { tightEncodingEnabled = value; }
}
public void addMarshaller(BaseDataStreamMarshaller marshaller)
{
byte type = marshaller.GetDataStructureType();
dataMarshallers[type & 0xFF] = marshaller;
}
public void Marshal(Object o, BinaryWriter ds)
{
int size = 1;
if (o != null)
{
DataStructure c = (DataStructure) o;
byte type = c.GetDataStructureType();
BaseDataStreamMarshaller dsm = dataMarshallers[type & 0xFF];
if (dsm == null)
throw new IOException("Unknown data type: " + type);
if(tightEncodingEnabled) {
BooleanStream bs = new BooleanStream();
size += dsm.TightMarshal1(this, c, bs);
size += bs.MarshalledSize();
if( !sizePrefixDisabled ) {
ds.Write(size);
}
ds.Write(type);
bs.Marshal(ds);
dsm.TightMarshal2(this, c, ds, bs);
} else {
BinaryWriter looseOut = ds;
MemoryStream ms = null;
// If we are prefixing then we need to first write it to memory,
// otherwise we can write direct to the stream.
if( !sizePrefixDisabled ) {
ms= new MemoryStream();
looseOut = new OpenWireBinaryWriter(ms);
looseOut.Write(size);
}
looseOut.Write(type);
dsm.LooseMarshal(this, c, looseOut);
if( !sizePrefixDisabled ) {
ms.Position=0;
looseOut.Write( (int)ms.Length-4 );
ds.Write(ms.GetBuffer(), 0, (int)ms.Length);
}
}
}
else
{
ds.Write(size);
ds.Write(NULL_TYPE);
}
}
public Object Unmarshal(BinaryReader dis)
{
// lets ignore the size of the packet
if( !sizePrefixDisabled ) {
dis.ReadInt32();
}
// first byte is the type of the packet
byte dataType = dis.ReadByte();
if (dataType != NULL_TYPE)
{
BaseDataStreamMarshaller dsm = dataMarshallers[dataType & 0xFF];
if (dsm == null)
throw new IOException("Unknown data type: " + dataType);
//Console.WriteLine("Parsing type: " + dataType + " with: " + dsm);
Object data = dsm.CreateObject();
if(tightEncodingEnabled) {
BooleanStream bs = new BooleanStream();
bs.Unmarshal(dis);
dsm.TightUnmarshal(this, data, dis, bs);
return data;
} else {
dsm.LooseUnmarshal(this, data, dis);
return data;
}
}
else
{
return null;
}
}
public int TightMarshalNestedObject1(DataStructure o, BooleanStream bs)
{
bs.WriteBoolean(o != null);
if (o == null)
return 0;
if (o.IsMarshallAware())
{
MarshallAware ma = (MarshallAware) o;
byte[] sequence = ma.GetMarshalledForm(this);
bs.WriteBoolean(sequence != null);
if (sequence != null)
{
return 1 + sequence.Length;
}
}
byte type = o.GetDataStructureType();
if (type == 0) {
throw new IOException("No valid data structure type for: " + o + " of type: " + o.GetType());
}
BaseDataStreamMarshaller dsm = (BaseDataStreamMarshaller) dataMarshallers[type & 0xFF];
if (dsm == null)
throw new IOException("Unknown data type: " + type);
//Console.WriteLine("Marshalling type: " + type + " with structure: " + o);
return 1 + dsm.TightMarshal1(this, o, bs);
}
public void TightMarshalNestedObject2(DataStructure o, BinaryWriter ds, BooleanStream bs)
{
if (!bs.ReadBoolean())
return ;
byte type = o.GetDataStructureType();
ds.Write(type);
if (o.IsMarshallAware() && bs.ReadBoolean())
{
MarshallAware ma = (MarshallAware) o;
byte[] sequence = ma.GetMarshalledForm(this);
ds.Write(sequence, 0, sequence.Length);
}
else
{
BaseDataStreamMarshaller dsm = (BaseDataStreamMarshaller) dataMarshallers[type & 0xFF];
if (dsm == null)
throw new IOException("Unknown data type: " + type);
dsm.TightMarshal2(this, o, ds, bs);
}
}
public DataStructure TightUnmarshalNestedObject(BinaryReader dis, BooleanStream bs)
{
if (bs.ReadBoolean())
{
byte dataType = dis.ReadByte();
BaseDataStreamMarshaller dsm = (BaseDataStreamMarshaller) dataMarshallers[dataType & 0xFF];
if (dsm == null)
throw new IOException("Unknown data type: " + dataType);
DataStructure data = dsm.CreateObject();
if (data.IsMarshallAware() && bs.ReadBoolean())
{
dis.ReadInt32();
dis.ReadByte();
BooleanStream bs2 = new BooleanStream();
bs2.Unmarshal(dis);
dsm.TightUnmarshal(this, data, dis, bs2);
// TODO: extract the sequence from the dis and associate it.
// MarshallAware ma = (MarshallAware)data
// ma.setCachedMarshalledForm(this, sequence);
}
else
{
dsm.TightUnmarshal(this, data, dis, bs);
}
return data;
}
else
{
return null;
}
}
public void LooseMarshalNestedObject(DataStructure o, BinaryWriter dataOut)
{
dataOut.Write(o!=null);
if( o!=null ) {
byte type = o.GetDataStructureType();
dataOut.Write(type);
BaseDataStreamMarshaller dsm = (BaseDataStreamMarshaller) dataMarshallers[type & 0xFF];
if( dsm == null )
throw new IOException("Unknown data type: "+type);
dsm.LooseMarshal(this, o, dataOut);
}
}
public DataStructure LooseUnmarshalNestedObject(BinaryReader dis)
{
if (dis.ReadBoolean())
{
byte dataType = dis.ReadByte();
BaseDataStreamMarshaller dsm = (BaseDataStreamMarshaller) dataMarshallers[dataType & 0xFF];
if (dsm == null)
throw new IOException("Unknown data type: " + dataType);
DataStructure data = dsm.CreateObject();
dsm.LooseUnmarshal(this, data, dis);
return data;
}
else
{
return null;
}
}
}
}
/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
using ActiveMQ.Commands;
using ActiveMQ.OpenWire.V1;
using System;
using System.IO;
namespace ActiveMQ.OpenWire
{
/// <summary>
/// Represents the wire format
/// </summary>
public class OpenWireFormat
{
private BaseDataStreamMarshaller[] dataMarshallers;
private const byte NULL_TYPE = 0;
private int version=1;
private bool stackTraceEnabled=false;
private bool tightEncodingEnabled=false;
private bool sizePrefixDisabled=false;
public OpenWireFormat()
{
dataMarshallers = new BaseDataStreamMarshaller[256];
MarshallerFactory factory = new MarshallerFactory();
factory.configure(this);
}
public bool StackTraceEnabled {
get { return stackTraceEnabled; }
set { stackTraceEnabled = value; }
}
public int Version {
get { return version; }
set { version = value; }
}
public bool SizePrefixDisabled {
get { return sizePrefixDisabled; }
set { sizePrefixDisabled = value; }
}
public bool TightEncodingEnabled {
get { return tightEncodingEnabled; }
set { tightEncodingEnabled = value; }
}
public void addMarshaller(BaseDataStreamMarshaller marshaller)
{
byte type = marshaller.GetDataStructureType();
dataMarshallers[type & 0xFF] = marshaller;
}
public void Marshal(Object o, BinaryWriter ds)
{
int size = 1;
if (o != null)
{
DataStructure c = (DataStructure) o;
byte type = c.GetDataStructureType();
BaseDataStreamMarshaller dsm = dataMarshallers[type & 0xFF];
if (dsm == null)
throw new IOException("Unknown data type: " + type);
if(tightEncodingEnabled) {
BooleanStream bs = new BooleanStream();
size += dsm.TightMarshal1(this, c, bs);
size += bs.MarshalledSize();
if( !sizePrefixDisabled ) {
ds.Write(size);
}
ds.Write(type);
bs.Marshal(ds);
dsm.TightMarshal2(this, c, ds, bs);
} else {
BinaryWriter looseOut = ds;
MemoryStream ms = null;
// If we are prefixing then we need to first write it to memory,
// otherwise we can write direct to the stream.
if( !sizePrefixDisabled ) {
ms= new MemoryStream();
looseOut = new OpenWireBinaryWriter(ms);
looseOut.Write(size);
}
looseOut.Write(type);
dsm.LooseMarshal(this, c, looseOut);
if( !sizePrefixDisabled ) {
ms.Position=0;
looseOut.Write( (int)ms.Length-4 );
ds.Write(ms.GetBuffer(), 0, (int)ms.Length);
}
}
}
else
{
ds.Write(size);
ds.Write(NULL_TYPE);
}
}
public Object Unmarshal(BinaryReader dis)
{
// lets ignore the size of the packet
if( !sizePrefixDisabled ) {
dis.ReadInt32();
}
// first byte is the type of the packet
byte dataType = dis.ReadByte();
if (dataType != NULL_TYPE)
{
BaseDataStreamMarshaller dsm = dataMarshallers[dataType & 0xFF];
if (dsm == null)
throw new IOException("Unknown data type: " + dataType);
//Console.WriteLine("Parsing type: " + dataType + " with: " + dsm);
Object data = dsm.CreateObject();
if(tightEncodingEnabled) {
BooleanStream bs = new BooleanStream();
bs.Unmarshal(dis);
dsm.TightUnmarshal(this, data, dis, bs);
return data;
} else {
dsm.LooseUnmarshal(this, data, dis);
return data;
}
}
else
{
return null;
}
}
public int TightMarshalNestedObject1(DataStructure o, BooleanStream bs)
{
bs.WriteBoolean(o != null);
if (o == null)
return 0;
if (o.IsMarshallAware())
{
MarshallAware ma = (MarshallAware) o;
byte[] sequence = ma.GetMarshalledForm(this);
bs.WriteBoolean(sequence != null);
if (sequence != null)
{
return 1 + sequence.Length;
}
}
byte type = o.GetDataStructureType();
if (type == 0) {
throw new IOException("No valid data structure type for: " + o + " of type: " + o.GetType());
}
BaseDataStreamMarshaller dsm = (BaseDataStreamMarshaller) dataMarshallers[type & 0xFF];
if (dsm == null)
throw new IOException("Unknown data type: " + type);
//Console.WriteLine("Marshalling type: " + type + " with structure: " + o);
return 1 + dsm.TightMarshal1(this, o, bs);
}
public void TightMarshalNestedObject2(DataStructure o, BinaryWriter ds, BooleanStream bs)
{
if (!bs.ReadBoolean())
return ;
byte type = o.GetDataStructureType();
ds.Write(type);
if (o.IsMarshallAware() && bs.ReadBoolean())
{
MarshallAware ma = (MarshallAware) o;
byte[] sequence = ma.GetMarshalledForm(this);
ds.Write(sequence, 0, sequence.Length);
}
else
{
BaseDataStreamMarshaller dsm = (BaseDataStreamMarshaller) dataMarshallers[type & 0xFF];
if (dsm == null)
throw new IOException("Unknown data type: " + type);
dsm.TightMarshal2(this, o, ds, bs);
}
}
public DataStructure TightUnmarshalNestedObject(BinaryReader dis, BooleanStream bs)
{
if (bs.ReadBoolean())
{
byte dataType = dis.ReadByte();
BaseDataStreamMarshaller dsm = (BaseDataStreamMarshaller) dataMarshallers[dataType & 0xFF];
if (dsm == null)
throw new IOException("Unknown data type: " + dataType);
DataStructure data = dsm.CreateObject();
if (data.IsMarshallAware() && bs.ReadBoolean())
{
dis.ReadInt32();
dis.ReadByte();
BooleanStream bs2 = new BooleanStream();
bs2.Unmarshal(dis);
dsm.TightUnmarshal(this, data, dis, bs2);
// TODO: extract the sequence from the dis and associate it.
// MarshallAware ma = (MarshallAware)data
// ma.setCachedMarshalledForm(this, sequence);
}
else
{
dsm.TightUnmarshal(this, data, dis, bs);
}
return data;
}
else
{
return null;
}
}
public void LooseMarshalNestedObject(DataStructure o, BinaryWriter dataOut)
{
dataOut.Write(o!=null);
if( o!=null ) {
byte type = o.GetDataStructureType();
dataOut.Write(type);
BaseDataStreamMarshaller dsm = (BaseDataStreamMarshaller) dataMarshallers[type & 0xFF];
if( dsm == null )
throw new IOException("Unknown data type: "+type);
dsm.LooseMarshal(this, o, dataOut);
}
}
public DataStructure LooseUnmarshalNestedObject(BinaryReader dis)
{
if (dis.ReadBoolean())
{
byte dataType = dis.ReadByte();
BaseDataStreamMarshaller dsm = (BaseDataStreamMarshaller) dataMarshallers[dataType & 0xFF];
if (dsm == null)
throw new IOException("Unknown data type: " + dataType);
DataStructure data = dsm.CreateObject();
dsm.LooseUnmarshal(this, data, dis);
return data;
}
else
{
return null;
}
}
}
}

View File

@ -1,64 +1,64 @@
//
//
// Copyright 2005-2006 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
using ActiveMQ.Commands;
using System;
using System.IO;
namespace ActiveMQ.OpenWire.V1
{
//
// Marshalling code for Open Wire Format for DataStructureSupport
//
//
// NOTE!: This file is autogenerated - do not modify!
// if you need to make a change, please see the Groovy scripts in the
// activemq-core module
//
public abstract class DataStructureSupportMarshaller : BaseDataStreamMarshaller
{
//
// Un-marshal an object instance from the data input stream
//
public override void TightUnmarshal(OpenWireFormat wireFormat, Object o, BinaryReader dataIn, BooleanStream bs)
{
base.TightUnmarshal(wireFormat, o, dataIn, bs);
}
//
// Write the booleans that this object uses to a BooleanStream
//
public override int TightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) {
DataStructureSupport info = (DataStructureSupport)o;
int rc = base.TightMarshal1(wireFormat, info, bs);
return rc + 0;
}
//
// Write a object instance to data output stream
//
public override void TightMarshal2(OpenWireFormat wireFormat, Object o, BinaryWriter dataOut, BooleanStream bs) {
base.TightMarshal2(wireFormat, o, dataOut, bs);
}
}
}
//
//
// Copyright 2005-2006 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
using ActiveMQ.Commands;
using System;
using System.IO;
namespace ActiveMQ.OpenWire.V1
{
//
// Marshalling code for Open Wire Format for DataStructureSupport
//
//
// NOTE!: This file is autogenerated - do not modify!
// if you need to make a change, please see the Groovy scripts in the
// activemq-core module
//
public abstract class DataStructureSupportMarshaller : BaseDataStreamMarshaller
{
//
// Un-marshal an object instance from the data input stream
//
public override void TightUnmarshal(OpenWireFormat wireFormat, Object o, BinaryReader dataIn, BooleanStream bs)
{
base.TightUnmarshal(wireFormat, o, dataIn, bs);
}
//
// Write the booleans that this object uses to a BooleanStream
//
public override int TightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) {
DataStructureSupport info = (DataStructureSupport)o;
int rc = base.TightMarshal1(wireFormat, info, bs);
return rc + 0;
}
//
// Write a object instance to data output stream
//
public override void TightMarshal2(OpenWireFormat wireFormat, Object o, BinaryWriter dataOut, BooleanStream bs) {
base.TightMarshal2(wireFormat, o, dataOut, bs);
}
}
}

View File

@ -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);
}
}
}

View File

@ -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);
}
}
}

View File

@ -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);
}
}
}

View File

@ -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);
}
}
}
}

View File

@ -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);
}
}
}

View File

@ -1,118 +1,118 @@
/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
using ActiveMQ;
using ActiveMQ.Commands;
using System.Collections;
namespace ActiveMQ
{
public enum TransactionType
{
Begin = 0, Prepare = 1, CommitOnePhase = 2, CommitTwoPhase = 3, Rollback = 4, Recover=5, Forget = 6, End = 7
}
}
namespace ActiveMQ
{
public class TransactionContext
{
private TransactionId transactionId;
private Session session;
private ArrayList synchronizations = new ArrayList();
public TransactionContext(Session session)
{
this.session = session;
}
public TransactionId TransactionId
{
get { return transactionId; }
}
/// <summary>
/// Method AddSynchronization
/// </summary>
public void AddSynchronization(ISynchronization synchronization)
{
synchronizations.Add(synchronization);
}
public void Begin()
{
if (transactionId == null)
{
transactionId = session.Connection.CreateLocalTransactionId();
TransactionInfo info = new TransactionInfo();
info.ConnectionId = session.Connection.ConnectionId;
info.TransactionId = transactionId;
info.Type = (int) TransactionType.Begin;
session.Connection.OneWay(info);
}
}
public void Rollback()
{
if (transactionId != null)
{
TransactionInfo info = new TransactionInfo();
info.ConnectionId = session.Connection.ConnectionId;
info.TransactionId = transactionId;
info.Type = (int) TransactionType.Rollback;
transactionId = null;
session.Connection.OneWay(info);
}
foreach (ISynchronization synchronization in synchronizations)
{
synchronization.AfterRollback();
}
synchronizations.Clear();
}
public void Commit()
{
foreach (ISynchronization synchronization in synchronizations)
{
synchronization.BeforeCommit();
}
if (transactionId != null)
{
TransactionInfo info = new TransactionInfo();
info.ConnectionId = session.Connection.ConnectionId;
info.TransactionId = transactionId;
info.Type = (int) TransactionType.CommitOnePhase;
transactionId = null;
session.Connection.OneWay(info);
}
foreach (ISynchronization synchronization in synchronizations)
{
synchronization.AfterCommit();
}
synchronizations.Clear();
}
}
}
/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
using ActiveMQ;
using ActiveMQ.Commands;
using System.Collections;
namespace ActiveMQ
{
public enum TransactionType
{
Begin = 0, Prepare = 1, CommitOnePhase = 2, CommitTwoPhase = 3, Rollback = 4, Recover=5, Forget = 6, End = 7
}
}
namespace ActiveMQ
{
public class TransactionContext
{
private TransactionId transactionId;
private Session session;
private ArrayList synchronizations = new ArrayList();
public TransactionContext(Session session)
{
this.session = session;
}
public TransactionId TransactionId
{
get { return transactionId; }
}
/// <summary>
/// Method AddSynchronization
/// </summary>
public void AddSynchronization(ISynchronization synchronization)
{
synchronizations.Add(synchronization);
}
public void Begin()
{
if (transactionId == null)
{
transactionId = session.Connection.CreateLocalTransactionId();
TransactionInfo info = new TransactionInfo();
info.ConnectionId = session.Connection.ConnectionId;
info.TransactionId = transactionId;
info.Type = (int) TransactionType.Begin;
session.Connection.OneWay(info);
}
}
public void Rollback()
{
if (transactionId != null)
{
TransactionInfo info = new TransactionInfo();
info.ConnectionId = session.Connection.ConnectionId;
info.TransactionId = transactionId;
info.Type = (int) TransactionType.Rollback;
transactionId = null;
session.Connection.OneWay(info);
}
foreach (ISynchronization synchronization in synchronizations)
{
synchronization.AfterRollback();
}
synchronizations.Clear();
}
public void Commit()
{
foreach (ISynchronization synchronization in synchronizations)
{
synchronization.BeforeCommit();
}
if (transactionId != null)
{
TransactionInfo info = new TransactionInfo();
info.ConnectionId = session.Connection.ConnectionId;
info.TransactionId = transactionId;
info.Type = (int) TransactionType.CommitOnePhase;
transactionId = null;
session.Connection.OneWay(info);
}
foreach (ISynchronization synchronization in synchronizations)
{
synchronization.AfterCommit();
}
synchronizations.Clear();
}
}
}

View File

@ -1,26 +1,26 @@
/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
using System;
namespace ActiveMQ.Transport
{
public interface ITransportFactory
{
ITransport CreateTransport(Uri location);
}
}
/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
using System;
namespace ActiveMQ.Transport
{
public interface ITransportFactory
{
ITransport CreateTransport(Uri location);
}
}

View File

@ -1,50 +1,50 @@
/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
using ActiveMQ.Commands;
using ActiveMQ.Transport;
using System;
namespace ActiveMQ.Transport
{
/// <summary>
/// A Transport filter that is used to log the commands sent and received.
/// </summary>
public class LoggingTransport : TransportFilter
{
public LoggingTransport(ITransport next) : base(next) {
}
protected override void OnCommand(ITransport sender, Command command) {
Console.WriteLine("RECEIVED: " + command);
this.commandHandler(sender, command);
}
protected override void OnException(ITransport sender, Exception error) {
Console.WriteLine("RECEIVED Exception: " + error);
this.exceptionHandler(sender, error);
}
public override void Oneway(Command command)
{
Console.WriteLine("SENDING: " + command);
this.next.Oneway(command);
}
}
}
/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
using ActiveMQ.Commands;
using ActiveMQ.Transport;
using System;
namespace ActiveMQ.Transport
{
/// <summary>
/// A Transport filter that is used to log the commands sent and received.
/// </summary>
public class LoggingTransport : TransportFilter
{
public LoggingTransport(ITransport next) : base(next) {
}
protected override void OnCommand(ITransport sender, Command command) {
Console.WriteLine("RECEIVED: " + command);
this.commandHandler(sender, command);
}
protected override void OnException(ITransport sender, Exception error) {
Console.WriteLine("RECEIVED Exception: " + error);
this.exceptionHandler(sender, error);
}
public override void Oneway(Command command)
{
Console.WriteLine("SENDING: " + command);
this.next.Oneway(command);
}
}
}

View File

@ -1,70 +1,70 @@
/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
using ActiveMQ.Commands;
using ActiveMQ.Transport;
using System;
namespace ActiveMQ.Transport
{
/// <summary>
/// A Transport which gaurds access to the next transport using a mutex.
/// </summary>
public class MutexTransport : TransportFilter
{
private readonly object transmissionLock = new object();
public MutexTransport(ITransport next) : base(next) {
}
public override void Oneway(Command command)
{
lock (transmissionLock)
{
this.next.Oneway(command);
}
}
public override FutureResponse AsyncRequest(Command command)
{
lock (transmissionLock)
{
return base.AsyncRequest(command);
}
}
public override Response Request(Command command)
{
lock (transmissionLock)
{
return base.Request(command);
}
}
public override void Dispose()
{
lock (transmissionLock)
{
base.Dispose();
}
}
}
}
/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
using ActiveMQ.Commands;
using ActiveMQ.Transport;
using System;
namespace ActiveMQ.Transport
{
/// <summary>
/// A Transport which gaurds access to the next transport using a mutex.
/// </summary>
public class MutexTransport : TransportFilter
{
private readonly object transmissionLock = new object();
public MutexTransport(ITransport next) : base(next) {
}
public override void Oneway(Command command)
{
lock (transmissionLock)
{
this.next.Oneway(command);
}
}
public override FutureResponse AsyncRequest(Command command)
{
lock (transmissionLock)
{
return base.AsyncRequest(command);
}
}
public override Response Request(Command command)
{
lock (transmissionLock)
{
return base.Request(command);
}
}
public override void Dispose()
{
lock (transmissionLock)
{
base.Dispose();
}
}
}
}

View File

@ -1,104 +1,104 @@
/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
using System;
using System.Collections;
using ActiveMQ.Commands;
using ActiveMQ.Transport;
namespace ActiveMQ.Transport
{
/// <summary>
/// A Transport which gaurds access to the next transport using a mutex.
/// </summary>
public class ResponseCorrelator : TransportFilter
{
private readonly IDictionary requestMap = Hashtable.Synchronized(new Hashtable());
private readonly Object mutex = new Object();
private short nextCommandId;
public ResponseCorrelator(ITransport next) : base(next) {
}
short GetNextCommandId() {
lock(mutex) {
return ++nextCommandId;
}
}
public override void Oneway(Command command)
{
command.CommandId = GetNextCommandId();
command.ResponseRequired = false;
next.Oneway(command);
}
public override FutureResponse AsyncRequest(Command command)
{
command.CommandId = GetNextCommandId();
command.ResponseRequired = true;
FutureResponse future = new FutureResponse();
requestMap[command.CommandId] = future;
next.Oneway(command);
return future;
}
public override Response Request(Command command)
{
FutureResponse future = AsyncRequest(command);
Response response = future.Response;
if (response is ExceptionResponse)
{
ExceptionResponse er = (ExceptionResponse) response;
BrokerError brokerError = er.Exception;
throw new BrokerException(brokerError);
}
return response;
}
protected override void OnCommand(ITransport sender, Command command)
{
if( command is Response ) {
Response response = (Response) command;
FutureResponse future = (FutureResponse) requestMap[response.CorrelationId];
if (future != null)
{
if (response is ExceptionResponse)
{
ExceptionResponse er = (ExceptionResponse) response;
BrokerError brokerError = er.Exception;
this.exceptionHandler(this, new BrokerException(brokerError));
}
future.Response = response;
}
else
{
Console.WriteLine("ERROR: Unknown response ID: " + response.CommandId + " for response: " + response);
}
} else {
this.commandHandler(sender, command);
}
}
}
}
/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
using System;
using System.Collections;
using ActiveMQ.Commands;
using ActiveMQ.Transport;
namespace ActiveMQ.Transport
{
/// <summary>
/// A Transport which gaurds access to the next transport using a mutex.
/// </summary>
public class ResponseCorrelator : TransportFilter
{
private readonly IDictionary requestMap = Hashtable.Synchronized(new Hashtable());
private readonly Object mutex = new Object();
private short nextCommandId;
public ResponseCorrelator(ITransport next) : base(next) {
}
short GetNextCommandId() {
lock(mutex) {
return ++nextCommandId;
}
}
public override void Oneway(Command command)
{
command.CommandId = GetNextCommandId();
command.ResponseRequired = false;
next.Oneway(command);
}
public override FutureResponse AsyncRequest(Command command)
{
command.CommandId = GetNextCommandId();
command.ResponseRequired = true;
FutureResponse future = new FutureResponse();
requestMap[command.CommandId] = future;
next.Oneway(command);
return future;
}
public override Response Request(Command command)
{
FutureResponse future = AsyncRequest(command);
Response response = future.Response;
if (response is ExceptionResponse)
{
ExceptionResponse er = (ExceptionResponse) response;
BrokerError brokerError = er.Exception;
throw new BrokerException(brokerError);
}
return response;
}
protected override void OnCommand(ITransport sender, Command command)
{
if( command is Response ) {
Response response = (Response) command;
FutureResponse future = (FutureResponse) requestMap[response.CorrelationId];
if (future != null)
{
if (response is ExceptionResponse)
{
ExceptionResponse er = (ExceptionResponse) response;
BrokerError brokerError = er.Exception;
this.exceptionHandler(this, new BrokerException(brokerError));
}
future.Response = response;
}
else
{
Console.WriteLine("ERROR: Unknown response ID: " + response.CommandId + " for response: " + response);
}
} else {
this.commandHandler(sender, command);
}
}
}
}

View File

@ -1,152 +1,152 @@
/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
using ActiveMQ;
using ActiveMQ.Commands;
using ActiveMQ.OpenWire;
using ActiveMQ.Transport;
using System;
using System.Collections;
using System.IO;
using System.Net;
using System.Net.Sockets;
using System.Threading;
namespace ActiveMQ.Transport.Tcp
{
/// <summary>
/// An implementation of ITransport that uses sockets to communicate with the broker
/// </summary>
public class TcpTransport : ITransport
{
private Socket socket;
private OpenWireFormat wireformat = new OpenWireFormat();
private BinaryReader socketReader;
private BinaryWriter socketWriter;
private Thread readThread;
private bool started;
volatile private bool closed;
private CommandHandler commandHandler;
private ExceptionHandler exceptionHandler;
public TcpTransport(Socket socket)
{
this.socket = socket;
}
/// <summary>
/// Method Start
/// </summary>
public void Start()
{
if (!started)
{
if( commandHandler == null )
throw new InvalidOperationException ("command cannot be null when Start is called.");
if( exceptionHandler == null )
throw new InvalidOperationException ("exception cannot be null when Start is called.");
started = true;
NetworkStream networkStream = new NetworkStream(socket);
socketWriter = new OpenWireBinaryWriter(networkStream);
socketReader = new OpenWireBinaryReader(networkStream);
// now lets create the background read thread
readThread = new Thread(new ThreadStart(ReadLoop));
readThread.Start();
// lets send the wireformat we're using
WireFormatInfo info = new WireFormatInfo();
info.StackTraceEnabled=false;
info.TightEncodingEnabled=false;
info.TcpNoDelayEnabled=false;
info.CacheEnabled=false;
info.SizePrefixDisabled=false;
Oneway(info);
}
}
public void Oneway(Command command)
{
wireformat.Marshal(command, socketWriter);
socketWriter.Flush();
}
public FutureResponse AsyncRequest(Command command)
{
throw new NotImplementedException("Use a ResponseCorrelator if you want to issue AsyncRequest calls");
}
public Response Request(Command command)
{
throw new NotImplementedException("Use a ResponseCorrelator if you want to issue Request calls");
}
public void Dispose()
{
closed = true;
socket.Close();
readThread.Join();
socketWriter.Close();
socketReader.Close();
}
public void ReadLoop()
{
while (!closed)
{
try
{
Command command = (Command) wireformat.Unmarshal(socketReader);
this.commandHandler(this, command);
}
catch (ObjectDisposedException)
{
break;
}
catch ( Exception e) {
if( e.GetBaseException() is ObjectDisposedException ) {
break;
}
if( !closed ) {
this.exceptionHandler(this,e);
}
break;
}
}
}
// Implementation methods
public CommandHandler Command {
get { return commandHandler; }
set { this.commandHandler = value; }
}
public ExceptionHandler Exception {
get { return exceptionHandler; }
set { this.exceptionHandler = value; }
}
}
}
/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
using ActiveMQ;
using ActiveMQ.Commands;
using ActiveMQ.OpenWire;
using ActiveMQ.Transport;
using System;
using System.Collections;
using System.IO;
using System.Net;
using System.Net.Sockets;
using System.Threading;
namespace ActiveMQ.Transport.Tcp
{
/// <summary>
/// An implementation of ITransport that uses sockets to communicate with the broker
/// </summary>
public class TcpTransport : ITransport
{
private Socket socket;
private OpenWireFormat wireformat = new OpenWireFormat();
private BinaryReader socketReader;
private BinaryWriter socketWriter;
private Thread readThread;
private bool started;
volatile private bool closed;
private CommandHandler commandHandler;
private ExceptionHandler exceptionHandler;
public TcpTransport(Socket socket)
{
this.socket = socket;
}
/// <summary>
/// Method Start
/// </summary>
public void Start()
{
if (!started)
{
if( commandHandler == null )
throw new InvalidOperationException ("command cannot be null when Start is called.");
if( exceptionHandler == null )
throw new InvalidOperationException ("exception cannot be null when Start is called.");
started = true;
NetworkStream networkStream = new NetworkStream(socket);
socketWriter = new OpenWireBinaryWriter(networkStream);
socketReader = new OpenWireBinaryReader(networkStream);
// now lets create the background read thread
readThread = new Thread(new ThreadStart(ReadLoop));
readThread.Start();
// lets send the wireformat we're using
WireFormatInfo info = new WireFormatInfo();
info.StackTraceEnabled=false;
info.TightEncodingEnabled=false;
info.TcpNoDelayEnabled=false;
info.CacheEnabled=false;
info.SizePrefixDisabled=false;
Oneway(info);
}
}
public void Oneway(Command command)
{
wireformat.Marshal(command, socketWriter);
socketWriter.Flush();
}
public FutureResponse AsyncRequest(Command command)
{
throw new NotImplementedException("Use a ResponseCorrelator if you want to issue AsyncRequest calls");
}
public Response Request(Command command)
{
throw new NotImplementedException("Use a ResponseCorrelator if you want to issue Request calls");
}
public void Dispose()
{
closed = true;
socket.Close();
readThread.Join();
socketWriter.Close();
socketReader.Close();
}
public void ReadLoop()
{
while (!closed)
{
try
{
Command command = (Command) wireformat.Unmarshal(socketReader);
this.commandHandler(this, command);
}
catch (ObjectDisposedException)
{
break;
}
catch ( Exception e) {
if( e.GetBaseException() is ObjectDisposedException ) {
break;
}
if( !closed ) {
this.exceptionHandler(this,e);
}
break;
}
}
}
// Implementation methods
public CommandHandler Command {
get { return commandHandler; }
set { this.commandHandler = value; }
}
public ExceptionHandler Exception {
get { return exceptionHandler; }
set { this.exceptionHandler = value; }
}
}
}

View File

@ -1,62 +1,62 @@
/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
using System;
using System.Net;
using System.Net.Sockets;
using ActiveMQ.Transport;
namespace ActiveMQ.Transport.Tcp
{
public class TcpTransportFactory : ITransportFactory
{
public ITransport CreateTransport(Uri location) {
// Console.WriteLine("Opening socket to: " + host + " on port: " + port);
Socket socket = Connect(location.Host, location.Port);
ITransport rc = new TcpTransport(socket);
// TODO: use URI query string to enable the LoggingTransport
rc = new LoggingTransport(rc);
rc = new ResponseCorrelator(rc);
rc = new MutexTransport(rc);
return rc;
}
protected Socket Connect(string host, int port)
{
// Looping through the AddressList allows different type of connections to be tried
// (IPv4, IPv6 and whatever else may be available).
IPHostEntry hostEntry = Dns.Resolve(host);
foreach (IPAddress address in hostEntry.AddressList)
{
Socket socket = new Socket(
address.AddressFamily,
SocketType.Stream,
ProtocolType.Tcp);
socket.Connect(new IPEndPoint(address, port));
if (socket.Connected)
{
return socket;
}
}
throw new SocketException();
}
}
}
/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
using System;
using System.Net;
using System.Net.Sockets;
using ActiveMQ.Transport;
namespace ActiveMQ.Transport.Tcp
{
public class TcpTransportFactory : ITransportFactory
{
public ITransport CreateTransport(Uri location) {
// Console.WriteLine("Opening socket to: " + host + " on port: " + port);
Socket socket = Connect(location.Host, location.Port);
ITransport rc = new TcpTransport(socket);
// TODO: use URI query string to enable the LoggingTransport
rc = new LoggingTransport(rc);
rc = new ResponseCorrelator(rc);
rc = new MutexTransport(rc);
return rc;
}
protected Socket Connect(string host, int port)
{
// Looping through the AddressList allows different type of connections to be tried
// (IPv4, IPv6 and whatever else may be available).
IPHostEntry hostEntry = Dns.Resolve(host);
foreach (IPAddress address in hostEntry.AddressList)
{
Socket socket = new Socket(
address.AddressFamily,
SocketType.Stream,
ProtocolType.Tcp);
socket.Connect(new IPEndPoint(address, port));
if (socket.Connected)
{
return socket;
}
}
throw new SocketException();
}
}
}

View File

@ -1,109 +1,109 @@
/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
using ActiveMQ.Commands;
using ActiveMQ.Transport;
using System;
namespace ActiveMQ.Transport
{
/// <summary>
/// Used to implement a filter on the transport layer.
/// </summary>
public class TransportFilter : ITransport
{
protected readonly ITransport next;
protected CommandHandler commandHandler;
protected ExceptionHandler exceptionHandler;
public TransportFilter(ITransport next) {
this.next = next;
this.next.Command = new CommandHandler(OnCommand);
this.next.Exception = new ExceptionHandler(OnException);
}
protected virtual void OnCommand(ITransport sender, Command command) {
this.commandHandler(sender, command);
}
protected virtual void OnException(ITransport sender, Exception command) {
this.exceptionHandler(sender, command);
}
/// <summary>
/// Method Oneway
/// </summary>
/// <param name="command">A Command</param>
public virtual void Oneway(Command command)
{
this.next.Oneway(command);
}
/// <summary>
/// Method AsyncRequest
/// </summary>
/// <returns>A FutureResponse</returns>
/// <param name="command">A Command</param>
public virtual FutureResponse AsyncRequest(Command command)
{
return this.next.AsyncRequest(command);
}
/// <summary>
/// Method Request
/// </summary>
/// <returns>A Response</returns>
/// <param name="command">A Command</param>
public virtual Response Request(Command command)
{
return this.next.Request(command);
}
/// <summary>
/// Method Start
/// </summary>
public virtual void Start()
{
if( commandHandler == null )
throw new InvalidOperationException ("command cannot be null when Start is called.");
if( exceptionHandler == null )
throw new InvalidOperationException ("exception cannot be null when Start is called.");
this.next.Start();
}
/// <summary>
/// Method Dispose
/// </summary>
public virtual void Dispose()
{
this.next.Dispose();
}
public CommandHandler Command {
get { return commandHandler; }
set { this.commandHandler = value; }
}
public ExceptionHandler Exception {
get { return exceptionHandler; }
set { this.exceptionHandler = value; }
}
}
}
/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
using ActiveMQ.Commands;
using ActiveMQ.Transport;
using System;
namespace ActiveMQ.Transport
{
/// <summary>
/// Used to implement a filter on the transport layer.
/// </summary>
public class TransportFilter : ITransport
{
protected readonly ITransport next;
protected CommandHandler commandHandler;
protected ExceptionHandler exceptionHandler;
public TransportFilter(ITransport next) {
this.next = next;
this.next.Command = new CommandHandler(OnCommand);
this.next.Exception = new ExceptionHandler(OnException);
}
protected virtual void OnCommand(ITransport sender, Command command) {
this.commandHandler(sender, command);
}
protected virtual void OnException(ITransport sender, Exception command) {
this.exceptionHandler(sender, command);
}
/// <summary>
/// Method Oneway
/// </summary>
/// <param name="command">A Command</param>
public virtual void Oneway(Command command)
{
this.next.Oneway(command);
}
/// <summary>
/// Method AsyncRequest
/// </summary>
/// <returns>A FutureResponse</returns>
/// <param name="command">A Command</param>
public virtual FutureResponse AsyncRequest(Command command)
{
return this.next.AsyncRequest(command);
}
/// <summary>
/// Method Request
/// </summary>
/// <returns>A Response</returns>
/// <param name="command">A Command</param>
public virtual Response Request(Command command)
{
return this.next.Request(command);
}
/// <summary>
/// Method Start
/// </summary>
public virtual void Start()
{
if( commandHandler == null )
throw new InvalidOperationException ("command cannot be null when Start is called.");
if( exceptionHandler == null )
throw new InvalidOperationException ("exception cannot be null when Start is called.");
this.next.Start();
}
/// <summary>
/// Method Dispose
/// </summary>
public virtual void Dispose()
{
this.next.Dispose();
}
public CommandHandler Command {
get { return commandHandler; }
set { this.commandHandler = value; }
}
public ExceptionHandler Exception {
get { return exceptionHandler; }
set { this.exceptionHandler = value; }
}
}
}

View File

@ -1,33 +1,33 @@
/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace NMS
{
/// <summary>
/// Represents a binary based message
/// </summary>
public interface IBytesMessage : IMessage
{
byte[] Content
{
get;
set;
}
}
}
/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace NMS
{
/// <summary>
/// Represents a binary based message
/// </summary>
public interface IBytesMessage : IMessage
{
byte[] Content
{
get;
set;
}
}
}

View File

@ -1,38 +1,38 @@
/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace NMS
{
/// <summary>
/// A Factory of IConnection objects
/// </summary>
public interface IConnectionFactory
{
/// <summary>
/// Creates a new connection
/// </summary>
IConnection CreateConnection();
/// <summary>
/// Creates a new connection with the given user name and password
/// </summary>
IConnection CreateConnection(string userName, string password);
}
}
/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace NMS
{
/// <summary>
/// A Factory of IConnection objects
/// </summary>
public interface IConnectionFactory
{
/// <summary>
/// Creates a new connection
/// </summary>
IConnection CreateConnection();
/// <summary>
/// Creates a new connection with the given user name and password
/// </summary>
IConnection CreateConnection(string userName, string password);
}
}

View File

@ -1,34 +1,34 @@
/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace NMS
{
/// <summary>
/// Represents a Map message which contains key and value pairs which are
/// of primitive types
/// </summary>
public interface IMapMessage : IMessage
{
IPrimitiveMap Body
{
get;
}
}
}
/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace NMS
{
/// <summary>
/// Represents a Map message which contains key and value pairs which are
/// of primitive types
/// </summary>
public interface IMapMessage : IMessage
{
IPrimitiveMap Body
{
get;
}
}
}

View File

@ -1,130 +1,130 @@
/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace NMS
{
/// <summary>
/// Represents a message either to be sent to a message broker or received from a message broker
/// </summary>
public interface IMessage
{
/// <summary>
/// If using client acknowledgement mode on the session then this method will acknowledge that the
/// message has been processed correctly.
/// </summary>
void Acknowledge();
/// <summary>
/// Provides access to the message properties (headers)
/// </summary>
IPrimitiveMap Properties
{
get;
}
/// <summary>
/// The correlation ID used to correlate messages from conversations or long running business processes
/// </summary>
string NMSCorrelationID
{
get;
set;
}
/// <summary>
/// The destination of the message
/// </summary>
IDestination NMSDestination
{
get;
}
/// <summary>
/// The time in milliseconds that this message should expire in
/// </summary>
long NMSExpiration
{
get;
set;
}
/// <summary>
/// The message ID which is set by the provider
/// </summary>
string NMSMessageId
{
get;
}
/// <summary>
/// Whether or not this message is persistent
/// </summary>
bool NMSPersistent
{
get;
set;
}
/// <summary>
/// The Priority on this message
/// </summary>
byte NMSPriority
{
get;
set;
}
/// <summary>
/// Returns true if this message has been redelivered to this or another consumer before being acknowledged successfully.
/// </summary>
bool NMSRedelivered
{
get;
}
/// <summary>
/// The destination that the consumer of this message should send replies to
/// </summary>
IDestination NMSReplyTo
{
get;
set;
}
/// <summary>
/// The timestamp the broker added to the message
/// </summary>
long NMSTimestamp
{
get;
}
/// <summary>
/// The type name of this message
/// </summary>
string NMSType
{
get;
set;
}
}
}
/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace NMS
{
/// <summary>
/// Represents a message either to be sent to a message broker or received from a message broker
/// </summary>
public interface IMessage
{
/// <summary>
/// If using client acknowledgement mode on the session then this method will acknowledge that the
/// message has been processed correctly.
/// </summary>
void Acknowledge();
/// <summary>
/// Provides access to the message properties (headers)
/// </summary>
IPrimitiveMap Properties
{
get;
}
/// <summary>
/// The correlation ID used to correlate messages from conversations or long running business processes
/// </summary>
string NMSCorrelationID
{
get;
set;
}
/// <summary>
/// The destination of the message
/// </summary>
IDestination NMSDestination
{
get;
}
/// <summary>
/// The time in milliseconds that this message should expire in
/// </summary>
long NMSExpiration
{
get;
set;
}
/// <summary>
/// The message ID which is set by the provider
/// </summary>
string NMSMessageId
{
get;
}
/// <summary>
/// Whether or not this message is persistent
/// </summary>
bool NMSPersistent
{
get;
set;
}
/// <summary>
/// The Priority on this message
/// </summary>
byte NMSPriority
{
get;
set;
}
/// <summary>
/// Returns true if this message has been redelivered to this or another consumer before being acknowledged successfully.
/// </summary>
bool NMSRedelivered
{
get;
}
/// <summary>
/// The destination that the consumer of this message should send replies to
/// </summary>
IDestination NMSReplyTo
{
get;
set;
}
/// <summary>
/// The timestamp the broker added to the message
/// </summary>
long NMSTimestamp
{
get;
}
/// <summary>
/// The type name of this message
/// </summary>
string NMSType
{
get;
set;
}
}
}

View File

@ -1,69 +1,69 @@
/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace NMS
{
/// <summary>
/// An object capable of sending messages to some destination
/// </summary>
public interface IMessageProducer : System.IDisposable
{
/// <summary>
/// Sends the message to the default destination for this producer
/// </summary>
void Send(IMessage message);
/// <summary>
/// Sends the message to the given destination
/// </summary>
void Send(IDestination destination, IMessage message);
bool Persistent
{
get;
set;
}
long TimeToLive
{
get;
set;
}
int Priority
{
get;
set;
}
bool DisableMessageID
{
get;
set;
}
bool DisableMessageTimestamp
{
get;
set;
}
}
}
/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace NMS
{
/// <summary>
/// An object capable of sending messages to some destination
/// </summary>
public interface IMessageProducer : System.IDisposable
{
/// <summary>
/// Sends the message to the default destination for this producer
/// </summary>
void Send(IMessage message);
/// <summary>
/// Sends the message to the given destination
/// </summary>
void Send(IDestination destination, IMessage message);
bool Persistent
{
get;
set;
}
long TimeToLive
{
get;
set;
}
int Priority
{
get;
set;
}
bool DisableMessageID
{
get;
set;
}
bool DisableMessageTimestamp
{
get;
set;
}
}
}

View File

@ -1,32 +1,32 @@
/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace NMS
{
/// <summary>
/// Summary description for IQueue.
/// </summary>
public interface IQueue : IDestination
{
string QueueName
{
get;
}
}
}
/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace NMS
{
/// <summary>
/// Summary description for IQueue.
/// </summary>
public interface IQueue : IDestination
{
string QueueName
{
get;
}
}
}

View File

@ -1,123 +1,123 @@
/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace NMS
{
/// <summary>
/// Represents a single unit of work on an IConnection.
/// So the ISession can be used to perform transactional receive and sends
/// </summary>
public interface ISession : System.IDisposable
{
/// <summary>
/// Creates a producer of messages
/// </summary>
IMessageProducer CreateProducer();
/// <summary>
/// Creates a producer of messages on a given destination
/// </summary>
IMessageProducer CreateProducer(IDestination destination);
/// <summary>
/// Creates a consumer of messages on a given destination
/// </summary>
IMessageConsumer CreateConsumer(IDestination destination);
/// <summary>
/// Creates a consumer of messages on a given destination with a selector
/// </summary>
IMessageConsumer CreateConsumer(IDestination destination, string selector);
/// <summary>
/// Creates a named durable consumer of messages on a given destination with a selector
/// </summary>
IMessageConsumer CreateDurableConsumer(ITopic destination, string name, string selector, bool noLocal);
/// <summary>
/// Returns the queue for the given name
/// </summary>
IQueue GetQueue(string name);
/// <summary>
/// Returns the topic for the given name
/// </summary>
ITopic GetTopic(string name);
/// <summary>
/// Creates a temporary queue
/// </summary>
ITemporaryQueue CreateTemporaryQueue();
/// <summary>
/// Creates a temporary topic
/// </summary>
ITemporaryTopic CreateTemporaryTopic();
// Factory methods to create messages
/// <summary>
/// Creates a new message with an empty body
/// </summary>
IMessage CreateMessage();
/// <summary>
/// Creates a new text message with an empty body
/// </summary>
ITextMessage CreateTextMessage();
/// <summary>
/// Creates a new text message with the given body
/// </summary>
ITextMessage CreateTextMessage(string text);
/// <summary>
/// Creates a new Map message which contains primitive key and value pairs
/// </summary>
IMapMessage CreateMapMessage();
/// <summary>
/// Creates a new binary message
/// </summary>
IBytesMessage CreateBytesMessage();
/// <summary>
/// Creates a new binary message with the given body
/// </summary>
IBytesMessage CreateBytesMessage(byte[] body);
// Transaction methods
/// <summary>
/// If this is a transactional session then commit all message
/// send and acknowledgements for producers and consumers in this session
/// </summary>
void Commit();
/// <summary>
/// If this is a transactional session then rollback all message
/// send and acknowledgements for producers and consumers in this session
/// </summary>
void Rollback();
}
}
/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace NMS
{
/// <summary>
/// Represents a single unit of work on an IConnection.
/// So the ISession can be used to perform transactional receive and sends
/// </summary>
public interface ISession : System.IDisposable
{
/// <summary>
/// Creates a producer of messages
/// </summary>
IMessageProducer CreateProducer();
/// <summary>
/// Creates a producer of messages on a given destination
/// </summary>
IMessageProducer CreateProducer(IDestination destination);
/// <summary>
/// Creates a consumer of messages on a given destination
/// </summary>
IMessageConsumer CreateConsumer(IDestination destination);
/// <summary>
/// Creates a consumer of messages on a given destination with a selector
/// </summary>
IMessageConsumer CreateConsumer(IDestination destination, string selector);
/// <summary>
/// Creates a named durable consumer of messages on a given destination with a selector
/// </summary>
IMessageConsumer CreateDurableConsumer(ITopic destination, string name, string selector, bool noLocal);
/// <summary>
/// Returns the queue for the given name
/// </summary>
IQueue GetQueue(string name);
/// <summary>
/// Returns the topic for the given name
/// </summary>
ITopic GetTopic(string name);
/// <summary>
/// Creates a temporary queue
/// </summary>
ITemporaryQueue CreateTemporaryQueue();
/// <summary>
/// Creates a temporary topic
/// </summary>
ITemporaryTopic CreateTemporaryTopic();
// Factory methods to create messages
/// <summary>
/// Creates a new message with an empty body
/// </summary>
IMessage CreateMessage();
/// <summary>
/// Creates a new text message with an empty body
/// </summary>
ITextMessage CreateTextMessage();
/// <summary>
/// Creates a new text message with the given body
/// </summary>
ITextMessage CreateTextMessage(string text);
/// <summary>
/// Creates a new Map message which contains primitive key and value pairs
/// </summary>
IMapMessage CreateMapMessage();
/// <summary>
/// Creates a new binary message
/// </summary>
IBytesMessage CreateBytesMessage();
/// <summary>
/// Creates a new binary message with the given body
/// </summary>
IBytesMessage CreateBytesMessage(byte[] body);
// Transaction methods
/// <summary>
/// If this is a transactional session then commit all message
/// send and acknowledgements for producers and consumers in this session
/// </summary>
void Commit();
/// <summary>
/// If this is a transactional session then rollback all message
/// send and acknowledgements for producers and consumers in this session
/// </summary>
void Rollback();
}
}

View File

@ -1,28 +1,28 @@
/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace NMS
{
/// <summary>
/// Implemented by NMS objects that can be started.
/// </summary>
public interface IStartable
{
void Start();
}
}
/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace NMS
{
/// <summary>
/// Implemented by NMS objects that can be started.
/// </summary>
public interface IStartable
{
void Start();
}
}

View File

@ -1,27 +1,27 @@
/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace NMS
{
/// <summary>
/// Implemented by NMS objects that can be started.
/// </summary>
public interface IStoppable
{
void Stop();
}
}
/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace NMS
{
/// <summary>
/// Implemented by NMS objects that can be started.
/// </summary>
public interface IStoppable
{
void Stop();
}
}

View File

@ -1,27 +1,27 @@
/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace NMS
{
/// <summary>
/// Summary description for ITemporaryQueue.
/// </summary>
public interface ITemporaryQueue : IDestination
{
}
}
/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace NMS
{
/// <summary>
/// Summary description for ITemporaryQueue.
/// </summary>
public interface ITemporaryQueue : IDestination
{
}
}

View File

@ -1,27 +1,27 @@
/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace NMS
{
/// <summary>
/// Summary description for TemporaryTopic.
/// </summary>
public interface ITemporaryTopic : IDestination
{
}
}
/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace NMS
{
/// <summary>
/// Summary description for TemporaryTopic.
/// </summary>
public interface ITemporaryTopic : IDestination
{
}
}

View File

@ -1,33 +1,33 @@
/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace NMS
{
/// <summary>
/// Represents a text based message
/// </summary>
public interface ITextMessage : IMessage
{
string Text
{
get;
set;
}
}
}
/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace NMS
{
/// <summary>
/// Represents a text based message
/// </summary>
public interface ITextMessage : IMessage
{
string Text
{
get;
set;
}
}
}

View File

@ -1,32 +1,32 @@
/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace NMS
{
/// <summary>
/// Summary description for ITopic.
/// </summary>
public interface ITopic : IDestination
{
string TopicName
{
get;
}
}
}
/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace NMS
{
/// <summary>
/// Summary description for ITopic.
/// </summary>
public interface ITopic : IDestination
{
string TopicName
{
get;
}
}
}

View File

@ -1,30 +1,30 @@
/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace NMS
{
/// <summary>
/// Represents a connection failure.
/// </summary>
public class NMSConnectionException : NMSException
{
public NMSConnectionException(string message) : base(message)
{
}
}
}
/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace NMS
{
/// <summary>
/// Represents a connection failure.
/// </summary>
public class NMSConnectionException : NMSException
{
public NMSConnectionException(string message) : base(message)
{
}
}
}

View File

@ -1,30 +1,30 @@
/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace NMS
{
/// <summary>
/// Represents a NMS exception
/// </summary>
public class NMSException : System.Exception
{
public NMSException(string message) : base(message)
{
}
}
}
/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace NMS
{
/// <summary>
/// Represents a NMS exception
/// </summary>
public class NMSException : System.Exception
{
public NMSException(string message) : base(message)
{
}
}
}

View File

@ -1,63 +1,63 @@
/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
using ActiveMQ.Commands;
using NUnit.Framework;
using System.Collections;
namespace ActiveMQ.Commands
{
[TestFixture]
public class CommandTest
{
[Test]
public void TestCommand()
{
ConsumerId value1 = new ConsumerId();
value1.ConnectionId = "abc";
value1.SessionId = 123;
value1.Value = 456;
ConsumerId value2 = new ConsumerId();
value2.ConnectionId = "abc";
value2.SessionId = 123;
value2.Value = 456;
ConsumerId value3 = new ConsumerId();
value3.ConnectionId = "abc";
value3.SessionId = 123;
value3.Value = 457;
Assert.AreEqual(value1, value2, "value1 and value2 should be equal");
Assert.AreEqual(value1.GetHashCode(), value2.GetHashCode(), "value1 and value2 hash codes should be equal");
Assert.IsTrue(!value1.Equals(value3), "value1 and value3 should not be equal");
Assert.IsTrue(!value3.Equals(value2), "value3 and value2 should not be equal");
// now lets test an IDictionary
IDictionary dictionary = new Hashtable();
dictionary[value1] = value3;
// now lets lookup with a copy
object actual = dictionary[value2];
Assert.AreEqual(value3, actual, "Should have found item in Map using value2 as a key");
}
}
}
/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
using ActiveMQ.Commands;
using NUnit.Framework;
using System.Collections;
namespace ActiveMQ.Commands
{
[TestFixture]
public class CommandTest
{
[Test]
public void TestCommand()
{
ConsumerId value1 = new ConsumerId();
value1.ConnectionId = "abc";
value1.SessionId = 123;
value1.Value = 456;
ConsumerId value2 = new ConsumerId();
value2.ConnectionId = "abc";
value2.SessionId = 123;
value2.Value = 456;
ConsumerId value3 = new ConsumerId();
value3.ConnectionId = "abc";
value3.SessionId = 123;
value3.Value = 457;
Assert.AreEqual(value1, value2, "value1 and value2 should be equal");
Assert.AreEqual(value1.GetHashCode(), value2.GetHashCode(), "value1 and value2 hash codes should be equal");
Assert.IsTrue(!value1.Equals(value3), "value1 and value3 should not be equal");
Assert.IsTrue(!value3.Equals(value2), "value3 and value2 should not be equal");
// now lets test an IDictionary
IDictionary dictionary = new Hashtable();
dictionary[value1] = value3;
// now lets lookup with a copy
object actual = dictionary[value2];
Assert.AreEqual(value3, actual, "Should have found item in Map using value2 as a key");
}
}
}

View File

@ -1,128 +1,128 @@
/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
using NUnit.Framework;
using System;
using System.IO;
namespace ActiveMQ.OpenWire
{
[TestFixture]
public class BooleanStreamTest
{
protected int endOfStreamMarker = 0x12345678;
int numberOfBytes = 8 * 200;
public delegate bool GetBooleanValueDelegate(int index, int count);
[Test]
public void TestBooleanMarshallingUsingAllTrue()
{
DoTestBooleanStream(numberOfBytes, new GetBooleanValueDelegate(GetBooleanValueAllTrue));
}
public bool GetBooleanValueAllTrue(int index, int count)
{
return true;
}
[Test]
public void TestBooleanMarshallingUsingAllFalse()
{
DoTestBooleanStream(numberOfBytes, new GetBooleanValueDelegate(GetBooleanValueAllFalse));
}
public bool GetBooleanValueAllFalse(int index, int count)
{
return false;
}
[Test]
public void TestBooleanMarshallingUsingAlternateTrueFalse()
{
DoTestBooleanStream(numberOfBytes, new GetBooleanValueDelegate(GetBooleanValueAlternateTrueFalse));
}
public bool GetBooleanValueAlternateTrueFalse(int index, int count)
{
return (index & 1) == 0;
}
[Test]
public void TestBooleanMarshallingUsingAlternateFalseTrue()
{
DoTestBooleanStream(numberOfBytes, new GetBooleanValueDelegate(GetBooleanValueAlternateFalseTrue));
}
public bool GetBooleanValueAlternateFalseTrue(int index, int count)
{
return (index & 1) != 0;
}
protected void DoTestBooleanStream(int numberOfBytes, GetBooleanValueDelegate valueDelegate)
{
for (int i = 1017; i < numberOfBytes; i++)
{
AssertMarshalBooleans(i, valueDelegate);
}
}
protected void AssertMarshalBooleans(int count, GetBooleanValueDelegate valueDelegate)
{
BooleanStream bs = new BooleanStream();
for (int i = 0; i < count; i++)
{
bs.WriteBoolean(valueDelegate(i, count));
}
MemoryStream buffer = new MemoryStream();
BinaryWriter ds = new OpenWireBinaryWriter(buffer);
bs.Marshal(ds);
ds.Write(endOfStreamMarker);
// now lets read from the stream
MemoryStream ins = new MemoryStream(buffer.ToArray());
BinaryReader dis = new OpenWireBinaryReader(ins);
bs = new BooleanStream();
bs.Unmarshal(dis);
for (int i = 0; i < count; i++)
{
bool expected = valueDelegate(i, count);
try
{
bool actual = bs.ReadBoolean();
Assert.AreEqual(expected, actual);
}
catch (Exception e)
{
Assert.Fail("Failed to parse bool: " + i + " out of: " + count + " due to: " + e);
}
}
int marker = dis.ReadInt32();
Assert.AreEqual(endOfStreamMarker, marker, "did not match: "+endOfStreamMarker+" and "+marker);
// lets try read and we should get an exception
try
{
dis.ReadByte();
Assert.Fail("Should have reached the end of the stream");
}
catch (IOException)
{
}
}
}
}
/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
using NUnit.Framework;
using System;
using System.IO;
namespace ActiveMQ.OpenWire
{
[TestFixture]
public class BooleanStreamTest
{
protected int endOfStreamMarker = 0x12345678;
int numberOfBytes = 8 * 200;
public delegate bool GetBooleanValueDelegate(int index, int count);
[Test]
public void TestBooleanMarshallingUsingAllTrue()
{
DoTestBooleanStream(numberOfBytes, new GetBooleanValueDelegate(GetBooleanValueAllTrue));
}
public bool GetBooleanValueAllTrue(int index, int count)
{
return true;
}
[Test]
public void TestBooleanMarshallingUsingAllFalse()
{
DoTestBooleanStream(numberOfBytes, new GetBooleanValueDelegate(GetBooleanValueAllFalse));
}
public bool GetBooleanValueAllFalse(int index, int count)
{
return false;
}
[Test]
public void TestBooleanMarshallingUsingAlternateTrueFalse()
{
DoTestBooleanStream(numberOfBytes, new GetBooleanValueDelegate(GetBooleanValueAlternateTrueFalse));
}
public bool GetBooleanValueAlternateTrueFalse(int index, int count)
{
return (index & 1) == 0;
}
[Test]
public void TestBooleanMarshallingUsingAlternateFalseTrue()
{
DoTestBooleanStream(numberOfBytes, new GetBooleanValueDelegate(GetBooleanValueAlternateFalseTrue));
}
public bool GetBooleanValueAlternateFalseTrue(int index, int count)
{
return (index & 1) != 0;
}
protected void DoTestBooleanStream(int numberOfBytes, GetBooleanValueDelegate valueDelegate)
{
for (int i = 1017; i < numberOfBytes; i++)
{
AssertMarshalBooleans(i, valueDelegate);
}
}
protected void AssertMarshalBooleans(int count, GetBooleanValueDelegate valueDelegate)
{
BooleanStream bs = new BooleanStream();
for (int i = 0; i < count; i++)
{
bs.WriteBoolean(valueDelegate(i, count));
}
MemoryStream buffer = new MemoryStream();
BinaryWriter ds = new OpenWireBinaryWriter(buffer);
bs.Marshal(ds);
ds.Write(endOfStreamMarker);
// now lets read from the stream
MemoryStream ins = new MemoryStream(buffer.ToArray());
BinaryReader dis = new OpenWireBinaryReader(ins);
bs = new BooleanStream();
bs.Unmarshal(dis);
for (int i = 0; i < count; i++)
{
bool expected = valueDelegate(i, count);
try
{
bool actual = bs.ReadBoolean();
Assert.AreEqual(expected, actual);
}
catch (Exception e)
{
Assert.Fail("Failed to parse bool: " + i + " out of: " + count + " due to: " + e);
}
}
int marker = dis.ReadInt32();
Assert.AreEqual(endOfStreamMarker, marker, "did not match: "+endOfStreamMarker+" and "+marker);
// lets try read and we should get an exception
try
{
dis.ReadByte();
Assert.Fail("Should have reached the end of the stream");
}
catch (IOException)
{
}
}
}
}

View File

@ -1,77 +1,77 @@
/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
using ActiveMQ.Commands;
using NMS;
using System;
namespace ActiveMQ
{
public class TestMain
{
public static void Main(string[] args)
{
try
{
Console.WriteLine("About to connect to ActiveMQ");
// START SNIPPET: demo
IConnectionFactory factory = new ConnectionFactory(new Uri("tcp://localhost:61616"));
using (IConnection connection = factory.CreateConnection())
{
Console.WriteLine("Created a connection!");
ISession session = connection.CreateSession();
IDestination destination = session.GetQueue("FOO.BAR");
Console.WriteLine("Using destination: " + destination);
// lets create a consumer and producer
IMessageConsumer consumer = session.CreateConsumer(destination);
IMessageProducer producer = session.CreateProducer(destination);
producer.Persistent = true;
// lets send a message
ITextMessage request = session.CreateTextMessage("Hello World!");
request.NMSCorrelationID = "abc";
request.Properties["JMSXGroupID"] = "cheese";
request.Properties["myHeader"] = "James";
producer.Send(request);
// lets consume a message
ActiveMQTextMessage message = (ActiveMQTextMessage) consumer.Receive();
if (message == null)
{
Console.WriteLine("No message received!");
}
else
{
Console.WriteLine("Received message with ID: " + message.NMSMessageId);
Console.WriteLine("Received message with text: " + message.Text);
}
}
// END SNIPPET: demo
}
catch (Exception e)
{
Console.WriteLine("Caught: " + e);
Console.WriteLine("Stack: " + e.StackTrace);
}
}
}
}
/*
* Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
using ActiveMQ.Commands;
using NMS;
using System;
namespace ActiveMQ
{
public class TestMain
{
public static void Main(string[] args)
{
try
{
Console.WriteLine("About to connect to ActiveMQ");
// START SNIPPET: demo
IConnectionFactory factory = new ConnectionFactory(new Uri("tcp://localhost:61616"));
using (IConnection connection = factory.CreateConnection())
{
Console.WriteLine("Created a connection!");
ISession session = connection.CreateSession();
IDestination destination = session.GetQueue("FOO.BAR");
Console.WriteLine("Using destination: " + destination);
// lets create a consumer and producer
IMessageConsumer consumer = session.CreateConsumer(destination);
IMessageProducer producer = session.CreateProducer(destination);
producer.Persistent = true;
// lets send a message
ITextMessage request = session.CreateTextMessage("Hello World!");
request.NMSCorrelationID = "abc";
request.Properties["JMSXGroupID"] = "cheese";
request.Properties["myHeader"] = "James";
producer.Send(request);
// lets consume a message
ActiveMQTextMessage message = (ActiveMQTextMessage) consumer.Receive();
if (message == null)
{
Console.WriteLine("No message received!");
}
else
{
Console.WriteLine("Received message with ID: " + message.NMSMessageId);
Console.WriteLine("Received message with text: " + message.Text);
}
}
// END SNIPPET: demo
}
catch (Exception e)
{
Console.WriteLine("Caught: " + e);
Console.WriteLine("Stack: " + e.StackTrace);
}
}
}
}

Some files were not shown because too many files have changed in this diff Show More