Task task = request.createTask(taskIdGenerator.incrementAndGet(), type, action, request.getParentTask(), headers); if (task == null) { return null; assert task.getParentTaskId().equals(request.getParentTask()) : "Request [ " + request + "] didn't preserve it parentTaskId"; if (logger.isTraceEnabled()) { logger.trace("register {} [{}] [{}] [{}]", task.getId(), type, action, task.getDescription());
/** * Returns the task object that should be used to keep track of the processing of the request. * * A request can override this method and return null to avoid being tracked by the task * manager. */ default Task createTask(long id, String type, String action, TaskId parentTaskId, Map<String, String> headers) { return new Task(id, type, action, getDescription(), parentTaskId, headers); }
/** * Set a reference to task that created this request. */ void setParentTask(TaskId taskId);
/** * Registers a task without parent task * <p> * Returns the task manager tracked task or null if the task doesn't support the task manager */ public Task register(String type, String action, TaskAwareRequest request) { Task task = request.createTask(taskIdGenerator.incrementAndGet(), type, action, request.getParentTask()); if (task == null) { return null; } assert task.getParentTaskId().equals(request.getParentTask()) : "Request [ " + request + "] didn't preserve it parentTaskId"; if (logger.isTraceEnabled()) { logger.trace("register {} [{}] [{}] [{}]", task.getId(), type, action, task.getDescription()); } if (task instanceof CancellableTask) { registerCancellableTask(task); } else { Task previousTask = tasks.put(task.getId(), task); assert previousTask == null; } return task; }
/** * Returns the task object that should be used to keep track of the processing of the request. * * A request can override this method and return null to avoid being tracked by the task * manager. */ default Task createTask(long id, String type, String action, TaskId parentTaskId) { return new Task(id, type, action, getDescription(), parentTaskId); }
/** * Set a reference to task that created this request. */ void setParentTask(TaskId taskId);
Task task = request.createTask(taskIdGenerator.incrementAndGet(), type, action, request.getParentTask(), headers); if (task == null) { return null; assert task.getParentTaskId().equals(request.getParentTask()) : "Request [ " + request + "] didn't preserve it parentTaskId"; if (logger.isTraceEnabled()) { logger.trace("register {} [{}] [{}] [{}]", task.getId(), type, action, task.getDescription());
/** * Returns the task object that should be used to keep track of the processing of the request. * * A request can override this method and return null to avoid being tracked by the task * manager. */ default Task createTask(long id, String type, String action, TaskId parentTaskId, Map<String, String> headers) { return new Task(id, type, action, getDescription(), parentTaskId, headers); }
/** * Set a reference to task that created this request. */ void setParentTask(TaskId taskId);
Task task = request.createTask(taskIdGenerator.incrementAndGet(), type, action, request.getParentTask(), headers); if (task == null) { return null; assert task.getParentTaskId().equals(request.getParentTask()) : "Request [ " + request + "] didn't preserve it parentTaskId"; if (logger.isTraceEnabled()) { logger.trace("register {} [{}] [{}] [{}]", task.getId(), type, action, task.getDescription());
/** * Returns the task object that should be used to keep track of the processing of the request. * * A request can override this method and return null to avoid being tracked by the task * manager. */ default Task createTask(long id, String type, String action, TaskId parentTaskId, Map<String, String> headers) { return new Task(id, type, action, getDescription(), parentTaskId, headers); }
/** * Set a reference to task that created this request. */ void setParentTask(TaskId taskId);