Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jboss.system.server
Class ServerConfigImpl

    java.lang.Object
      org.jboss.system.server.ServerConfigImpl

All Implemented Interfaces:
  ServerConfig, ServerConfigImplMBean

public class ServerConfigImpl
extends Object
implements ServerConfig, ServerConfigImplMBean

A container for the basic configuration elements required to create a Server instance.

MalformedURLException are rethrown as NestedRuntimeExceptions, so that code that needs to access these values does not have to directly worry about problems with lazy construction of final URL values.

Most values are determined durring first call to getter. All values when determined will have equivilent system properties set.

Clients are not meant to use this class directly. Instead use `ServerConfigLocator` to get an instance of `ServerConfig` and then use it to get the server's configuration bits.

Version:
  `$Revision: 1.9 $`
Author:
  Jason Dillon

Field Summary

Fields inherited from interface org.jboss.system.server.ServerConfig
`BLOCKING_SHUTDOWN, BOOT_LIBRARY_LIST, DEFAULT_BLOCKING_SHUTDOWN, DEFAULT_EXIT_ON_SHUTDOWN, DEFAULT_REQUIRE_JBOSS_URL_STREAM_HANDLER_FACTORY, DEFAULT_ROOT_DEPLOYMENT_FILENAME, DEFAULT_SERVER_NAME, EXIT_ON_SHUTDOWN, HOME_DIR, HOME_URL, LIBRARY_URL, LIBRARY_URL_SUFFIX, PATCH_URL, REQUIRE_JBOSS_URL_STREAM_HANDLER_FACTORY, ROOT_DEPLOYMENT_FILENAME, SERVER_BASE_DIR, SERVER_BASE_DIR_SUFFIX, SERVER_BASE_URL, SERVER_BASE_URL_SUFFIX, SERVER_BIND_ADDRESS, SERVER_CONFIG_URL, SERVER_CONFIG_URL_SUFFIX, SERVER_DATA_DIR, SERVER_DATA_DIR_SUFFIX, SERVER_HOME_DIR, SERVER_HOME_URL, SERVER_LIBRARY_URL, SERVER_NAME, SERVER_TEMP_DIR, SERVER_TEMP_DIR_SUFFIX, SERVER_TYPE`

Fields inherited from interface org.jboss.system.server.ServerConfigImplMBean
`OBJECT_NAME`

Constructor Summary
`ServerConfigImpl(Properties props)` Construct a new `ServerConfigImpl` instance.

Method Summary
`boolean` | `getBlockingShutdown()` Get the current value of the blocking shutdown flag.
`boolean` | `getExitOnShutdown()` Get the current value of the exit on shutdown flag.
`File` | `getHomeDir()` Get the local home directory which the server is running from.
`URL` | `getHomeURL()` Get the home URL which the server is running from.
`URL` | `getLibraryURL()` Get the home URL which the server is running from.
`URL` | `getPatchURL()` Get the patch URL for the server.
`boolean` | `getRequireJBossURLStreamHandlerFactory()` Get the current value of the requireJBossURLStreamHandlerFactory flag.
`String` | `getRootDeploymentFilename()` Get the filename of the root deployable that will be used to finalize the bootstrap process.
`File` | `getServerBaseDir()` Get the base directory for calculating server home directories.
`URL` | `getServerBaseURL()` Get the base directory for calculating server home URLs.
`URL` | `getServerConfigURL()` Get the server configuration URL.
`File` | `getServerDataDir()` Get the directory where local data will be stored.
`File` | `getServerHomeDir()` Get the server home directory.
`URL` | `getServerHomeURL()` Get the server home URL.
`URL` | `getServerLibraryURL()` Get the server library URL.
`String` | `getServerName()` Get the name of the server.
`File` | `getServerTempDir()` Get the directory where temporary files will be stored.
`void` | `initURLs()` Breakout the initialization of URLs from the constructor as we need the ServerConfig.HOME_DIR set for log setup, but we cannot create any file URLs prior to the
`void` | `setBlockingShutdown(boolean flag)` Enable or disable blocking when `Server.shutdown()` is called.
`void` | `setExitOnShutdown(boolean flag)` Enable or disable exiting the JVM when `Server.shutdown()` is called.
`void` | `setRequireJBossURLStreamHandlerFactory(boolean flag)` Set the RequireJBossURLStreamHandlerFactory flag.
`void` | `setRootDeploymentFilename(String filename)` Set the filename of the root deployable that will be used to finalize the bootstrap process.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### ServerConfigImpl

    public ServerConfigImpl(Properties props)
                     throws Exception

  Construct a new `ServerConfigImpl` instance.

Parameters:
  `props` - Configuration properties.
Throws:
  `Exception` - Missing or invalid configuration.

Method Detail

### initURLs

    public void initURLs()
                  throws MalformedURLException

  Breakout the initialization of URLs from the constructor as we need the ServerConfig.HOME_DIR set for log setup, but we cannot create any file URLs prior to the

  Throws:
    `MalformedURLException`

### getHomeDir

    public File getHomeDir()

  Get the local home directory which the server is running from.

  Specified by:
    `getHomeDir` in interface `ServerConfig`
  Returns:
    The local server home directory.

