KickJava   Java API By Example, From Geeks To Geeks.

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


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.internal.app;
13
14 import org.eclipse.osgi.framework.log.FrameworkLogEntry;
15
16 public class AnyThreadAppLauncher implements Runnable JavaDoc{
17     private EclipseAppHandle appHandle;
18
19     private AnyThreadAppLauncher(EclipseAppHandle appHandle) {
20         this.appHandle = appHandle;
21     }
22
23     public void run() {
24         try {
25             // pasing null will cause EclipseAppHandle to get the correct arguments
26
appHandle.run(null);
27         } catch (Throwable JavaDoc e) {
28             Activator.log(new FrameworkLogEntry(Activator.PI_APP, FrameworkLogEntry.ERROR, 0, e.getMessage(), 0, e, null));
29         }
30     }
31
32     static void launchEclipseApplication(EclipseAppHandle appHandle) {
33         AnyThreadAppLauncher launchable = new AnyThreadAppLauncher(appHandle);
34         new Thread JavaDoc(launchable, "app thread - " + appHandle.getInstanceId()).start(); //$NON-NLS-1$
35
}
36 }
37
Popular Tags