Class Configurations
- All Implemented Interfaces:
Iterable<Configuration>
,Collection<Configuration>
,List<Configuration>
,Dumpable
Configuration
instances.
The ordering of Configurations will initially be the order in which they
are added. The sort()
method can be used to apply a
TopologicalSort
to the ordering as defined by the
Configuration.getDependencies()
and
Configuration.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 for
Configuration.replaces()
then the added instance will replace
any existing instance of that type or that has already replaced that
type.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
Dumpable.DumpableContainer
-
Field Summary
Fields inherited from class java.util.AbstractList
modCount
-
Constructor Summary
ConstructorDescriptionConfigurations
(String... configurationClassNames) Configurations
(List<Configuration> configurations) Configurations
(Configuration... configurations) -
Method Summary
Modifier and TypeMethodDescriptionvoid
boolean
add
(Configuration configuration) void
add
(Configuration... configurations) void
clear()
boolean
configure
(WebAppContext webapp) dump()
void
dump
(Appendable out, String indent) Dump this object (and children) into an Appendable using the provided indent after any new lines.get
(int index) <T> T
<T> List<T>
getConfigurations
(Class<? extends T> configClass) static List<Configuration>
getKnown()
static Configurations
getServerDefault
(Server server) Get/Create the server default Configuration ClassList.iterator()
protected static Configuration
newConfiguration
(String classname) void
postConfigure
(WebAppContext webapp) void
preConfigure
(WebAppContext webapp) final void
remove
(Class<? extends Configuration>... configClass) void
void
remove
(Configuration... configurations) void
void
set
(Configuration... configurations) static void
static Configurations
setServerDefault
(Server server) Get/Set/Create the server default Configuration ClassList.int
size()
void
sort()
static void
sort
(List<Configuration> configurations) toArray()
toString()
String[]
Methods inherited from class java.util.AbstractList
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
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
Methods inherited from interface java.util.List
addAll, contains, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray
-
Field Details
-
SERVER_DEFAULT_ATTR
- See Also:
-
-
Constructor Details
-
Configurations
public Configurations() -
Configurations
-
Configurations
-
Configurations
-
-
Method Details
-
getKnown
-
setKnown
-
setServerDefault
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
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
-
add
- Specified by:
add
in interfaceCollection<Configuration>
- Specified by:
add
in interfaceList<Configuration>
- Overrides:
add
in classAbstractList<Configuration>
-
add
-
add
-
get
-
getConfigurations
-
clear
public void clear()- Specified by:
clear
in interfaceCollection<Configuration>
- Specified by:
clear
in interfaceList<Configuration>
- Overrides:
clear
in classAbstractList<Configuration>
-
set
-
set
-
remove
-
remove
-
remove
-
size
public int size()- Specified by:
size
in interfaceCollection<Configuration>
- Specified by:
size
in interfaceList<Configuration>
- Specified by:
size
in classAbstractCollection<Configuration>
-
toArray
- Specified by:
toArray
in interfaceCollection<Configuration>
- Specified by:
toArray
in interfaceList<Configuration>
- Overrides:
toArray
in classAbstractCollection<Configuration>
-
toStringArray
-
sort
public void sort() -
sort
-
getConfigurations
-
get
- Specified by:
get
in interfaceList<Configuration>
- Specified by:
get
in classAbstractList<Configuration>
-
iterator
- Specified by:
iterator
in interfaceCollection<Configuration>
- Specified by:
iterator
in interfaceIterable<Configuration>
- Specified by:
iterator
in interfaceList<Configuration>
- Overrides:
iterator
in classAbstractList<Configuration>
-
toString
- Overrides:
toString
in classAbstractCollection<Configuration>
-
preConfigure
- Throws:
Exception
-
configure
- Parameters:
webapp
- The webapp to configure- Returns:
- false if a
Configuration.abort(WebAppContext)
returns true, true otherwise - Throws:
Exception
- Thrown byConfiguration.configure(WebAppContext)
-
postConfigure
- Throws:
Exception
-
dump
-
dump
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.- Specified by:
dump
in interfaceDumpable
- Parameters:
out
- The appendable to dump toindent
- The indent to apply after any new lines.- Throws:
IOException
- if unable to write to Appendable
-