From 63680c700ff81fd9d84ce3df469cd0f2d4b0191c Mon Sep 17 00:00:00 2001 From: Britt Park Date: Tue, 19 Jun 2007 19:03:10 +0000 Subject: [PATCH] AVMNodeService now points at AVMLockingAwareService. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6023 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- config/alfresco/bootstrap-context.xml | 3 +++ config/alfresco/node-services-context.xml | 2 +- config/alfresco/public-services-context.xml | 11 ++------ .../repo/avm/AVMLockingAwareService.java | 27 +++++++++++-------- .../org/alfresco/repo/avm/AvmBootstrap.java | 8 ++++++ 5 files changed, 30 insertions(+), 21 deletions(-) diff --git a/config/alfresco/bootstrap-context.xml b/config/alfresco/bootstrap-context.xml index 7f548934bf..1367f47190 100644 --- a/config/alfresco/bootstrap-context.xml +++ b/config/alfresco/bootstrap-context.xml @@ -67,6 +67,9 @@ + + + diff --git a/config/alfresco/node-services-context.xml b/config/alfresco/node-services-context.xml index 542e20757f..250c540929 100644 --- a/config/alfresco/node-services-context.xml +++ b/config/alfresco/node-services-context.xml @@ -73,7 +73,7 @@ - + diff --git a/config/alfresco/public-services-context.xml b/config/alfresco/public-services-context.xml index 178f7bd714..2a57798381 100644 --- a/config/alfresco/public-services-context.xml +++ b/config/alfresco/public-services-context.xml @@ -751,15 +751,8 @@ - - - - - - - - - + diff --git a/source/java/org/alfresco/repo/avm/AVMLockingAwareService.java b/source/java/org/alfresco/repo/avm/AVMLockingAwareService.java index 53cf50dcf4..4e8c7267f4 100644 --- a/source/java/org/alfresco/repo/avm/AVMLockingAwareService.java +++ b/source/java/org/alfresco/repo/avm/AVMLockingAwareService.java @@ -49,12 +49,15 @@ import org.alfresco.service.cmr.repository.ContentWriter; import org.alfresco.service.cmr.security.AuthenticationService; import org.alfresco.service.namespace.QName; 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. * @author britt */ -public class AVMLockingAwareService implements AVMService +public class AVMLockingAwareService implements AVMService, ApplicationContextAware { private AVMService fService; @@ -62,25 +65,27 @@ public class AVMLockingAwareService implements AVMService private AuthenticationService fAuthenticationService; + private ApplicationContext fContext; + 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) * @see org.alfresco.service.cmr.avm.AVMService#addAspect(java.lang.String, org.alfresco.service.namespace.QName) */ diff --git a/source/java/org/alfresco/repo/avm/AvmBootstrap.java b/source/java/org/alfresco/repo/avm/AvmBootstrap.java index 8cf1b6c59d..0782a1dae1 100644 --- a/source/java/org/alfresco/repo/avm/AvmBootstrap.java +++ b/source/java/org/alfresco/repo/avm/AvmBootstrap.java @@ -44,10 +44,17 @@ public class AvmBootstrap extends AbstractLifecycleBean { private List issuers; + private AVMLockingAwareService avmLockingAwareService; + public AvmBootstrap() { issuers = new ArrayList(0); } + + public void setAvmLockingAwareService(AVMLockingAwareService service) + { + avmLockingAwareService = service; + } /** * Provide a list of {@link Issuer issuers} to bootstrap on context initialization. @@ -69,6 +76,7 @@ public class AvmBootstrap extends AbstractLifecycleBean { issuer.initialize(); } + avmLockingAwareService.init(); } /** NO-OP */