Class ServiceManager

java.lang.Object
com.groiss.component.ServiceManager

public class ServiceManager extends Object
The main class. It contains the main method, which is called on startup. Note that in standalone mode the Bootstrap class contains the main method that calls the main method of this class. The following steps are performed:
  • load the configuration file
  • set the system locale
  • set the resources
  • start the log service and settings service
  • start the configured services
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static Service
    Add an object to the list of services.
    static Service
    addService(String classname, String id)
    Add a class to the services, the class is loaded, the default contructor is called and the startup() method is called.
    static void
     
    static Locale
     
    static String
    Get the name of the JVM incarnation of @enterprise.
    static Service
    Return the service by id.
    static Date
    Return the date of startup.
    static boolean
    This method returns true if the shutdown in in progress.
    static boolean
    Returns true if @enterprise is running standalone (not in an application server).
    static boolean
    Returns true if @enterprise is running in upgrade mode.
    static void
    Start @enterprise without a configuration file ( in app-server; conffile has already been set via webapplistener)
    static void
    main(String[] args)
    Main method suitable for starting @enterprise.
    static void
    main(String confFiles, boolean logOnConsole, boolean isStandalone)
    Start @enterprise with a configuration file.
    static void
    Set the default locale and time zone for the whole java process.
    static void
    Shutdown the services, the shutdown() methods of the services are called.
    static void
    shutdown(int status)
    This method is called from HTMLAdmin
    static void
    shutdown(int status, int delayMS)
     
    static void
    This method is called as stop method when running as JavaService NT service

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • ServiceManager

      public ServiceManager()
  • Method Details

    • getJVMName

      public static String getJVMName()
      Get the name of the JVM incarnation of @enterprise. Usually in the form "pid@hostname".
      Returns:
      the name of the JVM
    • main

      public static void main(String[] args) throws Exception
      Main method suitable for starting @enterprise.
      Parameters:
      args - optional arguments are: -restricted:starts @enterprise in restricted mode (no non-sysadm logins allowed) and -upgrade: performs @enterprise and applications upgrades. In this mode, @enterprise stops after performing this upgrades.
      Throws:
      Exception
    • main

      public static void main() throws Exception
      Start @enterprise without a configuration file ( in app-server; conffile has already been set via webapplistener)
      Throws:
      Exception
    • main

      public static void main(String confFiles, boolean logOnConsole, boolean isStandalone) throws Exception
      Start @enterprise with a configuration file.
      Parameters:
      confFiles - pathes to the configuration
      logOnConsole - true if logging should go to the console.
      Throws:
      Exception
    • closeServerSocketLocker

      public static void closeServerSocketLocker()
    • setDefaultLocale

      public static void setDefaultLocale()
      Set the default locale and time zone for the whole java process. The method takes language, country and variant from the configuration file. if language or country is null, the default locale is not changed.
    • getConfiguredLocale

      public static Locale getConfiguredLocale()
    • addService

      public static Service addService(String id, Service s)
      Add an object to the list of services.
      Parameters:
      id - the id for the service table
      s - the service object
    • addService

      public static Service addService(String classname, String id)
      Add a class to the services, the class is loaded, the default contructor is called and the startup() method is called.
      Parameters:
      classname - the name of the service class
      id - the id for the service table
    • shutdownService

      public static void shutdownService(String[] args)
      This method is called as stop method when running as JavaService NT service
    • shutdown

      public static void shutdown(int status)
      This method is called from HTMLAdmin
      Parameters:
      status - 0='Stop server', 2='Restart server'
    • shutdown

      public static void shutdown(int status, int delayMS)
    • shutdown

      public static void shutdown()
      Shutdown the services, the shutdown() methods of the services are called. This is the final shutdown() method, called either from shutdown hook or from service stop method.
    • getService

      public static Service getService(String id)
      Return the service by id.
      Parameters:
      id - the id of a service.
      Returns:
      the service object.
    • getStartDate

      public static Date getStartDate()
      Return the date of startup.
    • isStandalone

      public static boolean isStandalone()
      Returns true if @enterprise is running standalone (not in an application server).
      Returns:
      true if standalone
    • isUpgrading

      public static boolean isUpgrading()
      Returns true if @enterprise is running in upgrade mode.
      Returns:
      true if upgrade taking place
    • isShutdownInProgress

      public static boolean isShutdownInProgress()
      This method returns true if the shutdown in in progress.
      Returns:
      true if in shutdown