public void updateTablePerTenantDescriptors(String property, Object value) {
// When all the table per tenant descriptors are set, we should initialize them.
boolean shouldInitializeDescriptors = true;
for (ClassDescriptor descriptor : getTablePerTenantDescriptors()) {
TablePerMultitenantPolicy policy = (TablePerMultitenantPolicy) descriptor.getMultitenantPolicy();
if ((! policy.hasContextTenant()) && policy.usesContextProperty(property)) {
policy.setContextTenant((String) value);
}
shouldInitializeDescriptors = shouldInitializeDescriptors && policy.hasContextTenant();
}
if (shouldInitializeDescriptors) {
// Now that the correct tables are set on all table per tenant
// descriptors, we can go through the initialization phases safely.