qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@apache.org
Subject svn commit: r562325 [1/3] - in /incubator/qpid/trunk/qpid: java/client/src/main/java/org/apache/qpid/nclient/api/ java/client/src/main/java/org/apache/qpid/nclient/impl/ java/common/ java/common/src/main/java/org/apache/qpidity/ specs/
Date Fri, 03 Aug 2007 04:25:26 GMT
Author: rhs
Date: Thu Aug  2 21:25:25 2007
New Revision: 562325

URL: http://svn.apache.org/viewvc?view=rev&rev=562325
Log:
added amqp.0-10-preview.xml and switched the qpidity codegen over to use it

Added:
    incubator/qpid/trunk/qpid/specs/amqp.0-10-preview.xml   (with props)
Modified:
    incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/nclient/api/Session.java
    incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/nclient/impl/ClientSessionDelegate.java
    incubator/qpid/trunk/qpid/java/common/generate
    incubator/qpid/trunk/qpid/java/common/pom.xml
    incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpidity/AbstractDecoder.java
    incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpidity/AbstractEncoder.java
    incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpidity/BBDecoder.java
    incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpidity/CommonSessionDelegate.java
    incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpidity/Decoder.java
    incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpidity/Encoder.java
    incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpidity/FragmentDecoder.java
    incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpidity/Method.java
    incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpidity/MethodDispatcher.java
    incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpidity/Struct.java

Modified: incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/nclient/api/Session.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/nclient/api/Session.java?view=diff&rev=562325&r1=562324&r2=562325
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/nclient/api/Session.java
(original)
+++ incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/nclient/api/Session.java
Thu Aug  2 21:25:25 2007
@@ -323,7 +323,7 @@
      * @param queueName The queue to be purged
      * @throws QpidException If the session fails to purge the queue due to some error.
      */
