Author: lhein
Date: Mon May 16 18:18:27 2011
New Revision: 1103820

URL: http://svn.apache.org/viewvc?rev=1103820&view=rev
Log:
SM-1206 - ClientFactory JNDI bind fails in non-standalone ServiceMix installs

Modified:
    
servicemix/components/trunk/bindings/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcConfiguration.java
    
servicemix/components/trunk/bindings/servicemix-http/src/main/java/org/apache/servicemix/http/HttpConfiguration.java
    
servicemix/components/trunk/bindings/servicemix-jms/src/main/java/org/apache/servicemix/jms/JmsConfiguration.java
    
servicemix/components/trunk/engines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/component/WSNComponent.java
    
servicemix/components/trunk/engines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/component/WSNConfiguration.java

Modified: 
servicemix/components/trunk/bindings/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcConfiguration.java
URL: 
http://svn.apache.org/viewvc/servicemix/components/trunk/bindings/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcConfiguration.java?rev=1103820&r1=1103819&r2=1103820&view=diff
==============================================================================
--- 
servicemix/components/trunk/bindings/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcConfiguration.java
 (original)
+++ 
servicemix/components/trunk/bindings/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcConfiguration.java
 Mon May 16 18:18:27 2011
@@ -36,7 +36,7 @@ public class CxfBcConfiguration {
     /**
      * The JNDI name of the AuthenticationService object
      */
-    private String authenticationServiceName = 
"java:org/apache/servicemix/AuthenticationService";
+    private String authenticationServiceName = 
"org.apache.servicemix.AuthenticationService";
     
     
     /**

Modified: 
servicemix/components/trunk/bindings/servicemix-http/src/main/java/org/apache/servicemix/http/HttpConfiguration.java
URL: 
http://svn.apache.org/viewvc/servicemix/components/trunk/bindings/servicemix-http/src/main/java/org/apache/servicemix/http/HttpConfiguration.java?rev=1103820&r1=1103819&r2=1103820&view=diff
==============================================================================
--- 
servicemix/components/trunk/bindings/servicemix-http/src/main/java/org/apache/servicemix/http/HttpConfiguration.java
 (original)
+++ 
servicemix/components/trunk/bindings/servicemix-http/src/main/java/org/apache/servicemix/http/HttpConfiguration.java
 Mon May 16 18:18:27 2011
@@ -50,12 +50,12 @@ public class HttpConfiguration implement
     /**
      * The JNDI name of the AuthenticationService object
      */
-    private String authenticationServiceName = 
"java:org/apache/servicemix/AuthenticationService";
+    private String authenticationServiceName = 
"org.apache.servicemix.AuthenticationService";
 
     /**
      * The JNDI name of the KeystoreManager object
      */
-    private String keystoreManagerName = 
"java:org/apache/servicemix/KeystoreManager";
+    private String keystoreManagerName = 
"org.apache.servicemix.KeystoreManager";
 
     /**
      * The maximum number of threads for the Jetty thread pool. It's set to 255

Modified: 
servicemix/components/trunk/bindings/servicemix-jms/src/main/java/org/apache/servicemix/jms/JmsConfiguration.java
URL: 
http://svn.apache.org/viewvc/servicemix/components/trunk/bindings/servicemix-jms/src/main/java/org/apache/servicemix/jms/JmsConfiguration.java?rev=1103820&r1=1103819&r2=1103820&view=diff
==============================================================================
--- 
servicemix/components/trunk/bindings/servicemix-jms/src/main/java/org/apache/servicemix/jms/JmsConfiguration.java
 (original)
+++ 
servicemix/components/trunk/bindings/servicemix-jms/src/main/java/org/apache/servicemix/jms/JmsConfiguration.java
 Mon May 16 18:18:27 2011
@@ -51,12 +51,12 @@ public class JmsConfiguration implements
     /**
      * The JNDI name of the AuthenticationService object
      */
-    private String authenticationServiceName = 
"java:org/apache/servicemix/AuthenticationService";
+    private String authenticationServiceName = 
"org.apache.servicemix.AuthenticationService";
     
     /**
      * The JNDI name of the KeystoreManager object
      */
-    private String keystoreManagerName = 
"java:org/apache/servicemix/KeystoreManager";
+    private String keystoreManagerName = 
"org.apache.servicemix.KeystoreManager";
 
     
     /**

Modified: 
servicemix/components/trunk/engines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/component/WSNComponent.java
URL: 
http://svn.apache.org/viewvc/servicemix/components/trunk/engines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/component/WSNComponent.java?rev=1103820&r1=1103819&r2=1103820&view=diff
==============================================================================
--- 
servicemix/components/trunk/engines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/component/WSNComponent.java
 (original)
+++ 
servicemix/components/trunk/engines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/component/WSNComponent.java
 Mon May 16 18:18:27 2011
@@ -17,6 +17,8 @@
 package org.apache.servicemix.wsn.component;
 
 import com.ibm.wsdl.Constants;
+import org.apache.activemq.ActiveMQConnectionFactory;
+import org.apache.activemq.broker.BrokerService;
 import org.apache.servicemix.common.*;
 import org.apache.servicemix.common.tools.wsdl.WSDLFlattener;
 import org.apache.servicemix.wsn.EndpointManager;
@@ -63,6 +65,9 @@ public class WSNComponent extends Defaul
 
     private WSNDeployer deployer;
 
+    private BrokerService brokerService;
+
+
     public WSNComponent() {
         configuration = new WSNConfiguration();
         serviceUnit = new DefaultServiceUnit(this);
@@ -141,16 +146,25 @@ public class WSNComponent extends Defaul
         notificationBroker = new 
JbiNotificationBroker(configuration.getBrokerName());
         notificationBroker.setManager(new WSNEndpointManager());
         if (connectionFactory == null) {
-            connectionFactory = lookupConnectionFactory();
+            try {
+                connectionFactory = lookupConnectionFactory();
+            } catch (Throwable t) {
+                // create some embedded cf
+                this.brokerService = new BrokerService();
+                this.brokerService.setUseJmx(false);
+                this.brokerService.setPersistent(false);
+                
this.brokerService.setBrokerName(configuration.getBrokerName());
+                this.brokerService.start();
+                this.connectionFactory = new ActiveMQConnectionFactory("vm://" 
+ configuration.getBrokerName());
+            }
+        }
+        if (connectionFactory != null) {
+            notificationBroker.setConnectionFactory(connectionFactory);
+            notificationBroker.init();
         }
-        notificationBroker.setConnectionFactory(connectionFactory);
-        notificationBroker.init();
         // Create PullPoint
         createPullPoint = new 
JmsCreatePullPoint(configuration.getBrokerName());
         createPullPoint.setManager(new WSNEndpointManager());
-        if (connectionFactory == null) {
-            connectionFactory = lookupConnectionFactory();
-        }
         createPullPoint.setConnectionFactory(connectionFactory);
         createPullPoint.init();
         // Create endpoints
@@ -174,6 +188,10 @@ public class WSNComponent extends Defaul
     protected void doShutDown() throws Exception {
         notificationBroker.destroy();
         createPullPoint.destroy();
+        if (this.brokerService != null) {
+            this.brokerService.stop();
+            this.brokerService = null;
+        }
         super.doShutDown();
     }
 

Modified: 
servicemix/components/trunk/engines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/component/WSNConfiguration.java
URL: 
http://svn.apache.org/viewvc/servicemix/components/trunk/engines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/component/WSNConfiguration.java?rev=1103820&r1=1103819&r2=1103820&view=diff
==============================================================================
--- 
servicemix/components/trunk/engines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/component/WSNConfiguration.java
 (original)
+++ 
servicemix/components/trunk/engines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/component/WSNConfiguration.java
 Mon May 16 18:18:27 2011
@@ -24,7 +24,7 @@ public class WSNConfiguration extends Pe
 
     private String jndiProviderURL;
 
-    private String jndiConnectionFactoryName = 
"java:org/apache/servicemix/jms/wsnotificationCF";
+    private String jndiConnectionFactoryName = 
"org.apache.servicemix.jms.wsnotificationCF";
 
     private String brokerName = "Broker";
 


Reply via email to