- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<Configuration>
-
- org.eclipse.jetty.webapp.Configurations
-
- All Implemented Interfaces:
java.lang.Iterable<Configuration>
,java.util.Collection<Configuration>
,java.util.List<Configuration>
,Dumpable
public class Configurations extends java.util.AbstractList<Configuration> implements Dumpable
An ordered list ofConfiguration
instances.The ordering of Configurations will initially be the order in which they are added. The
sort()
method can be used to apply aTopologicalSort
to the ordering as defined by theConfiguration.getDependencies()
andConfiguration.getDependents()
methods. Instances that do not have ordering dependencies will maintain their add order, as will additions/insertions made after the the sort.If an added
Configuration
returns a value forConfiguration.replaces()
then the added instance will replace any existing instance of that type or that has already replaced that type.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.List<Configuration>
_configurations
-
Constructor Summary
Constructors Constructor Description Configurations()
Configurations(java.lang.String... classes)
Configurations(java.util.List<java.lang.String> classes)
Configurations(Configurations classlist)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(java.lang.String... configClass)
void
add(Configuration... configurations)
void
clear()
boolean
configure(WebAppContext webapp)
java.lang.String
dump()
void
dump(java.lang.Appendable out, java.lang.String indent)
Dump this object (and children) into an Appendable using the provided indent after any new lines.Configuration
get(int index)
<T> T
get(java.lang.Class<? extends T> configClass)
java.util.List<Configuration>
getConfigurations()
<T> java.util.List<T>
getConfigurations(java.lang.Class<? extends T> configClass)
static java.util.List<Configuration>
getKnown()
static Configurations
getServerDefault(Server server)
Get/Create the server default Configuration ClassList.java.util.Iterator<Configuration>
iterator()
protected static Configuration
newConfiguration(java.lang.String classname)
void
postConfigure(WebAppContext webapp)
void
preConfigure(WebAppContext webapp)
void
remove(java.lang.Class<? extends Configuration>... configClass)
void
remove(java.lang.String... configClass)
void
remove(Configuration... configurations)
void
set(java.lang.String... configClass)
void
set(Configuration... configurations)
static void
setKnown(java.lang.String... classes)
static Configurations
setServerDefault(Server server)
Get/Set/Create the server default Configuration ClassList.int
size()
void
sort()
static void
sort(java.util.List<Configuration> configurations)
java.lang.String[]
toArray()
java.lang.String
toString()
-
Methods inherited from class java.util.AbstractList
add, add, addAll, equals, hashCode, indexOf, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList
-
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray
-
-
-
-
Field Detail
-
_configurations
protected java.util.List<Configuration> _configurations
-
-
Constructor Detail
-
Configurations
public Configurations()
-
Configurations
public Configurations(java.lang.String... classes)
-
Configurations
public Configurations(java.util.List<java.lang.String> classes)
-
Configurations
public Configurations(Configurations classlist)
-
-
Method Detail
-
getKnown
public static java.util.List<Configuration> getKnown()
-
setKnown
public static void setKnown(java.lang.String... classes)
-
setServerDefault
public static Configurations setServerDefault(Server server)
Get/Set/Create the server default Configuration ClassList.Get the class list from: a Server bean; or the attribute (which can either be a ClassList instance or an String[] of class names); or a new instance with default configuration classes.
This method also adds the obtained ClassList instance as a dependent bean on the server and clears the attribute
- Parameters:
server
- The server the default is for- Returns:
- the server default ClassList instance of the configuration classes for this server. Changes to this list will change the server default instance.
-
getServerDefault
public static Configurations getServerDefault(Server server)
Get/Create the server default Configuration ClassList.Get the class list from: a Server bean; or the attribute (which can either be a ClassList instance or an String[] of class names); or a new instance with default configuration classes.
- Parameters:
server
- The server the default is for- Returns:
- A copy of the server default ClassList instance of the configuration classes for this server. Changes to the returned list will not change the server default.
-
newConfiguration
protected static Configuration newConfiguration(java.lang.String classname)
-
add
public void add(Configuration... configurations)
-
add
public void add(@Name("configClass") java.lang.String... configClass)
-
get
public <T> T get(java.lang.Class<? extends T> configClass)
-
getConfigurations
public <T> java.util.List<T> getConfigurations(java.lang.Class<? extends T> configClass)
-
clear
public void clear()
- Specified by:
clear
in interfacejava.util.Collection<Configuration>
- Specified by:
clear
in interfacejava.util.List<Configuration>
- Overrides:
clear
in classjava.util.AbstractList<Configuration>
-
set
public void set(Configuration... configurations)
-
set
public void set(@Name("configClass") java.lang.String... configClass)
-
remove
public void remove(Configuration... configurations)
-
remove
public void remove(java.lang.Class<? extends Configuration>... configClass)
-
remove
public void remove(@Name("configClass") java.lang.String... configClass)
-
size
public int size()
- Specified by:
size
in interfacejava.util.Collection<Configuration>
- Specified by:
size
in interfacejava.util.List<Configuration>
- Specified by:
size
in classjava.util.AbstractCollection<Configuration>
-
toArray
public java.lang.String[] toArray()
- Specified by:
toArray
in interfacejava.util.Collection<Configuration>
- Specified by:
toArray
in interfacejava.util.List<Configuration>
- Overrides:
toArray
in classjava.util.AbstractCollection<Configuration>
-
sort
public void sort()
-
sort
public static void sort(java.util.List<Configuration> configurations)
-
getConfigurations
public java.util.List<Configuration> getConfigurations()
-
get
public Configuration get(int index)
- Specified by:
get
in interfacejava.util.List<Configuration>
- Specified by:
get
in classjava.util.AbstractList<Configuration>
-
iterator
public java.util.Iterator<Configuration> iterator()
- Specified by:
iterator
in interfacejava.util.Collection<Configuration>
- Specified by:
iterator
in interfacejava.lang.Iterable<Configuration>
- Specified by:
iterator
in interfacejava.util.List<Configuration>
- Overrides:
iterator
in classjava.util.AbstractList<Configuration>
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.util.AbstractCollection<Configuration>
-
preConfigure
public void preConfigure(WebAppContext webapp) throws java.lang.Exception
- Throws:
java.lang.Exception
-
configure
public boolean configure(WebAppContext webapp) throws java.lang.Exception
- Parameters:
webapp
- The webapp to configure- Returns:
- false if a
Configuration.abort(WebAppContext)
returns true, true otherwise - Throws:
java.lang.Exception
- Thrown byConfiguration.configure(WebAppContext)
-
postConfigure
public void postConfigure(WebAppContext webapp) throws java.lang.Exception
- Throws:
java.lang.Exception
-
dump
public void dump(java.lang.Appendable out, java.lang.String indent) throws java.io.IOException
Description copied from interface:Dumpable
Dump this object (and children) into an Appendable using the provided indent after any new lines. The indent should not be applied to the first object dumped.
-
-