mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
MT - add startup logging, if repo is MT-enabled
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@7460 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -435,6 +435,9 @@
|
|||||||
<bean id="startupLog" class="org.alfresco.repo.descriptor.DescriptorStartupLog">
|
<bean id="startupLog" class="org.alfresco.repo.descriptor.DescriptorStartupLog">
|
||||||
<property name="descriptorService">
|
<property name="descriptorService">
|
||||||
<ref local="descriptorComponent"/>
|
<ref local="descriptorComponent"/>
|
||||||
|
</property>
|
||||||
|
<property name="tenantService">
|
||||||
|
<ref bean="tenantService"/>
|
||||||
</property>
|
</property>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
|
@@ -28,6 +28,7 @@ import java.security.Principal;
|
|||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.alfresco.repo.tenant.TenantService;
|
||||||
import org.alfresco.service.descriptor.Descriptor;
|
import org.alfresco.service.descriptor.Descriptor;
|
||||||
import org.alfresco.service.descriptor.DescriptorService;
|
import org.alfresco.service.descriptor.DescriptorService;
|
||||||
import org.alfresco.service.license.LicenseDescriptor;
|
import org.alfresco.service.license.LicenseDescriptor;
|
||||||
@@ -49,6 +50,7 @@ public class DescriptorStartupLog extends AbstractLifecycleBean
|
|||||||
|
|
||||||
// Dependencies
|
// Dependencies
|
||||||
private DescriptorService descriptorService;
|
private DescriptorService descriptorService;
|
||||||
|
private TenantService tenantService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param descriptorService Descriptor Service
|
* @param descriptorService Descriptor Service
|
||||||
@@ -58,6 +60,14 @@ public class DescriptorStartupLog extends AbstractLifecycleBean
|
|||||||
this.descriptorService = descriptorService;
|
this.descriptorService = descriptorService;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param tenantService Tenant Service
|
||||||
|
*/
|
||||||
|
public void setTenantService(TenantService tenantService)
|
||||||
|
{
|
||||||
|
this.tenantService = tenantService;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get Organisation from Principal
|
* Get Organisation from Principal
|
||||||
@@ -150,6 +160,12 @@ public class DescriptorStartupLog extends AbstractLifecycleBean
|
|||||||
Descriptor serverDescriptor = descriptorService.getServerDescriptor();
|
Descriptor serverDescriptor = descriptorService.getServerDescriptor();
|
||||||
Descriptor installedRepoDescriptor = descriptorService.getInstalledRepositoryDescriptor();
|
Descriptor installedRepoDescriptor = descriptorService.getInstalledRepositoryDescriptor();
|
||||||
String serverEdition = serverDescriptor.getEdition();
|
String serverEdition = serverDescriptor.getEdition();
|
||||||
|
|
||||||
|
if (tenantService.isEnabled())
|
||||||
|
{
|
||||||
|
serverEdition = serverEdition + " - Multi-Tenant";
|
||||||
|
}
|
||||||
|
|
||||||
String serverVersion = serverDescriptor.getVersion();
|
String serverVersion = serverDescriptor.getVersion();
|
||||||
int serverSchemaVersion = serverDescriptor.getSchema();
|
int serverSchemaVersion = serverDescriptor.getSchema();
|
||||||
String installedRepoVersion = installedRepoDescriptor.getVersion();
|
String installedRepoVersion = installedRepoDescriptor.getVersion();
|
||||||
|
@@ -180,6 +180,9 @@ public class MultiTAdminServiceImpl extends AbstractLifecycleBean implements Ten
|
|||||||
// bootstrap Tenant Service internal cache
|
// bootstrap Tenant Service internal cache
|
||||||
List<Tenant> tenants = getAllTenants();
|
List<Tenant> tenants = getAllTenants();
|
||||||
|
|
||||||
|
int enabledCount = 0;
|
||||||
|
int disabledCount = 0;
|
||||||
|
|
||||||
if (tenants != null)
|
if (tenants != null)
|
||||||
{
|
{
|
||||||
for (Tenant tenant : tenants)
|
for (Tenant tenant : tenants)
|
||||||
@@ -188,11 +191,13 @@ public class MultiTAdminServiceImpl extends AbstractLifecycleBean implements Ten
|
|||||||
{
|
{
|
||||||
// this will also call tenant deployers registered so far ...
|
// this will also call tenant deployers registered so far ...
|
||||||
enableTenant(tenant.getTenantDomain(), true);
|
enableTenant(tenant.getTenantDomain(), true);
|
||||||
|
enabledCount++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// explicitly disable, without calling disableTenant callback
|
// explicitly disable, without calling disableTenant callback
|
||||||
disableTenant(tenant.getTenantDomain(), false);
|
disableTenant(tenant.getTenantDomain(), false);
|
||||||
|
disabledCount++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -200,6 +205,12 @@ public class MultiTAdminServiceImpl extends AbstractLifecycleBean implements Ten
|
|||||||
}
|
}
|
||||||
|
|
||||||
userTransaction.commit();
|
userTransaction.commit();
|
||||||
|
|
||||||
|
if (logger.isInfoEnabled())
|
||||||
|
{
|
||||||
|
logger.info(String.format("Alfresco Multi-Tenant startup - %d enabled tenants, %d disabled tenants",
|
||||||
|
enabledCount, disabledCount));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch(Throwable e)
|
catch(Throwable e)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user