1 17 package org.alfresco.repo.transaction; 18 19 import org.alfresco.error.AlfrescoRuntimeException; 20 import org.alfresco.repo.node.db.NodeDaoService; 21 import org.aopalliance.intercept.MethodInterceptor; 22 import org.aopalliance.intercept.MethodInvocation; 23 import org.springframework.beans.factory.InitializingBean; 24 25 34 public class NodeDaoServiceTransactionInterceptor implements MethodInterceptor, InitializingBean 35 { 36 private NodeDaoService nodeDaoService; 37 38 41 public void setNodeDaoService(NodeDaoService nodeDaoService) 42 { 43 this.nodeDaoService = nodeDaoService; 44 } 45 46 49 public void afterPropertiesSet() throws Exception 50 { 51 if (nodeDaoService == null) 52 { 53 throw new AlfrescoRuntimeException("NodeDaoService is required: " + this); 54 } 55 } 56 57 public Object invoke(MethodInvocation invocation) throws Throwable 58 { 59 AlfrescoTransactionSupport.bindNodeDaoService(nodeDaoService); 60 return invocation.proceed(); 62 } 63 } 64 | Popular Tags |