tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From andygumbre...@apache.org
Subject svn commit: r1528043 - in /tomee/tomee/trunk: container/openejb-core/pom.xml container/openejb-core/src/main/java/org/apache/openejb/resource/activemq/ActiveMQ5Factory.java pom.xml
Date Tue, 01 Oct 2013 11:27:00 GMT
Author: andygumbrecht
Date: Tue Oct  1 11:27:00 2013
New Revision: 1528043

URL: http://svn.apache.org/r1528043
Log:
Be more explicit defining persistence store.
Pull plugin version up. 
Exclude.

Modified:
    tomee/tomee/trunk/container/openejb-core/pom.xml
    tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/resource/activemq/ActiveMQ5Factory.java
    tomee/tomee/trunk/pom.xml

Modified: tomee/tomee/trunk/container/openejb-core/pom.xml
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/pom.xml?rev=1528043&r1=1528042&r2=1528043&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/pom.xml (original)
+++ tomee/tomee/trunk/container/openejb-core/pom.xml Tue Oct  1 11:27:00 2013
@@ -240,7 +240,6 @@
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-compiler-plugin</artifactId>
-        <version>3.0</version>
         <configuration>
           <source>1.6</source>
           <target>1.6</target>
@@ -467,6 +466,12 @@
     <dependency>
       <groupId>org.apache.activemq</groupId>
       <artifactId>activemq-jdbc-store</artifactId>
