org.codehaus.classworlds

Class Configurator


public class Configurator
extends java.lang.Object

Launcher configurator.
Version:
$Id: Configurator.java 126 2006-01-12 04:17:51Z $
Authors:
bob mcwhirter
Jason van Zyl

Field Summary

static String
IMPORT_PREFIX
static String
LOAD_PREFIX
static String
MAIN_PREFIX
static String
OPTIONALLY_PREFIX
Optionally spec prefix.
static String
SET_PREFIX

Constructor Summary

Configurator(ClassWorld world)
Construct.
Configurator(Launcher launcher)
Construct.

Method Summary

protected void
associateRealms()
Associate parent realms with their children.
void
configure(InputStream is)
Configure from a file.
protected String
filter(String text)
Filter a string for system properties.
protected void
loadGlob(String line, ClassRealm realm)
Load a glob into the specified classloader.
protected void
loadGlob(String line, ClassRealm realm, boolean optionally)
Load a glob into the specified classloader.
void
setClassWorld(ClassWorld world)
set world.

Field Details

IMPORT_PREFIX

public static final String IMPORT_PREFIX

LOAD_PREFIX

public static final String LOAD_PREFIX

MAIN_PREFIX

public static final String MAIN_PREFIX

OPTIONALLY_PREFIX

public static final String OPTIONALLY_PREFIX
Optionally spec prefix.

SET_PREFIX

public static final String SET_PREFIX

Constructor Details

Configurator

public Configurator(ClassWorld world)
Construct.
Parameters:

Configurator

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

Method Details

associateRealms

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

configure

public void configure(InputStream is)
            throws IOException,
                   MalformedURLException,
                   ConfigurationException,
                   DuplicateRealmException,
                   NoSuchRealmException
Configure from a file.
Parameters:
is - The config input stream
Throws:
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.

filter

protected String filter(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.

loadGlob

protected void loadGlob(String line,
                        ClassRealm realm)
            throws MalformedURLException,
                   FileNotFoundException
Load a glob into the specified classloader.
Parameters:
line - The path configuration line.
realm - The realm to populate

loadGlob

protected void loadGlob(String line,
                        ClassRealm realm,
                        boolean optionally)
            throws MalformedURLException,
                   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

setClassWorld

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