com.github.dynamicextensionsalfresco.aop.TransactionalAdvice Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of annotations-runtime Show documentation
Show all versions of annotations-runtime Show documentation
Adds an OSGi container to alfresco repository supporting dynamic code reloading, classpath isolation and a bunch of other useful features
package com.github.dynamicextensionsalfresco.aop;
import com.github.dynamicextensionsalfresco.annotations.Transactional;
import org.alfresco.repo.transaction.RetryingTransactionHelper;
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;
import org.springframework.core.annotation.AnnotationUtils;
import org.springframework.util.Assert;
/**
* Provides advice for {@link Transactional}-annotated methods.
*
* This implementation invokes {@link Transactional} operations within a {@link RetryingTransactionCallback}
*
* @author Laurens Fridael
*
*/
public class TransactionalAdvice implements MethodInterceptor {
/* Dependencies */
private RetryingTransactionHelper retryingTransactionHelper;
/* Main operations */
@Override
public Object invoke(final MethodInvocation invocation) throws Throwable {
final Transactional transactional = AnnotationUtils.findAnnotation(invocation.getMethod(), Transactional.class);
return getRetryingTransactionHelper().doInTransaction(new RetryingTransactionCallback
© 2015 - 2025 Weber Informatics LLC | Privacy Policy