ref #9359 upgrade TaxEditor to log4j2
[taxeditor.git] / eu.etaxonomy.taxeditor.editor / src / main / java / eu / etaxonomy / taxeditor / editor / internal / TaxeditorEditorPlugin.java
1 package eu.etaxonomy.taxeditor.editor.internal;
2
3 import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
4 import org.eclipse.ui.plugin.AbstractUIPlugin;
5 import org.osgi.framework.BundleContext;
6
7 import eu.etaxonomy.taxeditor.editor.UseObjectManager;
8 import eu.etaxonomy.taxeditor.editor.validation.ValidationContextListener;
9 import eu.etaxonomy.taxeditor.store.CdmStore;
10
11 /**
12 * The activator class controls the plug-in life cycle
13 *
14 * @author n.hoffmann
15 */
16 public class TaxeditorEditorPlugin extends AbstractUIPlugin {
17
18 /** Constant <code>logger</code> */
19 public static final Logger logger = LogManager.getLogger(TaxeditorEditorPlugin.class);
20
21 // The plug-in ID
22 /** Constant <code>PLUGIN_ID="eu.etaxonomy.taxeditor.editor"</code> */
23 public static final String PLUGIN_ID = "eu.etaxonomy.taxeditor.editor"; //$NON-NLS-1$
24
25 // The shared instance
26 private static TaxeditorEditorPlugin plugin;
27
28 /**
29 * The constructor
30 */
31 public TaxeditorEditorPlugin() {
32 }
33
34 @Override
35 public void start(BundleContext context) throws Exception {
36 super.start(context);
37
38 UseObjectManager useManager = new UseObjectManager();
39 CdmStore.getContextManager().addContextListener(useManager);
40
41 ValidationContextListener vcl = new ValidationContextListener();
42 // CdmStore.getContextManager().addContextListener(vcl);
43
44 plugin = this;
45 logger.trace("Plugin started: " + this.getBundle().getSymbolicName()); //$NON-NLS-1$
46 }
47
48 @Override
49 public void stop(BundleContext context) throws Exception {
50 plugin = null;
51 super.stop(context);
52 logger.trace("Plugin stopped"); //$NON-NLS-1$
53 }
54
55 /**
56 * Returns the shared instance
57 *
58 * @return the shared instance
59 */
60 public static TaxeditorEditorPlugin getDefault() {
61 return plugin;
62 }
63 }