You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by jl...@apache.org on 2018/12/28 21:38:34 UTC
[1/2] tomee git commit: Restore previously deleted files from
SafeGuard. Not sure integration is good though. To be checked and finished
possibly
Repository: tomee
Updated Branches:
refs/heads/master f1f49d792 -> 7210ebd3a
Restore previously deleted files from SafeGuard. Not sure integration is good though.
To be checked and finished possibly
Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/0ce22cbe
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/0ce22cbe
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/0ce22cbe
Branch: refs/heads/master
Commit: 0ce22cbe96d1ce815bff9baa9733073f0dc359f3
Parents: 85d7dbb
Author: Jean-Louis Monteiro <je...@gmail.com>
Authored: Fri Dec 28 22:36:56 2018 +0100
Committer: Jean-Louis Monteiro <je...@gmail.com>
Committed: Fri Dec 28 22:36:56 2018 +0100
----------------------------------------------------------------------
...ilsafeContainerExecutionManagerProvider.java | 33 ++++++++++
...feContainerExecutionManagerProviderTest.java | 69 ++++++++++++++++++++
2 files changed, 102 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tomee/blob/0ce22cbe/tomee/tomee-microprofile/mp-common/src/main/java/org/apache/tomee/microprofile/faulttolerance/FailsafeContainerExecutionManagerProvider.java
----------------------------------------------------------------------
diff --git a/tomee/tomee-microprofile/mp-common/src/main/java/org/apache/tomee/microprofile/faulttolerance/FailsafeContainerExecutionManagerProvider.java b/tomee/tomee-microprofile/mp-common/src/main/java/org/apache/tomee/microprofile/faulttolerance/FailsafeContainerExecutionManagerProvider.java
new file mode 100644
index 0000000..baef59a
--- /dev/null
+++ b/tomee/tomee-microprofile/mp-common/src/main/java/org/apache/tomee/microprofile/faulttolerance/FailsafeContainerExecutionManagerProvider.java
@@ -0,0 +1,33 @@
+package org.apache.tomee.microprofile.faulttolerance;
+/**
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.
+ */
+
+
+import org.apache.safeguard.impl.customizable.Safeguard;
+
+import javax.annotation.Resource;
+import javax.enterprise.concurrent.ManagedScheduledExecutorService;
+import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.inject.Produces;
+
+@ApplicationScoped
+public class FailsafeContainerExecutionManagerProvider {
+ @Resource
+ @Produces
+ @Safeguard
+ private ManagedScheduledExecutorService executor;
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tomee/blob/0ce22cbe/tomee/tomee-microprofile/mp-common/src/test/java/org/apache/tomee/microprofile/faulttolerance/FailsafeContainerExecutionManagerProviderTest.java
----------------------------------------------------------------------
diff --git a/tomee/tomee-microprofile/mp-common/src/test/java/org/apache/tomee/microprofile/faulttolerance/FailsafeContainerExecutionManagerProviderTest.java b/tomee/tomee-microprofile/mp-common/src/test/java/org/apache/tomee/microprofile/faulttolerance/FailsafeContainerExecutionManagerProviderTest.java
new file mode 100644
index 0000000..a7677bd
--- /dev/null
+++ b/tomee/tomee-microprofile/mp-common/src/test/java/org/apache/tomee/microprofile/faulttolerance/FailsafeContainerExecutionManagerProviderTest.java
@@ -0,0 +1,69 @@
+package org.apache.tomee.microprofile.faulttolerance;
+
+/**
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.
+ */
+
+import org.apache.openejb.jee.WebApp;
+import org.apache.openejb.junit.ApplicationComposer;
+import org.apache.openejb.testing.Classes;
+import org.apache.openejb.testing.Module;
+import org.eclipse.microprofile.faulttolerance.CircuitBreaker;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import javax.ejb.Singleton;
+import javax.inject.Inject;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+@RunWith(ApplicationComposer.class)
+public class FailsafeContainerExecutionManagerProviderTest {
+
+ @Inject
+ private FailsafeContainerExecutionManagerProvider manager;
+
+ @Inject
+ private FTClass ftClass;
+
+ @Module
+ @Classes(value = {FailsafeContainerExecutionManagerProvider.class,
+ FTClass.class},
+ cdi = true)
+ public WebApp app() {
+ return new WebApp();
+ }
+
+ @Test
+ public void testManagerInjection() throws Exception {
+
+ assertEquals("called", ftClass.validateInjectedClass());
+
+ assertTrue("We must override the original FailsafeExecutionManagerProvider, was:" + manager.getClass(),
+ manager instanceof FailsafeContainerExecutionManagerProvider);
+ }
+
+ @Singleton
+ public static class FTClass {
+
+ @CircuitBreaker
+ public String validateInjectedClass() {
+ return "called";
+ }
+ }
+
+}
\ No newline at end of file
[2/2] tomee git commit: Merge branch 'master' of
https://git-wip-us.apache.org/repos/asf/tomee
Posted by jl...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tomee
Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/7210ebd3
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/7210ebd3
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/7210ebd3
Branch: refs/heads/master
Commit: 7210ebd3a8478949d91fe2db14bcf1239366e723
Parents: 0ce22cb f1f49d7
Author: Jean-Louis Monteiro <je...@gmail.com>
Authored: Fri Dec 28 22:37:34 2018 +0100
Committer: Jean-Louis Monteiro <je...@gmail.com>
Committed: Fri Dec 28 22:37:34 2018 +0100
----------------------------------------------------------------------
examples/cdi-events/README.adoc | 2 +-
examples/mp-config-example/README.adoc | 2 +-
examples/mp-custom-healthcheck/README.adoc | 99 ++++++++++++--------
examples/mp-faulttolerance-fallback/README.adoc | 6 +-
examples/mp-faulttolerance-retry/README.adoc | 3 +-
examples/mp-metrics-counted/README.adoc | 2 +-
examples/mp-metrics-counted/README.md | 0
examples/mp-metrics-histogram/README.adoc | 2 +-
examples/mp-metrics-metered/README.adoc | 9 +-
examples/mp-metrics-timed/README.adoc | 3 +-
examples/mp-opentracing-traced/README.adoc | 9 +-
examples/mp-rest-client/README.adoc | 3 +-
examples/mp-rest-jwt/README.adoc | 3 +-
13 files changed, 80 insertions(+), 63 deletions(-)
----------------------------------------------------------------------