Author: [email protected]
Date: Mon Jan 30 14:03:37 2012
New Revision: 2022
Log:
AMDATU-529 Added a little doc to putIfAbsent trickery
Modified:
trunk/amdatu-core/tenant-factory/src/main/java/org/amdatu/core/tenant/factory/TenantServiceFactory.java
Modified:
trunk/amdatu-core/tenant-factory/src/main/java/org/amdatu/core/tenant/factory/TenantServiceFactory.java
==============================================================================
---
trunk/amdatu-core/tenant-factory/src/main/java/org/amdatu/core/tenant/factory/TenantServiceFactory.java
(original)
+++
trunk/amdatu-core/tenant-factory/src/main/java/org/amdatu/core/tenant/factory/TenantServiceFactory.java
Mon Jan 30 14:03:37 2012
@@ -74,14 +74,17 @@
.setInterface(Tenant.class.getName(), serviceProperties)
.setImplementation(tenant);
+ // registeredComponent is newly created Component unless one exists
Component registeredComponent = m_components.putIfAbsent(pid,
component);
if (registeredComponent == null) {
+ m_logService.log(LogService.LOG_DEBUG, "Registering tenant service
with pid: '" + properties.get(ID_KEY)
+ + "'");
m_dependencyManager.add(component);
}
else {
+ m_logService.log(LogService.LOG_DEBUG, "Updating tenant service
with pid: '" + properties.get(ID_KEY)
+ + "'");
registeredComponent.setServiceProperties(serviceProperties);
- m_logService.log(LogService.LOG_DEBUG, "pid already registered for
tenant '" + properties.get(ID_KEY)
- + "', skipping registration");
}
}
_______________________________________________
Amdatu-commits mailing list
[email protected]
http://lists.amdatu.org/mailman/listinfo/amdatu-commits