/activeobjects-core/src/main/java/com/atlassian/activeobjects/tx/Transactional.java

https://bitbucket.org/activeobjects/ao-plugin · Java · 30 lines · 16 code · 4 blank · 10 comment · 0 complexity · dcca2170032b6fd8b6f873e6f62cadc4 MD5 · raw file

  1. package com.atlassian.activeobjects.tx;
  2. import com.atlassian.activeobjects.external.TransactionalAnnotationProcessor;
  3. import org.springframework.beans.factory.config.BeanPostProcessor;
  4. import java.lang.annotation.Documented;
  5. import java.lang.annotation.Inherited;
  6. import java.lang.annotation.Retention;
  7. import java.lang.annotation.Target;
  8. import static java.lang.annotation.ElementType.METHOD;
  9. import static java.lang.annotation.ElementType.TYPE;
  10. import static java.lang.annotation.RetentionPolicy.RUNTIME;
  11. /**
  12. * <p>Annotating methods of an interface with this annotation will make those methods run within a transaction
  13. * provided by the host application.</p>
  14. * <p><strong>Note</strong> that in order for this annotation to be processed, one must declare the
  15. * {@link TransactionalAnnotationProcessor} as a component within their plugin.
  16. * This processor is a {@link BeanPostProcessor} which will only be able to handle classes instanciated as a
  17. * <a href="http://confluence.atlassian.com/display/PLUGINFRAMEWORK/Component+Plugin+Module">components</a>.</p>
  18. *
  19. * @see TransactionalAnnotationProcessor
  20. */
  21. @Retention(RUNTIME)
  22. @Target({TYPE, METHOD})
  23. @Inherited
  24. @Documented
  25. public @interface Transactional {
  26. }