001/*
002 * GWTEventService
003 * Copyright (c) 2011 and beyond, strawbill UG (haftungsbeschr?nkt)
004 *
005 * This is free software; you can redistribute it and/or modify it
006 * under the terms of the GNU Lesser General Public License as
007 * published by the Free Software Foundation; either version 3 of
008 * the License, or (at your option) any later version.
009 * Other licensing for GWTEventService may also be possible on request.
010 * Please view the license.txt of the project for more information.
011 *
012 * This software is distributed in the hope that it will be useful,
013 * but WITHOUT ANY WARRANTY; without even the implied warranty of
014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015 * Lesser General Public License for more details.
016 *
017 * You should have received a copy of the GNU Lesser General Public
018 * License along with this software; if not, write to the Free
019 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
020 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
021 */
022package de.novanic.eventservice.config.loader;
023
024import de.novanic.eventservice.config.EventServiceConfiguration;
025
026/**
027 * ConfigurationLoader is used by {@link de.novanic.eventservice.config.EventServiceConfigurationFactory}
028 * to load the {@link de.novanic.eventservice.config.EventServiceConfiguration}. There are different types/strategies to
029 * load the {@link de.novanic.eventservice.config.EventServiceConfiguration}.
030 *
031 * @see de.novanic.eventservice.config.loader.PropertyConfigurationLoader
032 * @see de.novanic.eventservice.config.loader.DefaultConfigurationLoader
033 *
034 * @author sstrohschein
035 *         <br>Date: 23.10.2008
036 *         <br>Time: 14:37:38
037 */
038public interface ConfigurationLoader
039{
040    /**
041     * Checks if the configuration is available and can be loaded. If no configuration is available, the load method
042     * {@link ConfigurationLoader#load()} shouldn't called.
043     * @return true when available, otherwise false
044     */
045    boolean isAvailable();
046
047    /**
048     * Loads the configuration with the loader.
049     * @return {@link de.novanic.eventservice.config.EventServiceConfiguration} the loaded configuration
050     * @throws de.novanic.eventservice.client.config.ConfigurationException occurs when the configuration can't be loaded or if it contains unreadable values.
051     */
052    EventServiceConfiguration load();
053}