Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse McConnell2011-05-20 16:54:25 -0400
committerJesse McConnell2011-05-20 16:54:25 -0400
commitef3feecb527478a0726c93386c60b449aea211f3 (patch)
tree87f644b730777e594cd4bdac112578b076e5f4b2 /jetty-deploy/src/main
parentf7d6bcad50e0e8c994f3482e0199e81d3b04a656 (diff)
downloadorg.eclipse.jetty.project-ef3feecb527478a0726c93386c60b449aea211f3.tar.gz
org.eclipse.jetty.project-ef3feecb527478a0726c93386c60b449aea211f3.tar.xz
org.eclipse.jetty.project-ef3feecb527478a0726c93386c60b449aea211f3.zip
Bug 346764 added new binding that provides ordered execution of bindings
git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@3226 7e9141cc-0065-0410-87d8-b60c137991c4
Diffstat (limited to 'jetty-deploy/src/main')
-rw-r--r--jetty-deploy/src/main/java/org/eclipse/jetty/deploy/bindings/OrderedGroupBinding.java75
1 files changed, 75 insertions, 0 deletions
diff --git a/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/bindings/OrderedGroupBinding.java b/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/bindings/OrderedGroupBinding.java
new file mode 100644
index 0000000000..f6b2ad6cb2
--- /dev/null
+++ b/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/bindings/OrderedGroupBinding.java
@@ -0,0 +1,75 @@
+package org.eclipse.jetty.deploy.bindings;
+//========================================================================
+//Copyright (c) Webtide LLC
+//------------------------------------------------------------------------
+//All rights reserved. This program and the accompanying materials
+//are made available under the terms of the Eclipse Public License v1.0
+//and Apache License v2.0 which accompanies this distribution.
+//
+//The Eclipse Public License is available at
+//http://www.eclipse.org/legal/epl-v10.html
+//
+//The Apache License v2.0 is available at
+//http://www.apache.org/licenses/LICENSE-2.0.txt
+//
+//You may elect to redistribute this code under either of these licenses.
+//========================================================================
+
+import java.util.LinkedList;
+
+import org.eclipse.jetty.deploy.App;
+import org.eclipse.jetty.deploy.AppLifeCycle;
+import org.eclipse.jetty.deploy.graph.Node;
+
+/**
+ * Provides a way of forcing the ordered execution of bindings within
+ * a declared binding target.
+ *
+ */
+public class OrderedGroupBinding implements AppLifeCycle.Binding
+{
+ private String[] _bindingTargets;
+
+ private LinkedList<AppLifeCycle.Binding> _orderedBindings;
+
+ public OrderedGroupBinding( String[] bindingTargets )
+ {
+ _bindingTargets = bindingTargets;
+ }
+
+ public void addBinding(AppLifeCycle.Binding binding)
+ {
+ if ( _orderedBindings == null )
+ {
+ _orderedBindings = new LinkedList<AppLifeCycle.Binding>();
+ }
+
+ _orderedBindings.add(binding);
+ }
+
+ public void addBindings(AppLifeCycle.Binding[] bindings)
+ {
+ if ( _orderedBindings == null )
+ {
+ _orderedBindings = new LinkedList<AppLifeCycle.Binding>();
+ }
+
+ for (AppLifeCycle.Binding binding : bindings)
+ {
+ _orderedBindings.add(binding);
+ }
+ }
+
+ public String[] getBindingTargets()
+ {
+ return _bindingTargets;
+ }
+
+ public void processBinding(Node node, App app) throws Exception
+ {
+ for ( AppLifeCycle.Binding binding : _orderedBindings )
+ {
+ binding.processBinding(node,app);
+ }
+ }
+}

Back to the top