KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > equinox > internal > app > ErrorApplication


1 /*******************************************************************************
2  * Copyright (c) 2005 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.internal.app;
13
14 import org.eclipse.equinox.app.IApplication;
15 import org.eclipse.equinox.app.IApplicationContext;
16
17 /*
18  * Special case class only used to throw exceptions when an application
19  * cannot be found.
20  */

21 public class ErrorApplication implements IApplication {
22     static final String JavaDoc ERROR_EXCEPTION = "error.exception"; //$NON-NLS-1$
23

24     public Object JavaDoc start(IApplicationContext context) throws Exception JavaDoc {
25         Exception JavaDoc error = (Exception JavaDoc) context.getArguments().get(ERROR_EXCEPTION);
26         if (error != null)
27             throw error;
28         throw new IllegalStateException JavaDoc();
29     }
30
31     public void stop() {
32         // do nothing
33
}
34 }
35
Popular Tags