KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > osgi > service > runnable > StartupMonitor


1 /*******************************************************************************
2  * Copyright (c) 2006, 2007 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  * Andrew Niefer - IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.osgi.service.runnable;
12
13 /**
14  * Service interface used to monitor the startup process.
15  *
16  * Bundles can register a monitor in order to be given processing time on the
17  * primary thread during the startup process. Clients with threading restrictions can
18  * use this interface to process events that may have been collected from another thread.
19  * <p>
20  * Monitors share time on the primary thread. The primary thread used to run the application
21  * will not proceed until monitors return from any operation. Because of this, monitors should
22  * not perform long running operations.
23  * </p>
24  * <p>
25  * Clients may implement this interface but should not invoke it. The platform
26  * is responsible for invoking the monitor at the appropriate times.
27  * </p>
28  * @since 3.3
29  */

30 public interface StartupMonitor {
31     /**
32      * Update the monitor. This method is periodically called by the platform from the primary thread during
33      * periods where the primary thread is waiting on another thread (ie start level increasing, refreshing packages)
34      * <p>
35      * If multiple monitors are registered then the platform will only call the monitor with the highest service
36      * ranking. In case of a service ranking tie the service with the lowest service id is selected (i.e. the
37      * first monitor registered).
38      * </p>
39      */

40     public void update();
41
42     /**
43      * This method is called by the platform from the primary thread once the application is completely
44      * initialized and running. This method should perform certain operations that are needed once an
45      * application is running. One example is bringing down a splash screen if it exists.
46      * <p>
47      * If multiple monitors are registered then the platform will call all monitors. The monitors are called
48      * according to service ranking; monitors with higher service rankings are called first. In case of a
49      * service ranking tie the service with the lowest service id is called first (i.e. the first monitor registered).
50      * </p>
51      */

52     public void applicationRunning();
53 }
54
Popular Tags