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.serviceprovider;
19 import org.eclipse.ui.plugin.AbstractUIPlugin;
20 import org.osgi.framework.BundleContext;
22 import oic.simulator.serviceprovider.manager.ImageManager;
23 import oic.simulator.serviceprovider.manager.LogManager;
24 import oic.simulator.serviceprovider.manager.ResourceManager;
27 * The activator class controls the plug-in life cycle.
29 public class Activator extends AbstractUIPlugin {
32 public static final String PLUGIN_ID = "ServiceProviderPlugin";
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 setLogManager(new LogManager());
54 setResourceManager(new ResourceManager());
55 imageManager = ImageManager.getInstance();
58 public void stop(BundleContext context) throws Exception {
61 // Stopping Resource Manager
62 if (null != resourceManager) {
63 resourceManager.shutdown();
64 resourceManager = null;
66 // Stopping Log Manager
67 if (null != logManager) {
68 logManager.shutdown();
74 public static Activator getDefault() {
78 public ResourceManager getResourceManager() {
79 return resourceManager;
82 private static void setResourceManager(ResourceManager manager) {
83 Activator.resourceManager = manager;
86 public LogManager getLogManager() {
90 private static void setLogManager(LogManager logManager) {
91 Activator.logManager = logManager;
94 public ImageManager getImageManager() {