Class Configurator
java.lang.Object
org.codehaus.classworlds.Configurator
Launcher configurator.- Version:
- $Id: Configurator.java 126 2006-01-12 04:17:51Z $
- Author:
- bob mcwhirter, Jason van Zyl
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConfigurator(ClassWorld world) Construct.Configurator(Launcher launcher) Construct. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidAssociate parent realms with their children.private booleanDetermine if a line can be ignored because it is a comment or simply blank.voidconfigure(InputStream is) Configure from a file.protected StringFilter a string for system properties.protected voidloadGlob(String line, ClassRealm realm) Load a glob into the specified classloader.protected voidloadGlob(String line, ClassRealm realm, boolean optionally) Load a glob into the specified classloader.voidsetClassWorld(ClassWorld world) set world.
-
Field Details
-
MAIN_PREFIX
- See Also:
-
SET_PREFIX
- See Also:
-
IMPORT_PREFIX
- See Also:
-
LOAD_PREFIX
- See Also:
-
OPTIONALLY_PREFIX
-
launcher
The launcher to configure. -
world
-
configuredRealms
Processed Realms.
-
-
Constructor Details
-
Configurator
-
Configurator
Construct.- Parameters:
classWorld- The classWorld to configure.
-
-
Method Details
-
setClassWorld
set world. this setter is provided so you can use the same configurator to configure several "worlds"- Parameters:
classWorld- The classWorld to configure.
-
configure
public void configure(InputStream is) throws IOException, MalformedURLException, ConfigurationException, DuplicateRealmException, NoSuchRealmException Configure from a file.- Parameters:
is- The config input stream- Throws:
IOException- If an error occurs reading the config file.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(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- Throws:
MalformedURLException- If the line does not represent a valid path element.FileNotFoundException- If the line does not represent a valid path element in the filesystem.
-
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 populateoptionally- Whether the path is optional or required- Throws:
MalformedURLException- If the line does not represent a valid path element.FileNotFoundException- If the line does not represent a valid path element in the filesystem.
-
filter
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
Determine if a line can be ignored because it is a comment or simply blank.- Parameters:
line- The line to test.- Returns:
trueif the line is ignorable, otherwisefalse.
-