29
29
import ome .security .basic .LightAdminPrivileges ;
30
30
import ome .services .sessions .SessionManager .CreationRequest ;
31
31
import ome .services .util .Executor ;
32
+ import ome .services .util .Executor .Priority ;
32
33
import ome .system .Principal ;
33
34
34
35
import org .slf4j .Logger ;
@@ -94,7 +95,7 @@ public Session createUserSession(final long timeToLiveMs,
94
95
cd .size () > 0 ? cd .getContext ().get ("omero.agent" ) : null ;
95
96
try {
96
97
final Principal principal = principal (defaultGroup , user );
97
- Future <Session > future = ex .submit (new Callable <Session >(){
98
+ Future <Session > future = ex .submit (Priority . SYSTEM , new Callable <Session >(){
98
99
public Session call () throws Exception {
99
100
final CreationRequest req = new CreationRequest ();
100
101
req .principal = principal ;
@@ -153,7 +154,7 @@ public Session createSessionWithTimeouts(@NotNull final Principal principal,
153
154
final String agent =
154
155
cd .size () > 0 ? cd .getContext ().get ("omero.agent" ) : null ;
155
156
try {
156
- Future <Session > future = ex .submit (new Callable <Session >(){
157
+ Future <Session > future = ex .submit (Priority . SYSTEM , new Callable <Session >(){
157
158
public Session call () throws Exception {
158
159
SessionManager .CreationRequest req = new SessionManager .CreationRequest ();
159
160
req .principal = principal ;
@@ -213,7 +214,7 @@ public int getReferenceCount(@NotNull String sessionUuid) {
213
214
214
215
@ RolesAllowed ( { "user" , "guest" })
215
216
public Session updateSession (@ NotNull final Session session ) {
216
- Future <Session > future = ex .submit (new Callable <Session >(){
217
+ Future <Session > future = ex .submit (Priority . SYSTEM , new Callable <Session >(){
217
218
public Session call () throws Exception {
218
219
return mgr .update (session );
219
220
}});
@@ -222,7 +223,7 @@ public Session call() throws Exception {
222
223
223
224
@ RolesAllowed ( { "user" , "guest" })
224
225
public int closeSession (@ NotNull final Session session ) {
225
- Future <Integer > future = ex .submit (new Callable <Integer >(){
226
+ Future <Integer > future = ex .submit (Priority . SYSTEM , new Callable <Integer >(){
226
227
public Integer call () throws Exception {
227
228
return mgr .close (session .getUuid ());
228
229
}});
@@ -232,7 +233,7 @@ public Integer call() throws Exception {
232
233
@ RolesAllowed ("user" )
233
234
public java .util .List <Session > getMyOpenSessions () {
234
235
final String uuid = currentContext ().getCurrentSessionUuid ();
235
- Future <List <Session >> future = ex .submit (new Callable <List <Session >>(){
236
+ Future <List <Session >> future = ex .submit (Priority . SYSTEM , new Callable <List <Session >>(){
236
237
public List <Session > call () throws Exception {
237
238
return mgr .findSameUser (uuid );
238
239
}});
@@ -242,7 +243,7 @@ public List<Session> call() throws Exception {
242
243
@ RolesAllowed ("user" )
243
244
public java .util .List <Session > getMyOpenAgentSessions (final String agent ) {
244
245
final String uuid = currentContext ().getCurrentSessionUuid ();
245
- Future <List <Session >> future = ex .submit (new Callable <List <Session >>(){
246
+ Future <List <Session >> future = ex .submit (Priority . SYSTEM , new Callable <List <Session >>(){
246
247
public List <Session > call () throws Exception {
247
248
return mgr .findSameUser (uuid , agent );
248
249
}});
@@ -252,7 +253,7 @@ public List<Session> call() throws Exception {
252
253
@ RolesAllowed ("user" )
253
254
public java .util .List <Session > getMyOpenClientSessions () {
254
255
final String uuid = currentContext ().getCurrentSessionUuid ();
255
- Future <List <Session >> future = ex .submit (new Callable <List <Session >>(){
256
+ Future <List <Session >> future = ex .submit (Priority . SYSTEM , new Callable <List <Session >>(){
256
257
public List <Session > call () throws Exception {
257
258
return mgr .findSameUser (uuid , "OMERO.insight" ,
258
259
"OMERO.web" , "OMERO.importer" );
0 commit comments