KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > osgi > framework > adaptor > BundleWatcher


1 /*******************************************************************************
2  * Copyright (c) 2000, 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 package org.eclipse.osgi.framework.adaptor;
12
13 import org.osgi.framework.Bundle;
14
15 /**
16  * Watches bundle lifecyle processes. This interface is different than that of
17  * a BundleLisener because it gets notified before and after all lifecycle
18  * changes. A bundle watcher acts as the main entry point for logging
19  * bundle activity.
20  * <p>
21  * Note that a bundle watcher is always notified of when a lifecycle processes
22  * has ended even in cases where the lifecycle process may have failed. For
23  * example, if activating a bundle fails the {@link #END_ACTIVATION} flag will
24  * still be sent to the bundle watcher to notify them that the activation
25  * process has ended.
26  * </p>
27  * <p>
28  * Clients may implement this interface.
29  * </p>
30  * @since 3.1
31  */

32 public interface BundleWatcher {
33     /**
34      * The install process is beginning for a bundle
35      * @since 3.2
36      */

37     public static final int START_INSTALLING = 0x0001;
38     /**
39      * The install process has ended for a bundle
40      * @since 3.2
41      */

42     public static final int END_INSTALLING = 0x0002;
43     /**
44      * The activation process is beginning for a bundle
45      * @since 3.2
46      */

47     public static final int START_ACTIVATION = 0x0004;
48     /**
49      * The activation process has ended for a bundle
50      * @since 3.2
51      */

52     public static final int END_ACTIVATION = 0x0008;
53     /**
54      * The deactivation process is beginning for a bundle
55      * @since 3.2
56      */

57     public static final int START_DEACTIVATION = 0x0010;
58     /**
59      * The deactivation process has ended for a bundle
60      * @since 3.2
61      */

62     public static final int END_DEACTIVATION = 0x0020;
63     /**
64      * The uninstallation process is beginning for a bundle
65      * @since 3.2
66      */

67     public static final int START_UNINSTALLING = 0x0040;
68     /**
69      * The uninstallation process has ended for a bundle
70      * @since 3.2
71      */

72     public static final int END_UNINSTALLING = 0x0080;
73
74     /**
75      * Receives notification that a lifecycle change is going to start or has
76      * ended.
77      * @param bundle the bundle for which the lifecycle change is occurring on.
78      * @param type the type of lifecycle change which is occurring.
79      * @see #START_INSTALLING
80      * @see #END_INSTALLING
81      * @see #START_ACTIVATION
82      * @see #END_ACTIVATION
83      * @see #START_DEACTIVATION
84      * @see #END_DEACTIVATION
85      * @see #START_UNINSTALLING
86      * @see #END_UNINSTALLING
87      * @since 3.2
88      */

89     public void watchBundle(Bundle bundle, int type);
90 }
91
Popular Tags