A product hands the runtime off to an application, which can be thought of as a custom Eclipse Runnable
class. This is the main entry point to the application which is responsible for setting up and tearing down the content of the application.
com.packtpub.e4.headless.application
. Ensure that the This plug-in will make contributions to the UI checkbox is deselected and Would you like to create a rich client application is set to No:applications
into the box. Ensure the Show only extension points from the required plug-ins checkbox is deselected. Choose the org.eclipse.core.runtime.applications
extension point:org.eclipse.equinox.app
. If so, say Yes to this:com.packtpub.e4.headless.application.Application
as the class name and click on the underlined class*: link on the left to open a new class wizard, which pre-fills the class name and supplies the IApplication
interface:public class Application implements IApplication { public Object start(IApplicationContext c) throws Exception { System.out.println("Headless Application"); return null; } public void stop() { } }
Creating an application requires an extension point and a class that implements the IApplication
interface. Using the wizard, an application was created and the start method was implemented with a simple display message.
When play is clicked, Eclipse will create a new launch configuration which points to an application:
This references the automatically generated ID of the application from the plugin.xml
. When Eclipse starts the runtime, it will bring up the runtime environment and then hand runtime control over to the application instance. At the end of the start method's execution, the application will terminate.