You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by jg...@apache.org on 2018/11/29 21:53:56 UTC

[05/15] tomee git commit: TOMEE-2278 - add alternative for the safeguard FailsafeExecutionManagerProvider bean. Reorganize project to into 2 libs

TOMEE-2278 - add alternative for the safeguard FailsafeExecutionManagerProvider bean. Reorganize project to into 2 libs

Signed-off-by: brunobat <br...@gmail.com>


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

Branch: refs/heads/master
Commit: ec927200f92d5c61ea96668d96b16af1de3c3db4
Parents: 258086a
Author: brunobat <br...@gmail.com>
Authored: Mon Nov 19 10:21:53 2018 +0000
Committer: brunobat <br...@gmail.com>
Committed: Mon Nov 19 10:21:53 2018 +0000

----------------------------------------------------------------------
 pom.xml                                         |    2 +-
 tomee/pom.xml                                   |    2 +-
 tomee/tomee-microprofile-webapp/pom.xml         |  209 ---
 .../src/main/assembly/war.xml                   |   92 --
 ...ilsafeContainerExecutionManagerProvider.java |   59 -
 .../src/main/resources/META-INF/LICENSE         | 1197 ------------------
 .../src/main/resources/META-INF/NOTICE          |  171 ---
 tomee/tomee-microprofile/pom.xml                |   21 +
 .../tomee-microprofile-common/pom.xml           |   35 +
 ...ilsafeContainerExecutionManagerProvider.java |   67 +
 .../src/main/resources/META-INF/beans.xml       |   19 +
 ...feContainerExecutionManagerProviderTest.java |   56 +
 .../tomee-microprofile-webapp/pom.xml           |  208 +++
 .../src/main/assembly/war.xml                   |   92 ++
 .../src/main/resources/META-INF/LICENSE         | 1197 ++++++++++++++++++
 .../src/main/resources/META-INF/NOTICE          |  171 +++
 16 files changed, 1868 insertions(+), 1730 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/ec927200/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 14ed42f..7297092 100644
--- a/pom.xml
+++ b/pom.xml
@@ -203,7 +203,7 @@
     <microprofile.config.impl.version>1.2</microprofile.config.impl.version>
     <microprofile.jwt.version>1.0</microprofile.jwt.version>
     <microprofile.jwt.impl.version>${project.version}</microprofile.jwt.impl.version>
-    <microprofile.fault-tolerance.version>1.1-SNAPSHOT</microprofile.fault-tolerance.version>
+    <microprofile.fault-tolerance.version>1.0</microprofile.fault-tolerance.version>
     <microprofile.fault-tolerance.impl.version>1.1-SNAPSHOT</microprofile.fault-tolerance.impl.version>
     <microprofile.health.version>1.0</microprofile.health.version>
     <microprofile.health.impl.version>1.0.0</microprofile.health.impl.version>

http://git-wip-us.apache.org/repos/asf/tomee/blob/ec927200/tomee/pom.xml
----------------------------------------------------------------------
diff --git a/tomee/pom.xml b/tomee/pom.xml
index ed94bfb..5a4182e 100644
--- a/tomee/pom.xml
+++ b/tomee/pom.xml
@@ -47,7 +47,7 @@
     <module>tomee-plume-webapp</module>
     <module>tomee-webservices</module>
     <module>tomee-embedded</module>
-    <module>tomee-microprofile-webapp</module>
+    <module>tomee-microprofile</module>
     <module>apache-tomee</module>
     <module>tomee-util</module>
     <module>tomee-juli</module>

