Base layout of eclipse plugin for service provider.
[platform/upstream/iotivity.git] / service / simulator / java / eclipse-plugin / ServiceProviderPlugin / src / oic / simulator / serviceprovider / Activator.java
1 package oic.simulator.serviceprovider;
2
3 import oic.simulator.serviceprovider.manager.ResourceManager;
4
5 import org.eclipse.ui.plugin.AbstractUIPlugin;
6 import org.osgi.framework.BundleContext;
7
8 /**
9  * The activator class controls the plug-in life cycle
10  */
11 public class Activator extends AbstractUIPlugin {
12
13     // The plug-in ID
14     public static final String     PLUGIN_ID = "ServiceProviderPlugin"; //$NON-NLS-1$
15
16     // The shared instance
17     private static Activator       plugin;
18
19     private static ResourceManager manager;
20
21     /**
22      * The constructor
23      */
24     public Activator() {
25     }
26
27     /*
28      * (non-Javadoc)
29      * 
30      * @see
31      * org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext
32      * )
33      */
34     public void start(BundleContext context) throws Exception {
35         super.start(context);
36         plugin = this;
37         setManager(new ResourceManager());
38     }
39
40     /*
41      * (non-Javadoc)
42      * 
43      * @see
44      * org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext
45      * )
46      */
47     public void stop(BundleContext context) throws Exception {
48         plugin = null;
49         super.stop(context);
50     }
51
52     /**
53      * Returns the shared instance
54      *
55      * @return the shared instance
56      */
57     public static Activator getDefault() {
58         return plugin;
59     }
60
61     public static ResourceManager getManager() {
62         return manager;
63     }
64
65     public static void setManager(ResourceManager manager) {
66         Activator.manager = manager;
67     }
68
69 }