Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: aab377f1ad6ee519ed4cafbfdaecadde04ed6aa8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/*******************************************************************************
 * Copyright (c) 2003, 2006 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/

package org.eclipse.osgi.framework.internal.core;

import java.util.EventObject;

/**
 * StartLevel Event for the OSGi framework.
 *
 * Event which signifies that a start level change has been requested for the framework or for a bundle.
 *
 */
class StartLevelEvent extends EventObject {
	private static final long serialVersionUID = 3258125839085155891L;
	public final static int CHANGE_BUNDLE_SL = 0x00000000;
	public final static int CHANGE_FW_SL = 0x00000001;

	/**
	 * Event Type
	 */
	private transient int type;

	/**
	 * StartLevel - value depends on event type: 
	 *  CHANGE_BUNDLE_SL - value is the new bundle startlevel
	 *  CHANGE_FW_SL - value is the new framework startlevel
	 * 
	 */
	private transient int newSl;

	/**
	 * For a change in bundle startlevel, this is the bundle to be changed.
	 * For a change in framework startlevel, this is the bundle requesting the change.
	 */
	private transient AbstractBundle bundle;

	/**
	 * Creates a StartLevel event regarding the specified bundle.
	 *
	 * @param type The type of startlevel event (inc or dec)
	 * @param newSl the ultimate requested startlevel we are on our way to
	 * @param bundle The affected bundle, or system bundle if it is for the framework
	 */
	public StartLevelEvent(int type, int newSl, AbstractBundle bundle) {
		super(bundle);
		this.type = type;
		this.newSl = newSl;
		this.bundle = bundle;
	}

	public int getType() {
		return this.type;
	}

	public int getNewSL() {
		return this.newSl;
	}

	public AbstractBundle getBundle() {
		return this.bundle;
	}

}

Back to the top