Skip to content

Latest commit

 

History

History
47 lines (35 loc) · 1.4 KB

README.adoc

File metadata and controls

47 lines (35 loc) · 1.4 KB

magnolia-context-annotations

Build Status Maven Central javadoc

Provides java annotation for executing in system context

Usage

After installing this module in your magnolia deployment (taking the maven dependency is enough), you can do in stead of

@Override
public String stuff() {
   return MgnlContext.doInSystemContext((MgnlContext.Op<String, Throwable>)
        () -> actualStuff());
}
@Override
@MgnlSystemContext
public String stuff() {
   return actualStuff();
}

It’s a bit like javax.transaction.Transactional

The annotation can also be used at class level, so you can quite easily mark all methods of a complete utility class to be executed in system context.

Installation

<dependency>
  <groupId>nl.vpro</groupId>
  <artifactId>magnolia-context-annotations</artifactId>
  <version>1.3.0</version>
</dependency>