### getHomeURL

    public URL getHomeURL()

  Get the home URL which the server is running from.

  Specified by:
    `getHomeURL` in interface `ServerConfig`
  Returns:
    The home URL which the server is running from.

### getLibraryURL

    public URL getLibraryURL()

  Get the home URL which the server is running from.

  Specified by:
    `getLibraryURL` in interface `ServerConfig`
  Returns:
    The library URL for the server.

### getPatchURL

    public URL getPatchURL()

  Get the patch URL for the server.

  Specified by:
    `getPatchURL` in interface `ServerConfig`
  Returns:
    The patch URL for the server.

### getServerName

    public String getServerName()

  Get the name of the server.

  Specified by:
    `getServerName` in interface `ServerConfig`
  Returns:
    The name of the server.

### getServerBaseDir

    public File getServerBaseDir()

  Get the base directory for calculating server home directories.

  Specified by:
    `getServerBaseDir` in interface `ServerConfig`
  Returns:
    Base server home directory.

### getServerHomeDir

    public File getServerHomeDir()

  Get the server home directory.

  Specified by:
    `getServerHomeDir` in interface `ServerConfig`
  Returns:
    Server home directory.

### getServerTempDir

    public File getServerTempDir()

  Get the directory where temporary files will be stored.

  Specified by:
    `getServerTempDir` in interface `ServerConfig`
  Returns:
    The directory where the server stores temporary files.

### getServerDataDir

    public File getServerDataDir()

  Get the directory where local data will be stored.

  Specified by:
    `getServerDataDir` in interface `ServerConfig`
  Returns:
    The directory where the server stores local data.

### getServerBaseURL

    public URL getServerBaseURL()

  Get the base directory for calculating server home URLs.

  Specified by:
    `getServerBaseURL` in interface `ServerConfig`
  Returns:
    Base server home URL.

### getServerHomeURL

    public URL getServerHomeURL()

  Get the server home URL.

  Specified by:
    `getServerHomeURL` in interface `ServerConfig`
  Returns:
    Server home URL.

### getServerLibraryURL

    public URL getServerLibraryURL()

  Get the server library URL.

  Specified by:
    `getServerLibraryURL` in interface `ServerConfig`
  Returns:
    Server library URL.

### getServerConfigURL

    public URL getServerConfigURL()

  Get the server configuration URL.

  Specified by:
    `getServerConfigURL` in interface `ServerConfig`
  Returns:
    Server configuration URL.

### setExitOnShutdown

    public void setExitOnShutdown(boolean flag)

  Enable or disable exiting the JVM when `Server.shutdown()` is called. If enabled, then shutdown calls `Server.exit(int)`. If disabled, then only the shutdown hook will be run.

  Specified by:
    `setExitOnShutdown` in interface `ServerConfig`
  Parameters:
    `flag` - True to enable calling exit on shutdown.

### getExitOnShutdown

    public boolean getExitOnShutdown()

  Get the current value of the exit on shutdown flag.

  Specified by:
    `getExitOnShutdown` in interface `ServerConfig`
  Returns:
    The current value of the exit on shutdown flag.

### setBlockingShutdown

    public void setBlockingShutdown(boolean flag)

  Enable or disable blocking when `Server.shutdown()` is called. If enabled, then shutdown will be called in the current thread. If disabled, then the shutdown hook will be run ansynchronously in a separate thread.

  Specified by:
    `setBlockingShutdown` in interface `ServerConfig`
  Parameters:
    `flag` - True to enable blocking shutdown.

### getBlockingShutdown

    public boolean getBlockingShutdown()

  Get the current value of the blocking shutdown flag.

  Specified by:
    `getBlockingShutdown` in interface `ServerConfig`
  Returns:
    The current value of the blocking shutdown flag.

### setRequireJBossURLStreamHandlerFactory

    public void setRequireJBossURLStreamHandlerFactory(boolean flag)

  Set the RequireJBossURLStreamHandlerFactory flag. if false, exceptions when setting the URLStreamHandlerFactory will be logged and ignored.

  Specified by:
    `setRequireJBossURLStreamHandlerFactory` in interface `ServerConfig`
  Parameters:
    `flag` - True to enable blocking shutdown.

### getRequireJBossURLStreamHandlerFactory

    public boolean getRequireJBossURLStreamHandlerFactory()

  Get the current value of the requireJBossURLStreamHandlerFactory flag.

  Specified by:
    `getRequireJBossURLStreamHandlerFactory` in interface `ServerConfig`
  Returns:
    The current value of the requireJBossURLStreamHandlerFactory flag.

### setRootDeploymentFilename

    public void setRootDeploymentFilename(String filename)

  Set the filename of the root deployable that will be used to finalize the bootstrap process.

  Specified by:
    `setRootDeploymentFilename` in interface `ServerConfig`
  Parameters:
    `filename` - The filename of the root deployable.

### getRootDeploymentFilename

    public String getRootDeploymentFilename()

  Get the filename of the root deployable that will be used to finalize the bootstrap process.

  Specified by:
    `getRootDeploymentFilename` in interface `ServerConfig`
  Returns:
    The filename of the root deployable.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2002 JBoss Group, LLC. All Rights Reserved.