http://git-wip-us.apache.org/repos/asf/tomee/blob/ec927200/tomee/tomee-microprofile-webapp/pom.xml
----------------------------------------------------------------------
diff --git a/tomee/tomee-microprofile-webapp/pom.xml b/tomee/tomee-microprofile-webapp/pom.xml
deleted file mode 100644
index 420c9c0..0000000
--- a/tomee/tomee-microprofile-webapp/pom.xml
+++ /dev/null
@@ -1,209 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
-    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.
--->
-
-<!-- $Rev: 600338 $ $Date: 2007-12-02 09:08:04 -0800 (Sun, 02 Dec 2007) $ -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
-  <parent>
-    <artifactId>tomee</artifactId>
-    <groupId>org.apache.tomee</groupId>
-    <version>8.0.0-SNAPSHOT</version>
-  </parent>
-
-  <modelVersion>4.0.0</modelVersion>
-
-  <artifactId>tomee-microprofile-webapp</artifactId>
-  <name>OpenEJB :: TomEE :: MicroProfile Webapp</name>
-  <packaging>war</packaging>
-
-  <properties>
-    <tomee.build.name>${project.groupId}.tomee.microprofile.webapp</tomee.build.name>
-  </properties>
-  <dependencies>
-
-    <!--<dependency>-->
-      <!--<groupId>${project.groupId}</groupId>-->
-      <!--<artifactId>javaee-api</artifactId>-->
-      <!--<scope>compile</scope>-->
-      <!--<classifier>tomcat</classifier>-->
-    <!--</dependency>-->
-
-    <dependency>
-      <groupId>${project.groupId}</groupId>
-      <artifactId>tomee-webapp</artifactId>
-      <version>${project.version}</version>
-      <type>war</type>
-    </dependency>
-
-    <dependency>
-      <groupId>org.eclipse.microprofile.config</groupId>
-      <artifactId>microprofile-config-api</artifactId>
-      <version>${microprofile.config.version}</version>
-    </dependency>
-
-    <dependency>
-      <groupId>org.apache.geronimo.config</groupId>
-      <artifactId>geronimo-config-impl</artifactId>
-      <version>${microprofile.config.impl.version}</version>
-    </dependency>
-
-    <dependency>
-      <groupId>org.eclipse.microprofile.jwt</groupId>
-      <artifactId>microprofile-jwt-auth-api</artifactId>
-      <version>${microprofile.jwt.version}</version>
-    </dependency>
-
-    <dependency>
-      <groupId>${project.groupId}</groupId>
-      <artifactId>mp-jwt</artifactId>
-      <version>${microprofile.jwt.impl.version}</version>
-    </dependency>
-
-    <dependency>
-      <groupId>org.eclipse.microprofile.fault-tolerance</groupId>
-      <artifactId>microprofile-fault-tolerance-api</artifactId>
-      <version>${microprofile.fault-tolerance.version}</version>
-    </dependency>
-
-    <dependency>
-      <groupId>org.apache.geronimo.safeguard</groupId>
-      <artifactId>safeguard-impl</artifactId>
-      <version>${microprofile.fault-tolerance.impl.version}</version>
-    </dependency>
-
-    <dependency>
-      <groupId>org.eclipse.microprofile.health</groupId>
-      <artifactId>microprofile-health-api</artifactId>
-      <version>${microprofile.health.version}</version>
-    </dependency>
-
-    <dependency>
-      <groupId>org.apache.geronimo</groupId>
-      <artifactId>geronimo-health</artifactId>
-      <version>${microprofile.health.impl.version}</version>
-    </dependency>
-
-    <dependency>
-      <groupId>org.eclipse.microprofile.metrics</groupId>
-      <artifactId>microprofile-metrics-api</artifactId>
-      <version>${microprofile.metrics.version}</version>
-    </dependency>
-
-    <dependency>
-      <groupId>org.apache.geronimo</groupId>
-      <artifactId>geronimo-metrics</artifactId>
-      <version>${microprofile.metrics.impl.version}</version>
-    </dependency>
-
-    <dependency>
-      <groupId>org.eclipse.microprofile.rest.client</groupId>
-      <artifactId>microprofile-rest-client-api</artifactId>
-      <version>${microprofile.rest-client.version}</version>
-    </dependency>
-
-    <dependency>
-      <groupId>org.apache.cxf</groupId>
-      <artifactId>cxf-rt-rs-mp-client</artifactId>
-      <version>${microprofile.rest-client.impl.version}</version>
-    </dependency>
-
-    <dependency>
-      <groupId>org.eclipse.microprofile.openapi</groupId>
-      <artifactId>microprofile-openapi-api</artifactId>
-      <version>${microprofile.openapi.version}</version>
-    </dependency>
-
-    <dependency>
-      <groupId>org.apache.geronimo</groupId>
-      <artifactId>geronimo-openapi-impl</artifactId>
-      <version>${microprofile.openapi.impl.version}</version>
-    </dependency>
-
-    <!-- Jackson required by OpenAPI Impl -->
-    <dependency>
-      <groupId>com.fasterxml.jackson.dataformat</groupId>
-      <artifactId>jackson-dataformat-yaml</artifactId>
-      <version>2.9.4</version>
-    </dependency>
-
-    <dependency>
-      <groupId>com.fasterxml.jackson.core</groupId>
-      <artifactId>jackson-databind</artifactId>
-      <version>2.9.4</version>
-    </dependency>
-
-    <dependency>
-      <groupId>org.eclipse.microprofile.opentracing</groupId>
-      <artifactId>microprofile-opentracing-api</artifactId>
-      <version>${microprofile.opentracing.version}</version>
-      <exclusions>
-        <exclusion>
-          <groupId>org.apache.geronimo.specs</groupId>
-          <artifactId>geronimo-atinject_1.0_spec</artifactId>
-        </exclusion>
-      </exclusions>
-    </dependency>
-
-    <dependency>
-      <groupId>org.apache.geronimo</groupId>
-      <artifactId>geronimo-opentracing</artifactId>
-      <version>${microprofile.opentracing.impl.version}</version>
-    </dependency>
-
-    <dependency>
-      <groupId>io.opentracing</groupId>
-      <artifactId>opentracing-api</artifactId>
-      <version>0.31.0</version>
-    </dependency>
-  </dependencies>
-
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-assembly-plugin</artifactId>
-        <executions>
-          <execution>
-            <id>war</id>
-            <phase>package</phase>
-            <goals>
-              <goal>single</goal>
-            </goals>
-          </execution>
-        </executions>
-        <configuration>
-          <appendAssemblyId>false</appendAssemblyId>
-          <descriptors>
-            <descriptor>src/main/assembly/war.xml</descriptor>
-          </descriptors>
-        </configuration>
-      </plugin>
-    </plugins>
-  </build>
-
-  <repositories>
-    <repository>
-      <id>Geronimo OpenAPI Staging</id>
-      <url>https://repository.apache.org/service/local/repositories/orgapachegeronimo-1067/content/</url>
-    </repository>
-  </repositories>
-
-</project>

