KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > osgi > framework > internal > core > StartLevelEvent


1 /*******************************************************************************
2  * Copyright (c) 2003, 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.osgi.framework.internal.core;
13
14 import java.util.EventObject JavaDoc;
15
16 /**
17  * StartLevel Event for the OSGi framework.
18  *
19  * Event which signifies that a start level change has been requested for the framework or for a bundle.
20  *
21  */

22 class StartLevelEvent extends EventObject JavaDoc {
23     private static final long serialVersionUID = 3258125839085155891L;
24     public final static int CHANGE_BUNDLE_SL = 0x00000000;
25     public final static int CHANGE_FW_SL = 0x00000001;
26
27     /**
28      * Event Type
29      */

30     private transient int type;
31
32     /**
33      * StartLevel - value depends on event type:
34      * CHANGE_BUNDLE_SL - value is the new bundle startlevel
35      * CHANGE_FW_SL - value is the new framework startlevel
36      *
37      */

38     private transient int newSl;
39
40     /**
41      * For a change in bundle startlevel, this is the bundle to be changed.
42      * For a change in framework startlevel, this is the bundle requesting the change.
43      */

44     private transient AbstractBundle bundle;
45
46     /**
47      * Creates a StartLevel event regarding the specified bundle.
48      *
49      * @param type The type of startlevel event (inc or dec)
50      * @param newSl the ultimate requested startlevel we are on our way to
51      * @param bundle The affected bundle, or system bundle if it is for the framework
52      */

53     public StartLevelEvent(int type, int newSl, AbstractBundle bundle) {
54         super(bundle);
55         this.type = type;
56         this.newSl = newSl;
57         this.bundle = bundle;
58     }
59
60     public int getType() {
61         return this.type;
62     }
63
64     public int getNewSL() {
65         return this.newSl;
66     }
67
68     public AbstractBundle getBundle() {
69         return this.bundle;
70     }
71
72 }
73
Popular Tags