org.codehaus.classworlds
Class Configurator

java.lang.Object
  extended byorg.codehaus.classworlds.Configurator

class Configurator
extends java.lang.Object

Launcher configurator.

Version:
$Id: Configurator.java,v 1.2 2003/08/29 08:47:14 user57 Exp $
Author:
bob mcwhirter, Jason van Zyl

Field Summary
private  java.util.Map configuredRealms
          Processed Realms.
static java.lang.String IMPORT_PREFIX
          Import spec prefix.
private  Launcher launcher
          The launcher to configure.
static java.lang.String LOAD_PREFIX
          Load spec prefix.
static java.lang.String MAIN_PREFIX
          Main spec prefix.
 
Constructor Summary
(package private) Configurator(Launcher launcher)
          Construct.
 
Method Summary
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.
(package private)  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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAIN_PREFIX

public static final java.lang.String MAIN_PREFIX
Main spec prefix.

See Also:
Constant Field Values

IMPORT_PREFIX

public static final java.lang.String IMPORT_PREFIX
Import spec prefix.

See Also:
Constant Field Values

LOAD_PREFIX

public static final java.lang.String LOAD_PREFIX
Load 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

Configurator(Launcher launcher)
Construct.

Parameters:
launcher - The launcher to configure.
Method Detail

configure

void configure(java.io.InputStream is)
         throws java.io.IOException,
                java.net.MalformedURLException,
                ConfigurationException,
                DuplicateRealmException,
                NoSuchRealmException
Configure from a file.

Parameters:
is - The config input stream
Throws:
java.io.IOException - If an error occurs reading the config file.
java.net.MalformedURLException - If the config file contains invalid URLs.
ConfigurationException - If the config file is corrupt.
DuplicateRealmException - If the config file defines two realms with the same id.
NoSuchRealmException - If the config file defines a main entry point in a non-existent realm.

associateRealms

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


loadGlob

protected void loadGlob(java.lang.String line,
                        ClassRealm realm)
                 throws java.net.MalformedURLException
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.

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.