Search in sources :

Example 1 with TaskContext

use of com.enonic.xp.impl.task.distributed.TaskContext in project xp by enonic.

the class TaskRunnable method newContext.

private Context newContext() {
    final TaskContext taskContext = runnableTask.getTaskContext();
    final ContextBuilder context = ContextBuilder.create().authInfo(taskContext.getAuthInfo()).branch(taskContext.getBranch()).repositoryId(taskContext.getRepo());
    if (taskContext.getContentRootPath() != null) {
        context.attribute(CONTENT_ROOT_PATH_ATTRIBUTE, taskContext.getContentRootPath());
    }
    return context.build();
}
Also used : TaskContext(com.enonic.xp.impl.task.distributed.TaskContext) ContextBuilder(com.enonic.xp.context.ContextBuilder)

Aggregations

ContextBuilder (com.enonic.xp.context.ContextBuilder)1 TaskContext (com.enonic.xp.impl.task.distributed.TaskContext)1