Class Configurator


  • public class Configurator
    extends java.lang.Object
    Launcher configurator.
    Version:
    $Id: Configurator.java 126 2006-01-12 04:17:51Z $
    Author:
    bob mcwhirter, Jason van Zyl
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void associateRealms()
      Associate parent realms with their children.
      private boolean canIgnore​(java.lang.String line)
      Determine if a line can be ignored because it is a comment or simply blank.
      void configure​(java.io.InputStream is)
      Configure from a file.
      protected java.lang.String filter​(java.lang.String text)
      Filter a string for system properties.
      protected void loadGlob​(java.lang.String line, ClassRealm realm)
      Load a glob into the specified classloader.
      protected void loadGlob​(java.lang.String line, ClassRealm realm, boolean optionally)
      Load a glob into the specified classloader.
      void setClassWorld​(ClassWorld world)
      set world.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • OPTIONALLY_PREFIX

        public static final java.lang.String OPTIONALLY_PREFIX
        Optionally spec prefix.
        See Also:
        Constant Field Values
      • launcher

        private Launcher launcher
        The launcher to configure.
      • configuredRealms

        private java.util.Map configuredRealms
        Processed Realms.
    • Constructor Detail

      • Configurator

        public Configurator​(Launcher launcher)
        Construct.
        Parameters:
        launcher - The launcher to configure.
      • Configurator

        public Configurator​(ClassWorld world)
        Construct.
        Parameters:
        classWorld - The classWorld to configure.
    • Method Detail

      • setClassWorld

        public void setClassWorld​(ClassWorld world)
        set world. this setter is provided so you can use the same configurator to configure several "worlds"
        Parameters:
        classWorld - The classWorld to configure.
      • associateRealms

        protected void associateRealms()
        Associate parent realms with their children.
      • loadGlob

        protected void loadGlob​(java.lang.String line,
                                ClassRealm realm)
                         throws java.net.MalformedURLException,
                                java.io.FileNotFoundException
        Load a glob into the specified classloader.
        Parameters:
        line - The path configuration line.
        realm - The realm to populate
        Throws:
        java.net.MalformedURLException - If the line does not represent a valid path element.
        java.io.FileNotFoundException - If the line does not represent a valid path element in the filesystem.
      • loadGlob

        protected void loadGlob​(java.lang.String line,
                                ClassRealm realm,
                                boolean optionally)
                         throws java.net.MalformedURLException,
                                java.io.FileNotFoundException
        Load a glob into the specified classloader.
        Parameters:
        line - The path configuration line.
        realm - The realm to populate
        optionally - Whether the path is optional or required
        Throws:
        java.net.MalformedURLException - If the line does not represent a valid path element.
        java.io.FileNotFoundException - If the line does not represent a valid path element in the filesystem.
      • filter

        protected java.lang.String filter​(java.lang.String text)
                                   throws ConfigurationException
        Filter a string for system properties.
        Parameters:
        text - The text to filter.
        Returns:
        The filtered text.
        Throws:
        ConfigurationException - If the property does not exist or if there is a syntax error.
      • canIgnore

        private boolean canIgnore​(java.lang.String line)
        Determine if a line can be ignored because it is a comment or simply blank.
        Parameters:
        line - The line to test.
        Returns:
        true if the line is ignorable, otherwise false.