Class Configurations

  • All Implemented Interfaces:
    java.lang.Iterable<Configuration>, java.util.Collection<Configuration>, java.util.List<Configuration>, org.eclipse.jetty.util.component.Dumpable

    public class Configurations
    extends java.util.AbstractList<Configuration>
    implements org.eclipse.jetty.util.component.Dumpable
    An ordered list of 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.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.util.List<Configuration> _configurations  
      • Fields inherited from class java.util.AbstractList

        modCount
      • Fields inherited from interface org.eclipse.jetty.util.component.Dumpable

        KEY
    • 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)  
      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​(org.eclipse.jetty.server.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​(org.eclipse.jetty.server.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
      • 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 org.eclipse.jetty.util.component.Dumpable

        dumpSelf
      • Methods inherited from interface java.lang.Iterable

        forEach
      • Methods inherited from interface java.util.List

        addAll, contains, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator, 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)
    • Method Detail

      • getKnown

        public static java.util.List<Configuration> getKnown()
      • setKnown

        public static void setKnown​(java.lang.String... classes)
      • setServerDefault

        public static Configurations setServerDefault​(org.eclipse.jetty.server.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​(org.eclipse.jetty.server.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​(@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 interface java.util.Collection<Configuration>
        Specified by:
        clear in interface java.util.List<Configuration>
        Overrides:
        clear in class java.util.AbstractList<Configuration>
      • 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 interface java.util.Collection<Configuration>
        Specified by:
        size in interface java.util.List<Configuration>
        Specified by:
        size in class java.util.AbstractCollection<Configuration>
      • toArray

        public java.lang.String[] toArray()
        Specified by:
        toArray in interface java.util.Collection<Configuration>
        Specified by:
        toArray in interface java.util.List<Configuration>
        Overrides:
        toArray in class java.util.AbstractCollection<Configuration>
      • sort

        public void sort()
      • sort

        public static void sort​(java.util.List<Configuration> configurations)
      • getConfigurations

        public java.util.List<Configuration> getConfigurations()
      • iterator

        public java.util.Iterator<Configuration> iterator()
        Specified by:
        iterator in interface java.util.Collection<Configuration>
        Specified by:
        iterator in interface java.lang.Iterable<Configuration>
        Specified by:
        iterator in interface java.util.List<Configuration>
        Overrides:
        iterator in class java.util.AbstractList<Configuration>
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.util.AbstractCollection<Configuration>
      • preConfigure

        public void preConfigure​(WebAppContext webapp)
                          throws java.lang.Exception
        Throws:
        java.lang.Exception
      • postConfigure

        public void postConfigure​(WebAppContext webapp)
                           throws java.lang.Exception
        Throws:
        java.lang.Exception
      • dump

        public java.lang.String dump()
        Specified by:
        dump in interface org.eclipse.jetty.util.component.Dumpable
      • dump

        public void dump​(java.lang.Appendable out,
                         java.lang.String indent)
                  throws java.io.IOException
        Specified by:
        dump in interface org.eclipse.jetty.util.component.Dumpable
        Throws:
        java.io.IOException