1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.springframework.osgi.bundle;
18
19 import org.springframework.core.enums.StaticLabeledEnum;
20
21 /**
22 * Enum-like class for the {@link org.osgi.framework.Bundle} actions supported
23 * by {@link BundleFactoryBean}.
24 *
25 * @author Costin Leau
26 *
27 */
28 public class BundleAction extends StaticLabeledEnum {
29
30 private static final long serialVersionUID = 3723986124669884703L;
31
32 /**
33 * Install bundle. This action is implied by {@link #START} and
34 * {@link #UPDATE} in case no bundle is found in the existing OSGi
35 * BundleContext.
36 *
37 * @see org.osgi.framework.BundleContext#installBundle(String)
38 */
39 public static final BundleAction INSTALL = new BundleAction(1, "install");
40
41 /**
42 * Start bundle. If no bundle is found, it will try first to install one
43 * based on the existing configuration.
44 *
45 * @see org.osgi.framework.Bundle#start()
46 */
47 public static final BundleAction START = new BundleAction(2, "start");
48
49 /**
50 * Update bundle. If no bundle is found, it will try first to install one
51 * based on the existing configuration.
52 *
53 * @see org.osgi.framework.Bundle#update()
54 */
55 public static final BundleAction UPDATE = new BundleAction(3, "update");
56
57 /**
58 * Stop bundle. If no bundle is found, this action does nothing (it will
59 * trigger loading).
60 *
61 * @see org.osgi.framework.Bundle#stop()
62 */
63 public static final BundleAction STOP = new BundleAction(4, "stop");
64
65 /**
66 * Uninstall bundle. If no bundle is found, this action does nothing (it
67 * will trigger loading).
68 *
69 * @see org.osgi.framework.Bundle#uninstall()
70 */
71 public static final BundleAction UNINSTALL = new BundleAction(5, "uninstall");
72
73
74 /**
75 * Constructs a new <code>BundleAction</code> instance.
76 *
77 * @param code
78 * @param label
79 */
80 private BundleAction(int code, String label) {
81 super(code, label);
82 }
83 }