activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject svn commit: r367565 - in /incubator/activemq/trunk/activemq-core/src: gram/script/ main/java/org/apache/activemq/command/ main/java/org/apache/activemq/openwire/v1/
Date Tue, 10 Jan 2006 10:55:07 GMT
Author: jstrachan
Date: Tue Jan 10 02:55:01 2006
New Revision: 367565

URL: http://svn.apache.org/viewcvs?rev=367565&view=rev
Log:
further cleaning up of the OpenWire protocol now that the FooId classes all now have value
properties called "value"

Modified:
    incubator/activemq/trunk/activemq-core/src/gram/script/GenerateCSharpClasses.groovy
    incubator/activemq/trunk/activemq-core/src/gram/script/GenerateCSharpMarshalling.groovy
    incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ProducerId.java
    incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ProducerIdMarshaller.java

Modified: incubator/activemq/trunk/activemq-core/src/gram/script/GenerateCSharpClasses.groovy
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/gram/script/GenerateCSharpClasses.groovy?rev=367565&r1=367564&r2=367565&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/gram/script/GenerateCSharpClasses.groovy (original)
+++ incubator/activemq/trunk/activemq-core/src/gram/script/GenerateCSharpClasses.groovy Tue
Jan 10 02:55:01 2006
@@ -31,7 +31,7 @@
         		it.getAnnotation("openwire:marshaller")!=null
         }
 
-			  def destinationNames = ['ActiveMQDestination', 'ActiveMQTempDestination', 'ActiveMQQueue',
'ActiveMQTopic', 'ActiveMQTempQueue', 'ActiveMQTempTopic']
+			  def manuallyMaintainedClasses = ['ActiveMQDestination', 'ActiveMQTempDestination', 'ActiveMQQueue',
'ActiveMQTopic', 'ActiveMQTempQueue', 'ActiveMQTempTopic', 'BaseCommand']
 			  
         println "Generating Java marshalling code to directory ${destDir}"
 
@@ -42,7 +42,7 @@
 
         for (jclass in messageClasses) {
 
-						if (destinationNames.contains(jclass.simpleName)) continue
+						if (manuallyMaintainedClasses.contains(jclass.simpleName)) continue
 						
             println "Processing $jclass.simpleName"
 
@@ -114,10 +114,6 @@
                     def type = toCSharpType(property.type)
                     def name = decapitalize(property.simpleName)
                     def propertyName = property.simpleName
-                    if (propertyName == jclass.simpleName) {
-                        // TODO think of a better naming convention :)
-                    		propertyName += "Value"
-                    }
                     def getter = capitalize(property.getter.simpleName)
                     def setter = capitalize(property.setter.simpleName)
 
@@ -125,14 +121,8 @@
                     out << """
         public $type $propertyName
         {
-            get
-            {
-                return $name;
-            }
-            set
-            {
-                $name = value;
-            }            
+            get { return $name; }
+            set { this.$name = value; }            
         }
 """
                 }

Modified: incubator/activemq/trunk/activemq-core/src/gram/script/GenerateCSharpMarshalling.groovy
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/gram/script/GenerateCSharpMarshalling.groovy?rev=367565&r1=367564&r2=367565&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/gram/script/GenerateCSharpMarshalling.groovy
(original)
+++ incubator/activemq/trunk/activemq-core/src/gram/script/GenerateCSharpMarshalling.groovy
Tue Jan 10 02:55:01 2006
@@ -128,10 +128,6 @@
 							 }
                 for (property in propertyList) {
                 		 def propertyName = property.simpleName
-                    if (propertyName == jclass.simpleName) {
-                        // TODO think of a better naming convention :)
-                    		propertyName += "Value"
-                    }
                     out << "            info.${propertyName} = "
 
                     type = toCSharpType(property.type)

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ProducerId.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ProducerId.java?rev=367565&r1=367564&r2=367565&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ProducerId.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ProducerId.java
Tue Jan 10 02:55:01 2006
@@ -27,7 +27,7 @@
 
     protected String connectionId;
     protected long sessionId;
-    protected long producerId;
+    protected long value;
 
     protected transient int hashCode;
     protected transient String key;
@@ -39,20 +39,20 @@
     public ProducerId(SessionId sessionId, long producerId) {
         this.connectionId = sessionId.getConnectionId();
         this.sessionId = sessionId.getValue();
-        this.producerId=producerId;
+        this.value=producerId;
     }
 
     public ProducerId(ProducerId id) {
         this.connectionId = id.getConnectionId();
         this.sessionId = id.getSessionId();
-        this.producerId=id.getProducerId();
+        this.value=id.getValue();
     }
 
     public ProducerId(String producerKey) {
         // Parse off the producerId
         int p = producerKey.lastIndexOf(":");
         if( p >= 0 ) {
-            producerId = Long.parseLong(producerKey.substring(p+1));
+            value = Long.parseLong(producerKey.substring(p+1));
             producerKey = producerKey.substring(0,p);
         }
         setProducerSessionKey(producerKey);
@@ -67,7 +67,7 @@
 
     public int hashCode() {
         if( hashCode == 0 ) {
-            hashCode = connectionId.hashCode() ^ (int)sessionId ^ (int)producerId;
+            hashCode = connectionId.hashCode() ^ (int)sessionId ^ (int)value;
         }
         return hashCode;
     }
@@ -79,7 +79,7 @@
             return false;
         ProducerId id = (ProducerId) o;
         return sessionId==id.sessionId 
-               && producerId==id.producerId
+               && value==id.value
                && connectionId.equals(id.connectionId);
     }
 
@@ -100,7 +100,7 @@
 
     public String toString() {
         if( key == null ) {
-            key=connectionId+":"+sessionId+":"+producerId;
+            key=connectionId+":"+sessionId+":"+value;
         }
         return key;
     }
@@ -120,11 +120,11 @@
     /**
      * @openwire:property version=1
      */
-    public long getProducerId() {
-        return producerId;
+    public long getValue() {
+        return value;
     }
-    public void setProducerId(long producerId) {
-        this.producerId = producerId;
+    public void setValue(long producerId) {
+        this.value = producerId;
     }
     
     /**

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ProducerIdMarshaller.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ProducerIdMarshaller.java?rev=367565&r1=367564&r2=367565&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ProducerIdMarshaller.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ProducerIdMarshaller.java
Tue Jan 10 02:55:01 2006
@@ -65,7 +65,7 @@
 
         ProducerId info = (ProducerId)o;
         info.setConnectionId(readString(dataIn, bs));
-        info.setProducerId(unmarshalLong(wireFormat, dataIn, bs));
+        info.setValue(unmarshalLong(wireFormat, dataIn, bs));
         info.setSessionId(unmarshalLong(wireFormat, dataIn, bs));
 
     }
@@ -80,7 +80,7 @@
 
         int rc = super.marshal1(wireFormat, o, bs);
         rc += writeString(info.getConnectionId(), bs);
-        rc+=marshal1Long(wireFormat, info.getProducerId(), bs);
+        rc+=marshal1Long(wireFormat, info.getValue(), bs);
         rc+=marshal1Long(wireFormat, info.getSessionId(), bs);
 
         return rc+0;
@@ -98,7 +98,7 @@
 
         ProducerId info = (ProducerId)o;
         writeString(info.getConnectionId(), dataOut, bs);
-        marshal2Long(wireFormat, info.getProducerId(), dataOut, bs);
+        marshal2Long(wireFormat, info.getValue(), dataOut, bs);
         marshal2Long(wireFormat, info.getSessionId(), dataOut, bs);
 
     }



Mime
View raw message