cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bimargul...@apache.org
Subject svn commit: r998731 - in /cxf/trunk: distribution/src/main/release/samples/java_first_jms/src/main/java/demo/client/ distribution/src/main/release/samples/java_first_jms/src/main/java/demo/server/ rt/transports/jms/src/main/java/org/apache/cxf/transpor...
Date Sun, 19 Sep 2010 21:04:26 GMT
Author: bimargulies
Date: Sun Sep 19 21:04:25 2010
New Revision: 998731

URL: http://svn.apache.org/viewvc?rev=998731&view=rev
Log:
1. Switch sample to new JMS config.
2. Fix typo in comment.

Modified:
    cxf/trunk/distribution/src/main/release/samples/java_first_jms/src/main/java/demo/client/ClientJMS.java
    cxf/trunk/distribution/src/main/release/samples/java_first_jms/src/main/java/demo/server/ServerJMS.java
    cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java

Modified: cxf/trunk/distribution/src/main/release/samples/java_first_jms/src/main/java/demo/client/ClientJMS.java
URL: http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/samples/java_first_jms/src/main/java/demo/client/ClientJMS.java?rev=998731&r1=998730&r2=998731&view=diff
==============================================================================
--- cxf/trunk/distribution/src/main/release/samples/java_first_jms/src/main/java/demo/client/ClientJMS.java
(original)
+++ cxf/trunk/distribution/src/main/release/samples/java_first_jms/src/main/java/demo/client/ClientJMS.java
Sun Sep 19 21:04:25 2010
@@ -20,6 +20,8 @@
 package demo.client;
 
 import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
