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;
46 public void start(BundleContext context) throws Exception {
49 setLogManager(new LogManager());
50 setResourceManager(new ResourceManager());
51 imageManager = ImageManager.getInstance();
54 public void stop(BundleContext context) throws Exception {
57 // Stopping Resource Manager
58 if (null != resourceManager) {
59 resourceManager.shutdown();
60 resourceManager = null;
62 // Stopping Log Manager
63 if (null != logManager) {
64 logManager.shutdown();
70 public static Activator getDefault() {
74 public ResourceManager getResourceManager() {
75 return resourceManager;
78 private static void setResourceManager(ResourceManager manager) {
79 Activator.resourceManager = manager;
82 public LogManager getLogManager() {
86 private static void setLogManager(LogManager logManager) {
87 Activator.logManager = logManager;
90 public ImageManager getImageManager() {