Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoberto E. Escobar2012-10-30 00:16:12 +0000
committerRoberto E. Escobar2012-10-30 00:16:12 +0000
commit00569ee1e7b8b6ab493c48c7eeee3fc6d66227e5 (patch)
tree0ce6787e0d88e8cb4fb22a98316dcfea49a50202 /plugins/org.eclipse.osee.framework.access
parentaf3c3d4947f46d3158910eaacb7f7517eec8852e (diff)
downloadorg.eclipse.osee-00569ee1e7b8b6ab493c48c7eeee3fc6d66227e5.tar.gz
org.eclipse.osee-00569ee1e7b8b6ab493c48c7eeee3fc6d66227e5.tar.xz
org.eclipse.osee-00569ee1e7b8b6ab493c48c7eeee3fc6d66227e5.zip
refinement: Make access control cache loading lazy
Diffstat (limited to 'plugins/org.eclipse.osee.framework.access')
-rw-r--r--plugins/org.eclipse.osee.framework.access/src/org/eclipse/osee/framework/access/internal/cm/CmAccessProviderProxy.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/plugins/org.eclipse.osee.framework.access/src/org/eclipse/osee/framework/access/internal/cm/CmAccessProviderProxy.java b/plugins/org.eclipse.osee.framework.access/src/org/eclipse/osee/framework/access/internal/cm/CmAccessProviderProxy.java
index 2fadcd22714..242d859160c 100644
--- a/plugins/org.eclipse.osee.framework.access/src/org/eclipse/osee/framework/access/internal/cm/CmAccessProviderProxy.java
+++ b/plugins/org.eclipse.osee.framework.access/src/org/eclipse/osee/framework/access/internal/cm/CmAccessProviderProxy.java
@@ -45,6 +45,8 @@ public final class CmAccessProviderProxy implements IAccessProvider {
private BundleContext bundleContext;
private Thread thread;
+ private volatile boolean requiresReload = true;
+
public void addCmAccessControl(ServiceReference<CmAccessControl> reference) {
if (isReady()) {
register(bundleContext, reference);
@@ -72,7 +74,7 @@ public final class CmAccessProviderProxy implements IAccessProvider {
} else {
cmServices.add(cmAccessControl);
}
- reloadCache();
+ requiresReload = true;
}
private void unregister(BundleContext bundleContext, ServiceReference<CmAccessControl> reference) {
@@ -82,7 +84,7 @@ public final class CmAccessProviderProxy implements IAccessProvider {
} else {
cmServices.remove(cmAccessControl);
}
- reloadCache();
+ requiresReload = true;
}
private boolean isDefault(ServiceReference<CmAccessControl> reference) {
@@ -96,6 +98,7 @@ public final class CmAccessProviderProxy implements IAccessProvider {
public void start(BundleContext context) {
this.bundleContext = context;
+ requiresReload = true;
cmProvider = new CmAccessControlProviderImpl(cmServices);
accessProvider = new CmAccessProvider(cmProvider);
@@ -144,6 +147,10 @@ public final class CmAccessProviderProxy implements IAccessProvider {
private void checkInitialized() throws OseeCoreException {
Conditions.checkNotNull(getAccessProvider(), "object access provider",
"Object Access Provider not properly initialized");
+ if (requiresReload) {
+ requiresReload = false;
+ reloadCache();
+ }
}
@Override

Back to the top