001    /**
002     * =========================================
003     * LibXML : a free Java layouting library
004     * =========================================
005     *
006     * Project Info:  http://reporting.pentaho.org/libxml/
007     *
008     * (C) Copyright 2006-2007, by Object Refinery Ltd, Pentaho Corporation and Contributors.
009     *
010     * This library is free software; you can redistribute it and/or modify it under the terms
011     * of the GNU Lesser General Public License as published by the Free Software Foundation;
012     * either version 2.1 of the License, or (at your option) any later version.
013     *
014     * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
015     * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
016     * See the GNU Lesser General Public License for more details.
017     *
018     * You should have received a copy of the GNU Lesser General Public License along with this
019     * library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
020     * Boston, MA 02111-1307, USA.
021     *
022     * [Java is a trademark or registered trademark of Sun Microsystems, Inc.
023     * in the United States and other countries.]
024     *
025     *
026     * ------------
027     * $Id: LibXmlBoot.java 3518 2007-10-16 10:26:53Z tmorgner $
028     * ------------
029     * (C) Copyright 2006-2007, by Pentaho Corporation.
030     */
031    
032    package org.jfree.xmlns;
033    
034    import org.jfree.base.AbstractBoot;
035    import org.jfree.base.BootableProjectInfo;
036    import org.jfree.util.Configuration;
037    
038    /**
039     * The LibXmlBoot class is used to initialize the library before it is
040     * first used. This loads all configurations and initializes all factories.
041     *
042     * Without booting, basic services like logging and the global configuration
043     * will not be availble.
044     *
045     * @author Thomas Morgner
046     */
047    public class LibXmlBoot extends AbstractBoot
048    {
049      private static LibXmlBoot singleton;
050    
051      /**
052       * Returns the singleton instance of the boot-class.
053       *
054       * @return the singleton booter.
055       */
056      public static synchronized LibXmlBoot getInstance()
057      {
058        if (singleton == null)
059        {
060          singleton = new LibXmlBoot();
061        }
062        return singleton;
063      }
064    
065      /**
066       * Private constructor prevents object creation.
067       */
068      private LibXmlBoot ()
069      {
070      }
071    
072      /**
073       * Returns the project info.
074       *
075       * @return The project info.
076       */
077      protected BootableProjectInfo getProjectInfo ()
078      {
079        return LibXmlInfo.getInstance();
080      }
081    
082      /**
083       * Loads the configuration.
084       *
085       * @return The configuration.
086       */
087      protected Configuration loadConfiguration ()
088      {
089        return createDefaultHierarchicalConfiguration
090                ("/org/jfree/xmlns/libxml.properties",
091                 "/libxml.properties", true);
092      }
093    
094      /**
095       * Performs the boot.
096       */
097      protected void performBoot ()
098      {
099      }
100    }