summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Liebig2008-02-21 05:42:53 (EST)
committerStefan Liebig2008-02-21 05:42:53 (EST)
commitdcef345b4c735c8a8207395545f9d5e2fb4554fa (patch)
tree39a289c60fc835cd5e78bbabf71f51fdc4641543
parent0d4d5c9b6c10c3def4b98aaf835f622927202ba7 (diff)
downloadorg.eclipse.riena-dcef345b4c735c8a8207395545f9d5e2fb4554fa.zip
org.eclipse.riena-dcef345b4c735c8a8207395545f9d5e2fb4554fa.tar.gz
org.eclipse.riena-dcef345b4c735c8a8207395545f9d5e2fb4554fa.tar.bz2
lazy init has to be synchronized
-rw-r--r--org.eclipse.riena.security.common/src/org/eclipse/riena/internal/security/common/Activator.java122
-rw-r--r--org.eclipse.riena.security.server/src/org/eclipse/riena/internal/security/server/Activator.java116
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/internal/tests/Activator.java2
3 files changed, 120 insertions, 120 deletions
diff --git a/org.eclipse.riena.security.common/src/org/eclipse/riena/internal/security/common/Activator.java b/org.eclipse.riena.security.common/src/org/eclipse/riena/internal/security/common/Activator.java
index 215eb9b..4e941b8 100644
--- a/org.eclipse.riena.security.common/src/org/eclipse/riena/internal/security/common/Activator.java
+++ b/org.eclipse.riena.security.common/src/org/eclipse/riena/internal/security/common/Activator.java
@@ -28,74 +28,74 @@ import org.osgi.framework.ServiceRegistration;
*/
public class Activator extends Plugin {
- // The plug-in ID
- public static final String PLUGIN_ID = "org.eclipse.riena.security.common";
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.riena.security.common";
- // The shared instance
- private static Activator plugin;
- private static BundleContext CONTEXT;
- private LogUtil logUtil;
+ // The shared instance
+ private static Activator plugin;
+ private static BundleContext CONTEXT;
+ private LogUtil logUtil;
- private ServiceRegistration sessionHolderService;
- private ServiceRegistration securityCallHook;
- private ServiceRegistration principalHolderService;
- private ServiceRegistration permissionCache;
+ private ServiceRegistration sessionHolderService;
+ private ServiceRegistration securityCallHook;
+ private ServiceRegistration principalHolderService;
+ private ServiceRegistration permissionCache;
- /**
- * The constructor
- */
- public Activator() {
- }
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext)
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- plugin = this;
- CONTEXT = context;
- sessionHolderService = CONTEXT.registerService(ISessionHolderService.ID, new SimpleSessionHolderService(), null);
- securityCallHook = CONTEXT.registerService(ICallHook.ID, new SecurityCallHook(), null);
- principalHolderService = CONTEXT.registerService(ISubjectHolderService.ID, new SubjectHolderService(), null);
- permissionCache = CONTEXT.registerService(IPermissionCache.ID,new PermissionCache(),null);
- RienaPolicy.init();
- }
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ CONTEXT = context;
+ sessionHolderService = CONTEXT
+ .registerService(ISessionHolderService.ID, new SimpleSessionHolderService(), null);
+ securityCallHook = CONTEXT.registerService(ICallHook.ID, new SecurityCallHook(), null);
+ principalHolderService = CONTEXT.registerService(ISubjectHolderService.ID, new SubjectHolderService(), null);
+ permissionCache = CONTEXT.registerService(IPermissionCache.ID, new PermissionCache(), null);
+ RienaPolicy.init();
+ }
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
- */
- public void stop(BundleContext context) throws Exception {
- super.stop(context);
- sessionHolderService.unregister();
- securityCallHook.unregister();
- principalHolderService.unregister();
- plugin = null;
- CONTEXT = null;
- }
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ super.stop(context);
+ sessionHolderService.unregister();
+ securityCallHook.unregister();
+ principalHolderService.unregister();
+ plugin = null;
+ CONTEXT = null;
+ }
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static Activator getDefault() {
- return plugin;
- }
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
- public static BundleContext getContext() {
- return CONTEXT;
- }
-
- public Logger getLogger(String name) {
- if (logUtil == null) {
- logUtil = new LogUtil(CONTEXT);
- }
- return logUtil.getLogger(name);
- }
+ public static BundleContext getContext() {
+ return CONTEXT;
+ }
+ public synchronized Logger getLogger(String name) {
+ if (logUtil == null) {
+ logUtil = new LogUtil(CONTEXT);
+ }
+ return logUtil.getLogger(name);
+ }
}
diff --git a/org.eclipse.riena.security.server/src/org/eclipse/riena/internal/security/server/Activator.java b/org.eclipse.riena.security.server/src/org/eclipse/riena/internal/security/server/Activator.java
index 3a115bd..bec5c44 100644
--- a/org.eclipse.riena.security.server/src/org/eclipse/riena/internal/security/server/Activator.java
+++ b/org.eclipse.riena.security.server/src/org/eclipse/riena/internal/security/server/Activator.java
@@ -26,69 +26,69 @@ import org.osgi.framework.ServiceRegistration;
*/
public class Activator extends Plugin {
- // The plug-in ID
- public static final String PLUGIN_ID = "de.compeople.scp.security.server";
+ // The plug-in ID
+ public static final String PLUGIN_ID = "de.compeople.scp.security.server";
- // The shared instance
- private static Activator plugin;
- private static BundleContext CONTEXT;
- private LogUtil logUtil;
- private ServiceRegistration principalCacheRegistration;
- private ServiceRegistration securityServiceHook;
+ // The shared instance
+ private static Activator plugin;
+ private static BundleContext CONTEXT;
+ private LogUtil logUtil;
+ private ServiceRegistration principalCacheRegistration;
+ private ServiceRegistration securityServiceHook;
- /**
- * The constructor
- */
- public Activator() {
- }
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext)
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- plugin = this;
- CONTEXT = context;
- GenericObjectCache principalCache = new GenericObjectCache();
- principalCache.setName("principalCache");
- Hashtable<String, String> props = new Hashtable<String, String>();
- props.put("cache.type", "PrincipalCache");
- principalCacheRegistration = CONTEXT.registerService(IGenericObjectCache.ID, principalCache, props);
- securityServiceHook = CONTEXT.registerService(IServiceHook.ID, new SecurityServiceHook(), null);
- }
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ CONTEXT = context;
+ GenericObjectCache principalCache = new GenericObjectCache();
+ principalCache.setName("principalCache");
+ Hashtable<String, String> props = new Hashtable<String, String>();
+ props.put("cache.type", "PrincipalCache");
+ principalCacheRegistration = CONTEXT.registerService(IGenericObjectCache.ID, principalCache, props);
+ securityServiceHook = CONTEXT.registerService(IServiceHook.ID, new SecurityServiceHook(), null);
+ }
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
- */
- public void stop(BundleContext context) throws Exception {
- super.stop(context);
- principalCacheRegistration.unregister();
- securityServiceHook.unregister();
- plugin = null;
- CONTEXT = null;
- }
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ super.stop(context);
+ principalCacheRegistration.unregister();
+ securityServiceHook.unregister();
+ plugin = null;
+ CONTEXT = null;
+ }
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static Activator getDefault() {
- return plugin;
- }
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
- public static BundleContext getContext() {
- return CONTEXT;
- }
+ public static BundleContext getContext() {
+ return CONTEXT;
+ }
- public Logger getLogger(String name) {
- if (logUtil == null) {
- logUtil = new LogUtil(CONTEXT);
- }
- return logUtil.getLogger(name);
- }
+ public synchronized Logger getLogger(String name) {
+ if (logUtil == null) {
+ logUtil = new LogUtil(CONTEXT);
+ }
+ return logUtil.getLogger(name);
+ }
} \ No newline at end of file
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/tests/Activator.java b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/tests/Activator.java
index c62a360..3cd7bd7 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/tests/Activator.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/tests/Activator.java
@@ -69,7 +69,7 @@ public class Activator extends Plugin {
return CONTEXT;
}
- public Logger getLogger(String name) {
+ public synchronized Logger getLogger(String name) {
if (logUtil == null) {
logUtil = new LogUtil(CONTEXT);
}