diff --git a/config/alfresco/core-services-context.xml b/config/alfresco/core-services-context.xml index f604ca354a..d6c8098ce7 100644 --- a/config/alfresco/core-services-context.xml +++ b/config/alfresco/core-services-context.xml @@ -1104,7 +1104,7 @@ - + false diff --git a/source/java/org/alfresco/repo/management/subsystems/ChildApplicationContextFactory.java b/source/java/org/alfresco/repo/management/subsystems/ChildApplicationContextFactory.java index fa25d1f72c..5004f6f0ea 100644 --- a/source/java/org/alfresco/repo/management/subsystems/ChildApplicationContextFactory.java +++ b/source/java/org/alfresco/repo/management/subsystems/ChildApplicationContextFactory.java @@ -293,7 +293,7 @@ public class ChildApplicationContextFactory extends AbstractPropertyBackedBean i @Override protected PropertyBackedBeanState createInitialState() throws IOException { - return new ApplicationContextState(); + return new ApplicationContextState(false); } /* @@ -565,7 +565,8 @@ public class ChildApplicationContextFactory extends AbstractPropertyBackedBean i */ protected class ApplicationContextState implements PropertyBackedBeanState { - + private boolean allowInitAccess = false; + /** The properties to be used in placeholder expansion. */ private Properties properties; @@ -584,8 +585,9 @@ public class ChildApplicationContextFactory extends AbstractPropertyBackedBean i * @throws IOException * Signals that an I/O exception has occurred. */ - protected ApplicationContextState() throws IOException + protected ApplicationContextState(boolean allowInitAccess ) throws IOException { + this.allowInitAccess = allowInitAccess; // Load the property defaults PropertiesFactoryBean factory = new PropertiesFactoryBean(); factory.setPropertiesPersister(getPersister()); @@ -800,6 +802,10 @@ public class ChildApplicationContextFactory extends AbstractPropertyBackedBean i try { + if(allowInitAccess) + { + this.applicationContext = applicationContext; + } applicationContext.refresh(); this.applicationContext = applicationContext; ChildApplicationContextFactory.logger.info("Startup of '" + getCategory() + "' subsystem, ID: " diff --git a/source/java/org/alfresco/repo/management/subsystems/LuceneChildApplicationContextFactory.java b/source/java/org/alfresco/repo/management/subsystems/LuceneChildApplicationContextFactory.java new file mode 100644 index 0000000000..38eedca811 --- /dev/null +++ b/source/java/org/alfresco/repo/management/subsystems/LuceneChildApplicationContextFactory.java @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2005-2013 Alfresco Software Limited. + * + * This file is part of Alfresco + * + * Alfresco is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Alfresco is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Alfresco. If not, see . + */ +package org.alfresco.repo.management.subsystems; + +import java.io.IOException; + +/** + * @author Andy + * + */ +public class LuceneChildApplicationContextFactory extends ChildApplicationContextFactory +{ + + /* (non-Javadoc) + * @see org.alfresco.repo.management.subsystems.ChildApplicationContextFactory#createInitialState() + */ + @Override + protected PropertyBackedBeanState createInitialState() throws IOException + { + return new ApplicationContextState(true); + } + + +}