diff options
Diffstat (limited to 'moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/Configurator.java')
-rw-r--r-- | moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/Configurator.java | 57 |
1 files changed, 34 insertions, 23 deletions
diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/Configurator.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/Configurator.java index 59db7b5..f2d3b89 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/Configurator.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/Configurator.java @@ -21,17 +21,17 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.api; import at.gv.egovernment.moa.spss.MOAException; import at.gv.egovernment.moa.spss.server.init.ConfiguratorImpl; +import at.gv.egovernment.moa.spss.server.init.StartupConfigurationHolder; /** * Configures the SP/SS API. - * - * Also handles dynamic configuration updates. - * + * + * Also handles dynamic configuration updates. + * * @author Patrick Peck * @version $Id$ */ @@ -39,7 +39,7 @@ public abstract class Configurator { /** The default implementation class. */ private static final String DEFAULT_IMPLEMENTATION = - "at.gv.egovernment.moa.spss.server.init.ConfiguratorImpl"; + "at.gv.egovernment.moa.spss.server.init.ConfiguratorImpl"; /** The single instance of this class. */ private static Configurator instance = null; @@ -47,14 +47,13 @@ public abstract class Configurator { public static synchronized Configurator getInstance() { if (instance == null) { try { - /*DiscoverClass discover = new DiscoverClass(); - instance = - (Configurator) discover.newInstance( - Configurator.class, - DEFAULT_IMPLEMENTATION);*/ - instance = new ConfiguratorImpl(); - } catch (Exception e) { - // this can not happen since we provide a valid default + /* + * DiscoverClass discover = new DiscoverClass(); instance = (Configurator) + * discover.newInstance( Configurator.class, DEFAULT_IMPLEMENTATION); + */ + instance = new ConfiguratorImpl(); + } catch (final Exception e) { + // this can not happen since we provide a valid default // implementation } } @@ -62,23 +61,35 @@ public abstract class Configurator { } /** + * Get current configuration object. + * + * @return Configuration or <code>null</code> if it was not initialized yet + */ + public abstract StartupConfigurationHolder getCurrentConfiguration(); + + /** * Initialize the SP/SS configuration. - * - * Only a single call to this method will have an effect. Use - * <code>update()</code> for reflecting changes in the configuration instead. - * + * + * Only a single call to this method will have an effect. Use + * <code>update()</code> for reflecting changes in the configuration instead. + * + * @return Configuration holder + * * @throws MOAException An error occurred updating the SP/SS configuration. - */ - public abstract void init() throws MOAException; - + */ + public abstract StartupConfigurationHolder init() throws MOAException; + /** * Update the SP/SS configuration. - * + * * This will only have an effect after the system has been initialized once * using <code>init()</code>. - * + * + * @return Updated Configuration holder, or <code>null</code> if it was not + * initialized + * * @throws MOAException An error occurred updating the SP/SS configuration. */ - public abstract void update() throws MOAException; + public abstract StartupConfigurationHolder update() throws MOAException; } |