Class Configurator
- java.lang.Object
-
- org.codehaus.plexus.classworlds.launcher.Configurator
-
- All Implemented Interfaces:
ConfigurationHandler
public class Configurator extends java.lang.Object implements ConfigurationHandler
Launcherconfigurator.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<java.lang.String,ClassRealm>configuredRealmsProcessed Realms.private ClassRealmcurRealmCurrent Realm.private java.lang.ClassLoaderforeignClassLoaderprivate LauncherlauncherThe launcher to configure.private ClassWorldworld
-
Constructor Summary
Constructors Constructor Description Configurator(ClassWorld world)Construct.Configurator(Launcher launcher)Construct.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddImportFrom(java.lang.String relamName, java.lang.String importSpec)Add an import specification from a realmvoidaddLoadFile(java.io.File file)Add a file to the realmvoidaddLoadURL(java.net.URL url)Add an URL to the realmvoidaddRealm(java.lang.String realmName)Define a new realmvoidassociateRealms()Associate parent realms with their children.voidconfigure(java.io.InputStream is)Configure from a file.voidsetAppMain(java.lang.String mainClassName, java.lang.String mainRealmName)Define the main class namevoidsetClassWorld(ClassWorld world)set world.
-
-
-
Field Detail
-
launcher
private Launcher launcher
The launcher to configure.
-
world
private ClassWorld world
-
configuredRealms
private java.util.Map<java.lang.String,ClassRealm> configuredRealms
Processed Realms.
-
curRealm
private ClassRealm curRealm
Current Realm.
-
foreignClassLoader
private java.lang.ClassLoader foreignClassLoader
-
-
Constructor Detail
-
Configurator
public Configurator(Launcher launcher)
Construct.- Parameters:
launcher- The launcher to configure.
-
Configurator
public Configurator(ClassWorld world)
Construct.- Parameters:
world- 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:
world- The classWorld to configure.
-
configure
public void configure(java.io.InputStream is) throws java.io.IOException, ConfigurationException, DuplicateRealmException, NoSuchRealmExceptionConfigure 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
public void associateRealms()
Associate parent realms with their children.
-
addImportFrom
public void addImportFrom(java.lang.String relamName, java.lang.String importSpec) throws NoSuchRealmExceptionDescription copied from interface:ConfigurationHandlerAdd an import specification from a realm- Specified by:
addImportFromin interfaceConfigurationHandler- Parameters:
relamName- the realm nameimportSpec- the import specification- Throws:
NoSuchRealmException- if realm doesn't exist
-
addLoadFile
public void addLoadFile(java.io.File file)
Description copied from interface:ConfigurationHandlerAdd a file to the realm- Specified by:
addLoadFilein interfaceConfigurationHandler- Parameters:
file- the file to load content from
-
addLoadURL
public void addLoadURL(java.net.URL url)
Description copied from interface:ConfigurationHandlerAdd an URL to the realm- Specified by:
addLoadURLin interfaceConfigurationHandler- Parameters:
url- the url to load content from
-
addRealm
public void addRealm(java.lang.String realmName) throws DuplicateRealmExceptionDescription copied from interface:ConfigurationHandlerDefine a new realm- Specified by:
addRealmin interfaceConfigurationHandler- Parameters:
realmName- the new realm name- Throws:
DuplicateRealmException- when realm with name already exists
-
setAppMain
public void setAppMain(java.lang.String mainClassName, java.lang.String mainRealmName)Description copied from interface:ConfigurationHandlerDefine the main class name- Specified by:
setAppMainin interfaceConfigurationHandler- Parameters:
mainClassName- the main class namemainRealmName- the main realm from which the main class is loaded
-
-