tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r611036 - in /openejb/trunk/openejb3/container/openejb-core/src/main: java/org/apache/openejb/config/ java/org/apache/openejb/resource/activemq/ resources/META-INF/org.apache.openejb.embedded/
Date Fri, 11 Jan 2008 03:41:01 GMT
Author: dain
Date: Thu Jan 10 19:41:00 2008
New Revision: 611036

URL: http://svn.apache.org/viewvc?rev=611036&view=rev
Log:
When embedded disable persistent messaging and db

Added:
    openejb/trunk/openejb3/container/openejb-core/src/main/resources/META-INF/org.apache.openejb.embedded/
    openejb/trunk/openejb3/container/openejb-core/src/main/resources/META-INF/org.apache.openejb.embedded/service-jar.xml
      - copied, changed from r610992, openejb/trunk/openejb3/container/openejb-core/src/main/resources/META-INF/org.apache.openejb/service-jar.xml
Modified:
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/ServiceUtils.java
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/resource/activemq/OpenEjbBrokerFactory.java

Modified: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/ServiceUtils.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/ServiceUtils.java?rev=611036&r1=611035&r2=611036&view=diff
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/ServiceUtils.java
(original)
+++ openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/ServiceUtils.java
Thu Jan 10 19:41:00 2008
@@ -17,6 +17,8 @@
 package org.apache.openejb.config;
 
 import org.apache.openejb.OpenEJBException;
+import org.apache.openejb.loader.SystemInstance;
+import org.apache.openejb.loader.FileUtils;
 import org.apache.openejb.config.sys.ServiceProvider;
 import org.apache.openejb.config.sys.ServicesJar;
 import org.apache.openejb.config.sys.JaxbOpenejb;
@@ -38,7 +40,29 @@
 public class ServiceUtils {
     public static final String ANY = ServiceUtils.class.getName() + "@ANY";
 
-    public static final String defaultProviderURL = System.getProperty("openejb.provider.default",
"org.apache.openejb");
+    /**
+     * Default service provider package.  This value is choosen as follows:
+     * </p>
+     * 1. System property "openejb.provider.default" </br>
+     * 2. If in a full server containing a "conf" directory "org.apache.openejb" </br>
+     * 3. Embedded mode "org.apache.openejb.embedded" </br>
+     */
+    public static final String defaultProviderURL;
+    static {
+        String defaultValue = "org.apache.openejb";
+        try {
+            SystemInstance system = SystemInstance.get();
+            FileUtils base = system.getBase();
+            File confDir = base.getDirectory("conf");
+            if (!confDir.exists()) {
+                defaultValue = "org.apache.openejb.embedded";
+            }
+        } catch (Exception ignored) {
+        }
+        defaultProviderURL = System.getProperty("openejb.provider.default", defaultValue);
+    }
+
+
     private static Map<String, List<ServiceProvider>> loadedServiceJars = new
HashMap<String, List<ServiceProvider>>();
     public static Messages messages = new Messages("org.apache.openejb.util.resources");
     public static Logger logger = Logger.getInstance(LogCategory.OPENEJB, "org.apache.openejb.util.resources");

Modified: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/resource/activemq/OpenEjbBrokerFactory.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/resource/activemq/OpenEjbBrokerFactory.java?rev=611036&r1=611035&r2=611036&view=diff
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/resource/activemq/OpenEjbBrokerFactory.java
(original)
+++ openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/resource/activemq/OpenEjbBrokerFactory.java
Thu Jan 10 19:41:00 2008
@@ -44,6 +44,10 @@
         Properties properties = getLowerCaseProperties();
         
         Object value = properties.get("datasource");
+        if (value instanceof String && value.toString().length() == 0) {
+            value = null;
+        }
+        
         if (value != null) {
             DataSource dataSource;
             if (value instanceof DataSource) {

Copied: openejb/trunk/openejb3/container/openejb-core/src/main/resources/META-INF/org.apache.openejb.embedded/service-jar.xml
(from r610992, openejb/trunk/openejb3/container/openejb-core/src/main/resources/META-INF/org.apache.openejb/service-jar.xml)
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/resources/META-INF/org.apache.openejb.embedded/service-jar.xml?p2=openejb/trunk/openejb3/container/openejb-core/src/main/resources/META-INF/org.apache.openejb.embedded/service-jar.xml&p1=openejb/trunk/openejb3/container/openejb-core/src/main/resources/META-INF/org.apache.openejb/service-jar.xml&r1=610992&r2=611036&rev=611036&view=diff
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/main/resources/META-INF/org.apache.openejb/service-jar.xml
(original)
+++ openejb/trunk/openejb3/container/openejb-core/src/main/resources/META-INF/org.apache.openejb.embedded/service-jar.xml
Thu Jan 10 19:41:00 2008
@@ -23,19 +23,17 @@
 
   <!--
   #===================================================================#
-  #       D E F A U L T    O P E N E J B    S E R V I C E S           #
+  #       E M B E D D E D    O P E N E J B    S E R V I C E S         #
   #===================================================================#
   #
   #
   #  This file defines all the default configurations of containers,
-  #  factories, managers and services that come with OpenEJB.
+  #  factories, managers and services when operating OpenEJB in
+  #  embedded mode.
   #
   #  Can contain numerous configurations of the standard services
   #  making it easy for users to simply name the one they want in
   #  their configuration files.
-  #
-  #  Over time this will be become a library of default
-  #  configurations
   -->
 
   <!--
@@ -270,7 +268,7 @@
 
     # Url for creating connections
 
-    JdbcUrl jdbc:hsqldb:file:hsqldb
+    JdbcUrl jdbc:hsqldb:mem:hsqldb
 
     # Default user name
 
@@ -456,7 +454,7 @@
     # Url for creating connections
 
     #JdbcUrl jdbc:derby:derbyDB;create=true
-    JdbcUrl jdbc:hsqldb:file:hsqldb
+    JdbcUrl jdbc:hsqldb:mem:hsqldb
 
     # Default user name
 
@@ -644,7 +642,7 @@
     ServerUrl vm://localhost?async=true
 
     # DataSource for persistence messages
-    DataSource Default Unmanaged JDBC Database
+    DataSource 
 
     # Specifies the size of the thread pool available to AciveMQ.
     ThreadPoolSize 30



Mime
View raw message