}
if (LOG.isDebugEnabled())
{
LOG.debug("The configuration file of the DistributedCacheManager will be loaded from " + configurationFile);
}
final TemplateConfigurationHelper helper =
new TemplateConfigurationHelper(new String[]{"^.*"}, new String[]{}, configManager);
if (LOG.isDebugEnabled() && parameters != null && !parameters.isEmpty())
{
LOG.debug("The parameters to use while processing the configuration file are " + parameters);
}
return SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<EmbeddedCacheManager>()
{
public EmbeddedCacheManager run() throws Exception
{
ParserRegistry parser = new ParserRegistry(Thread.currentThread().getContextClassLoader());
// Load the configuration
ConfigurationBuilderHolder holder = parser.parse(helper.fillTemplate(configurationFile, parameters));
GlobalConfigurationBuilder configBuilder = holder.getGlobalConfigurationBuilder();
Utils.loadJGroupsConfig(configManager, configBuilder.build(), configBuilder);
// Create the CacheManager from the new configuration
EmbeddedCacheManager manager =
new DefaultCacheManager(configBuilder.build(), holder.getDefaultConfigurationBuilder().build());