KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > java > plugin > boot > ApplicationInitializer


1 /*****************************************************************************
2  * Java Plug-in Framework (JPF)
3  * Copyright (C) 2004-2005 Dmitry Olshansky
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  *****************************************************************************/

19 package org.java.plugin.boot;
20
21 import org.java.plugin.util.ExtendedProperties;
22
23 /**
24  * Interface to plug custom code into JPF based application boot procedure. The
25  * implementation should contain logic on configuring and initializing (but not
26  * starting) application.
27  *
28  * @version $Id: ApplicationInitializer.java,v 1.4 2006/01/27 20:52:15 ddimon Exp $
29  */

30 public interface ApplicationInitializer {
31     /**
32      * Configures this initializer instance, this method will be called once
33      * before any other method call in this class. There is no pre-defined
34      * configuration parameters, see concrete implementations for supported
35      * parameters.
36      * @param config application configuration data from
37      * <code>boot.properties</code> file and <code>System</code>
38      * properties as defaults
39      * @throws Exception if any error has occurred during initializer
40      * configuring
41      */

42     void configure(ExtendedProperties config) throws Exception JavaDoc;
43     
44     /**
45      * This method should configure and initialize an application instance to be
46      * started.
47      * @param errorHandler callback interface to report errors to the user,
48      * it is recommended to use this handler only for
49      * "non-fatal" errors and ask user via
50      * {@link BootErrorHandler#handleError(String, Exception)}
51      * or {@link BootErrorHandler#handleError(String, org.java.plugin.registry.IntegrityCheckReport)}
52      * if he wants to abort application boot process
53      * @param args command line arguments as they passed to program
54      * <code>main</code> method
55      * @return initialized application instance or <code>null</code> if
56      * initializing failed
57      * @throws Exception if any error has occurred during application
58      * initializing
59      */

60     Application initApplication(BootErrorHandler errorHandler, String JavaDoc[] args)
61             throws Exception JavaDoc;
62 }
63
Popular Tags