AVMNodeService now points at AVMLockingAwareService.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6023 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Britt Park 2007-06-19 19:03:10 +00:00
parent d8050806af
commit 63680c700f
5 changed files with 30 additions and 21 deletions

View File

@ -67,6 +67,9 @@
<ref bean="layerIssuer" /> <ref bean="layerIssuer" />
</list> </list>
</property> </property>
<property name="avmLockingAwareService">
<ref bean="avmLockingAwareService"/>
</property>
</bean> </bean>
<!-- Bootstrap AVM Locking Service. --> <!-- Bootstrap AVM Locking Service. -->

View File

@ -73,7 +73,7 @@
<ref bean="dictionaryService"/> <ref bean="dictionaryService"/>
</property> </property>
<property name="avmService"> <property name="avmService">
<ref bean="avmService"/> <ref bean="avmLockingAwareService"/>
</property> </property>
<property name="policyComponent"> <property name="policyComponent">
<ref bean="policyComponent"/> <ref bean="policyComponent"/>

View File

@ -751,15 +751,8 @@
<!-- The AVMLockingAwareService --> <!-- The AVMLockingAwareService -->
<bean id="avmLockingAwareService" class="org.alfresco.repo.avm.AVMLockingAwareService"> <bean id="avmLockingAwareService" class="org.alfresco.repo.avm.AVMLockingAwareService">
<property name="avmService"> <!-- Because of circular dependendencies, this bean's dependencies
<ref bean="avmService"/> are grabbed at bootstrap time. -->
</property>
<property name="avmLockingService">
<ref bean="avmLockingService"/>
</property>
<property name="authenticationService">
<ref bean="authenticationService"/>
</property>
</bean> </bean>
<bean id="AVMLockingAwareService" class="org.springframework.aop.framework.ProxyFactoryBean"> <bean id="AVMLockingAwareService" class="org.springframework.aop.framework.ProxyFactoryBean">

View File

@ -49,12 +49,15 @@ import org.alfresco.service.cmr.repository.ContentWriter;
import org.alfresco.service.cmr.security.AuthenticationService; import org.alfresco.service.cmr.security.AuthenticationService;
import org.alfresco.service.namespace.QName; import org.alfresco.service.namespace.QName;
import org.alfresco.util.Pair; import org.alfresco.util.Pair;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
/** /**
* An AVMLockingService aware implemantation of AVMService. * An AVMLockingService aware implemantation of AVMService.
* @author britt * @author britt
*/ */
public class AVMLockingAwareService implements AVMService public class AVMLockingAwareService implements AVMService, ApplicationContextAware
{ {
private AVMService fService; private AVMService fService;
@ -62,25 +65,27 @@ public class AVMLockingAwareService implements AVMService
private AuthenticationService fAuthenticationService; private AuthenticationService fAuthenticationService;
private ApplicationContext fContext;
public AVMLockingAwareService() public AVMLockingAwareService()
{ {
} }
public void setAvmService(AVMService service) /* (non-Javadoc)
* @see org.springframework.context.ApplicationContextAware#setApplicationContext(org.springframework.context.ApplicationContext)
*/
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException
{ {
fService = service; fContext = applicationContext;
} }
public void setAvmLockingService(AVMLockingService service) public void init()
{ {
fLockingService = service; fService = (AVMService)fContext.getBean("avmService");
fLockingService = (AVMLockingService)fContext.getBean("avmLockingService");
fAuthenticationService = (AuthenticationService)fContext.getBean("authenticationService");
} }
public void setAuthenticationService(AuthenticationService service)
{
fAuthenticationService = service;
}
/* (non-Javadoc) /* (non-Javadoc)
* @see org.alfresco.service.cmr.avm.AVMService#addAspect(java.lang.String, org.alfresco.service.namespace.QName) * @see org.alfresco.service.cmr.avm.AVMService#addAspect(java.lang.String, org.alfresco.service.namespace.QName)
*/ */

View File

@ -44,10 +44,17 @@ public class AvmBootstrap extends AbstractLifecycleBean
{ {
private List<Issuer> issuers; private List<Issuer> issuers;
private AVMLockingAwareService avmLockingAwareService;
public AvmBootstrap() public AvmBootstrap()
{ {
issuers = new ArrayList<Issuer>(0); issuers = new ArrayList<Issuer>(0);
} }
public void setAvmLockingAwareService(AVMLockingAwareService service)
{
avmLockingAwareService = service;
}
/** /**
* Provide a list of {@link Issuer issuers} to bootstrap on context initialization. * Provide a list of {@link Issuer issuers} to bootstrap on context initialization.
@ -69,6 +76,7 @@ public class AvmBootstrap extends AbstractLifecycleBean
{ {
issuer.initialize(); issuer.initialize();
} }
avmLockingAwareService.init();
} }
/** NO-OP */ /** NO-OP */