activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r472165 - in /incubator/activemq/trunk/activemq-core/src: main/java/org/apache/activemq/command/ main/java/org/apache/activemq/openwire/v2/ test/java/org/apache/activemq/openwire/v2/
Date Tue, 07 Nov 2006 16:56:12 GMT
Author: chirino
Date: Tue Nov  7 08:56:12 2006
New Revision: 472165

URL: http://svn.apache.org/viewvc?view=rev&rev=472165
Log:
Added some fields for future use to the BrokerInfo and ProducerInfo classes.

Modified:
    incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/BrokerInfo.java
    incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ProducerInfo.java
    incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v2/BrokerInfoMarshaller.java
    incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ProducerInfoMarshaller.java
    incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v2/BrokerInfoTest.java
    incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ProducerInfoTest.java

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/BrokerInfo.java
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/BrokerInfo.java?view=diff&rev=472165&r1=472164&r2=472165
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/BrokerInfo.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/BrokerInfo.java
Tue Nov  7 08:56:12 2006
@@ -37,6 +37,7 @@
     boolean duplexConnection;
     BrokerInfo peerBrokerInfos[];
     String brokerName;
+    long connectionId;
 
     public boolean isBrokerInfo(){
         return true;
@@ -169,4 +170,19 @@
     public void setNetworkConnection(boolean networkConnection){
         this.networkConnection=networkConnection;
     }
+
+    /**
+     * The broker assigns a each connection it accepts a connection id.
+     * 
+     * @openwire:property version=2
+     */
+	public long getConnectionId() {
+		return connectionId;
+	}
+
+	public void setConnectionId(long connectionId) {
+		this.connectionId = connectionId;
+	}
+
+  
 }

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ProducerInfo.java
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ProducerInfo.java?view=diff&rev=472165&r1=472164&r2=472165
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ProducerInfo.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ProducerInfo.java
Tue Nov  7 08:56:12 2006
@@ -31,6 +31,7 @@
     protected ProducerId producerId;
     protected ActiveMQDestination destination;
     protected BrokerId[] brokerPath;
+    protected boolean dispatchAsync;
     
     public ProducerInfo() {
     }
@@ -100,5 +101,20 @@
     public Response visit(CommandVisitor visitor) throws Exception {
         return visitor.processAddProducer( this );
     }
+
+    /**
+     * If the broker should dispatch messages from this producer async.  Since sync
+     * dispatch could potentally block the producer thread, this could be an important
+     * setting for the producer.
+     * 
+     * @openwire:property version=2
+     */
+	public boolean isDispatchAsync() {
+		return dispatchAsync;
+	}
+
+	public void setDispatchAsync(boolean dispatchAsync) {
+		this.dispatchAsync = dispatchAsync;
+	}
 
 }

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v2/BrokerInfoMarshaller.java
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v2/BrokerInfoMarshaller.java?view=diff&rev=472165&r1=472164&r2=472165
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v2/BrokerInfoMarshaller.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v2/BrokerInfoMarshaller.java
Tue Nov  7 08:56:12 2006
@@ -86,6 +86,7 @@
         info.setFaultTolerantConfiguration(bs.readBoolean());
         info.setDuplexConnection(bs.readBoolean());
         info.setNetworkConnection(bs.readBoolean());
+        info.setConnectionId(tightUnmarshalLong(wireFormat, dataIn, bs));
 
     }
 
@@ -107,6 +108,7 @@
         bs.writeBoolean(info.isFaultTolerantConfiguration());
         bs.writeBoolean(info.isDuplexConnection());
         bs.writeBoolean(info.isNetworkConnection());
+        rc+=tightMarshalLong1(wireFormat, info.getConnectionId(), bs);
 
         return rc + 0;
     }
@@ -131,6 +133,7 @@
         bs.readBoolean();
         bs.readBoolean();
         bs.readBoolean();
+        tightMarshalLong2(wireFormat, info.getConnectionId(), dataOut, bs);
 
     }
 
@@ -165,6 +168,7 @@
         info.setFaultTolerantConfiguration(dataIn.readBoolean());
         info.setDuplexConnection(dataIn.readBoolean());
         info.setNetworkConnection(dataIn.readBoolean());
+        info.setConnectionId(looseUnmarshalLong(wireFormat, dataIn));
 
     }
 
@@ -186,6 +190,7 @@
         dataOut.writeBoolean(info.isFaultTolerantConfiguration());
         dataOut.writeBoolean(info.isDuplexConnection());
         dataOut.writeBoolean(info.isNetworkConnection());
+        looseMarshalLong(wireFormat, info.getConnectionId(), dataOut);
 
     }
 }

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ProducerInfoMarshaller.java
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ProducerInfoMarshaller.java?view=diff&rev=472165&r1=472164&r2=472165
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ProducerInfoMarshaller.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ProducerInfoMarshaller.java
Tue Nov  7 08:56:12 2006
@@ -80,6 +80,7 @@
         else {
             info.setBrokerPath(null);
         }
+        info.setDispatchAsync(bs.readBoolean());
 
     }
 
@@ -95,6 +96,7 @@
         rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getProducerId(),
bs);
         rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getDestination(),
bs);
         rc += tightMarshalObjectArray1(wireFormat, info.getBrokerPath(), bs);
+        bs.writeBoolean(info.isDispatchAsync());
 
         return rc + 0;
     }
@@ -113,6 +115,7 @@
         tightMarshalCachedObject2(wireFormat, (DataStructure)info.getProducerId(), dataOut,
bs);
         tightMarshalCachedObject2(wireFormat, (DataStructure)info.getDestination(), dataOut,
bs);
         tightMarshalObjectArray2(wireFormat, info.getBrokerPath(), dataOut, bs);
+        bs.readBoolean();
 
     }
 
@@ -141,6 +144,7 @@
         else {
             info.setBrokerPath(null);
         }
+        info.setDispatchAsync(dataIn.readBoolean());
 
     }
 
@@ -156,6 +160,7 @@
         looseMarshalCachedObject(wireFormat, (DataStructure)info.getProducerId(), dataOut);
         looseMarshalCachedObject(wireFormat, (DataStructure)info.getDestination(), dataOut);
         looseMarshalObjectArray(wireFormat, info.getBrokerPath(), dataOut);
+        dataOut.writeBoolean(info.isDispatchAsync());
 
     }
 }

Modified: incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v2/BrokerInfoTest.java
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v2/BrokerInfoTest.java?view=diff&rev=472165&r1=472164&r2=472165
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v2/BrokerInfoTest.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v2/BrokerInfoTest.java
Tue Nov  7 08:56:12 2006
@@ -66,5 +66,6 @@
         info.setFaultTolerantConfiguration(true);
         info.setDuplexConnection(false);
         info.setNetworkConnection(true);
+        info.setConnectionId(1);
     }
 }

Modified: incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ProducerInfoTest.java
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ProducerInfoTest.java?view=diff&rev=472165&r1=472164&r2=472165
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ProducerInfoTest.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ProducerInfoTest.java
Tue Nov  7 08:56:12 2006
@@ -60,5 +60,6 @@
             }
             info.setBrokerPath(value);
         }
+        info.setDispatchAsync(true);
     }
 }



Mime
View raw message