/*
 * Application.java  $Revision: 1.4 $  $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.4 $ $Date: 2007/10/03 04:39:39 $
 * @author Rob Richards
 */
public interface Application
{
    /** Key sent to ApplicationContext listeners when Application is closing. */
    public static final String  APPLICATION_CLOSING_KEY = "Application.CLOSING";

    /** Key sent to ApplicationContext listeners when Application is closed. */
    public static final String  APPLICATION_CLOSED_KEY = "Application.CLOSED";

    /**
     * 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.
     * @param appName 
     */
    public void applicationInitialize(String appName);

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

    /** Opens obj in this application. */
    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;
}
