fedora.server
Class BasicServer

java.lang.Object
  extended byfedora.server.Parameterized
      extended byfedora.server.Pluggable
          extended byfedora.server.Server
              extended byfedora.server.BasicServer
All Implemented Interfaces:
Logging

public class BasicServer
extends Server

Title: BasicServer.java

Description:

-----------------------------------------------------------------------------

License and Copyright: The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.mozilla.org/MPL/.

Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.

The entire file consists of original code. Copyright © 2002-2005 by The Rector and Visitors of the University of Virginia and Cornell University. All rights reserved.

-----------------------------------------------------------------------------

Version:
$Id: BasicServer.java,v 1.27 2005/02/01 21:10:31 eddie Exp $
Author:
cwilper@cs.cornell.edu

Field Summary
 
Fields inherited from class fedora.server.Server
BIN_DIR, BUILD_NUMBER, CONFIG_ATTRIBUTE_CLASS, CONFIG_ATTRIBUTE_ID, CONFIG_ATTRIBUTE_NAME, CONFIG_ATTRIBUTE_ROLE, CONFIG_ATTRIBUTE_VALUE, CONFIG_DIR, CONFIG_ELEMENT_COMMENT, CONFIG_ELEMENT_DATASTORE, CONFIG_ELEMENT_MODULE, CONFIG_ELEMENT_PARAM, CONFIG_ELEMENT_ROOT, CONFIG_FILE, CONFIG_NAMESPACE, DEFAULT_SERVER_CLASS, EXTENSION_DIR, HOME_PROPERTY, INIT_CONFIG_CONFIG_EXAMININGELEMENT, INIT_CONFIG_CONFIG_PARAMETERIS, INIT_CONFIG_SEVERE_BADELEMENT, INIT_CONFIG_SEVERE_BADNAMESPACE, INIT_CONFIG_SEVERE_BADROOTELEMENT, INIT_CONFIG_SEVERE_INCOMPLETEPARAM, INIT_CONFIG_SEVERE_MALFORMEDXML, INIT_CONFIG_SEVERE_NOCLASSGIVEN, INIT_CONFIG_SEVERE_NOIDGIVEN, INIT_CONFIG_SEVERE_NOROLEGIVEN, INIT_CONFIG_SEVERE_REASSIGNMENT, INIT_CONFIG_SEVERE_UNREADABLE, INIT_LOG_WARNING_CANTWRITESTARTUPLOG, INIT_MODULE_SEVERE_BADARGS, INIT_MODULE_SEVERE_CLASSNOTFOUND, INIT_MODULE_SEVERE_ILLEGALACCESS, INIT_MODULE_SEVERE_ISABSTRACT, INIT_MODULE_SEVERE_MISSINGCONSTRUCTOR, INIT_MODULE_SEVERE_UNFULFILLEDROLE, INIT_SERVER_SEVERE_BADARGS, INIT_SERVER_SEVERE_CLASSNOTFOUND, INIT_SERVER_SEVERE_ILLEGALACCESS, INIT_SERVER_SEVERE_ISABSTRACT, INIT_SERVER_SEVERE_MISSINGCONSTRUCTOR, INIT_SERVER_SEVERE_UNFULFILLEDROLE, INIT_XMLPARSER_SEVERE_MISSING, LOG_DIR, LOG_STARTUP_FILE, MODULE_CONSTRUCTOR_PARAM1_CLASS, MODULE_CONSTRUCTOR_PARAM2_CLASS, MODULE_CONSTRUCTOR_PARAM3_CLASS, NAMESPACE_PREFIX, SERVER_CONSTRUCTOR_PARAM1_CLASS, SERVER_CONSTRUCTOR_PARAM2_CLASS, STORAGE_FORMAT, VERSION_MAJOR, VERSION_MINOR
 
Constructor Summary
BasicServer(org.w3c.dom.Element rootElement, java.io.File fedoraHomeDir)
           
 
Method Summary
 java.lang.String[] getRequiredModuleRoles()
          Gets the names of the roles that are required to be fulfilled by modules specified in this server's configuration file.
 void initServer()
          Performs any server start-up tasks particular to this type of Server.
static void main(java.lang.String[] args)
           
 void shutdownServer()
          Performs shutdown tasks for the server itself.
 
Methods inherited from class fedora.server.Server
closeLogger, datastoreConfigIds, finalize, flushLogger, getConfigSummary, getDatastoreConfig, getHomeDir, getInstance, getInstance, getLocale, getModule, getPID, hasInitialized, hasInstance, loadedModuleRoles, logConfig, logFine, logFiner, logFinest, loggingConfig, loggingFine, loggingFiner, loggingFinest, loggingInfo, loggingSevere, loggingWarning, logInfo, logSevere, logWarning, pidFromFilename, postInitServer, setLogger, shutdown
 
Methods inherited from class fedora.server.Pluggable
getHelp, getOptionalParameters, getParameterHelp, getRequiredParameters
 
Methods inherited from class fedora.server.Parameterized
getParameter, getParameters, parameterNames, setParameter, setParameters
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicServer

public BasicServer(org.w3c.dom.Element rootElement,
                   java.io.File fedoraHomeDir)
            throws ServerInitializationException,
                   ModuleInitializationException
Method Detail

initServer

public void initServer()
                throws ServerInitializationException
Description copied from class: Server
Performs any server start-up tasks particular to this type of Server.

This is guaranteed to be run before any modules are loaded. The default implementation does nothing.

Overrides:
initServer in class Server
Throws:
ServerInitializationException - If a severe server startup-related error occurred.

shutdownServer

public void shutdownServer()
                    throws ServerShutdownException
Description copied from class: Server
Performs shutdown tasks for the server itself.

The default implementation simply calls closeLogger() - it should be overridden in Server implementations that tie up additional system resources.

This should be written so that system resources are always freed, regardless of whether there is an error. If an error occurs, it should be thrown as a ServerShutdownException after attempts to free every resource have been made.

Overrides:
shutdownServer in class Server
Throws:
ServerShutdownException - If a severe server shutdown-related error occurred.

getRequiredModuleRoles

public java.lang.String[] getRequiredModuleRoles()
Gets the names of the roles that are required to be fulfilled by modules specified in this server's configuration file.

Overrides:
getRequiredModuleRoles in class Pluggable
Returns:
String[] The roles.

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Throws:
java.lang.Exception