org.codehaus.plexus.classworlds.launcher

## Class Configurator

- java.lang.Object
- - org.codehaus.plexus.classworlds.launcher.Configurator

All Implemented Interfaces:
  ConfigurationHandler

    public class Configurator
    extends java.lang.Object
    implements ConfigurationHandler

`Launcher` configurator.

Version:
  $Id: Configurator.java 7933 2008-12-17 17:33:58Z bentmann $
Author:
  bob mcwhirter, Jason van Zyl

### Constructor Summary

Constructors
Constructor and Description
`Configurator(ClassWorld world)` Construct.
`Configurator(Launcher launcher)` Construct.

### Method Summary

Methods
`void` `addImportFrom(java.lang.String relamName, java.lang.String importSpec)`
`void` `addLoadFile(java.io.File file)`
`void` `addLoadURL(java.net.URL url)`
`void` `addRealm(java.lang.String realmName)`
`void` `associateRealms()` Associate parent realms with their children.
`void` `configure(java.io.InputStream is)` Configure from a file.
`void` `setAppMain(java.lang.String mainClassName, java.lang.String mainRealmName)`
`void` `setClassWorld(ClassWorld world)` set world.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### 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,
                          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

    public void associateRealms()

Associate parent realms with their children.

#### addImportFrom

    public void addImportFrom(java.lang.String relamName,
                     java.lang.String importSpec)
                       throws NoSuchRealmException

Specified by:
  `addImportFrom` in interface `ConfigurationHandler`
Throws:
  `NoSuchRealmException`

#### addLoadFile

    public void addLoadFile(java.io.File file)

Specified by:
  `addLoadFile` in interface `ConfigurationHandler`

#### addLoadURL

    public void addLoadURL(java.net.URL url)

Specified by:
  `addLoadURL` in interface `ConfigurationHandler`

#### addRealm

    public void addRealm(java.lang.String realmName)
                  throws DuplicateRealmException

Specified by:
  `addRealm` in interface `ConfigurationHandler`
Throws:
  `DuplicateRealmException`

#### setAppMain

    public void setAppMain(java.lang.String mainClassName,
                  java.lang.String mainRealmName)

Specified by:
  `setAppMain` in interface `ConfigurationHandler`