http://git-wip-us.apache.org/repos/asf/tomee/blob/ec927200/tomee/tomee-microprofile-webapp/src/main/assembly/war.xml
----------------------------------------------------------------------
diff --git a/tomee/tomee-microprofile-webapp/src/main/assembly/war.xml b/tomee/tomee-microprofile-webapp/src/main/assembly/war.xml
deleted file mode 100644
index 9a7ba10..0000000
--- a/tomee/tomee-microprofile-webapp/src/main/assembly/war.xml
+++ /dev/null
@@ -1,92 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
-    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.
--->
-<assembly>
-  <id>war</id>
-  <formats>
-    <format>war</format>
-  </formats>
-  <includeBaseDirectory>false</includeBaseDirectory>
-  <fileSets>
-    <fileSet>
-      <directory>target/maven-shared-archive-resources</directory>
-      <outputDirectory>/</outputDirectory>
-    </fileSet>
-    <fileSet>
-      <directory>${project.basedir}</directory>
-      <includes>
-        <include>README.txt</include>
-      </includes>
-    </fileSet>
-    <fileSet>
-      <directory>${project.basedir}/src/main/webapp</directory>
-      <outputDirectory>/</outputDirectory>
-    </fileSet>
-    <fileSet>
-      <directory>${project.basedir}/target/classes</directory>
-      <outputDirectory>/</outputDirectory>
-      <excludes>
-        <exclude>org/**</exclude>
-        <exclude>META-INF/LICENSE</exclude>
-        <exclude>META-INF/NOTICE</exclude>
-      </excludes>
-    </fileSet>
-    <fileSet>
-      <directory>${project.basedir}/target/classes</directory>
-      <outputDirectory>WEB-INF/classes</outputDirectory>
-      <excludes>
-        <exclude>META-INF/LICENSE</exclude>
-        <exclude>META-INF/NOTICE</exclude>
-      </excludes>
-    </fileSet>
-    <fileSet>
-      <directory>${project.build.directory}/${project.artifactId}-${project.version}/</directory>
-      <outputDirectory>/</outputDirectory>
-      <includes>
-        <include>WEB-INF/web.xml</include>
-        <include>WEB-INF/classes/**</include>
-        <include>**/*.html</include>
-        <include>**/*.css</include>
-        <include>**/*.js</include>
-        <include>lib/*.jar</include>
-      </includes>
-    </fileSet>
-  </fileSets>
-  <dependencySets>
-    <dependencySet>
-      <outputDirectory>lib</outputDirectory>
-      <scope>runtime</scope>
-      <excludes>
-        <!-- provided -->
-        <exclude>org.apache.tomcat:*</exclude>
-        <!-- wars and pom -->
-        <exclude>*:war</exclude>
-        <exclude>*:pom</exclude>
-      </excludes>
-    </dependencySet>
-    <dependencySet>
-      <outputDirectory>WEB-INF/lib</outputDirectory>
-      <scope>runtime</scope>
-      <includes>
-        <include>org.apache.tomee:tomee-loader</include>
-        <include>org.codehaus.swizzle:swizzle-stream</include>
-      </includes>
-    </dependencySet>
-  </dependencySets>
-</assembly>
-

http://git-wip-us.apache.org/repos/asf/tomee/blob/ec927200/tomee/tomee-microprofile-webapp/src/main/java/org/apache/tomee/microprofile/faulttolerance/FailsafeContainerExecutionManagerProvider.java
----------------------------------------------------------------------
diff --git a/tomee/tomee-microprofile-webapp/src/main/java/org/apache/tomee/microprofile/faulttolerance/FailsafeContainerExecutionManagerProvider.java b/tomee/tomee-microprofile-webapp/src/main/java/org/apache/tomee/microprofile/faulttolerance/FailsafeContainerExecutionManagerProvider.java
deleted file mode 100644
index b348e08..0000000
--- a/tomee/tomee-microprofile-webapp/src/main/java/org/apache/tomee/microprofile/faulttolerance/FailsafeContainerExecutionManagerProvider.java
+++ /dev/null
@@ -1,59 +0,0 @@
-package org.apache.tomee.microprofile.faulttolerance;
-/*
- * Tomitribe Confidential
- *
- * Copyright Tomitribe Corporation. 2018
- *
- * The source code for this program is not published or otherwise divested
- * of its trade secrets, irrespective of what has been deposited with the
- * U.S. Copyright Office.
- */
-
-
-import org.apache.safeguard.api.ExecutionManager;
-import org.apache.safeguard.impl.FailsafeExecutionManager;
-import org.apache.safeguard.impl.bulkhead.BulkheadManagerImpl;
-import org.apache.safeguard.impl.cdi.FailsafeExecutionManagerProvider;
-import org.apache.safeguard.impl.circuitbreaker.FailsafeCircuitBreakerManager;
-import org.apache.safeguard.impl.config.MicroprofileAnnotationMapper;
-import org.apache.safeguard.impl.executionPlans.ExecutionPlanFactory;
-import org.apache.safeguard.impl.executorService.DefaultExecutorServiceProvider;
-import org.apache.safeguard.impl.retry.FailsafeRetryManager;
-
-import javax.enterprise.context.ApplicationScoped;
-import javax.enterprise.inject.Alternative;
-import javax.enterprise.inject.Specializes;
-import javax.naming.InitialContext;
-import javax.ws.rs.Produces;
-import java.util.concurrent.ScheduledExecutorService;
-
-@Specializes
-@Alternative
-@ApplicationScoped
-public class FailsafeContainerExecutionManagerProvider extends FailsafeExecutionManagerProvider {
-
-    @Produces
-    @ApplicationScoped
-    @Override
-    public ExecutionManager createExecutionManager() throws Exception {
-
-        ScheduledExecutorService executor = new InitialContext().doLookup(
-                System.getProperty("apache.safeguard.executorservice.location",
-                        "java:comp/DefaultManagedScheduledExecutorService"));
-
-        final MicroprofileAnnotationMapper mapper = MicroprofileAnnotationMapper.getInstance();
-        final DefaultExecutorServiceProvider executorServiceProvider = new DefaultExecutorServiceProvider(executor);
-        final BulkheadManagerImpl bulkheadManager = new BulkheadManagerImpl();
-        final FailsafeCircuitBreakerManager circuitBreakerManager = new FailsafeCircuitBreakerManager();
-        final FailsafeRetryManager retryManager = new FailsafeRetryManager();
-
-        return new FailsafeExecutionManager(
-                mapper,
-                bulkheadManager,
-                circuitBreakerManager,
-                retryManager,
-                new ExecutionPlanFactory(circuitBreakerManager, retryManager, bulkheadManager, mapper,
-                        executorServiceProvider),
-                executorServiceProvider);
-    }
-}
\ No newline at end of file