Derek Hulley b37ec12379 Fix AR-1208
- Issuers were using Spring init to load data.  The Hibernate database auto-update was switch on and this bypassed the SchemaBootstrap.
 - Added an AvmBootstrap bean for initializing AVM components that require DB interaction


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5042 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2007-02-05 17:23:09 +00:00

73 lines
1.8 KiB
Java

/*
* Copyright (C) 2006 Alfresco, Inc.
*
* Licensed under the Mozilla Public License version 1.1
* with a permitted attribution clause. You may obtain a
* copy of the License at
*
* http://www.alfresco.org/legal/license.txt
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific
* language governing permissions and limitations under the
* License.
*/
package org.alfresco.repo.avm;
import java.util.ArrayList;
import java.util.List;
import org.alfresco.util.AbstractLifecycleBean;
import org.springframework.context.ApplicationEvent;
/**
* This component ensures that the AVM system is properly bootstrapped
* and that this is done in the correct order relative to other
* bootstrap components.
*
* @see #setIssuers(List)
* @see org.alfresco.repo.avm.Issuer
*
* @author Derek Hulley
*/
public class AvmBootstrap extends AbstractLifecycleBean
{
private List<Issuer> issuers;
public AvmBootstrap()
{
issuers = new ArrayList<Issuer>(0);
}
/**
* Provide a list of {@link Issuer issuers} to bootstrap on context initialization.
*
* @see #onBootstrap(ApplicationEvent)
*/
public void setIssuers(List<Issuer> issuers)
{
this.issuers = issuers;
}
/**
* Initialize the issuers.
*/
@Override
protected void onBootstrap(ApplicationEvent event)
{
for (Issuer issuer : issuers)
{
issuer.initialize();
}
}
/** NO-OP */
@Override
protected void onShutdown(ApplicationEvent event)
{
// Nothing
}
}