You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ch...@apache.org on 2007/08/08 20:58:13 UTC
svn commit: r563982 [13/32] - in /activemq/trunk/activemq-core/src:
main/java/org/apache/activemq/ main/java/org/apache/activemq/advisory/
main/java/org/apache/activemq/blob/ main/java/org/apache/activemq/broker/
main/java/org/apache/activemq/broker/jm...
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v3/BaseDataStreamMarshaller.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v3/BaseDataStreamMarshaller.java?view=diff&rev=563982&r1=563981&r2=563982
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v3/BaseDataStreamMarshaller.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v3/BaseDataStreamMarshaller.java Wed Aug 8 11:56:59 2007
@@ -33,36 +33,38 @@
static final public Constructor STACK_TRACE_ELEMENT_CONSTRUCTOR;
static {
- Constructor constructor=null;
+ Constructor constructor = null;
try {
- constructor = StackTraceElement.class.getConstructor(new Class[]{String.class, String.class, String.class, int.class});
+ constructor = StackTraceElement.class.getConstructor(new Class[] {String.class, String.class, String.class, int.class});
} catch (Throwable e) {
}
STACK_TRACE_ELEMENT_CONSTRUCTOR = constructor;
}
-
abstract public byte getDataStructureType();
+
abstract public DataStructure createObject();
public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException {
return 0;
}
+
public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutput dataOut, BooleanStream bs) throws IOException {
}
+
public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn, BooleanStream bs) throws IOException {
}
public int tightMarshalLong1(OpenWireFormat wireFormat, long o, BooleanStream bs) throws IOException {
- if( o == 0 ) {
+ if (o == 0) {
bs.writeBoolean(false);
bs.writeBoolean(false);
return 0;
- } else if ( (o & 0xFFFFFFFFFFFF0000l ) == 0 ) {
+ } else if ((o & 0xFFFFFFFFFFFF0000l) == 0) {
bs.writeBoolean(false);
bs.writeBoolean(true);
return 2;
- } else if ( (o & 0xFFFFFFFF00000000l ) == 0) {
+ } else if ((o & 0xFFFFFFFF00000000l) == 0) {
bs.writeBoolean(true);
bs.writeBoolean(false);
return 4;
@@ -72,28 +74,30 @@
return 8;
}
}
+
public void tightMarshalLong2(OpenWireFormat wireFormat, long o, DataOutput dataOut, BooleanStream bs) throws IOException {
- if( bs.readBoolean() ) {
- if( bs.readBoolean() ) {
+ if (bs.readBoolean()) {
+ if (bs.readBoolean()) {
dataOut.writeLong(o);
} else {
- dataOut.writeInt((int) o);
+ dataOut.writeInt((int)o);
}
} else {
- if( bs.readBoolean() ) {
- dataOut.writeShort((int) o);
+ if (bs.readBoolean()) {
+ dataOut.writeShort((int)o);
}
}
}
+
public long tightUnmarshalLong(OpenWireFormat wireFormat, DataInput dataIn, BooleanStream bs) throws IOException {
- if( bs.readBoolean() ) {
- if( bs.readBoolean() ) {
+ if (bs.readBoolean()) {
+ if (bs.readBoolean()) {
return dataIn.readLong();
} else {
return toLong(dataIn.readInt());
}
} else {
- if( bs.readBoolean() ) {
+ if (bs.readBoolean()) {
return toLong(dataIn.readShort());
} else {
return 0;
@@ -116,6 +120,7 @@
protected DataStructure tightUnmarsalNestedObject(OpenWireFormat wireFormat, DataInput dataIn, BooleanStream bs) throws IOException {
return wireFormat.tightUnmarshalNestedObject(dataIn, bs);
}
+
protected int tightMarshalNestedObject1(OpenWireFormat wireFormat, DataStructure o, BooleanStream bs) throws IOException {
return wireFormat.tightMarshalNestedObject1(o, bs);
}
@@ -125,8 +130,8 @@
}
protected DataStructure tightUnmarsalCachedObject(OpenWireFormat wireFormat, DataInput dataIn, BooleanStream bs) throws IOException {
- if( wireFormat.isCacheEnabled() ) {
- if( bs.readBoolean() ) {
+ if (wireFormat.isCacheEnabled()) {
+ if (bs.readBoolean()) {
short index = dataIn.readShort();
DataStructure object = wireFormat.tightUnmarshalNestedObject(dataIn, bs);
wireFormat.setInUnmarshallCache(index, object);
@@ -139,14 +144,15 @@
return wireFormat.tightUnmarshalNestedObject(dataIn, bs);
}
}
+
protected int tightMarshalCachedObject1(OpenWireFormat wireFormat, DataStructure o, BooleanStream bs) throws IOException {
- if( wireFormat.isCacheEnabled() ) {
+ if (wireFormat.isCacheEnabled()) {
Short index = wireFormat.getMarshallCacheIndex(o);
bs.writeBoolean(index == null);
- if( index == null ) {
+ if (index == null) {
int rc = wireFormat.tightMarshalNestedObject1(o, bs);
wireFormat.addToMarshallCache(o);
- return 2+rc;
+ return 2 + rc;
} else {
return 2;
}
@@ -154,10 +160,11 @@
return wireFormat.tightMarshalNestedObject1(o, bs);
}
}
+
protected void tightMarshalCachedObject2(OpenWireFormat wireFormat, DataStructure o, DataOutput dataOut, BooleanStream bs) throws IOException {
- if( wireFormat.isCacheEnabled() ) {
+ if (wireFormat.isCacheEnabled()) {
Short index = wireFormat.getMarshallCacheIndex(o);
- if( bs.readBoolean() ) {
+ if (bs.readBoolean()) {
dataOut.writeShort(index.shortValue());
wireFormat.tightMarshalNestedObject2(o, dataOut, bs);
} else {
@@ -169,21 +176,19 @@
}
protected Throwable tightUnmarsalThrowable(OpenWireFormat wireFormat, DataInput dataIn, BooleanStream bs) throws IOException {
- if( bs.readBoolean() ) {
- String clazz = tightUnmarshalString(dataIn, bs);
+ if (bs.readBoolean()) {
+ String clazz = tightUnmarshalString(dataIn, bs);
String message = tightUnmarshalString(dataIn, bs);
Throwable o = createThrowable(clazz, message);
- if( wireFormat.isStackTraceEnabled() ) {
- if( STACK_TRACE_ELEMENT_CONSTRUCTOR !=null) {
+ if (wireFormat.isStackTraceEnabled()) {
+ if (STACK_TRACE_ELEMENT_CONSTRUCTOR != null) {
StackTraceElement ss[] = new StackTraceElement[dataIn.readShort()];
for (int i = 0; i < ss.length; i++) {
try {
- ss[i] = (StackTraceElement) STACK_TRACE_ELEMENT_CONSTRUCTOR.newInstance(new Object[]{
- tightUnmarshalString(dataIn, bs),
- tightUnmarshalString(dataIn, bs),
- tightUnmarshalString(dataIn, bs),
- Integer.valueOf(dataIn.readInt())
- });
+ ss[i] = (StackTraceElement)STACK_TRACE_ELEMENT_CONSTRUCTOR.newInstance(new Object[] {tightUnmarshalString(dataIn, bs),
+ tightUnmarshalString(dataIn, bs),
+ tightUnmarshalString(dataIn, bs),
+ Integer.valueOf(dataIn.readInt())});
} catch (IOException e) {
throw e;
} catch (Throwable e) {
@@ -211,23 +216,23 @@
private Throwable createThrowable(String className, String message) {
try {
Class clazz = ClassLoading.loadClass(className, BaseDataStreamMarshaller.class.getClassLoader());
- Constructor constructor = clazz.getConstructor(new Class[]{String.class});
- return (Throwable) constructor.newInstance(new Object[]{message});
+ Constructor constructor = clazz.getConstructor(new Class[] {String.class});
+ return (Throwable)constructor.newInstance(new Object[] {message});
} catch (Throwable e) {
- return new Throwable(className+": "+message);
+ return new Throwable(className + ": " + message);
}
}
protected int tightMarshalThrowable1(OpenWireFormat wireFormat, Throwable o, BooleanStream bs) throws IOException {
- if( o==null ) {
+ if (o == null) {
bs.writeBoolean(false);
return 0;
} else {
- int rc=0;
+ int rc = 0;
bs.writeBoolean(true);
rc += tightMarshalString1(o.getClass().getName(), bs);
rc += tightMarshalString1(o.getMessage(), bs);
- if( wireFormat.isStackTraceEnabled() ) {
+ if (wireFormat.isStackTraceEnabled()) {
rc += 2;
StackTraceElement[] stackTrace = o.getStackTrace();
for (int i = 0; i < stackTrace.length; i++) {
@@ -244,10 +249,10 @@
}
protected void tightMarshalThrowable2(OpenWireFormat wireFormat, Throwable o, DataOutput dataOut, BooleanStream bs) throws IOException {
- if( bs.readBoolean() ) {
+ if (bs.readBoolean()) {
tightMarshalString2(o.getClass().getName(), dataOut, bs);
tightMarshalString2(o.getMessage(), dataOut, bs);
- if( wireFormat.isStackTraceEnabled() ) {
+ if (wireFormat.isStackTraceEnabled()) {
StackTraceElement[] stackTrace = o.getStackTrace();
dataOut.writeShort(stackTrace.length);
for (int i = 0; i < stackTrace.length; i++) {
@@ -263,13 +268,14 @@
}
protected String tightUnmarshalString(DataInput dataIn, BooleanStream bs) throws IOException {
- if( bs.readBoolean() ) {
- if( bs.readBoolean() ) {
+ if (bs.readBoolean()) {
+ if (bs.readBoolean()) {
int size = dataIn.readShort();
byte data[] = new byte[size];
dataIn.readFully(data);
- return new String(data,0); // Yes deprecated, but we know what we are doing.
- } else {
+ return new String(data, 0); // Yes deprecated, but we know what
+ // we are doing.
+ } else {
return dataIn.readUTF();
}
} else {
@@ -278,14 +284,14 @@
}
protected int tightMarshalString1(String value, BooleanStream bs) throws IOException {
- bs.writeBoolean(value!=null);
- if( value!=null ) {
+ bs.writeBoolean(value != null);
+ if (value != null) {
int strlen = value.length();
int utflen = 0;
char[] charr = new char[strlen];
int c, count = 0;
- boolean isOnlyAscii=true;
+ boolean isOnlyAscii = true;
value.getChars(0, strlen, charr, 0);
@@ -295,18 +301,18 @@
utflen++;
} else if (c > 0x07FF) {
utflen += 3;
- isOnlyAscii=false;
+ isOnlyAscii = false;
} else {
- isOnlyAscii=false;
+ isOnlyAscii = false;
utflen += 2;
}
}
- if( utflen >= Short.MAX_VALUE )
+ if (utflen >= Short.MAX_VALUE) {
throw new IOException("Encountered a String value that is too long to encode.");
-
+ }
bs.writeBoolean(isOnlyAscii);
- return utflen+2;
+ return utflen + 2;
} else {
return 0;
@@ -314,9 +320,9 @@
}
protected void tightMarshalString2(String value, DataOutput dataOut, BooleanStream bs) throws IOException {
- if( bs.readBoolean() ) {
+ if (bs.readBoolean()) {
// If we verified it only holds ascii values
- if( bs.readBoolean() ) {
+ if (bs.readBoolean()) {
dataOut.writeShort(value.length());
dataOut.writeBytes(value);
} else {
@@ -326,12 +332,12 @@
}
protected int tightMarshalObjectArray1(OpenWireFormat wireFormat, DataStructure[] objects, BooleanStream bs) throws IOException {
- if( objects != null ) {
- int rc=0;
+ if (objects != null) {
+ int rc = 0;
bs.writeBoolean(true);
rc += 2;
- for( int i=0; i < objects.length; i++ ) {
- rc += tightMarshalNestedObject1(wireFormat,objects[i], bs);
+ for (int i = 0; i < objects.length; i++) {
+ rc += tightMarshalNestedObject1(wireFormat, objects[i], bs);
}
return rc;
} else {
@@ -341,10 +347,10 @@
}
protected void tightMarshalObjectArray2(OpenWireFormat wireFormat, DataStructure[] objects, DataOutput dataOut, BooleanStream bs) throws IOException {
- if( bs.readBoolean() ) {
+ if (bs.readBoolean()) {
dataOut.writeShort(objects.length);
- for( int i=0; i < objects.length; i++ ) {
- tightMarshalNestedObject2(wireFormat,objects[i], dataOut, bs);
+ for (int i = 0; i < objects.length; i++) {
+ tightMarshalNestedObject2(wireFormat, objects[i], dataOut, bs);
}
}
}
@@ -352,6 +358,7 @@
protected int tightMarshalConstByteArray1(byte[] data, BooleanStream bs, int i) throws IOException {
return i;
}
+
protected void tightMarshalConstByteArray2(byte[] data, DataOutput dataOut, BooleanStream bs, int i) throws IOException {
dataOut.write(data, 0, i);
}
@@ -363,24 +370,24 @@
}
protected int tightMarshalByteArray1(byte[] data, BooleanStream bs) throws IOException {
- bs.writeBoolean(data!=null);
- if( data!=null ){
- return data.length+4;
+ bs.writeBoolean(data != null);
+ if (data != null) {
+ return data.length + 4;
} else {
return 0;
}
}
protected void tightMarshalByteArray2(byte[] data, DataOutput dataOut, BooleanStream bs) throws IOException {
- if( bs.readBoolean() ){
+ if (bs.readBoolean()) {
dataOut.writeInt(data.length);
dataOut.write(data);
}
}
protected byte[] tightUnmarshalByteArray(DataInput dataIn, BooleanStream bs) throws IOException {
- byte rc[]=null;
- if( bs.readBoolean() ) {
+ byte rc[] = null;
+ if (bs.readBoolean()) {
int size = dataIn.readInt();
rc = new byte[size];
dataIn.readFully(rc);
@@ -389,24 +396,24 @@
}
protected int tightMarshalByteSequence1(ByteSequence data, BooleanStream bs) throws IOException {
- bs.writeBoolean(data!=null);
- if( data!=null ){
- return data.getLength()+4;
+ bs.writeBoolean(data != null);
+ if (data != null) {
+ return data.getLength() + 4;
} else {
return 0;
}
}
protected void tightMarshalByteSequence2(ByteSequence data, DataOutput dataOut, BooleanStream bs) throws IOException {
- if( bs.readBoolean() ){
+ if (bs.readBoolean()) {
dataOut.writeInt(data.getLength());
dataOut.write(data.getData(), data.getOffset(), data.getLength());
}
}
protected ByteSequence tightUnmarshalByteSequence(DataInput dataIn, BooleanStream bs) throws IOException {
- ByteSequence rc=null;
- if( bs.readBoolean() ) {
+ ByteSequence rc = null;
+ if (bs.readBoolean()) {
int size = dataIn.readInt();
byte[] t = new byte[size];
dataIn.readFully(t);
@@ -421,12 +428,14 @@
public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutput dataOut) throws IOException {
}
+
public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn) throws IOException {
}
public void looseMarshalLong(OpenWireFormat wireFormat, long o, DataOutput dataOut) throws IOException {
dataOut.writeLong(o);
}
+
public long looseUnmarshalLong(OpenWireFormat wireFormat, DataInput dataIn) throws IOException {
return dataIn.readLong();
}
@@ -434,13 +443,14 @@
protected DataStructure looseUnmarsalNestedObject(OpenWireFormat wireFormat, DataInput dataIn) throws IOException {
return wireFormat.looseUnmarshalNestedObject(dataIn);
}
+
protected void looseMarshalNestedObject(OpenWireFormat wireFormat, DataStructure o, DataOutput dataOut) throws IOException {
wireFormat.looseMarshalNestedObject(o, dataOut);
}
protected DataStructure looseUnmarsalCachedObject(OpenWireFormat wireFormat, DataInput dataIn) throws IOException {
- if( wireFormat.isCacheEnabled() ) {
- if( dataIn.readBoolean() ) {
+ if (wireFormat.isCacheEnabled()) {
+ if (dataIn.readBoolean()) {
short index = dataIn.readShort();
DataStructure object = wireFormat.looseUnmarshalNestedObject(dataIn);
wireFormat.setInUnmarshallCache(index, object);
@@ -453,11 +463,12 @@
return wireFormat.looseUnmarshalNestedObject(dataIn);
}
}
+
protected void looseMarshalCachedObject(OpenWireFormat wireFormat, DataStructure o, DataOutput dataOut) throws IOException {
- if( wireFormat.isCacheEnabled() ) {
+ if (wireFormat.isCacheEnabled()) {
Short index = wireFormat.getMarshallCacheIndex(o);
dataOut.writeBoolean(index == null);
- if( index == null ) {
+ if (index == null) {
index = wireFormat.addToMarshallCache(o);
dataOut.writeShort(index.shortValue());
wireFormat.looseMarshalNestedObject(o, dataOut);
@@ -470,21 +481,17 @@
}
protected Throwable looseUnmarsalThrowable(OpenWireFormat wireFormat, DataInput dataIn) throws IOException {
- if( dataIn.readBoolean() ) {
- String clazz = looseUnmarshalString(dataIn);
+ if (dataIn.readBoolean()) {
+ String clazz = looseUnmarshalString(dataIn);
String message = looseUnmarshalString(dataIn);
Throwable o = createThrowable(clazz, message);
- if( wireFormat.isStackTraceEnabled() ) {
- if( STACK_TRACE_ELEMENT_CONSTRUCTOR !=null) {
+ if (wireFormat.isStackTraceEnabled()) {
+ if (STACK_TRACE_ELEMENT_CONSTRUCTOR != null) {
StackTraceElement ss[] = new StackTraceElement[dataIn.readShort()];
for (int i = 0; i < ss.length; i++) {
try {
- ss[i] = (StackTraceElement) STACK_TRACE_ELEMENT_CONSTRUCTOR.newInstance(new Object[]{
- looseUnmarshalString(dataIn),
- looseUnmarshalString(dataIn),
- looseUnmarshalString(dataIn),
- Integer.valueOf(dataIn.readInt())
- });
+ ss[i] = (StackTraceElement)STACK_TRACE_ELEMENT_CONSTRUCTOR.newInstance(new Object[] {looseUnmarshalString(dataIn), looseUnmarshalString(dataIn),
+ looseUnmarshalString(dataIn), Integer.valueOf(dataIn.readInt())});
} catch (IOException e) {
throw e;
} catch (Throwable e) {
@@ -509,13 +516,12 @@
}
}
-
protected void looseMarshalThrowable(OpenWireFormat wireFormat, Throwable o, DataOutput dataOut) throws IOException {
- dataOut.writeBoolean(o!=null);
- if( o!=null ) {
+ dataOut.writeBoolean(o != null);
+ if (o != null) {
looseMarshalString(o.getClass().getName(), dataOut);
looseMarshalString(o.getMessage(), dataOut);
- if( wireFormat.isStackTraceEnabled() ) {
+ if (wireFormat.isStackTraceEnabled()) {
StackTraceElement[] stackTrace = o.getStackTrace();
dataOut.writeShort(stackTrace.length);
for (int i = 0; i < stackTrace.length; i++) {
@@ -531,7 +537,7 @@
}
protected String looseUnmarshalString(DataInput dataIn) throws IOException {
- if( dataIn.readBoolean() ) {
+ if (dataIn.readBoolean()) {
return dataIn.readUTF();
} else {
return null;
@@ -539,18 +545,18 @@
}
protected void looseMarshalString(String value, DataOutput dataOut) throws IOException {
- dataOut.writeBoolean(value!=null);
- if( value!=null ) {
+ dataOut.writeBoolean(value != null);
+ if (value != null) {
dataOut.writeUTF(value);
}
}
protected void looseMarshalObjectArray(OpenWireFormat wireFormat, DataStructure[] objects, DataOutput dataOut) throws IOException {
- dataOut.writeBoolean(objects!=null);
- if( objects!=null ) {
+ dataOut.writeBoolean(objects != null);
+ if (objects != null) {
dataOut.writeShort(objects.length);
- for( int i=0; i < objects.length; i++ ) {
- looseMarshalNestedObject(wireFormat,objects[i], dataOut);
+ for (int i = 0; i < objects.length; i++) {
+ looseMarshalNestedObject(wireFormat, objects[i], dataOut);
}
}
}
@@ -566,16 +572,16 @@
}
protected void looseMarshalByteArray(OpenWireFormat wireFormat, byte[] data, DataOutput dataOut) throws IOException {
- dataOut.writeBoolean(data!=null);
- if( data!=null ){
+ dataOut.writeBoolean(data != null);
+ if (data != null) {
dataOut.writeInt(data.length);
dataOut.write(data);
}
}
protected byte[] looseUnmarshalByteArray(DataInput dataIn) throws IOException {
- byte rc[]=null;
- if( dataIn.readBoolean() ) {
+ byte rc[] = null;
+ if (dataIn.readBoolean()) {
int size = dataIn.readInt();
rc = new byte[size];
dataIn.readFully(rc);
@@ -584,16 +590,16 @@
}
protected void looseMarshalByteSequence(OpenWireFormat wireFormat, ByteSequence data, DataOutput dataOut) throws IOException {
- dataOut.writeBoolean(data!=null);
- if( data!=null ){
+ dataOut.writeBoolean(data != null);
+ if (data != null) {
dataOut.writeInt(data.getLength());
dataOut.write(data.getData(), data.getOffset(), data.getLength());
}
}
protected ByteSequence looseUnmarshalByteSequence(DataInput dataIn) throws IOException {
- ByteSequence rc=null;
- if( dataIn.readBoolean() ) {
+ ByteSequence rc = null;
+ if (dataIn.readBoolean()) {
int size = dataIn.readInt();
byte[] t = new byte[size];
dataIn.readFully(t);
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v3/BrokerInfoMarshaller.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v3/BrokerInfoMarshaller.java?view=diff&rev=563982&r1=563981&r2=563982
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v3/BrokerInfoMarshaller.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v3/BrokerInfoMarshaller.java Wed Aug 8 11:56:59 2007
@@ -24,29 +24,27 @@
import org.apache.activemq.openwire.*;
import org.apache.activemq.command.*;
-
-
/**
* Marshalling code for Open Wire Format for BrokerInfoMarshaller
- *
- *
- * 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.
- *
+ *
+ *
+ * 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 BrokerInfoMarshaller extends BaseCommandMarshaller {
/**
* Return the type of Data Structure we marshal
+ *
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return BrokerInfo.DATA_STRUCTURE_TYPE;
}
-
+
/**
* @return a new object instance
*/
@@ -56,27 +54,29 @@
/**
* 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, DataInput dataIn, BooleanStream bs) throws IOException {
+ public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn, BooleanStream bs)
+ throws IOException {
super.tightUnmarshal(wireFormat, o, dataIn, bs);
BrokerInfo info = (BrokerInfo)o;
- info.setBrokerId((org.apache.activemq.command.BrokerId) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
+ info.setBrokerId((org.apache.activemq.command.BrokerId)tightUnmarsalCachedObject(wireFormat, dataIn,
+ bs));
info.setBrokerURL(tightUnmarshalString(dataIn, bs));
if (bs.readBoolean()) {
short size = dataIn.readShort();
org.apache.activemq.command.BrokerInfo value[] = new org.apache.activemq.command.BrokerInfo[size];
- for( int i=0; i < size; i++ ) {
- value[i] = (org.apache.activemq.command.BrokerInfo) tightUnmarsalNestedObject(wireFormat,dataIn, bs);
+ for (int i = 0; i < size; i++) {
+ value[i] = (org.apache.activemq.command.BrokerInfo)tightUnmarsalNestedObject(wireFormat,
+ dataIn, bs);
}
info.setPeerBrokerInfos(value);
- }
- else {
+ } else {
info.setPeerBrokerInfos(null);
}
info.setBrokerName(tightUnmarshalString(dataIn, bs));
@@ -91,7 +91,6 @@
}
-
/**
* Write the booleans that this object uses to a BooleanStream
*/
@@ -109,7 +108,7 @@
bs.writeBoolean(info.isFaultTolerantConfiguration());
bs.writeBoolean(info.isDuplexConnection());
bs.writeBoolean(info.isNetworkConnection());
- rc+=tightMarshalLong1(wireFormat, info.getConnectionId(), bs);
+ rc += tightMarshalLong1(wireFormat, info.getConnectionId(), bs);
rc += tightMarshalString1(info.getBrokerUploadUrl(), bs);
rc += tightMarshalString1(info.getNetworkProperties(), bs);
@@ -118,12 +117,13 @@
/**
* 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, DataOutput dataOut, BooleanStream bs) throws IOException {
+ public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutput dataOut, BooleanStream bs)
+ throws IOException {
super.tightMarshal2(wireFormat, o, dataOut, bs);
BrokerInfo info = (BrokerInfo)o;
@@ -144,7 +144,7 @@
/**
* 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
@@ -153,18 +153,18 @@
super.looseUnmarshal(wireFormat, o, dataIn);
BrokerInfo info = (BrokerInfo)o;
- info.setBrokerId((org.apache.activemq.command.BrokerId) looseUnmarsalCachedObject(wireFormat, dataIn));
+ info.setBrokerId((org.apache.activemq.command.BrokerId)looseUnmarsalCachedObject(wireFormat, dataIn));
info.setBrokerURL(looseUnmarshalString(dataIn));
if (dataIn.readBoolean()) {
short size = dataIn.readShort();
org.apache.activemq.command.BrokerInfo value[] = new org.apache.activemq.command.BrokerInfo[size];
- for( int i=0; i < size; i++ ) {
- value[i] = (org.apache.activemq.command.BrokerInfo) looseUnmarsalNestedObject(wireFormat,dataIn);
+ for (int i = 0; i < size; i++) {
+ value[i] = (org.apache.activemq.command.BrokerInfo)looseUnmarsalNestedObject(wireFormat,
+ dataIn);
}
info.setPeerBrokerInfos(value);
- }
- else {
+ } else {
info.setPeerBrokerInfos(null);
}
info.setBrokerName(looseUnmarshalString(dataIn));
@@ -178,7 +178,6 @@
info.setNetworkProperties(looseUnmarshalString(dataIn));
}
-
/**
* Write the booleans that this object uses to a BooleanStream
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ConnectionInfoMarshaller.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ConnectionInfoMarshaller.java?view=diff&rev=563982&r1=563981&r2=563982
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ConnectionInfoMarshaller.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ConnectionInfoMarshaller.java Wed Aug 8 11:56:59 2007
@@ -24,29 +24,27 @@
import org.apache.activemq.openwire.*;
import org.apache.activemq.command.*;
-
-
/**
* Marshalling code for Open Wire Format for ConnectionInfoMarshaller
- *
- *
- * 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.
- *
+ *
+ *
+ * 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 ConnectionInfoMarshaller extends BaseCommandMarshaller {
/**
* Return the type of Data Structure we marshal
+ *
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return ConnectionInfo.DATA_STRUCTURE_TYPE;
}
-
+
/**
* @return a new object instance
*/
@@ -56,16 +54,18 @@
/**
* 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, DataInput dataIn, BooleanStream bs) throws IOException {
+ public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn, BooleanStream bs)
+ throws IOException {
super.tightUnmarshal(wireFormat, o, dataIn, bs);
ConnectionInfo info = (ConnectionInfo)o;
- info.setConnectionId((org.apache.activemq.command.ConnectionId) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
+ info.setConnectionId((org.apache.activemq.command.ConnectionId)tightUnmarsalCachedObject(wireFormat,
+ dataIn, bs));
info.setClientId(tightUnmarshalString(dataIn, bs));
info.setPassword(tightUnmarshalString(dataIn, bs));
info.setUserName(tightUnmarshalString(dataIn, bs));
@@ -73,12 +73,12 @@
if (bs.readBoolean()) {
short size = dataIn.readShort();
org.apache.activemq.command.BrokerId value[] = new org.apache.activemq.command.BrokerId[size];
- for( int i=0; i < size; i++ ) {
- value[i] = (org.apache.activemq.command.BrokerId) tightUnmarsalNestedObject(wireFormat,dataIn, bs);
+ for (int i = 0; i < size; i++) {
+ value[i] = (org.apache.activemq.command.BrokerId)tightUnmarsalNestedObject(wireFormat,
+ dataIn, bs);
}
info.setBrokerPath(value);
- }
- else {
+ } else {
info.setBrokerPath(null);
}
info.setBrokerMasterConnector(bs.readBoolean());
@@ -87,7 +87,6 @@
}
-
/**
* Write the booleans that this object uses to a BooleanStream
*/
@@ -110,12 +109,13 @@
/**
* 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, DataOutput dataOut, BooleanStream bs) throws IOException {
+ public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutput dataOut, BooleanStream bs)
+ throws IOException {
super.tightMarshal2(wireFormat, o, dataOut, bs);
ConnectionInfo info = (ConnectionInfo)o;
@@ -132,7 +132,7 @@
/**
* 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
@@ -141,7 +141,8 @@
super.looseUnmarshal(wireFormat, o, dataIn);
ConnectionInfo info = (ConnectionInfo)o;
- info.setConnectionId((org.apache.activemq.command.ConnectionId) looseUnmarsalCachedObject(wireFormat, dataIn));
+ info.setConnectionId((org.apache.activemq.command.ConnectionId)looseUnmarsalCachedObject(wireFormat,
+ dataIn));
info.setClientId(looseUnmarshalString(dataIn));
info.setPassword(looseUnmarshalString(dataIn));
info.setUserName(looseUnmarshalString(dataIn));
@@ -149,12 +150,11 @@
if (dataIn.readBoolean()) {
short size = dataIn.readShort();
org.apache.activemq.command.BrokerId value[] = new org.apache.activemq.command.BrokerId[size];
- for( int i=0; i < size; i++ ) {
- value[i] = (org.apache.activemq.command.BrokerId) looseUnmarsalNestedObject(wireFormat,dataIn);
+ for (int i = 0; i < size; i++) {
+ value[i] = (org.apache.activemq.command.BrokerId)looseUnmarsalNestedObject(wireFormat, dataIn);
}
info.setBrokerPath(value);
- }
- else {
+ } else {
info.setBrokerPath(null);
}
info.setBrokerMasterConnector(dataIn.readBoolean());
@@ -162,7 +162,6 @@
info.setClientMaster(dataIn.readBoolean());
}
-
/**
* Write the booleans that this object uses to a BooleanStream
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ConsumerIdMarshaller.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ConsumerIdMarshaller.java?view=diff&rev=563982&r1=563981&r2=563982
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ConsumerIdMarshaller.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ConsumerIdMarshaller.java Wed Aug 8 11:56:59 2007
@@ -24,29 +24,27 @@
import org.apache.activemq.openwire.*;
import org.apache.activemq.command.*;
-
-
/**
* Marshalling code for Open Wire Format for ConsumerIdMarshaller
- *
- *
- * 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.
- *
+ *
+ *
+ * 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 ConsumerIdMarshaller extends BaseDataStreamMarshaller {
/**
* Return the type of Data Structure we marshal
+ *
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return ConsumerId.DATA_STRUCTURE_TYPE;
}
-
+
/**
* @return a new object instance
*/
@@ -56,12 +54,13 @@
/**
* 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, DataInput dataIn, BooleanStream bs) throws IOException {
+ public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn, BooleanStream bs)
+ throws IOException {
super.tightUnmarshal(wireFormat, o, dataIn, bs);
ConsumerId info = (ConsumerId)o;
@@ -71,7 +70,6 @@
}
-
/**
* Write the booleans that this object uses to a BooleanStream
*/
@@ -81,20 +79,21 @@
int rc = super.tightMarshal1(wireFormat, o, bs);
rc += tightMarshalString1(info.getConnectionId(), bs);
- rc+=tightMarshalLong1(wireFormat, info.getSessionId(), bs);
- rc+=tightMarshalLong1(wireFormat, info.getValue(), bs);
+ rc += tightMarshalLong1(wireFormat, info.getSessionId(), bs);
+ rc += tightMarshalLong1(wireFormat, info.getValue(), bs);
return rc + 0;
}
/**
* 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, DataOutput dataOut, BooleanStream bs) throws IOException {
+ public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutput dataOut, BooleanStream bs)
+ throws IOException {
super.tightMarshal2(wireFormat, o, dataOut, bs);
ConsumerId info = (ConsumerId)o;
@@ -106,7 +105,7 @@
/**
* 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
@@ -120,7 +119,6 @@
info.setValue(looseUnmarshalLong(wireFormat, dataIn));
}
-
/**
* Write the booleans that this object uses to a BooleanStream
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ConsumerInfoMarshaller.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ConsumerInfoMarshaller.java?view=diff&rev=563982&r1=563981&r2=563982
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ConsumerInfoMarshaller.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ConsumerInfoMarshaller.java Wed Aug 8 11:56:59 2007
@@ -24,29 +24,27 @@
import org.apache.activemq.openwire.*;
import org.apache.activemq.command.*;
-
-
/**
* Marshalling code for Open Wire Format for ConsumerInfoMarshaller
- *
- *
- * 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.
- *
+ *
+ *
+ * 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 ConsumerInfoMarshaller extends BaseCommandMarshaller {
/**
* Return the type of Data Structure we marshal
+ *
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return ConsumerInfo.DATA_STRUCTURE_TYPE;
}
-
+
/**
* @return a new object instance
*/
@@ -56,18 +54,24 @@
/**
* 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, DataInput dataIn, BooleanStream bs) throws IOException {
+ public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn, BooleanStream bs)
+ throws IOException {
super.tightUnmarshal(wireFormat, o, dataIn, bs);
ConsumerInfo info = (ConsumerInfo)o;
- info.setConsumerId((org.apache.activemq.command.ConsumerId) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
+ info.setConsumerId((org.apache.activemq.command.ConsumerId)tightUnmarsalCachedObject(wireFormat,
+ dataIn, bs));
info.setBrowser(bs.readBoolean());
- info.setDestination((org.apache.activemq.command.ActiveMQDestination) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
+ info
+ .setDestination((org.apache.activemq.command.ActiveMQDestination)tightUnmarsalCachedObject(
+ wireFormat,
+ dataIn,
+ bs));
info.setPrefetchSize(dataIn.readInt());
info.setMaximumPendingMessageLimit(dataIn.readInt());
info.setDispatchAsync(bs.readBoolean());
@@ -81,22 +85,25 @@
if (bs.readBoolean()) {
short size = dataIn.readShort();
org.apache.activemq.command.BrokerId value[] = new org.apache.activemq.command.BrokerId[size];
- for( int i=0; i < size; i++ ) {
- value[i] = (org.apache.activemq.command.BrokerId) tightUnmarsalNestedObject(wireFormat,dataIn, bs);
+ for (int i = 0; i < size; i++) {
+ value[i] = (org.apache.activemq.command.BrokerId)tightUnmarsalNestedObject(wireFormat,
+ dataIn, bs);
}
info.setBrokerPath(value);
- }
- else {
+ } else {
info.setBrokerPath(null);
}
- info.setAdditionalPredicate((org.apache.activemq.filter.BooleanExpression) tightUnmarsalNestedObject(wireFormat, dataIn, bs));
+ info
+ .setAdditionalPredicate((org.apache.activemq.filter.BooleanExpression)tightUnmarsalNestedObject(
+ wireFormat,
+ dataIn,
+ bs));
info.setNetworkSubscription(bs.readBoolean());
info.setOptimizedAcknowledge(bs.readBoolean());
info.setNoRangeAcks(bs.readBoolean());
}
-
/**
* Write the booleans that this object uses to a BooleanStream
*/
@@ -125,12 +132,13 @@
/**
* 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, DataOutput dataOut, BooleanStream bs) throws IOException {
+ public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutput dataOut, BooleanStream bs)
+ throws IOException {
super.tightMarshal2(wireFormat, o, dataOut, bs);
ConsumerInfo info = (ConsumerInfo)o;
@@ -156,7 +164,7 @@
/**
* 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
@@ -165,9 +173,13 @@
super.looseUnmarshal(wireFormat, o, dataIn);
ConsumerInfo info = (ConsumerInfo)o;
- info.setConsumerId((org.apache.activemq.command.ConsumerId) looseUnmarsalCachedObject(wireFormat, dataIn));
+ info.setConsumerId((org.apache.activemq.command.ConsumerId)looseUnmarsalCachedObject(wireFormat,
+ dataIn));
info.setBrowser(dataIn.readBoolean());
- info.setDestination((org.apache.activemq.command.ActiveMQDestination) looseUnmarsalCachedObject(wireFormat, dataIn));
+ info
+ .setDestination((org.apache.activemq.command.ActiveMQDestination)looseUnmarsalCachedObject(
+ wireFormat,
+ dataIn));
info.setPrefetchSize(dataIn.readInt());
info.setMaximumPendingMessageLimit(dataIn.readInt());
info.setDispatchAsync(dataIn.readBoolean());
@@ -181,21 +193,22 @@
if (dataIn.readBoolean()) {
short size = dataIn.readShort();
org.apache.activemq.command.BrokerId value[] = new org.apache.activemq.command.BrokerId[size];
- for( int i=0; i < size; i++ ) {
- value[i] = (org.apache.activemq.command.BrokerId) looseUnmarsalNestedObject(wireFormat,dataIn);
+ for (int i = 0; i < size; i++) {
+ value[i] = (org.apache.activemq.command.BrokerId)looseUnmarsalNestedObject(wireFormat, dataIn);
}
info.setBrokerPath(value);
- }
- else {
+ } else {
info.setBrokerPath(null);
}
- info.setAdditionalPredicate((org.apache.activemq.filter.BooleanExpression) looseUnmarsalNestedObject(wireFormat, dataIn));
+ info
+ .setAdditionalPredicate((org.apache.activemq.filter.BooleanExpression)looseUnmarsalNestedObject(
+ wireFormat,
+ dataIn));
info.setNetworkSubscription(dataIn.readBoolean());
info.setOptimizedAcknowledge(dataIn.readBoolean());
info.setNoRangeAcks(dataIn.readBoolean());
}
-
/**
* Write the booleans that this object uses to a BooleanStream
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v3/DataArrayResponseMarshaller.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v3/DataArrayResponseMarshaller.java?view=diff&rev=563982&r1=563981&r2=563982
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v3/DataArrayResponseMarshaller.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v3/DataArrayResponseMarshaller.java Wed Aug 8 11:56:59 2007
@@ -24,29 +24,27 @@
import org.apache.activemq.openwire.*;
import org.apache.activemq.command.*;
-
-
/**
* Marshalling code for Open Wire Format for DataArrayResponseMarshaller
- *
- *
- * 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.
- *
+ *
+ *
+ * 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 DataArrayResponseMarshaller extends ResponseMarshaller {
/**
* Return the type of Data Structure we marshal
+ *
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return DataArrayResponse.DATA_STRUCTURE_TYPE;
}
-
+
/**
* @return a new object instance
*/
@@ -56,12 +54,13 @@
/**
* 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, DataInput dataIn, BooleanStream bs) throws IOException {
+ public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn, BooleanStream bs)
+ throws IOException {
super.tightUnmarshal(wireFormat, o, dataIn, bs);
DataArrayResponse info = (DataArrayResponse)o;
@@ -69,18 +68,17 @@
if (bs.readBoolean()) {
short size = dataIn.readShort();
org.apache.activemq.command.DataStructure value[] = new org.apache.activemq.command.DataStructure[size];
- for( int i=0; i < size; i++ ) {
- value[i] = (org.apache.activemq.command.DataStructure) tightUnmarsalNestedObject(wireFormat,dataIn, bs);
+ for (int i = 0; i < size; i++) {
+ value[i] = (org.apache.activemq.command.DataStructure)tightUnmarsalNestedObject(wireFormat,
+ dataIn, bs);
}
info.setData(value);
- }
- else {
+ } else {
info.setData(null);
}
}
-
/**
* Write the booleans that this object uses to a BooleanStream
*/
@@ -96,12 +94,13 @@
/**
* 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, DataOutput dataOut, BooleanStream bs) throws IOException {
+ public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutput dataOut, BooleanStream bs)
+ throws IOException {
super.tightMarshal2(wireFormat, o, dataOut, bs);
DataArrayResponse info = (DataArrayResponse)o;
@@ -111,7 +110,7 @@
/**
* 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
@@ -124,17 +123,16 @@
if (dataIn.readBoolean()) {
short size = dataIn.readShort();
org.apache.activemq.command.DataStructure value[] = new org.apache.activemq.command.DataStructure[size];
- for( int i=0; i < size; i++ ) {
- value[i] = (org.apache.activemq.command.DataStructure) looseUnmarsalNestedObject(wireFormat,dataIn);
+ for (int i = 0; i < size; i++) {
+ value[i] = (org.apache.activemq.command.DataStructure)looseUnmarsalNestedObject(wireFormat,
+ dataIn);
}
info.setData(value);
- }
- else {
+ } else {
info.setData(null);
}
}
-
/**
* Write the booleans that this object uses to a BooleanStream
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v3/DestinationInfoMarshaller.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v3/DestinationInfoMarshaller.java?view=diff&rev=563982&r1=563981&r2=563982
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v3/DestinationInfoMarshaller.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v3/DestinationInfoMarshaller.java Wed Aug 8 11:56:59 2007
@@ -24,29 +24,27 @@
import org.apache.activemq.openwire.*;
import org.apache.activemq.command.*;
-
-
/**
* Marshalling code for Open Wire Format for DestinationInfoMarshaller
- *
- *
- * 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.
- *
+ *
+ *
+ * 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 DestinationInfoMarshaller extends BaseCommandMarshaller {
/**
* Return the type of Data Structure we marshal
+ *
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return DestinationInfo.DATA_STRUCTURE_TYPE;
}
-
+
/**
* @return a new object instance
*/
@@ -56,35 +54,40 @@
/**
* 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, DataInput dataIn, BooleanStream bs) throws IOException {
+ public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn, BooleanStream bs)
+ throws IOException {
super.tightUnmarshal(wireFormat, o, dataIn, bs);
DestinationInfo info = (DestinationInfo)o;
- info.setConnectionId((org.apache.activemq.command.ConnectionId) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
- info.setDestination((org.apache.activemq.command.ActiveMQDestination) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
+ info.setConnectionId((org.apache.activemq.command.ConnectionId)tightUnmarsalCachedObject(wireFormat,
+ dataIn, bs));
+ info
+ .setDestination((org.apache.activemq.command.ActiveMQDestination)tightUnmarsalCachedObject(
+ wireFormat,
+ dataIn,
+ bs));
info.setOperationType(dataIn.readByte());
info.setTimeout(tightUnmarshalLong(wireFormat, dataIn, bs));
if (bs.readBoolean()) {
short size = dataIn.readShort();
org.apache.activemq.command.BrokerId value[] = new org.apache.activemq.command.BrokerId[size];
- for( int i=0; i < size; i++ ) {
- value[i] = (org.apache.activemq.command.BrokerId) tightUnmarsalNestedObject(wireFormat,dataIn, bs);
+ for (int i = 0; i < size; i++) {
+ value[i] = (org.apache.activemq.command.BrokerId)tightUnmarsalNestedObject(wireFormat,
+ dataIn, bs);
}
info.setBrokerPath(value);
- }
- else {
+ } else {
info.setBrokerPath(null);
}
}
-
/**
* Write the booleans that this object uses to a BooleanStream
*/
@@ -95,7 +98,7 @@
int rc = super.tightMarshal1(wireFormat, o, bs);
rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getConnectionId(), bs);
rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getDestination(), bs);
- rc+=tightMarshalLong1(wireFormat, info.getTimeout(), bs);
+ rc += tightMarshalLong1(wireFormat, info.getTimeout(), bs);
rc += tightMarshalObjectArray1(wireFormat, info.getBrokerPath(), bs);
return rc + 1;
@@ -103,12 +106,13 @@
/**
* 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, DataOutput dataOut, BooleanStream bs) throws IOException {
+ public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutput dataOut, BooleanStream bs)
+ throws IOException {
super.tightMarshal2(wireFormat, o, dataOut, bs);
DestinationInfo info = (DestinationInfo)o;
@@ -122,7 +126,7 @@
/**
* 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
@@ -131,25 +135,27 @@
super.looseUnmarshal(wireFormat, o, dataIn);
DestinationInfo info = (DestinationInfo)o;
- info.setConnectionId((org.apache.activemq.command.ConnectionId) looseUnmarsalCachedObject(wireFormat, dataIn));
- info.setDestination((org.apache.activemq.command.ActiveMQDestination) looseUnmarsalCachedObject(wireFormat, dataIn));
+ info.setConnectionId((org.apache.activemq.command.ConnectionId)looseUnmarsalCachedObject(wireFormat,
+ dataIn));
+ info
+ .setDestination((org.apache.activemq.command.ActiveMQDestination)looseUnmarsalCachedObject(
+ wireFormat,
+ dataIn));
info.setOperationType(dataIn.readByte());
info.setTimeout(looseUnmarshalLong(wireFormat, dataIn));
if (dataIn.readBoolean()) {
short size = dataIn.readShort();
org.apache.activemq.command.BrokerId value[] = new org.apache.activemq.command.BrokerId[size];
- for( int i=0; i < size; i++ ) {
- value[i] = (org.apache.activemq.command.BrokerId) looseUnmarsalNestedObject(wireFormat,dataIn);
+ for (int i = 0; i < size; i++) {
+ value[i] = (org.apache.activemq.command.BrokerId)looseUnmarsalNestedObject(wireFormat, dataIn);
}
info.setBrokerPath(value);
- }
- else {
+ } else {
info.setBrokerPath(null);
}
}
-
/**
* Write the booleans that this object uses to a BooleanStream
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v3/MessagePullMarshaller.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v3/MessagePullMarshaller.java?view=diff&rev=563982&r1=563981&r2=563982
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v3/MessagePullMarshaller.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v3/MessagePullMarshaller.java Wed Aug 8 11:56:59 2007
@@ -24,29 +24,27 @@
import org.apache.activemq.openwire.*;
import org.apache.activemq.command.*;
-
-
/**
* Marshalling code for Open Wire Format for MessagePullMarshaller
- *
- *
- * 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.
- *
+ *
+ *
+ * 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 MessagePullMarshaller extends BaseCommandMarshaller {
/**
* Return the type of Data Structure we marshal
+ *
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return MessagePull.DATA_STRUCTURE_TYPE;
}
-
+
/**
* @return a new object instance
*/
@@ -56,24 +54,30 @@
/**
* 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, DataInput dataIn, BooleanStream bs) throws IOException {
+ public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn, BooleanStream bs)
+ throws IOException {
super.tightUnmarshal(wireFormat, o, dataIn, bs);
MessagePull info = (MessagePull)o;
- info.setConsumerId((org.apache.activemq.command.ConsumerId) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
- info.setDestination((org.apache.activemq.command.ActiveMQDestination) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
+ info.setConsumerId((org.apache.activemq.command.ConsumerId)tightUnmarsalCachedObject(wireFormat,
+ dataIn, bs));
+ info
+ .setDestination((org.apache.activemq.command.ActiveMQDestination)tightUnmarsalCachedObject(
+ wireFormat,
+ dataIn,
+ bs));
info.setTimeout(tightUnmarshalLong(wireFormat, dataIn, bs));
info.setCorrelationId(tightUnmarshalString(dataIn, bs));
- info.setMessageId((org.apache.activemq.command.MessageId) tightUnmarsalNestedObject(wireFormat, dataIn, bs));
+ info.setMessageId((org.apache.activemq.command.MessageId)tightUnmarsalNestedObject(wireFormat,
+ dataIn, bs));
}
-
/**
* Write the booleans that this object uses to a BooleanStream
*/
@@ -84,7 +88,7 @@
int rc = super.tightMarshal1(wireFormat, o, bs);
rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getConsumerId(), bs);
rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getDestination(), bs);
- rc+=tightMarshalLong1(wireFormat, info.getTimeout(), bs);
+ rc += tightMarshalLong1(wireFormat, info.getTimeout(), bs);
rc += tightMarshalString1(info.getCorrelationId(), bs);
rc += tightMarshalNestedObject1(wireFormat, (DataStructure)info.getMessageId(), bs);
@@ -93,12 +97,13 @@
/**
* 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, DataOutput dataOut, BooleanStream bs) throws IOException {
+ public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutput dataOut, BooleanStream bs)
+ throws IOException {
super.tightMarshal2(wireFormat, o, dataOut, bs);
MessagePull info = (MessagePull)o;
@@ -112,7 +117,7 @@
/**
* 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
@@ -121,14 +126,18 @@
super.looseUnmarshal(wireFormat, o, dataIn);
MessagePull info = (MessagePull)o;
- info.setConsumerId((org.apache.activemq.command.ConsumerId) looseUnmarsalCachedObject(wireFormat, dataIn));
- info.setDestination((org.apache.activemq.command.ActiveMQDestination) looseUnmarsalCachedObject(wireFormat, dataIn));
+ info.setConsumerId((org.apache.activemq.command.ConsumerId)looseUnmarsalCachedObject(wireFormat,
+ dataIn));
+ info
+ .setDestination((org.apache.activemq.command.ActiveMQDestination)looseUnmarsalCachedObject(
+ wireFormat,
+ dataIn));
info.setTimeout(looseUnmarshalLong(wireFormat, dataIn));
info.setCorrelationId(looseUnmarshalString(dataIn));
- info.setMessageId((org.apache.activemq.command.MessageId) looseUnmarsalNestedObject(wireFormat, dataIn));
+ info
+ .setMessageId((org.apache.activemq.command.MessageId)looseUnmarsalNestedObject(wireFormat, dataIn));
}
-
/**
* Write the booleans that this object uses to a BooleanStream
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ProducerInfoMarshaller.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ProducerInfoMarshaller.java?view=diff&rev=563982&r1=563981&r2=563982
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ProducerInfoMarshaller.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v3/ProducerInfoMarshaller.java Wed Aug 8 11:56:59 2007
@@ -24,29 +24,27 @@
import org.apache.activemq.openwire.*;
import org.apache.activemq.command.*;
-
-
/**
* Marshalling code for Open Wire Format for ProducerInfoMarshaller
- *
- *
- * 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.
- *
+ *
+ *
+ * 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 ProducerInfoMarshaller extends BaseCommandMarshaller {
/**
* Return the type of Data Structure we marshal
+ *
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return ProducerInfo.DATA_STRUCTURE_TYPE;
}
-
+
/**
* @return a new object instance
*/
@@ -56,27 +54,33 @@
/**
* 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, DataInput dataIn, BooleanStream bs) throws IOException {
+ public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn, BooleanStream bs)
+ throws IOException {
super.tightUnmarshal(wireFormat, o, dataIn, bs);
ProducerInfo info = (ProducerInfo)o;
- info.setProducerId((org.apache.activemq.command.ProducerId) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
- info.setDestination((org.apache.activemq.command.ActiveMQDestination) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
+ info.setProducerId((org.apache.activemq.command.ProducerId)tightUnmarsalCachedObject(wireFormat,
+ dataIn, bs));
+ info
+ .setDestination((org.apache.activemq.command.ActiveMQDestination)tightUnmarsalCachedObject(
+ wireFormat,
+ dataIn,
+ bs));
if (bs.readBoolean()) {
short size = dataIn.readShort();
org.apache.activemq.command.BrokerId value[] = new org.apache.activemq.command.BrokerId[size];
- for( int i=0; i < size; i++ ) {
- value[i] = (org.apache.activemq.command.BrokerId) tightUnmarsalNestedObject(wireFormat,dataIn, bs);
+ for (int i = 0; i < size; i++) {
+ value[i] = (org.apache.activemq.command.BrokerId)tightUnmarsalNestedObject(wireFormat,
+ dataIn, bs);
}
info.setBrokerPath(value);
- }
- else {
+ } else {
info.setBrokerPath(null);
}
info.setDispatchAsync(bs.readBoolean());
@@ -84,7 +88,6 @@
}
-
/**
* Write the booleans that this object uses to a BooleanStream
*/
@@ -103,12 +106,13 @@
/**
* 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, DataOutput dataOut, BooleanStream bs) throws IOException {
+ public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutput dataOut, BooleanStream bs)
+ throws IOException {
super.tightMarshal2(wireFormat, o, dataOut, bs);
ProducerInfo info = (ProducerInfo)o;
@@ -122,7 +126,7 @@
/**
* 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
@@ -131,25 +135,27 @@
super.looseUnmarshal(wireFormat, o, dataIn);
ProducerInfo info = (ProducerInfo)o;
- info.setProducerId((org.apache.activemq.command.ProducerId) looseUnmarsalCachedObject(wireFormat, dataIn));
- info.setDestination((org.apache.activemq.command.ActiveMQDestination) looseUnmarsalCachedObject(wireFormat, dataIn));
+ info.setProducerId((org.apache.activemq.command.ProducerId)looseUnmarsalCachedObject(wireFormat,
+ dataIn));
+ info
+ .setDestination((org.apache.activemq.command.ActiveMQDestination)looseUnmarsalCachedObject(
+ wireFormat,
+ dataIn));
if (dataIn.readBoolean()) {
short size = dataIn.readShort();
org.apache.activemq.command.BrokerId value[] = new org.apache.activemq.command.BrokerId[size];
- for( int i=0; i < size; i++ ) {
- value[i] = (org.apache.activemq.command.BrokerId) looseUnmarsalNestedObject(wireFormat,dataIn);
+ for (int i = 0; i < size; i++) {
+ value[i] = (org.apache.activemq.command.BrokerId)looseUnmarsalNestedObject(wireFormat, dataIn);
}
info.setBrokerPath(value);
- }
- else {
+ } else {
info.setBrokerPath(null);
}
info.setDispatchAsync(dataIn.readBoolean());
info.setWindowSize(dataIn.readInt());
}
-
/**
* Write the booleans that this object uses to a BooleanStream
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v3/SessionIdMarshaller.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v3/SessionIdMarshaller.java?view=diff&rev=563982&r1=563981&r2=563982
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v3/SessionIdMarshaller.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v3/SessionIdMarshaller.java Wed Aug 8 11:56:59 2007
@@ -24,29 +24,27 @@
import org.apache.activemq.openwire.*;
import org.apache.activemq.command.*;
-
-
/**
* Marshalling code for Open Wire Format for SessionIdMarshaller
- *
- *
- * 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.
- *
+ *
+ *
+ * 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 SessionIdMarshaller extends BaseDataStreamMarshaller {
/**
* Return the type of Data Structure we marshal
+ *
* @return short representation of the type data structure
*/
public byte getDataStructureType() {
return SessionId.DATA_STRUCTURE_TYPE;
}
-
+
/**
* @return a new object instance
*/
@@ -56,12 +54,13 @@
/**
* 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, DataInput dataIn, BooleanStream bs) throws IOException {
+ public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn, BooleanStream bs)
+ throws IOException {
super.tightUnmarshal(wireFormat, o, dataIn, bs);
SessionId info = (SessionId)o;
@@ -70,7 +69,6 @@
}
-
/**
* Write the booleans that this object uses to a BooleanStream
*/
@@ -80,19 +78,20 @@
int rc = super.tightMarshal1(wireFormat, o, bs);
rc += tightMarshalString1(info.getConnectionId(), bs);
- rc+=tightMarshalLong1(wireFormat, info.getValue(), bs);
+ rc += tightMarshalLong1(wireFormat, info.getValue(), bs);
return rc + 0;
}
/**
* 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, DataOutput dataOut, BooleanStream bs) throws IOException {
+ public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutput dataOut, BooleanStream bs)
+ throws IOException {
super.tightMarshal2(wireFormat, o, dataOut, bs);
SessionId info = (SessionId)o;
@@ -103,7 +102,7 @@
/**
* 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
@@ -116,7 +115,6 @@
info.setValue(looseUnmarshalLong(wireFormat, dataIn));
}
-
/**
* Write the booleans that this object uses to a BooleanStream
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/pool/ConnectionKey.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/pool/ConnectionKey.java?view=diff&rev=563982&r1=563981&r2=563982
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/pool/ConnectionKey.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/pool/ConnectionKey.java Wed Aug 8 11:56:59 2007
@@ -18,7 +18,7 @@
/**
* A cache key for the connection details
- *
+ *
* @version $Revision: 1.1 $
*/
public class ConnectionKey {
@@ -30,7 +30,7 @@
this.password = password;
this.userName = userName;
hash = 31;
- if (userName != null) {
+ if (userName != null) {
hash += userName.hashCode();
}
hash *= 31;
@@ -48,13 +48,13 @@
return true;
}
if (that instanceof ConnectionKey) {
- return equals((ConnectionKey) that);
+ return equals((ConnectionKey)that);
}
return false;
}
public boolean equals(ConnectionKey that) {
- return isEqual(this.userName, that.userName) && isEqual(this.password, that.password);
+ return isEqual(this.userName, that.userName) && isEqual(this.password, that.password);
}
public String getPassword() {
@@ -71,6 +71,5 @@
}
return (o1 != null && o2 != null && o1.equals(o2));
}
-
}
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/pool/ConnectionPool.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/pool/ConnectionPool.java?view=diff&rev=563982&r1=563981&r2=563982
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/pool/ConnectionPool.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/pool/ConnectionPool.java Wed Aug 8 11:56:59 2007
@@ -41,38 +41,44 @@
* @version $Revision$
*/
public class ConnectionPool {
-
+
private TransactionManager transactionManager;
private ActiveMQConnection connection;
private Map cache;
private AtomicBoolean started = new AtomicBoolean(false);
private int referenceCount;
private ObjectPoolFactory poolFactory;
- private long lastUsed = System.currentTimeMillis();
- private boolean hasFailed;
- private boolean hasExpired;
- private int idleTimeout = 30*1000;
+ private long lastUsed = System.currentTimeMillis();
+ private boolean hasFailed;
+ private boolean hasExpired;
+ private int idleTimeout = 30 * 1000;
- public ConnectionPool(ActiveMQConnection connection, ObjectPoolFactory poolFactory, TransactionManager transactionManager) {
+ public ConnectionPool(ActiveMQConnection connection, ObjectPoolFactory poolFactory,
+ TransactionManager transactionManager) {
this(connection, new HashMap(), poolFactory, transactionManager);
- // Add a transport Listener so that we can notice if this connection should be expired due to
+ // Add a transport Listener so that we can notice if this connection
+ // should be expired due to
// a connection failure.
- connection.addTransportListener(new TransportListener(){
- public void onCommand(Object command) {
- }
- public void onException(IOException error) {
- synchronized(ConnectionPool.this) {
- hasFailed = true;
- }
- }
- public void transportInterupted() {
- }
- public void transportResumed() {
- }
- });
+ connection.addTransportListener(new TransportListener() {
+ public void onCommand(Object command) {
+ }
+
+ public void onException(IOException error) {
+ synchronized (ConnectionPool.this) {
+ hasFailed = true;
+ }
+ }
+
+ public void transportInterupted() {
+ }
+
+ public void transportResumed() {
+ }
+ });
}
- public ConnectionPool(ActiveMQConnection connection, Map cache, ObjectPoolFactory poolFactory, TransactionManager transactionManager) {
+ public ConnectionPool(ActiveMQConnection connection, Map cache, ObjectPoolFactory poolFactory,
+ TransactionManager transactionManager) {
this.connection = connection;
this.cache = cache;
this.poolFactory = poolFactory;
@@ -97,7 +103,7 @@
ackMode = Session.SESSION_TRANSACTED;
}
SessionKey key = new SessionKey(transacted, ackMode);
- SessionPool pool = (SessionPool) cache.get(key);
+ SessionPool pool = (SessionPool)cache.get(key);
if (pool == null) {
pool = new SessionPool(this, key, poolFactory.createPool());
cache.put(key, pool);
@@ -122,72 +128,72 @@
}
synchronized public void close() {
- if( connection!=null ) {
- try {
- Iterator i = cache.values().iterator();
- while (i.hasNext()) {
- SessionPool pool = (SessionPool) i.next();
- i.remove();
- try {
- pool.close();
- } catch (Exception e) {
- }
- }
- } finally {
+ if (connection != null) {
+ try {
+ Iterator i = cache.values().iterator();
+ while (i.hasNext()) {
+ SessionPool pool = (SessionPool)i.next();
+ i.remove();
+ try {
+ pool.close();
+ } catch (Exception e) {
+ }
+ }
+ } finally {
try {
- connection.close();
+ connection.close();
} catch (Exception e) {
} finally {
- connection = null;
+ connection = null;
}
- }
- }
+ }
+ }
}
synchronized public void incrementReferenceCount() {
- referenceCount++;
- lastUsed = System.currentTimeMillis();
- }
-
- synchronized public void decrementReferenceCount() {
- referenceCount--;
- lastUsed = System.currentTimeMillis();
- if( referenceCount == 0 ) {
- expiredCheck();
- }
- }
-
- /**
- * @return true if this connection has expired.
- */
- synchronized public boolean expiredCheck() {
- if( connection == null ) {
- return true;
- }
- if( hasExpired ) {
- if( referenceCount == 0 ) {
- close();
- }
- return true;
- }
- if( hasFailed || ( idleTimeout>0 && System.currentTimeMillis() > lastUsed+idleTimeout) ) {
- hasExpired=true;
- if( referenceCount == 0 ) {
- close();
- }
- return true;
- }
- return false;
- }
-
- public int getIdleTimeout() {
- return idleTimeout;
- }
-
- public void setIdleTimeout(int idleTimeout) {
- this.idleTimeout = idleTimeout;
- }
-
+ referenceCount++;
+ lastUsed = System.currentTimeMillis();
+ }
+
+ synchronized public void decrementReferenceCount() {
+ referenceCount--;
+ lastUsed = System.currentTimeMillis();
+ if (referenceCount == 0) {
+ expiredCheck();
+ }
+ }
+
+ /**
+ * @return true if this connection has expired.
+ */
+ synchronized public boolean expiredCheck() {
+ if (connection == null) {
+ return true;
+ }
+ if (hasExpired) {
+ if (referenceCount == 0) {
+ close();
+ }
+ return true;
+ }
+ if (hasFailed || (idleTimeout > 0 && System.currentTimeMillis() > lastUsed + idleTimeout)) {
+ hasExpired = true;
+ if (referenceCount == 0) {
+ close();
+ }
+ return true;
+ }
+ return false;
+ }
+
+ public int getIdleTimeout() {
+ return idleTimeout;
+ }
+
+ public void setIdleTimeout(int idleTimeout) {
+ this.idleTimeout = idleTimeout;
+ }
+
protected XAResource createXaResource(PooledSession session) throws JMSException {
return session.getSession().getTransactionContext();
}
@@ -201,7 +207,7 @@
public void beforeCompletion() {
}
-
+
public void afterCompletion(int status) {
try {
// This will return session to the pool.
@@ -213,5 +219,5 @@
}
}
}
-
+
}