org.appng.core.service

## Class HsqlStarter

- java.lang.Object
- - org.appng.core.service.HsqlStarter

-     public class HsqlStarter
      extends Object

  Utility class responsible for starting and stopping a HSQL `Server` in case appNG is configured to use `DatabaseConnection.DatabaseType.HSQL`.
  Author:
    Matthias Müller

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `CONTEXT`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `HsqlStarter()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `shutdown(org.hsqldb.Server server)` Shuts down the given `Server`, if non-null.
    `static org.hsqldb.Server` | `startHsql(Properties platformProperties, String appngHome)` Starts a HSQL `Server`, but only if `DatabaseConnection.DatabaseType.HSQL` is the configured type.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### CONTEXT

          public static final String CONTEXT

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### HsqlStarter

          public HsqlStarter()

  - ### Method Detail

    - #### startHsql

          public static org.hsqldb.Server startHsql(Properties platformProperties,
                                                    String appngHome)
                                             throws IOException

      Starts a HSQL `Server`, but only if `DatabaseConnection.DatabaseType.HSQL` is the configured type.
      Parameters:
        `platformProperties` - the properties read from "/conf/appNG.properties"
        `appngHome` - the home folder of appNG
      Returns:
        a `Server`-instance, if `DatabaseConnection.DatabaseType.HSQL` is the configured type.
      Throws:
        `IOException` - in case the database folder or hsql logfiles could not be accessed

    - #### shutdown

          public static void shutdown(org.hsqldb.Server server)

      Shuts down the given `Server`, if non-null.
      Parameters:
        `server` - the `Server` to shut down, may be `null`

Copyright © 2011–2023 aiticon GmbH. All rights reserved.