-    public void queuePurge(String queueName, Option... options) throws QpidException;
+    public void queuePurge(String queueName) throws QpidException;
 
     /**
      * Delet a queue.

Modified: incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/nclient/impl/ClientSessionDelegate.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/nclient/impl/ClientSessionDelegate.java?view=diff&rev=562325&r1=562324&r2=562325
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/nclient/impl/ClientSessionDelegate.java
(original)
+++ incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/nclient/impl/ClientSessionDelegate.java
Thu Aug  2 21:25:25 2007
@@ -2,30 +2,15 @@
 
 import org.apache.qpidity.CommonSessionDelegate;
 import org.apache.qpidity.ExchangeQueryOk;
-import org.apache.qpidity.QueueDeclareOk;
-import org.apache.qpidity.QueueDeleteOk;
-import org.apache.qpidity.QueuePurgeOk;
 import org.apache.qpidity.Session;
 
 
 public class ClientSessionDelegate extends CommonSessionDelegate
 {
 
-	
-	 // --------------------------------------------
-	 //   Exchange related functionality
-	 // --------------------------------------------	 
+    // --------------------------------------------
+    //   Exchange related functionality
+    // --------------------------------------------
     public void exchangeQueryOk(Session session, ExchangeQueryOk struct) {}
 
-    
-    
-	// --------------------------------------------
-	//    Queue related functionality
-	// --------------------------------------------
-    
-    public void queueDeclareOk(Session session, QueueDeclareOk struct) {}
-    
-    public void queuePurgeOk(Session session, QueuePurgeOk struct) {}
-    
-    public void queueDeleteOk(Session session, QueueDeleteOk struct) {}
 }

Modified: incubator/qpid/trunk/qpid/java/common/generate
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/common/generate?view=diff&rev=562325&r1=562324&r2=562325
==============================================================================
--- incubator/qpid/trunk/qpid/java/common/generate (original)
+++ incubator/qpid/trunk/qpid/java/common/generate Thu Aug  2 21:25:25 2007
@@ -54,7 +54,8 @@
   "timestamp": "long",
   "content": "String",
   "uuid": "UUID",
-  "rfc1982-long-set": "Range<Long>[]"
+  "rfc1982-long-set": "Range<Long>[]",
+  "long-struct": "Struct"
   }
 
 def camel(offset, *args):

Modified: incubator/qpid/trunk/qpid/java/common/pom.xml
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/common/pom.xml?view=diff&rev=562325&r1=562324&r2=562325
==============================================================================
--- incubator/qpid/trunk/qpid/java/common/pom.xml (original)
+++ incubator/qpid/trunk/qpid/java/common/pom.xml Thu Aug  2 21:25:25 2007
@@ -88,7 +88,7 @@
                                 <param>${basedir}/generate</param>
                                 <param>${generated.path}</param>
                                 <param>org.apache.qpidity</param>
-                                <param>${specs.dir}/amqp-transitional.0-10.xml</param>
+                                <param>${specs.dir}/amqp.0-10-preview.xml</param>
                             </params>
                         </configuration>
                         <goals>

Modified: incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpidity/AbstractDecoder.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpidity/AbstractDecoder.java?view=diff&rev=562325&r1=562324&r2=562325
==============================================================================
--- incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpidity/AbstractDecoder.java
(original)
+++ incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpidity/AbstractDecoder.java
Thu Aug  2 21:25:25 2007
@@ -35,6 +35,13 @@
 abstract class AbstractDecoder implements Decoder
 {
 
+    private final StructFactory factory;
+
+    protected AbstractDecoder(StructFactory factory)
+    {
+        this.factory = factory;
+    }
+
     protected abstract byte get();
 
     protected abstract void get(byte[] bytes);
@@ -144,6 +151,13 @@
     public String readContent()
     {
         throw new Error("Deprecated");
+    }
+
+    public Struct readLongStruct()
+    {
+        long size = readLong();
+        int type = readShort();
+        return factory.create(type, this);
     }
 
 }

Modified: incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpidity/AbstractEncoder.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpidity/AbstractEncoder.java?view=diff&rev=562325&r1=562324&r2=562325
==============================================================================
--- incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpidity/AbstractEncoder.java
(original)
+++ incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpidity/AbstractEncoder.java
Thu Aug  2 21:25:25 2007
@@ -155,6 +155,16 @@
         throw new Error("Deprecated");
     }
 
+    public void writeLongStruct(Struct s)
+    {
+        SizeEncoder sizer = new SizeEncoder();
+        sizer.writeShort(s.getEncodedType());
+        s.write(sizer);
+        writeLong(sizer.getSize());
+        writeShort(s.getEncodedType());
+        s.write(this);
+    }
+
     public void flush()
     {
         flushBits();

Modified: incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpidity/BBDecoder.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpidity/BBDecoder.java?view=diff&rev=562325&r1=562324&r2=562325
==============================================================================
--- incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpidity/BBDecoder.java
(original)
+++ incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpidity/BBDecoder.java
Thu Aug  2 21:25:25 2007
@@ -34,8 +34,9 @@
 
     private final ByteBuffer in;
 
-    public BBDecoder(ByteBuffer in)
+    public BBDecoder(StructFactory factory, ByteBuffer in)
     {
+        super(factory);
         this.in = in;
     }
 

Modified: incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpidity/CommonSessionDelegate.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpidity/CommonSessionDelegate.java?view=diff&rev=562325&r1=562324&r2=562325
==============================================================================
--- incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpidity/CommonSessionDelegate.java
(original)
+++ incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpidity/CommonSessionDelegate.java
Thu Aug  2 21:25:25 2007
@@ -42,48 +42,43 @@
 
     @Override public void sessionResume(Session session, SessionResume struct) {}
 
-    @Override public void sessionPing(Session session, SessionPing struct) {}
-
-    @Override public void sessionPong(Session session, SessionPong struct) {}
-
     @Override public void sessionSuspend(Session session, SessionSuspend struct) {}
 
     @Override public void sessionDetached(Session session, SessionDetached struct) {}
 
-	@Override
-	public void messageTransfer(Session context, MessageTransfer struct)
-	{
-		StreamingMessageListener l = context.messagListeners.get(struct.getDestination());
-		l.messageTransfer(struct.getDestination(),new Option[0]);
-	}
-
-	// ---------------------------------------------------------------
-	//  Non generated methods - but would like if they are also generated.
-	//  These methods should be called from Body and Header Handlers.
-	//  If these methods are generated as part of the delegate then
-	//  I can call these methods from the BodyHandler and HeaderHandler
-	//  in a generic way
-	
-	
-	//  I have used destination to indicate my intent of receiving 
-	//  some form of correlation to know which consumer this data belongs to.
-	//  It can be anything as long as I can make the right correlation
-	// ----------------------------------------------------------------
-	public void data(Session context,String destination,byte[] src) throws QpidException
-	{
-		StreamingMessageListener l = context.messagListeners.get(destination);
-		l.data(src);
-	}
-
-	public void endData(Session context,String destination) throws QpidException
-	{
-		StreamingMessageListener l = context.messagListeners.get(destination);
-		l.endData();
-	}
-
-	public void messageHeaders(Session context,String destination,Header... headers) throws
QpidException
-	{
-		StreamingMessageListener l = context.messagListeners.get(destination);
-		l.endData();		
-	}
+    @Override public void messageTransfer(Session context, MessageTransfer struct)
+    {
+        StreamingMessageListener l = context.messagListeners.get(struct.getDestination());
+        l.messageTransfer(struct.getDestination(),new Option[0]);
+    }
+
+    // ---------------------------------------------------------------
+    //  Non generated methods - but would like if they are also generated.
+    //  These methods should be called from Body and Header Handlers.
+    //  If these methods are generated as part of the delegate then
+    //  I can call these methods from the BodyHandler and HeaderHandler
+    //  in a generic way
+
+    //  I have used destination to indicate my intent of receiving
+    //  some form of correlation to know which consumer this data belongs to.
+    //  It can be anything as long as I can make the right correlation
+    // ----------------------------------------------------------------
+    public void data(Session context,String destination,byte[] src) throws QpidException
+    {
+        StreamingMessageListener l = context.messagListeners.get(destination);
+        l.data(src);
+    }
+
+    public void endData(Session context,String destination) throws QpidException
+    {
+        StreamingMessageListener l = context.messagListeners.get(destination);
+        l.endData();
+    }
+
+    public void messageHeaders(Session context,String destination,Header... headers) throws
QpidException
+    {
+        StreamingMessageListener l = context.messagListeners.get(destination);
+        l.endData();
+    }
+
 }

Modified: incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpidity/Decoder.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpidity/Decoder.java?view=diff&rev=562325&r1=562324&r2=562325
==============================================================================
--- incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpidity/Decoder.java (original)
+++ incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpidity/Decoder.java Thu
Aug  2 21:25:25 2007
@@ -49,4 +49,6 @@
 
     String readContent();
 
+    Struct readLongStruct();
+
 }

Modified: incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpidity/Encoder.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpidity/Encoder.java?view=diff&rev=562325&r1=562324&r2=562325
==============================================================================
--- incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpidity/Encoder.java (original)
+++ incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpidity/Encoder.java Thu
Aug  2 21:25:25 2007
@@ -51,4 +51,6 @@
 
     void flush();
 
+    void writeLongStruct(Struct s);
+
 }

Modified: incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpidity/FragmentDecoder.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpidity/FragmentDecoder.java?view=diff&rev=562325&r1=562324&r2=562325
==============================================================================
--- incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpidity/FragmentDecoder.java
(original)
+++ incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpidity/FragmentDecoder.java
Thu Aug  2 21:25:25 2007
@@ -40,8 +40,9 @@
     private final Iterator<ByteBuffer> fragments;
     private ByteBuffer current;
 
-    public FragmentDecoder(Iterator<ByteBuffer> fragments)
+    public FragmentDecoder(StructFactory factory, Iterator<ByteBuffer> fragments)
     {
+        super(factory);
         this.fragments = fragments;
         this.current = null;
     }

Modified: incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpidity/Method.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpidity/Method.java?view=diff&rev=562325&r1=562324&r2=562325
==============================================================================
--- incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpidity/Method.java (original)
+++ incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpidity/Method.java Thu
Aug  2 21:25:25 2007
@@ -27,9 +27,8 @@
  * @author Rafael H. Schloming
  */
 
