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
This commit is contained in:
parent
f7d6bcad50
commit
ef3feecb52
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue