/** * Gets name task executed by current thread. * * @return Task name or {@code null} if security is disabled. */ public String currentTaskName() { if (!ctx.security().enabled()) return null; GridComputeTaskSession ses = currentSess.get(); if (ses == null) return null; return ses.getTaskName(); }
/** {@inheritDoc} */ @Override public GridNode failover(GridFailoverContext ctx, List<GridNode> top) { U.warn(log, "Returning 'null' node for failed job (failover will not happen) [job=" + ctx.getJobResult().getJob() + ", task=" + ctx.getTaskSession().getTaskName() + ", sessionId=" + ctx.getTaskSession().getId() + ']'); return null; }
/** {@inheritDoc} */ @Override public boolean cancel() throws GridException { ctx.security().authorize(ses.getTaskName(), GridSecurityPermission.TASK_CANCEL, null); checkValid(); if (onCancelled()) { ctx.task().onCancelled(ses.getId()); return true; } return isCancelled(); }
", job=" + ctx.getJobResult().getJob() + ", jobCtx=" + ctx.getJobResult().getJobContext() + ", task=" + ctx.getTaskSession().getTaskName() + ']');
", job=" + ctx.getJobResult().getJob() + ", jobCtx=" + ctx.getJobResult().getJobContext() + ", task=" + ctx.getTaskSession().getTaskName() + ']'); ", job=" + ctx.getJobResult().getJob() + ", jobCtx=" + ctx.getJobResult().getJobContext() + ", task=" + ctx.getTaskSession().getTaskName() + ']');