+      <exclusions>
+        <exclusion>
+          <artifactId>activemq-broker</artifactId>
+          <groupId>org.apache.activemq</groupId>
+        </exclusion>
+      </exclusions>
     </dependency>
     <dependency>
       <groupId>org.apache.geronimo.components</groupId>

Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/resource/activemq/ActiveMQ5Factory.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/resource/activemq/ActiveMQ5Factory.java?rev=1528043&r1=1528042&r2=1528043&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/resource/activemq/ActiveMQ5Factory.java
(original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/resource/activemq/ActiveMQ5Factory.java
Tue Oct  1 11:27:00 2013
@@ -65,16 +65,19 @@ public class ActiveMQ5Factory implements
             if (!uri.getScheme().toLowerCase().startsWith("xbean")) {
 
                 Object value = properties.get("datasource");
-                if (value instanceof String && value.toString().length() == 0) {
+
+                if (String.class.isInstance(value) && value.toString().length() ==
0) {
                     value = null;
                 }
 
+                final DataSource dataSource;
+
                 if (value != null) {
-                    final DataSource dataSource;
-                    if (value instanceof DataSource) {
-                        dataSource = (DataSource) value;
-                    } else {
-                        final String resouceId = (String) value;
+
+                    if (DataSource.class.isInstance(value)) {
+                        dataSource = DataSource.class.cast(value);
+                    } else if (String.class.isInstance(value)) {
+                        final String resouceId = String.class.cast(value);
 
                         try {
                             final ContainerSystem containerSystem = SystemInstance.get().getComponent(ContainerSystem.class);
@@ -82,19 +85,26 @@ public class ActiveMQ5Factory implements
                             final Object obj = context.lookup("openejb/Resource/" + resouceId);
                             if (!(obj instanceof DataSource)) {
                                 throw new IllegalArgumentException("Resource with id " +
resouceId
-                                        + " is not a DataSource, but is " + obj.getClass().getName());
+                                                                   + " is not a DataSource,
but is " + obj.getClass().getName());
                             }
                             dataSource = (DataSource) obj;
                         } catch (NamingException e) {
                             throw new IllegalArgumentException("Unknown datasource " + resouceId);
                         }
+                    } else {
+                        throw new IllegalArgumentException("Unexpected datasource definition:
" + value);
                     }
 
+                } else {
+                    dataSource = null;
+                }
+
+                if (null != dataSource) {
                     final JDBCPersistenceAdapter persistenceAdapter = new JDBCPersistenceAdapter();
 
                     if (properties.containsKey("usedatabaselock")) {
                         //This must be false for hsqldb
-                        persistenceAdapter.setUseDatabaseLock(Boolean.parseBoolean(properties.getProperty("usedatabaselock",
"true")));
+                        persistenceAdapter.setUseLock(Boolean.parseBoolean(properties.getProperty("usedatabaselock",
"true")));
                     }
 
                     persistenceAdapter.setDataSource(dataSource);
@@ -130,14 +140,26 @@ public class ActiveMQ5Factory implements
                     try {
                         //Start before returning - this is known to be safe.
                         if (!bs.isStarted()) {
-                            org.apache.openejb.util.Logger.getInstance(LogCategory.OPENEJB_STARTUP,
ActiveMQ5Factory.class).getChildLogger("service").info("Starting ActiveMQ BrokerService");
+                            org.apache
+                                .openejb
+                                .util
+                                .Logger
+                                .getInstance(LogCategory.OPENEJB_STARTUP, ActiveMQ5Factory.class)
+                                .getChildLogger("service")
+                                .info("Starting ActiveMQ BrokerService");
                             bs.start();
                         }
 
                         bs.waitUntilStarted();
 
                         //Force a checkpoint to initialize pools
-                        org.apache.openejb.util.Logger.getInstance(LogCategory.OPENEJB_STARTUP,
ActiveMQ5Factory.class).getChildLogger("service").info("Starting ActiveMQ checkpoint");
+                        org.apache
+                            .openejb
+                            .util
+                            .Logger
+                            .getInstance(LogCategory.OPENEJB_STARTUP, ActiveMQ5Factory.class)
+                            .getChildLogger("service")
+                            .info("Starting ActiveMQ checkpoint");
                         bs.getPersistenceAdapter().checkpoint(true);
                         started.set(true);
 
@@ -165,7 +187,13 @@ public class ActiveMQ5Factory implements
 
             try {
                 timeout = Integer.parseInt(properties.getProperty("startuptimeout", "30000"));
-                org.apache.openejb.util.Logger.getInstance(LogCategory.OPENEJB_STARTUP, ActiveMQ5Factory.class).getChildLogger("service").info("Using
ActiveMQ startup timeout of " + timeout + "ms");
+                org.apache
+                    .openejb
+                    .util
+                    .Logger
+                    .getInstance(LogCategory.OPENEJB_STARTUP, ActiveMQ5Factory.class)
+                    .getChildLogger("service")
+                    .info("Using ActiveMQ startup timeout of " + timeout + "ms");
             } catch (Throwable e) {
                 //Ignore
             }
@@ -180,11 +208,18 @@ public class ActiveMQ5Factory implements
             }
 
             if (null != throwable) {
-                org.apache.openejb.util.Logger.getInstance(LogCategory.OPENEJB_STARTUP, ActiveMQ5Factory.class).getChildLogger("service").error("ActiveMQ
failed to start broker", throwable);
+                org.apache.openejb.util.Logger.getInstance(LogCategory.OPENEJB_STARTUP, ActiveMQ5Factory.class).getChildLogger("service").error("ActiveMQ
failed to start broker",
+                                                                                        
                                                       throwable);
             } else if (started.get()) {
                 org.apache.openejb.util.Logger.getInstance(LogCategory.OPENEJB_STARTUP, ActiveMQ5Factory.class).getChildLogger("service").info("ActiveMQ
broker started");
             } else {
-                org.apache.openejb.util.Logger.getInstance(LogCategory.OPENEJB_STARTUP, ActiveMQ5Factory.class).getChildLogger("service").warning("ActiveMQ
failed to start broker within " + timeout + " seconds - It may be unusable");
+                org.apache
+                    .openejb
+                    .util
+                    .Logger
+                    .getInstance(LogCategory.OPENEJB_STARTUP, ActiveMQ5Factory.class)
+                    .getChildLogger("service")
+                    .warning("ActiveMQ failed to start broker within " + timeout + " seconds
- It may be unusable");
             }
 
         }

Modified: tomee/tomee/trunk/pom.xml
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/pom.xml?rev=1528043&r1=1528042&r2=1528043&view=diff
==============================================================================
--- tomee/tomee/trunk/pom.xml (original)
+++ tomee/tomee/trunk/pom.xml Tue Oct  1 11:27:00 2013
@@ -204,12 +204,32 @@
         <plugin>
           <groupId>org.codehaus.mojo</groupId>
           <artifactId>build-helper-maven-plugin</artifactId>
-          <version>1.7</version>
+          <version>1.8</version>
         </plugin>
         <plugin>
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-compiler-plugin</artifactId>
-          <version>3.0</version>
+          <version>3.1</version>
+        </plugin>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-surefire-plugin</artifactId>
+          <version>2.14.1</version>
+        </plugin>
+        <plugin> <!-- maven-dependency-plugin:properties doesn't work as well as
this one for us -->
+          <groupId>org.apache.geronimo.buildsupport</groupId>
+          <artifactId>geronimo-property-plugin</artifactId>
+          <version>3.0.0</version>
+        </plugin>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-jar-plugin</artifactId>
+          <version>2.4</version>
+        </plugin>
+        <plugin>
+          <groupId>org.codehaus.swizzle</groupId>
+          <artifactId>dependency-report-plugin</artifactId>
+          <version>1.0.2</version>
         </plugin>
       </plugins>
     </pluginManagement>
@@ -226,7 +246,6 @@
       <plugin> <!-- maven-dependency-plugin:properties doesn't work as well as this
one for us -->
         <groupId>org.apache.geronimo.buildsupport</groupId>
         <artifactId>geronimo-property-plugin</artifactId>
-        <version>3.0.0</version>
         <configuration>
           <propertyName>openejb.build.endorsed</propertyName>
           <listFiles>false</listFiles>
@@ -251,7 +270,6 @@
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-surefire-plugin</artifactId>
-        <version>2.13</version>
         <configuration>
           <forkMode>always</forkMode>
         </configuration>
@@ -294,7 +312,6 @@
       <plugin>
         <groupId>org.codehaus.swizzle</groupId>
         <artifactId>dependency-report-plugin</artifactId>
-        <version>1.0.2</version>
         <executions>
           <execution>
             <phase>compile</phase>
@@ -313,7 +330,6 @@
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-jar-plugin</artifactId>
-        <version>2.4</version>
         <configuration>
           <archive>
             <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>



Mime
View raw message