tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmannibu...@apache.org
Subject tomee git commit: adding static failover strategy
Date Thu, 09 Jun 2016 18:07:24 GMT
Repository: tomee
Updated Branches:
  refs/heads/master 15a2879d4 -> ebb7d3ee2


adding static failover strategy


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

Branch: refs/heads/master
Commit: ebb7d3ee2667f08854f32f3b561fabb1db552d6c
Parents: 15a2879
Author: Romain manni-Bucau <rmannibucau@gmail.com>
Authored: Thu Jun 9 20:06:56 2016 +0200
Committer: Romain manni-Bucau <rmannibucau@gmail.com>
Committed: Thu Jun 9 20:06:56 2016 +0200

----------------------------------------------------------------------
 .../openejb/resource/jdbc/router/FailOverRouter.java   | 13 +++++++++++++
 1 file changed, 13 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/ebb7d3ee/container/openejb-core/src/main/java/org/apache/openejb/resource/jdbc/router/FailOverRouter.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/resource/jdbc/router/FailOverRouter.java
b/container/openejb-core/src/main/java/org/apache/openejb/resource/jdbc/router/FailOverRouter.java
index 44361f2..26cfedc 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/resource/jdbc/router/FailOverRouter.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/resource/jdbc/router/FailOverRouter.java
@@ -179,6 +179,19 @@ public class FailOverRouter extends AbstractRouter {
                     }
                 };
                 break;
+            case "static":
+                strategyRuntime = new Strategy() { // no auto adaption (if first ds is always
faster for instance)
+                    @Override
+                    public Collection<DataSourceHolder> prepare(final Collection<DataSourceHolder>
list) {
+                        return list;
+                    }
+
+                    @Override
+                    public void used(final DataSourceHolder holder) {
+                        // no-op
+                    }
+                };
+                break;
             case DEFAULT_STRATEGY:
             default:
                 strategyRuntime = new Strategy() { // use the list and save a working item
as first one


Mime
View raw message