2 * Copyright 2015 Samsung Electronics All Rights Reserved.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 package oic.simulator.clientcontroller;
19 import oic.simulator.clientcontroller.manager.ImageManager;
20 import oic.simulator.clientcontroller.manager.LogManager;
21 import oic.simulator.clientcontroller.manager.ResourceManager;
23 import org.eclipse.ui.plugin.AbstractUIPlugin;
24 import org.osgi.framework.BundleContext;
27 * The activator class controls the plug-in life cycle.
29 public class Activator extends AbstractUIPlugin {
32 public static final String PLUGIN_ID = "ClientControllerPlugin";
34 // The shared instance
35 private static Activator plugin;
37 private static ResourceManager resourceManager;
39 private static LogManager logManager;
41 private static ImageManager imageManager;
44 System.loadLibrary("SimulatorManager");
50 public void start(BundleContext context) throws Exception {
53 setResourceManager(new ResourceManager());
54 setLogManager(new LogManager());
55 imageManager = ImageManager.getInstance();
58 public void stop(BundleContext context) throws Exception {
60 // Stopping Resource Manager
61 if (null != resourceManager) {
62 resourceManager.shutdown();
63 resourceManager = null;
65 // Stopping Log Manager
66 if (null != logManager) {
67 logManager.shutdown();
73 public static Activator getDefault() {
77 public ResourceManager getResourceManager() {
78 return resourceManager;
81 private static void setResourceManager(ResourceManager manager) {
82 Activator.resourceManager = manager;
85 public LogManager getLogManager() {
89 private static void setLogManager(LogManager logManager) {
90 Activator.logManager = logManager;
93 public ImageManager getImageManager() {