@RolesAllowed("user") @Transactional(readOnly = false) public void closeShare(long shareId) { final String uuid = idToUuid(shareId); Future<Object> future = executor.submit(new Callable<Object>() { public Object call() throws Exception { sessionManager.close(uuid); return null; } }); executor.get(future); }
@RolesAllowed( { "user", "guest" }) public int closeSession(@NotNull final Session session) { Future<Integer> future = ex.submit(new Callable<Integer>(){ public Integer call() throws Exception { return mgr.close(session.getUuid()); }}); return ex.get(future); }
@RolesAllowed( { "user", "guest" }) public Session updateSession(@NotNull final Session session) { Future<Session> future = ex.submit(new Callable<Session>(){ public Session call() throws Exception { return mgr.update(session); }}); return ex.get(future); }
@RolesAllowed("user") public java.util.List<Session> getMyOpenSessions() { final String uuid = currentContext().getCurrentSessionUuid(); Future<List<Session>> future = ex.submit(new Callable<List<Session>>(){ public List<Session> call() throws Exception { return mgr.findSameUser(uuid); }}); return ex.get(future); }
@RolesAllowed("user") public java.util.List<Session> getMyOpenAgentSessions(final String agent) { final String uuid = currentContext().getCurrentSessionUuid(); Future<List<Session>> future = ex.submit(new Callable<List<Session>>(){ public List<Session> call() throws Exception { return mgr.findSameUser(uuid, agent); }}); return ex.get(future); }
@RolesAllowed("user") public java.util.List<Session> getMyOpenClientSessions() { final String uuid = currentContext().getCurrentSessionUuid(); Future<List<Session>> future = ex.submit(new Callable<List<Session>>(){ public List<Session> call() throws Exception { return mgr.findSameUser(uuid, "OMERO.insight", "OMERO.web", "OMERO.importer"); }}); return ex.get(future); }
public EventContext reload(final String uuid) { final SessionContext ctx = cache.getSessionContext(uuid); if (ctx == null) { throw new RemovedSessionException("No session with uuid:" + uuid); } Future<Object> future = executor.submit(Priority.SYSTEM, new Callable<Object>(){ public Object call() throws Exception { cache.reload(uuid); return null; }}); // A freshly loaded session should now have been saved // as if it had been reloaded during synchronization. executor.get(future); return cache.getSessionContext(uuid); }
executor.submit(priority, current.ctx, Executors.callable(handle)); __cb.ice_response(prx); } catch (Throwable e) {
final Long user = ec.getCurrentUserId(); final Long group = ec.getCurrentGroupId(); final Future<Share> future = executor.submit(new Callable<Share>() { public Share call() throws Exception { return sessionManager.createShare(new Principal(omename),
/** * Called in the main server (Blitz-0) in order to create a PIXELDATA * {@link EventLog} which will get processed by PixelData-0. */ public void onApplicationEvent(final MissingPyramidMessage mpm) { if (readOnly.isReadOnlyDb()) { log.debug("Ignored: " + mpm); return; } log.info("Received: " + mpm); // #5232. If this is called without an active event, then throw // an exception since a call to Executor should wrap whatever the // invoker is doing. final CurrentDetails cd = executor.getContext().getBean(CurrentDetails.class); if (cd.size() <= 0) { throw new InternalException("Not logged in."); } final EventContext ec = cd.getCurrentEventContext(); if (null == ec.getCurrentUserId()) { throw new InternalException("No user! Must be wrapped by call to Executor?"); } Future<EventLog> future = this.executor.submit(cd.getContext(), new Callable<EventLog>(){ public EventLog call() throws Exception { return makeEvent(ec, mpm); }}); this.executor.get(future); }
@RolesAllowed("system") public void indexObject(IObject row) { if (row == null || row.getId() == null) { throw new ValidationException( "Non-managed object cannot be indexed."); } CreationLogLoader logs = new CreationLogLoader(localQuery, row); FullTextIndexer fti = new FullTextIndexer(logs); fti.setApplicationContext(this.executor.getContext()); final FullTextThread ftt = new FullTextThread(sessionManager, executor, fti, this.fullTextBridge, true); Future<Object> future = executor.submit(Executors.callable(ftt)); executor.get(future); }
Future<Session> future = ex.submit(new Callable<Session>(){ public Session call() throws Exception { SessionManager.CreationRequest req = new SessionManager.CreationRequest();
Future<Session> future = ex.submit(new Callable<Session>(){ public Session call() throws Exception { final CreationRequest req = new CreationRequest();