Use standard JAAS login context for RAP login
[lgpl/argeo-commons.git] / org.argeo.security.ui / src / org / argeo / security / ui / SecurityUiPlugin.java
index 03584185bf06ad73193068ec1b2d717543262459..a19fec17d02cb9ad107e23eaba5768d7f3ccf11e 100644 (file)
@@ -43,6 +43,7 @@ public class SecurityUiPlugin extends AbstractUIPlugin {
        private ServiceRegistration defaultCallbackHandlerReg;
 
        private static SecurityUiPlugin plugin;
+       private static BundleContext bundleContext;
 
        public static InheritableThreadLocal<Display> display = new InheritableThreadLocal<Display>() {
 
@@ -55,6 +56,7 @@ public class SecurityUiPlugin extends AbstractUIPlugin {
        public void start(BundleContext context) throws Exception {
                super.start(context);
                plugin = this;
+               bundleContext = context;
 
                defaultCallbackHandler = new DefaultCallbackHandler();
                defaultCallbackHandlerReg = context.registerService(
@@ -63,6 +65,7 @@ public class SecurityUiPlugin extends AbstractUIPlugin {
 
        public void stop(BundleContext context) throws Exception {
                plugin = null;
+               bundleContext = null;
                defaultCallbackHandlerReg.unregister();
                super.stop(context);
        }
@@ -76,6 +79,10 @@ public class SecurityUiPlugin extends AbstractUIPlugin {
                return plugin;
        }
 
+       public static BundleContext getBundleContext() {
+               return bundleContext;
+       }
+
        public static ImageDescriptor getImageDescriptor(String path) {
                return imageDescriptorFromPlugin(PLUGIN_ID, path);
        }