vpro / magnolia-context-annotations

Provides java annotation for executing in system context

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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>

About

Provides java annotation for executing in system context

License:GNU General Public License v3.0


Languages

Language:Java 100.0%