tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From radcor...@apache.org
Subject [tomee] branch master updated: TOMEE-2408 - Register MP Observers only one time.
Date Tue, 05 Feb 2019 15:27:27 GMT
This is an automated email from the ASF dual-hosted git repository.

radcortez pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomee.git


The following commit(s) were added to refs/heads/master by this push:
     new 0fbfd06  TOMEE-2408 - Register MP Observers only one time.
0fbfd06 is described below

commit 0fbfd0640b6397bb99336b2d5f8e277e25c99b94
Author: Roberto Cortez <radcortez@yahoo.com>
AuthorDate: Tue Feb 5 15:27:19 2019 +0000

    TOMEE-2408 - Register MP Observers only one time.
---
 .../org/apache/tomee/catalina/TomcatLoader.java    |  2 ++
 .../microprofile/TomEEMicroProfileService.java     | 33 ++++++++++++++++++++++
 .../META-INF/org.apache.openejb.extension          |  1 -
 3 files changed, 35 insertions(+), 1 deletion(-)

diff --git a/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomcatLoader.java
b/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomcatLoader.java
index 79dcbee..b3dbb32 100644
--- a/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomcatLoader.java
+++ b/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomcatLoader.java
@@ -215,6 +215,8 @@ public class TomcatLoader implements Loader {
         // for compatibility purpose, no more used normally by our trunk
         SystemInstance.get().setComponent(WebDeploymentListeners.class, new WebDeploymentListeners());
 
+        optionalService(properties, "org.apache.tomee.microprofile.TomEEMicroProfileService");
+
         // tomee webapp enricher
         final TomEEClassLoaderEnricher classLoaderEnricher = new TomEEClassLoaderEnricher();
         SystemInstance.get().setComponent(WebAppEnricher.class, classLoaderEnricher);
diff --git a/tomee/tomee-microprofile/mp-common/src/main/java/org/apache/tomee/microprofile/TomEEMicroProfileService.java
b/tomee/tomee-microprofile/mp-common/src/main/java/org/apache/tomee/microprofile/TomEEMicroProfileService.java
new file mode 100644
index 0000000..3601867
--- /dev/null
+++ b/tomee/tomee-microprofile/mp-common/src/main/java/org/apache/tomee/microprofile/TomEEMicroProfileService.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.tomee.microprofile;
+
+import org.apache.openejb.loader.SystemInstance;
+import org.apache.openejb.spi.Service;
+
+import java.util.Properties;
+
+public class TomEEMicroProfileService implements Service {
+    static {
+        SystemInstance.get().addObserver(new TomEEMicroProfileListener());
+    }
+
+    @Override
+    public void init(final Properties props) throws Exception {
+
+    }
+}
diff --git a/tomee/tomee-microprofile/mp-common/src/main/resources/META-INF/org.apache.openejb.extension
b/tomee/tomee-microprofile/mp-common/src/main/resources/META-INF/org.apache.openejb.extension
deleted file mode 100644
index 3192713..0000000
--- a/tomee/tomee-microprofile/mp-common/src/main/resources/META-INF/org.apache.openejb.extension
+++ /dev/null
@@ -1 +0,0 @@
-org.apache.tomee.microprofile.TomEEMicroProfileListener


Mime
View raw message