From ef3feecb527478a0726c93386c60b449aea211f3 Mon Sep 17 00:00:00 2001 From: Jesse McConnell Date: Fri, 20 May 2011 20:54:25 +0000 Subject: 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 --- VERSION.txt | 1 + .../jetty/deploy/bindings/OrderedGroupBinding.java | 75 ++++++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 jetty-deploy/src/main/java/org/eclipse/jetty/deploy/bindings/OrderedGroupBinding.java diff --git a/VERSION.txt b/VERSION.txt index 14760c9d70..b2a4dcf011 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -11,6 +11,7 @@ jetty-7.4.2-SNAPSHOT + 346181 o.e.j.server.StressTest stalls on MacOS X platform + JETTY-1342 Recreate selector if wakeup throws JVM bug + 346614 HttpConnection.handle() spins in case of SSL truncation attacks + + 346764 OrderedGroupBinding deployment binding jetty-7.4.1.v20110513 + 288563 remove unsupported and deprecated --secure option 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 _orderedBindings; + + public OrderedGroupBinding( String[] bindingTargets ) + { + _bindingTargets = bindingTargets; + } + + public void addBinding(AppLifeCycle.Binding binding) + { + if ( _orderedBindings == null ) + { + _orderedBindings = new LinkedList(); + } + + _orderedBindings.add(binding); + } + + public void addBindings(AppLifeCycle.Binding[] bindings) + { + if ( _orderedBindings == null ) + { + _orderedBindings = new LinkedList(); + } + + 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); + } + } +} -- cgit v1.2.3