com.inteligr8.alfresco.annotations.TransactionalRetryable Maven / Gradle / Ivy
The newest version!
package com.inteligr8.alfresco.annotations;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.alfresco.repo.transaction.RetryingTransactionHelper;
/**
* This annotation tells the framework to wrap the annotated method inside an
* ACS API retryable transaction. This may be used in conjunction with the
* Spring Transactional annotation.
*
* @see org.springframework.transaction.annotation.Transactional
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface TransactionalRetryable {
/**
* @return A number of retries; -1 for ACS API default (unlimited).
* @see RetryingTransactionHelper#setMaxRetries(int)
*/
int maxRetries() default -1;
/**
* @return A minimum number of milliseconds to wait between retries; -1 for ACS API default (200 ms).
* @see RetryingTransactionHelper#setMinRetryWaitMs(int)
*/
int minRetryWaitInMillis() default -1;
/**
* @return A maximum number of milliseconds to wait between retries; -1 for ACS API default (2000 ms).
* @see RetryingTransactionHelper#setMaxRetryWaitMs(int)
*/
int maxRetryWaitInMillis() default -1;
/**
* @return A number of milliseconds to progressively add to the wait after each attempt; -1 for ACS API default (100 ms).
* @see RetryingTransactionHelper#setRetryWaitIncrementMs(int)
*/
int incRetryWaitInMillis() default -1;
}