tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From andygumbre...@apache.org
Subject [72/77] [abbrv] tomee git commit: TOMEE-1672 user tx not available during deployment of the app
Date Tue, 01 Dec 2015 22:04:24 GMT
TOMEE-1672 user tx not available during deployment of the app


Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/9a4e6fd4
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/9a4e6fd4
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/9a4e6fd4

Branch: refs/heads/tomee-7.0.0-M1
Commit: 9a4e6fd4d4123cfade2f6f14a2ba930f64771f85
Parents: f79ce15
Author: Romain Manni-Bucau <rmannibu@gmail.com>
Authored: Tue Dec 1 18:50:39 2015 +0100
Committer: Romain Manni-Bucau <rmannibu@gmail.com>
Committed: Tue Dec 1 18:50:39 2015 +0100

----------------------------------------------------------------------
 .../java/org/apache/tomee/catalina/ContextListener.java  |  3 ++-
 .../org/apache/tomee/catalina/GlobalListenerSupport.java |  4 ++--
 .../org/apache/tomee/catalina/TomcatWebAppBuilder.java   | 11 ++++++++---
 3 files changed, 12 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/9a4e6fd4/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/ContextListener.java
----------------------------------------------------------------------
diff --git a/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/ContextListener.java
b/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/ContextListener.java
index 2fd0c3e..4ad1a87 100644
--- a/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/ContextListener.java
+++ b/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/ContextListener.java
@@ -16,6 +16,7 @@
  */
 package org.apache.tomee.catalina;
 
+import org.apache.catalina.LifecycleEvent;
 import org.apache.catalina.core.StandardContext;
 import org.apache.catalina.core.StandardHost;
 import org.apache.catalina.core.StandardServer;
@@ -99,5 +100,5 @@ public interface ContextListener {
      */
     void checkHost(StandardHost standardHost);
 
-    void configureStart(StandardContext standardContext);
+    void configureStart(LifecycleEvent event, StandardContext standardContext);
 }

http://git-wip-us.apache.org/repos/asf/tomee/blob/9a4e6fd4/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/GlobalListenerSupport.java
----------------------------------------------------------------------
diff --git a/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/GlobalListenerSupport.java
b/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/GlobalListenerSupport.java
index 0bdf9cb..59759cb 100644
--- a/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/GlobalListenerSupport.java
+++ b/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/GlobalListenerSupport.java
@@ -130,7 +130,7 @@ public class GlobalListenerSupport implements PropertyChangeListener,
LifecycleL
                     contextListener.destroy(standardContext);
                     break;
                 case Lifecycle.CONFIGURE_START_EVENT:
-                    contextListener.configureStart(standardContext);
+                    contextListener.configureStart(event, standardContext);
                     break;
                 default:
             }
@@ -157,7 +157,7 @@ public class GlobalListenerSupport implements PropertyChangeListener,
LifecycleL
                 TomcatHelper.setStopping(true);
                 final TomEEClusterListener tomEEClusterListener = SystemInstance.get().getComponent(TomEEClusterListener.class);
                 if (tomEEClusterListener != null) {
-                    tomEEClusterListener.stop();
+                    TomEEClusterListener.stop();
                 }
             }
 

http://git-wip-us.apache.org/repos/asf/tomee/blob/9a4e6fd4/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomcatWebAppBuilder.java
----------------------------------------------------------------------
diff --git a/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomcatWebAppBuilder.java
b/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomcatWebAppBuilder.java
index 95b40cf..8949d97 100644
--- a/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomcatWebAppBuilder.java
+++ b/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomcatWebAppBuilder.java
@@ -21,6 +21,7 @@ import org.apache.catalina.Container;
 import org.apache.catalina.Engine;
 import org.apache.catalina.Host;
 import org.apache.catalina.Lifecycle;
+import org.apache.catalina.LifecycleEvent;
 import org.apache.catalina.LifecycleException;
 import org.apache.catalina.LifecycleListener;
 import org.apache.catalina.LifecycleState;
@@ -1059,12 +1060,16 @@ public class TomcatWebAppBuilder implements WebAppBuilder, ContextListener,
Pare
     }
 
     @Override
-    public void configureStart(final StandardContext standardContext) {
-        TomcatHelper.configureJarScanner(standardContext);
-
+    public void configureStart(final LifecycleEvent event, final StandardContext standardContext)
{
         final ContextTransaction contextTransaction = new ContextTransaction();
         contextTransaction.setProperty(org.apache.naming.factory.Constants.FACTORY, UserTransactionFactory.class.getName());
         standardContext.getNamingResources().setTransaction(contextTransaction);
+
+        // ensure NamingContext is available for eager usage (@Observes @Initialized(ApplicationScoped)
for instance)
+        standardContext.getNamingContextListener().lifecycleEvent(event);
+
+        TomcatHelper.configureJarScanner(standardContext);
+
         startInternal(standardContext);
 
         // clear a bit log for default case


Mime
View raw message