1 package org
.argeo
.security
.jcr
;
3 import java
.util
.concurrent
.Callable
;
5 import javax
.jcr
.Session
;
7 import org
.argeo
.ArgeoException
;
8 import org
.argeo
.jcr
.spring
.ThreadBoundSession
;
9 import org
.argeo
.security
.SystemExecutionService
;
11 /** Thread bounded JCR session which logins as system authentication. */
12 public class SystemSession
extends ThreadBoundSession
{
13 private SystemExecutionService systemExecutionService
;
16 protected Session
login() {
18 return systemExecutionService
.submit(new Callable
<Session
>() {
19 public Session
call() throws Exception
{
20 return SystemSession
.super.login();
23 } catch (Exception e
) {
24 throw new ArgeoException(
25 "Cannot login to JCR with system authentication", e
);
29 public void setSystemExecutionService(
30 SystemExecutionService systemExecutionService
) {
31 this.systemExecutionService
= systemExecutionService
;