[Carbon-commits] [Carbon-Components] svn commit r67810 - trunk/carbon/components/security/org.wso2.carbon.security.mgt/src/main/java/org/wso2/carbon/security/deployment
azeez at wso2.com
azeez at wso2.com
Thu Jun 10 01:54:46 PDT 2010
Author: azeez
Date: Thu Jun 10 01:54:45 2010
New Revision: 67810
URL: http://wso2.org/svn/browse/wso2?view=rev&revision=67810
Log:
Startup Perf Optimization
Modified:
trunk/carbon/components/security/org.wso2.carbon.security.mgt/src/main/java/org/wso2/carbon/security/deployment/SecurityDeploymentInterceptor.java
trunk/carbon/components/security/org.wso2.carbon.security.mgt/src/main/java/org/wso2/carbon/security/deployment/SecurityDeploymentListener.java
Modified: trunk/carbon/components/security/org.wso2.carbon.security.mgt/src/main/java/org/wso2/carbon/security/deployment/SecurityDeploymentInterceptor.java
URL: http://wso2.org/svn/browse/wso2/trunk/carbon/components/security/org.wso2.carbon.security.mgt/src/main/java/org/wso2/carbon/security/deployment/SecurityDeploymentInterceptor.java?rev=67810&r1=67809&r2=67810&view=diff
==============================================================================
--- trunk/carbon/components/security/org.wso2.carbon.security.mgt/src/main/java/org/wso2/carbon/security/deployment/SecurityDeploymentInterceptor.java (original)
+++ trunk/carbon/components/security/org.wso2.carbon.security.mgt/src/main/java/org/wso2/carbon/security/deployment/SecurityDeploymentInterceptor.java Thu Jun 10 01:54:45 2010
@@ -15,9 +15,7 @@
import org.osgi.framework.BundleContext;
import org.osgi.service.component.ComponentContext;
import org.wso2.carbon.CarbonConstants;
-import org.wso2.carbon.utils.Axis2ConfigurationContextObserver;
import org.wso2.carbon.core.RegistryResources;
-import org.wso2.carbon.utils.multitenancy.MultitenantConstants;
import org.wso2.carbon.core.util.AnonymousSessionUtil;
import org.wso2.carbon.registry.core.Association;
import org.wso2.carbon.registry.core.Collection;
@@ -39,7 +37,9 @@
import org.wso2.carbon.user.core.UserRealm;
import org.wso2.carbon.user.core.service.RealmService;
import org.wso2.carbon.user.core.tenant.Tenant;
+import org.wso2.carbon.utils.Axis2ConfigurationContextObserver;
import org.wso2.carbon.utils.ServerConfiguration;
+import org.wso2.carbon.utils.multitenancy.MultitenantConstants;
import java.net.URL;
import java.util.ArrayList;
@@ -73,7 +73,7 @@
protected void activate(ComponentContext ctxt) {
try {
loadSecurityScenarios(SecurityServiceHolder.getRegistryService().getConfigSystemRegistry(),
- ctxt.getBundleContext());
+ ctxt.getBundleContext());
} catch (Exception e) {
String msg = "Cannot load security scenarios";
log.error(msg, e);
@@ -223,16 +223,7 @@
if (!registry.resourceExists(resourceUri)) {
registry.put(resourceUri, scenarioResource);
}
-
- // Add the scenarios to the tenant registries
- Tenant[] tenants = SecurityServiceHolder.getRealmService().getTenantManager().getAllTenants();
- for (Tenant tenant : tenants) {
- UserRegistry tenantUserRegistry = SecurityServiceHolder.getRegistryService().
- getConfigSystemRegistry(tenant.getId());
- if (!tenantUserRegistry.resourceExists(resourceUri)) {
- tenantUserRegistry.put(resourceUri, scenarioResource);
- }
- }
+
// Cache the resource in-memory in order to add it to the newly created tenants
SecurityServiceHolder.addPolicyResource(resourceUri, scenarioResource);
}
Modified: trunk/carbon/components/security/org.wso2.carbon.security.mgt/src/main/java/org/wso2/carbon/security/deployment/SecurityDeploymentListener.java
URL: http://wso2.org/svn/browse/wso2/trunk/carbon/components/security/org.wso2.carbon.security.mgt/src/main/java/org/wso2/carbon/security/deployment/SecurityDeploymentListener.java?rev=67810&r1=67809&r2=67810&view=diff
==============================================================================
--- trunk/carbon/components/security/org.wso2.carbon.security.mgt/src/main/java/org/wso2/carbon/security/deployment/SecurityDeploymentListener.java (original)
+++ trunk/carbon/components/security/org.wso2.carbon.security.mgt/src/main/java/org/wso2/carbon/security/deployment/SecurityDeploymentListener.java Thu Jun 10 01:54:45 2010
@@ -44,7 +44,7 @@
} catch (Exception e) {
String errorMsg = "Error when storing the policy resource in registry for tenant : " +
tenantId;
- log.error(errorMsg);
+ log.error(errorMsg, e);
}
}
More information about the Carbon-commits
mailing list