-interface Method extends Struct {
-
-    int getEncodedType();
+interface Method extends Struct
+{
 
     byte getEncodedTrack();
 

Modified: incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpidity/MethodDispatcher.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpidity/MethodDispatcher.java?view=diff&rev=562325&r1=562324&r2=562325
==============================================================================
--- incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpidity/MethodDispatcher.java
(original)
+++ incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpidity/MethodDispatcher.java
Thu Aug  2 21:25:25 2007
@@ -47,7 +47,7 @@
     {
         System.out.println("got method segment:\n  " + event.target);
         Iterator<ByteBuffer> fragments = event.target.getFragments();
-        Decoder dec = new FragmentDecoder(fragments);
+        Decoder dec = new FragmentDecoder(factory, fragments);
         int type = (int) dec.readLong();
         Struct struct = factory.create(type, dec);
         Delegate<C> delegate = resolver.resolve(struct);

Modified: incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpidity/Struct.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpidity/Struct.java?view=diff&rev=562325&r1=562324&r2=562325
==============================================================================
--- incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpidity/Struct.java (original)
+++ incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpidity/Struct.java Thu
Aug  2 21:25:25 2007
@@ -27,4 +27,9 @@
  * @author Rafael H. Schloming
  */
 
-interface Struct extends Delegator, Writable {}
+interface Struct extends Delegator, Writable
+{
+
+    int getEncodedType();
+
+}



Mime
View raw message