+import org.apache.cxf.transport.jms.spec.JMSSpecConstants;
+
 import demo.service.HelloWorld;
 
 public final class ClientJMS {
@@ -30,7 +32,11 @@ public final class ClientJMS {
     public static void main(String[] args) throws Exception {
         JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
         factory.setServiceClass(HelloWorld.class);
-        factory.setAddress("jms://");
+        factory.setTransportId(JMSSpecConstants.SOAP_JMS_SPECIFICIATION_TRANSPORTID);
+        factory.setAddress("jms:queue:test.cxf.jmstransport.queue?timeToLive=1000"
+            + "&jndiConnectionFactoryName=ConnectionFactory"
+            + "&jndiInitialContextFactory"
+            + "=org.apache.activemq.jndi.ActiveMQInitialContextFactory");
         HelloWorld client = (HelloWorld)factory.create();
         String reply = client.sayHi("HI");
         System.out.println(reply);

Modified: cxf/trunk/distribution/src/main/release/samples/java_first_jms/src/main/java/demo/server/ServerJMS.java
URL: http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/samples/java_first_jms/src/main/java/demo/server/ServerJMS.java?rev=998731&r1=998730&r2=998731&view=diff
==============================================================================
--- cxf/trunk/distribution/src/main/release/samples/java_first_jms/src/main/java/demo/server/ServerJMS.java
(original)
+++ cxf/trunk/distribution/src/main/release/samples/java_first_jms/src/main/java/demo/server/ServerJMS.java
Sun Sep 19 21:04:25 2010
@@ -58,7 +58,10 @@ public final class ServerJMS {
         JaxWsServerFactoryBean svrFactory = new JaxWsServerFactoryBean();
         svrFactory.setServiceClass(HelloWorld.class);
         svrFactory.setTransportId(JMSSpecConstants.SOAP_JMS_SPECIFICIATION_TRANSPORTID);
-        svrFactory.setAddress("jms:queue:test.cxf.jmstransport.queue?timeToLive=1000");
+        svrFactory.setAddress("jms:queue:test.cxf.jmstransport.queue?timeToLive=1000"
+                              + "&jndiConnectionFactoryName=ConnectionFactory"
+                              + "&jndiInitialContextFactory"
+                              + "=org.apache.activemq.jndi.ActiveMQInitialContextFactory");
         svrFactory.setServiceBean(implementor);
         svrFactory.create();
 

Modified: cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java?rev=998731&r1=998730&r2=998731&view=diff
==============================================================================
--- cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java
(original)
+++ cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java
Sun Sep 19 21:04:25 2010
@@ -37,18 +37,18 @@ import org.springframework.transaction.P
 @NoJSR250Annotations
 public class JMSConfiguration implements InitializingBean {
     /**
-     * The use of -1 is to make easier to determine 
+     * The use of -1 is to make easier to determine
      * if the setCacheLevel has been called.
      */
     public static final int DEFAULT_VALUE = -1;
-    
+
     static final boolean DEFAULT_USEJMS11 = true;
-    
+
     private boolean usingEndpointInfo = true;
-    
+
     private JmsTemplate jmsTemplate;
     private AbstractMessageListenerContainer messageListenerContainer;
-    
+
     private JndiTemplate jndiTemplate;
     private ConnectionFactory connectionFactory;
     private DestinationResolver destinationResolver;
@@ -66,7 +66,7 @@ public class JMSConfiguration implements
     private int priority = Message.DEFAULT_PRIORITY;
     private long timeToLive = Message.DEFAULT_TIME_TO_LIVE;
     private boolean sessionTransacted;
-    
+
     private int concurrentConsumers = 1;
     private int maxConcurrentConsumers = 1;
     private int maxSuspendedContinuations = DEFAULT_VALUE;
@@ -95,17 +95,17 @@ public class JMSConfiguration implements
     //For jms spec.
     private String targetService;
     private String requestURI;
-    
+
     private ConnectionFactory wrappedConnectionFactory;
-    
+
     private JNDIConfiguration jndiConfig;
-    
+
     public void ensureProperlyConfigured(org.apache.cxf.common.i18n.Message msg) {
         if (targetDestination == null ||  getOrCreateWrappedConnectionFactory() == null)
{
             throw new ConfigurationException(msg);
         }
     }
-    
+
     public String getCacheLevelName() {
         return cacheLevelName;
     }
@@ -142,7 +142,7 @@ public class JMSConfiguration implements
     public boolean isUsingEndpointInfo() {
         return this.usingEndpointInfo;
     }
-    
+
     public void setUsingEndpointInfo(boolean usingEndpointInfo) {
         this.usingEndpointInfo = usingEndpointInfo;
     }
@@ -233,7 +233,7 @@ public class JMSConfiguration implements
     public boolean isSetConduitSelectorPrefix() {
         return conduitSelectorPrefix != null;
     }
-    
+
     public boolean isSubscriptionDurable() {
         return subscriptionDurable;
     }
@@ -284,7 +284,7 @@ public class JMSConfiguration implements
     public void setReplyToDestination(String replyToDestination) {
         this.replyToDestination = replyToDestination;
     }
-    
+
     public String getMessageType() {
         return messageType;
     }
@@ -348,7 +348,7 @@ public class JMSConfiguration implements
     public void setMaxConcurrentConsumers(int maxConcurrentConsumers) {
         this.maxConcurrentConsumers = maxConcurrentConsumers;
     }
-    
+
     public int getMaxSuspendedContinuations() {
         return maxSuspendedContinuations;
     }
@@ -356,7 +356,7 @@ public class JMSConfiguration implements
     public void setMaxSuspendedContinuations(int maxSuspendedContinuations) {
         this.maxSuspendedContinuations = maxSuspendedContinuations;
     }
-    
+
     public int getReconnectPercentOfMax() {
         return reconnectPercentOfMax;
     }
@@ -414,17 +414,17 @@ public class JMSConfiguration implements
     public boolean isAcceptMessagesWhileStopping() {
         return acceptMessagesWhileStopping;
     }
-    
+
     public void setAcceptMessagesWhileStopping(boolean acceptMessagesWhileStopping) {
         this.acceptMessagesWhileStopping = acceptMessagesWhileStopping;
     }
-    
+
     /**
      * Tries to creates a ConnectionFactory from jndi if none was set as a property
-     * by using the jndConfig. Then it determiens if the connectionFactory should be wrapped
+     * by using the jndConfig. Then it determines if the connectionFactory should be wrapped
      * into a SingleConnectionFactory and wraps it if necessary. After the first call the
      * same connectionFactory will be returned for all subsequent calls
-     * 
+     *
      * @return usable connectionFactory
      */
     public synchronized ConnectionFactory getOrCreateWrappedConnectionFactory() {
@@ -442,7 +442,7 @@ public class JMSConfiguration implements
                     }
                 } else {
                     @SuppressWarnings("deprecation")
-                    SingleConnectionFactory scf2 
+                    SingleConnectionFactory scf2
                         = new org.springframework.jms.connection.SingleConnectionFactory102(connectionFactory,
                                                                                         
   pubSubDomain);
                     scf = scf2;
@@ -461,7 +461,7 @@ public class JMSConfiguration implements
     public ConnectionFactory getWrappedConnectionFactory() {
         return wrappedConnectionFactory;
     }
-    
+
     public synchronized void destroyWrappedConnectionFactory() {
         if (wrappedConnectionFactory instanceof SingleConnectionFactory) {
             ((SingleConnectionFactory)wrappedConnectionFactory).destroy();
@@ -471,7 +471,7 @@ public class JMSConfiguration implements
             wrappedConnectionFactory = null;
         }
     }
-    
+
     /**
      * Only for tests
      * @return
@@ -511,7 +511,7 @@ public class JMSConfiguration implements
     public String getRequestURI() {
         return requestURI;
     }
-    
+
     public boolean isEnforceSpec() {
         if (!isSetEnforceSpec()) {
             return true;
@@ -522,7 +522,7 @@ public class JMSConfiguration implements
     public void setEnforceSpec(boolean enforceSpec) {
         this.enforceSpec = enforceSpec;
     }
-    
+
     public boolean isSetEnforceSpec() {
         return this.enforceSpec != null;
     }



Mime
View raw message