org.jboss.bootstrap.spi.config
Interface ServerConfig<T extends ServerConfig<?>>


public interface ServerConfig<T extends ServerConfig<?>>

ServerConfig Configuration used in Server creation and initialization

Version:
$Revision: $
Author:
ALR

Field Summary
static String PROP_KEY_BOOTSTRAP_HOME_URL
          Property denoting the URL pointing to the home of the bootstrap (from which other properties may be defaulted)
static String PROP_KEY_BOOTSTRAP_NAME
          Property denoting the name of the bootstrap configuration
static String PROP_KEY_BOOTSTRAP_URL
          Property denoting the URL of the bootstrap configuration
 
Method Summary
 T bootstrapHome(String bootstrapHome)
          Sets the location of the bootstrap directory.
 T bootstrapHome(URL bootstrapHome)
          Sets the location of the bootstrap directory.
 T bootstrapName(String name)
          Sets the name of the bootstrap configuration file.
 T bootstrapUrl(String bootstrapUrl)
          Sets the location of the bootstrap file.
 T bootstrapUrl(URL bootstrapLocation)
          Sets the location of the bootstrap file.
 void freeze()
          Freezes the configuration, marking it as immutable.
 URL getBootstrapHome()
          Obtains the location of the bootstrap directory.
 String getBootstrapName()
          Obtains the name of the bootstrap configuration.
 URL getBootstrapUrl()
          Obtains the location of the bootstrap file.
 Map<String,String> getProperties()
          Returns an immutable copy of the properties used in configuring the server
 String getProperty(String key)
          Returns the configuration property for the specified key, or null if not present
 boolean isFrozen()
          Returns whether or not this configuration is frozen and immutable
 T properties(Map<String,String> properties)
          Sets the specified properties upon the configuration
 T properties(Properties properties)
          Sets the specified properties upon the configuration.
 T property(String key, String value)
          Sets the property with the specified key to the specified value
 

Field Detail

PROP_KEY_BOOTSTRAP_HOME_URL

static final String PROP_KEY_BOOTSTRAP_HOME_URL
Property denoting the URL pointing to the home of the bootstrap (from which other properties may be defaulted)

See Also:
Constant Field Values

PROP_KEY_BOOTSTRAP_NAME

static final String PROP_KEY_BOOTSTRAP_NAME
Property denoting the name of the bootstrap configuration

See Also:
Constant Field Values

PROP_KEY_BOOTSTRAP_URL

static final String PROP_KEY_BOOTSTRAP_URL
Property denoting the URL of the bootstrap configuration

See Also:
Constant Field Values
Method Detail

getBootstrapHome

URL getBootstrapHome()
Obtains the location of the bootstrap directory. Corresponds to PROP_KEY_BOOTSTRAP_HOME_URL.

Returns:

bootstrapHome

T bootstrapHome(URL bootstrapHome)
                                        throws IllegalArgumentException,
                                               IllegalStateException
Sets the location of the bootstrap directory. Corresponds to PROP_KEY_BOOTSTRAP_HOME_URL.

Parameters:
bootstrapHome -
Returns:
This configuration
Throws:
IllegalArgumentException - If the bootstrap home location was not specified
IllegalStateException - If the configuration has been frozen

bootstrapHome

T bootstrapHome(String bootstrapHome)
                                        throws IllegalArgumentException,
                                               IllegalStateException
Sets the location of the bootstrap directory. Corresponds to PROP_KEY_BOOTSTRAP_HOME_URL.

Parameters:
bootstrapHome -
Returns:
This configuration
Throws:
IllegalArgumentException - If the bootstrap home location was not specified, or could not be assigned to a URL (ie. MalformedURLException
IllegalStateException - If the configuration has been frozen

getBootstrapUrl

URL getBootstrapUrl()
Obtains the location of the bootstrap file. Corresponds to PROP_KEY_BOOTSTRAP_URL.

Returns:

bootstrapUrl

T bootstrapUrl(URL bootstrapLocation)
                                       throws IllegalArgumentException,
                                              IllegalStateException
Sets the location of the bootstrap file. Corresponds to PROP_KEY_BOOTSTRAP_URL.

Parameters:
bootstrapLocation -
Returns:
This configuration
Throws:
IllegalArgumentException - If the location was not specified
IllegalStateException - If the configuration has been frozen

bootstrapUrl

T bootstrapUrl(String bootstrapUrl)
                                       throws IllegalArgumentException,
                                              IllegalStateException
Sets the location of the bootstrap file. Corresponds to PROP_KEY_BOOTSTRAP_URL.

Parameters:
bootstrapUrl -
Returns:
This configuration
Throws:
IllegalArgumentException - If the bootstrap URL location was not specified, or could not be assigned to a URL (ie. MalformedURLException
IllegalStateException - If the configuration has been frozen

getBootstrapName

String getBootstrapName()
Obtains the name of the bootstrap configuration. Corresponds to PROP_KEY_BOOTSTRAP_NAME.

Returns:

bootstrapName

T bootstrapName(String name)
                                        throws IllegalArgumentException,
                                               IllegalStateException
Sets the name of the bootstrap configuration file. Corresponds to PROP_KEY_BOOTSTRAP_NAME.

Parameters:
name -
Returns:
This configuration
Throws:
IllegalArgumentException - If the name was not specified
IllegalStateException - If the configuration has been frozen

getProperties

Map<String,String> getProperties()
Returns an immutable copy of the properties used in configuring the server

Returns:

getProperty

String getProperty(String key)
                   throws IllegalArgumentException
Returns the configuration property for the specified key, or null if not present

Parameters:
key - The key
Returns:
Throws:
IllegalArgumentException - If the key was not specified

property

T property(String key,
           String value)
                                   throws IllegalArgumentException,
                                          IllegalStateException
Sets the property with the specified key to the specified value

Parameters:
key -
value -
Returns:
This configuration
Throws:
IllegalArgumentException - If the key was not supplied
IllegalStateException - If the configuration has been frozen

properties

T properties(Map<String,String> properties)
                                     throws IllegalArgumentException,
                                            IllegalStateException
Sets the specified properties upon the configuration

Parameters:
properties -
Returns:
Throws:
IllegalArgumentException - If the properties are null
IllegalStateException - If the configuration has been frozen

properties

T properties(Properties properties)
                                     throws IllegalArgumentException,
                                            IllegalStateException
Sets the specified properties upon the configuration. For true type safety, it is recommended to use properties(Map) instead. This is provided for compatibility with System.getProperties().

Parameters:
properties -
Returns:
Throws:
IllegalArgumentException - If the properties are null, or if any of the properties are not String/String pairs.
IllegalStateException - If the configuration has been frozen

freeze

void freeze()
            throws IllegalStateException
Freezes the configuration, marking it as immutable. Will typically be invoked by a server during the start lifecycle.

Throws:
IllegalStateException

isFrozen

boolean isFrozen()
Returns whether or not this configuration is frozen and immutable

Returns:


Copyright © 2009 JBoss, a division of Red Hat, Inc.. All Rights Reserved.