KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > equinox > app > IApplication


1 /*******************************************************************************
2  * Copyright (c) 2005, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11
12 package org.eclipse.equinox.app;
13
14 /**
15  * Bootstrap type for an application. An IApplication represent executable
16  * entry points into an application. An IApplication can be configured into
17  * the Platform's <code>org.eclipse.equinox.applications</code> extension-point.
18  *
19  * <p>
20  * Clients may implement this interface.
21  * </p>
22  *
23  * @since 1.0
24  */

25 public interface IApplication {
26
27     /**
28      * Exit object indicating normal termination
29      */

30     public static final Integer JavaDoc EXIT_OK = new Integer JavaDoc(0);
31
32     /**
33      * Exit object requesting platform restart
34      */

35     public static final Integer JavaDoc EXIT_RESTART = new Integer JavaDoc(23);
36
37     /**
38      * Exit object requesting that the command passed back be executed. Typically
39      * this is used to relaunch Eclipse with different command line arguments. When the executable is
40      * relaunched the command line will be retrieved from the <code>eclipse.exitdata</code> system property.
41      */

42     public static final Integer JavaDoc EXIT_RELAUNCH = new Integer JavaDoc(24);
43
44     /**
45      * Starts this application with the given context and returns a result. This
46      * method must not exit until the application is finished and is ready to exit.
47      * The content of the context is unchecked and should conform to the expectations of
48      * the application being invoked.<p>
49      *
50      * Applications can return any object they like. If an <code>Integer</code> is returned
51      * it is treated as the program exit code if Eclipse is exiting.
52      * <p>
53      * Note: This method is called by the platform; it is not intended
54      * to be called directly by clients.
55      * </p>
56      * @return the return value of the application
57      * @see #EXIT_OK
58      * @see #EXIT_RESTART
59      * @see #EXIT_RELAUNCH
60      * @param context the application context to pass to the application
61      * @exception Exception if there is a problem running this application.
62      */

63     public Object JavaDoc start(IApplicationContext context) throws Exception JavaDoc;
64
65     /**
66      * Forces this running application to exit. This method should wait until the
67      * running application is ready to exit. The {@link #start(IApplicationContext)}
68      * should already have exited or should exit very soon after this method exits<p>
69      *
70      * This method is only called to force an application to exit.
71      * This method will not be called if an application exits normally from
72      * the {@link #start(IApplicationContext)} method.
73      * <p>
74      * Note: This method is called by the platform; it is not intended
75      * to be called directly by clients.
76      * </p>
77      */

78     public void stop();
79 }
80
Popular Tags