/*
 * AbstractApplication.java  $Revision: 1.5 $  $Date: 2007/10/03 04:39:39 $
 *
 * Copyright (C) 2007 Meldcraft Corporation
 *
 * This file is part of Scaffold.
 * 
 * Scaffold is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * Scaffold 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 Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with Scaffold.  If not, see <http://www.gnu.org/licenses/>.
 */

package com.meldcraft.application;

/**
 * @version $Revision: 1.5 $ $Date: 2007/10/03 04:39:39 $
 * @author Rob Richards
 */
abstract public class AbstractApplication implements Application
{
// Static variables
// Member variables
// Constructors and initialization
// Interface implemenations
    /**
     * Called after instantiation, and before any other methods are called
     * by the application framework.  Typically, configuration is loaded
     * and the user interface is initialized here.
     */
    abstract public void applicationInitialize(String appName);

    /** Returns the application context. */
    abstract public ApplicationContext getApplicationContext();

    /** Opens obj in this application. */
    abstract public void applicationOpen(Object obj);

    /**
     * Closes the application.  If closing is not allowed, then an
     * ApplicationClosingNotAllowedException should be thrown to prevent
     * closing.
     */
    public void applicationClose() throws ApplicationClosingNotAllowedException
    {
        getApplicationContext().contextChanged(Application.APPLICATION_CLOSING_KEY, null);
    }

// Public methods
// Protected methods
// Private methods
// Inner classes
}
