Updated the order of imports in the source files of simulator plugins.
[platform/upstream/iotivity.git] / service / simulator / java / eclipse-plugin / ClientControllerPlugin / src / oic / simulator / clientcontroller / Activator.java
1 /*
2  * Copyright 2015 Samsung Electronics All Rights Reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 package oic.simulator.clientcontroller;
18
19 import org.eclipse.ui.plugin.AbstractUIPlugin;
20 import org.osgi.framework.BundleContext;
21
22 import oic.simulator.clientcontroller.manager.ImageManager;
23 import oic.simulator.clientcontroller.manager.LogManager;
24 import oic.simulator.clientcontroller.manager.ResourceManager;
25
26 /**
27  * The activator class controls the plug-in life cycle.
28  */
29 public class Activator extends AbstractUIPlugin {
30
31     // The plug-in ID
32     public static final String     PLUGIN_ID = "ClientControllerPlugin";
33
34     // The shared instance
35     private static Activator       plugin;
36
37     private static ResourceManager resourceManager;
38
39     private static LogManager      logManager;
40
41     private static ImageManager    imageManager;
42
43     static {
44         System.loadLibrary("SimulatorManager");
45     }
46
47     public Activator() {
48     }
49
50     public void start(BundleContext context) throws Exception {
51         super.start(context);
52         plugin = this;
53         setResourceManager(new ResourceManager());
54         setLogManager(new LogManager());
55         imageManager = ImageManager.getInstance();
56     }
57
58     public void stop(BundleContext context) throws Exception {
59         plugin = null;
60         // Stopping Resource Manager
61         if (null != resourceManager) {
62             resourceManager.shutdown();
63             resourceManager = null;
64         }
65         // Stopping Log Manager
66         if (null != logManager) {
67             logManager.shutdown();
68             logManager = null;
69         }
70         super.stop(context);
71     }
72
73     public static Activator getDefault() {
74         return plugin;
75     }
76
77     public ResourceManager getResourceManager() {
78         return resourceManager;
79     }
80
81     private static void setResourceManager(ResourceManager manager) {
82         Activator.resourceManager = manager;
83     }
84
85     public LogManager getLogManager() {
86         return logManager;
87     }
88
89     private static void setLogManager(LogManager logManager) {
90         Activator.logManager = logManager;
91     }
92
93     public ImageManager getImageManager() {
94         return imageManager;
95     }
96 }