mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
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
This commit is contained in:
@@ -6,8 +6,7 @@
|
|||||||
|
|
||||||
<!-- ID Issuers. -->
|
<!-- ID Issuers. -->
|
||||||
|
|
||||||
<bean id="nodeIssuer" class="org.alfresco.repo.avm.Issuer"
|
<bean id="nodeIssuer" class="org.alfresco.repo.avm.Issuer" depends-on="avmDAOs" >
|
||||||
depends-on="avmDAOs" init-method="init">
|
|
||||||
<property name="name">
|
<property name="name">
|
||||||
<value>node</value>
|
<value>node</value>
|
||||||
</property>
|
</property>
|
||||||
@@ -16,8 +15,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="layerIssuer" class="org.alfresco.repo.avm.Issuer"
|
<bean id="layerIssuer" class="org.alfresco.repo.avm.Issuer" depends-on="avmDAOs" >
|
||||||
depends-on="avmDAOs" init-method="init">
|
|
||||||
<property name="name">
|
<property name="name">
|
||||||
<value>layer</value>
|
<value>layer</value>
|
||||||
</property>
|
</property>
|
||||||
|
@@ -50,6 +50,16 @@
|
|||||||
</property>
|
</property>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
|
<!-- Bootstrap the AVM -->
|
||||||
|
<bean id="avmBootstrap" class="org.alfresco.repo.avm.AvmBootstrap" >
|
||||||
|
<property name="issuers">
|
||||||
|
<list>
|
||||||
|
<ref bean="nodeIssuer" />
|
||||||
|
<ref bean="layerIssuer" />
|
||||||
|
</list>
|
||||||
|
</property>
|
||||||
|
</bean>
|
||||||
|
|
||||||
<!-- Bootstrap Files -->
|
<!-- Bootstrap Files -->
|
||||||
|
|
||||||
<bean id="systemInfoBootstrap" parent="systemInfoImporter">
|
<bean id="systemInfoBootstrap" parent="systemInfoImporter">
|
||||||
|
@@ -31,7 +31,7 @@
|
|||||||
</bean>
|
</bean>
|
||||||
<bean id="sessionFactoryBase" abstract="true">
|
<bean id="sessionFactoryBase" abstract="true">
|
||||||
<property name="schemaUpdate">
|
<property name="schemaUpdate">
|
||||||
<value>true</value>
|
<value>false</value>
|
||||||
</property>
|
</property>
|
||||||
<property name="mappingResources">
|
<property name="mappingResources">
|
||||||
<list>
|
<list>
|
||||||
@@ -58,7 +58,7 @@
|
|||||||
<!-- from elsewhere -->
|
<!-- from elsewhere -->
|
||||||
<!-- -->
|
<!-- -->
|
||||||
<value>org/jbpm/graph/action/Script.hbm.xml</value>
|
<value>org/jbpm/graph/action/Script.hbm.xml</value>
|
||||||
<value>org/jbpm/db/hibernate.queries.hbm.xml</value>
|
<value>org/jbpm/db/hibernate.queries.hbm.xml</value>
|
||||||
<value>org/jbpm/graph/def/ProcessDefinition.hbm.xml</value>
|
<value>org/jbpm/graph/def/ProcessDefinition.hbm.xml</value>
|
||||||
<value>org/jbpm/graph/def/Node.hbm.xml</value>
|
<value>org/jbpm/graph/def/Node.hbm.xml</value>
|
||||||
<value>org/jbpm/graph/def/Transition.hbm.xml</value>
|
<value>org/jbpm/graph/def/Transition.hbm.xml</value>
|
||||||
|
72
source/java/org/alfresco/repo/avm/AvmBootstrap.java
Normal file
72
source/java/org/alfresco/repo/avm/AvmBootstrap.java
Normal file
@@ -0,0 +1,72 @@
|
|||||||
|
/*
|
||||||
|
* 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
|
||||||
|
}
|
||||||
|
}
|
@@ -65,7 +65,7 @@ public class Issuer
|
|||||||
/**
|
/**
|
||||||
* After the database is up, get our value.
|
* After the database is up, get our value.
|
||||||
*/
|
*/
|
||||||
public void init()
|
public void initialize()
|
||||||
{
|
{
|
||||||
class TxnWork implements TransactionUtil.TransactionWork<Long>
|
class TxnWork implements TransactionUtil.TransactionWork<Long>
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user