Class Configurator
java.lang.Object
org.codehaus.plexus.classworlds.launcher.Configurator
- All Implemented Interfaces:
ConfigurationHandler
Launcher
configurator.- Author:
- bob mcwhirter, Jason van Zyl
-
Constructor Summary
ConstructorDescriptionConfigurator
(ClassWorld world) Construct.Configurator
(Launcher launcher) Construct. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addImportFrom
(String relamName, String importSpec) Add an import specification from a realmvoid
addLoadFile
(File file) Add a file to the realmvoid
addLoadURL
(URL url) Add an URL to the realmvoid
Define a new realmvoid
Associate parent realms with their children.void
configure
(InputStream is) Configure from a file.void
setAppMain
(String mainClassName, String mainRealmName) Define the main class namevoid
setClassWorld
(ClassWorld world) set world.
-
Constructor Details
-
Configurator
Construct.- Parameters:
launcher
- The launcher to configure.
-
Configurator
Construct.- Parameters:
world
- 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:
world
- The classWorld to configure.
-
configure
public void configure(InputStream is) throws IOException, 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
public void associateRealms()Associate parent realms with their children. -
addImportFrom
Description copied from interface:ConfigurationHandler
Add an import specification from a realm- Specified by:
addImportFrom
in interfaceConfigurationHandler
- Parameters:
relamName
- the realm nameimportSpec
- the import specification- Throws:
NoSuchRealmException
- if realm doesn't exist
-
addLoadFile
Description copied from interface:ConfigurationHandler
Add a file to the realm- Specified by:
addLoadFile
in interfaceConfigurationHandler
- Parameters:
file
- the file to load content from
-
addLoadURL
Description copied from interface:ConfigurationHandler
Add an URL to the realm- Specified by:
addLoadURL
in interfaceConfigurationHandler
- Parameters:
url
- the url to load content from
-
addRealm
Description copied from interface:ConfigurationHandler
Define a new realm- Specified by:
addRealm
in interfaceConfigurationHandler
- Parameters:
realmName
- the new realm name- Throws:
DuplicateRealmException
- when realm with name already exists
-
setAppMain
Description copied from interface:ConfigurationHandler
Define the main class name- Specified by:
setAppMain
in interfaceConfigurationHandler
- Parameters:
mainClassName
- the main class namemainRealmName
- the main realm from which the main class is loaded
-