com.groiss.component
Class ServiceManager

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

public class ServiceManager
extends java.lang.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


    Constructor Summary
    ServiceManager()
               
     
    Method Summary
    static Service addService(java.lang.String id, Service s)
              Add an object to the list of services.
    static Service addService(java.lang.String classname, java.lang.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 closeServerSocketLocker()
               
    static Service getService(java.lang.String id)
              Return the service by id.
    static java.util.Date getStartDate()
              Return the date of startup.
    static boolean isShutdownInProgress()
              This method returns true if the shutdown in in progress.
    static boolean isStandalone()
              Returns true if @enterprise is running standalone (not in an application server).
    static void main(java.lang.String[] args)
              Main method suitable for starting @enterprise.
    static void main(java.lang.String conffile, boolean logOnConsole, boolean isStandalone)
              Start @enterprise with a configuration file.
    static void reconfigureAll()
              Calls reconfigure of all services managed by the service manager.
    static void setDefaultLocale()
              Set the default locale for the whole java process.
    static void shutdown()
              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 shutdownService(java.lang.String[] args)
              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
     

    Constructor Detail

    ServiceManager

    public ServiceManager()
    Method Detail

    main

    public static void main(java.lang.String[] args)
                     throws java.lang.Exception
    Main method suitable for starting @enterprise.

    Parameters:
    args - the first argument should contain the path of the configuration file. additional 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:
    java.lang.Exception

    main

    public static void main(java.lang.String conffile,
                            boolean logOnConsole,
                            boolean isStandalone)
                     throws java.lang.Exception
    Start @enterprise with a configuration file.

    Parameters:
    conffile - path to the configuration
    logOnConsole - true if logging should go to the console.
    Throws:
    java.lang.Exception

    closeServerSocketLocker

    public static void closeServerSocketLocker()

    setDefaultLocale

    public static void setDefaultLocale()
    Set the default locale for the whole java process. The method takes language, country and variant from the configuration file. if language or country is null the method does nothing.


    addService

    public static Service addService(java.lang.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(java.lang.String classname,
                                     java.lang.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(java.lang.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(java.lang.String id)
    Return the service by id.

    Parameters:
    id - the id of a service.
    Returns:
    the service object.

    getStartDate

    public static java.util.Date getStartDate()
    Return the date of startup.


    reconfigureAll

    public static void reconfigureAll()
    Calls reconfigure of all services managed by the service manager.


    isStandalone

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

    Returns:
    true if standalone

    isShutdownInProgress

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

    Returns:
    true if in shutdown


    @enterprise 8.0.22989 Copyright © 2001-2017 Groiss Informatics GmbH. All Rights Reserved.