Package jmri

Interface ConfigureManager

All Known Implementing Classes:
AppsConfigurationManager, ConfigXmlManager, JmriConfigurationManager

public interface ConfigureManager
Provide load/store capabilities for general configuration.

Areas of responsibility:

  • Register and deregister configuration objects so they can eventually be stored.
  • Invoke the load and store operations as needed
  • Give access to the configuration objects for independent GUIs

The managed items are divided into four types:

  1. "Prefs" - handled first on read, these are the general preferences controlling how the program starts up
  2. "Config" - layout configuration information, e.g. turnout, signal, etc - generally, all NamedBeanManagers
  3. "Tool" - (Not really clear yet, but present)
  4. "User" - typically information about panels and windows, these are handled last during startup - all the jmri.display panel types

The configuration manager is generally located through the InstanceManager.

The original implementation was via the jmri.configurexml package.


This file is part of JMRI.

JMRI is free software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation. See the "COPYING" file for a copy of this license.

JMRI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

See Also:
  • Method Details

    • registerPref

    • removePrefItems

    • registerConfig

    • registerConfig

      void registerConfig(Object o, int x)
    • registerTool

    • registerUser

    • registerUserPrefs

    • deregister

      void deregister(Object o)
    • findInstance

      Object findInstance(Class<?> c, int index)
      Find the ith instance of an object of particular class that's been registered for storage.

      Note that the index of an object can change when other objects are stored or removed. The index is for indexing over the objects stored at a moment, not for use as an identification number.

      There may be synchronization issues associated with this, although they are expected to be rare in practice.

      Parameters:
      c - Class of the desired objects
      index - a 1-based index of the object to return
      Returns:
      an object of class c or null
    • getInstanceList

      Returns a list of instances stored for a given class.
      Parameters:
      c - Class of the desired objects
      Returns:
      an List of objects of class c or null
    • storePrefs

      void storePrefs()
      Stores just preferences information.

      Where that information is stored is implementation-specific.

    • storePrefs

      void storePrefs(File file)
      Stores just preferences information.
      Parameters:
      file - the to store preferences into
    • storeUserPrefs

      void storeUserPrefs(File file)
      Stores just user preferences information.
      Parameters:
      file - the file to store user preferences into
    • storeConfig

      boolean storeConfig(File file)
      Stores just configuration information.
      Parameters:
      file - Output file
      Returns:
      true if successful; false otherwise
    • storeUser

      boolean storeUser(File file)
      Stores user and config information.
      Parameters:
      file - Output file
      Returns:
      true if succeeded
    • load

      boolean load(File file) throws JmriException
      Create the objects defined in a particular configuration file
      Parameters:
      file - Input file
      Returns:
      true if succeeded
      Throws:
      JmriException - if unable to load file due to internal error
    • load

      boolean load(URL file) throws JmriException
      Create the objects defined in a particular configuration file
      Parameters:
      file - Input URL
      Returns:
      true if succeeded
      Throws:
      JmriException - if unable to load URL due to internal error
    • load

      boolean load(File file, boolean registerDeferred) throws JmriException
      Create the objects defined in a particular configuration file
      Parameters:
      file - Input file
      registerDeferred - true to register actions for deferred load
      Returns:
      true if succeeded
      Throws:
      JmriException - if problem during load
      Since:
      2.11.2
    • load

      boolean load(URL file, boolean registerDeferred) throws JmriException
      Create the objects defined in a particular configuration file
      Parameters:
      file - Input URL
      registerDeferred - true to register actions for deferred load
      Returns:
      true if succeeded
      Throws:
      JmriException - if problem during load
      Since:
      2.11.2
    • loadDeferred

      boolean loadDeferred(File file) throws JmriException
      Create the objects defined in a particular configuration file that have been deferred until after basic GUI construction completed
      Parameters:
      file - Input file
      Returns:
      true if succeeded
      Throws:
      JmriException - if problem during load
      Since:
      2.11.2
      See Also:
    • loadDeferred

      boolean loadDeferred(URL file) throws JmriException
      Create the objects defined in a particular configuration file that have been deferred until after basic GUI construction completed
      Parameters:
      file - Input URL
      Returns:
      true if succeeded
      Throws:
      JmriException - if problem during load
      Since:
      2.11.2
      See Also:
    • find

      URL find(String filename)
      Provide a method-specific way of locating a file to be loaded from a name.
      Parameters:
      filename - Local filename, perhaps without path information
      Returns:
      Corresponding URL
    • makeBackup

      boolean makeBackup(File file)
      Make a backup file.
      Parameters:
      file - to be backed up
      Returns:
      true if successful
    • setValidate

      void setValidate(XmlFile.Validate validate)
      Control the scope of validation of XML files when loading.
      Parameters:
      validate - the validation scope
    • getValidate

      Get the scope of validation of XML files when loading.
      Returns:
      the validation scope