You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ma...@apache.org on 2006/12/12 15:31:13 UTC

svn commit: r486165 - in /incubator/qpid/trunk/qpid/java/client/example: ./ src/main/java/org/apache/qpid/example/publisher/ src/main/java/org/apache/qpid/example/subscriber/

Author: marnie
Date: Tue Dec 12 06:31:12 2006
New Revision: 486165

URL: http://svn.apache.org/viewvc?view=rev&rev=486165
Log:
More example fixes and updated pom

Modified:
    incubator/qpid/trunk/qpid/java/client/example/pom.xml
    incubator/qpid/trunk/qpid/java/client/example/src/main/java/org/apache/qpid/example/publisher/Publisher.java
    incubator/qpid/trunk/qpid/java/client/example/src/main/java/org/apache/qpid/example/subscriber/MonitoredSubscriber.java
    incubator/qpid/trunk/qpid/java/client/example/src/main/java/org/apache/qpid/example/subscriber/Subscriber.java

Modified: incubator/qpid/trunk/qpid/java/client/example/pom.xml
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/example/pom.xml?view=diff&rev=486165&r1=486164&r2=486165
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/example/pom.xml (original)
+++ incubator/qpid/trunk/qpid/java/client/example/pom.xml Tue Dec 12 06:31:12 2006
@@ -49,25 +49,8 @@
         </dependency>
 
         <dependency>
-            <groupId>commons-codec</groupId>
-            <artifactId>commons-codec</artifactId>
-        </dependency>
-
-        <dependency>
             <groupId>org.apache.geronimo.specs</groupId>
             <artifactId>geronimo-jms_1.1_spec</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>commons-collections</groupId>
-            <artifactId>commons-collections</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>commons-lang</groupId>
-            <artifactId>commons-lang</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.mina</groupId>
-            <artifactId>mina-filter-ssl</artifactId>
         </dependency>
 
         <dependency>

Modified: incubator/qpid/trunk/qpid/java/client/example/src/main/java/org/apache/qpid/example/publisher/Publisher.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/example/src/main/java/org/apache/qpid/example/publisher/Publisher.java?view=diff&rev=486165&r1=486164&r2=486165
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/example/src/main/java/org/apache/qpid/example/publisher/Publisher.java (original)
+++ incubator/qpid/trunk/qpid/java/client/example/src/main/java/org/apache/qpid/example/publisher/Publisher.java Tue Dec 12 06:31:12 2006
@@ -75,7 +75,7 @@
 
             //lookup the example queue and use it
             //Queue is non-exclusive and not deleted when last consumer detaches
-            _destination = _session.createQueue((String)ctx.lookup("MyQueue"));
+            _destination = (Queue) ctx.lookup("MyQueue");
 
             //create a message producer
             _producer = _session.createProducer(_destination);

Modified: incubator/qpid/trunk/qpid/java/client/example/src/main/java/org/apache/qpid/example/subscriber/MonitoredSubscriber.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/example/src/main/java/org/apache/qpid/example/subscriber/MonitoredSubscriber.java?view=diff&rev=486165&r1=486164&r2=486165
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/example/src/main/java/org/apache/qpid/example/subscriber/MonitoredSubscriber.java (original)
+++ incubator/qpid/trunk/qpid/java/client/example/src/main/java/org/apache/qpid/example/subscriber/MonitoredSubscriber.java Tue Dec 12 06:31:12 2006
@@ -39,7 +39,7 @@
     {
         super();
         //lookup queue name and append suffix
-        _monitorDestinationName = _destinationName + Statics.MONITOR_QUEUE_SUFFIX;
+        _monitorDestinationName = _destination.toString() + Statics.MONITOR_QUEUE_SUFFIX;
     }
 
     /**

Modified: incubator/qpid/trunk/qpid/java/client/example/src/main/java/org/apache/qpid/example/subscriber/Subscriber.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/example/src/main/java/org/apache/qpid/example/subscriber/Subscriber.java?view=diff&rev=486165&r1=486164&r2=486165
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/example/src/main/java/org/apache/qpid/example/subscriber/Subscriber.java (original)
+++ incubator/qpid/trunk/qpid/java/client/example/src/main/java/org/apache/qpid/example/subscriber/Subscriber.java Tue Dec 12 06:31:12 2006
@@ -45,7 +45,7 @@
 
     protected static AMQConnectionFactory _connectionFactory;
 
-    protected String _destinationName;
+    protected Destination _destination;
 
     public Subscriber()
     {
@@ -58,8 +58,8 @@
             //then create a connection using the AMQConnectionFactory
             _connectionFactory = (AMQConnectionFactory) ctx.lookup("local");
 
-            //lookup queue name
-            _destinationName = (String) ctx.lookup("MyQueue");
+            //lookup queue from context
+            _destination = (Destination) ctx.lookup("MyQueue");
 
         }
         catch (Exception e)
@@ -79,7 +79,6 @@
         public ExampleMessageListener(String name)
         {
             _name = name;
-
         }
 
         /**
@@ -127,11 +126,8 @@
              //create a transactional session
             Session session =  _connection.createSession(true, Session.AUTO_ACKNOWLEDGE);
 
-            //Queue is non-exclusive and not deleted when last consumer detaches
-            Destination destination = session.createQueue(_destinationName);
-
             //Create a consumer with a destination of our queue which will use defaults for prefetch etc
-            _consumer = session.createConsumer(destination);
+            _consumer = session.createConsumer(_destination);
 
             //give the message listener a name of it's own
             _consumer.setMessageListener(new ExampleMessageListener("MessageListener " + System.currentTimeMillis()));
@@ -158,15 +154,6 @@
         {
             _log.warn("Exception while Subscriber sleeping",e);
         }
-    }
-
-    /**
-     * Set destination (queue or topic) name
-     * @param name
-     */
-    public void setDestinationName(String name)
-    {
-        _destinationName = name;
     }
 
     /**