Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ public class XarTestPipelineJob extends PipelineJob implements FileAnalysisJobSu
{
public static final String PROVIDER_NAME = "XarTestPipelineJob Provider";

private final String _location = PipelineJobService.LocationType.WebServer.name();
private TaskId _taskPipelineId;

private String _jobName;
Expand All @@ -88,7 +87,7 @@ private XarTestPipelineJob(Container c, User user, PipeRoot pipeRoot, String job
{
super(PROVIDER_NAME, new ViewBackgroundInfo(c, user, null), pipeRoot);

_taskPipelineId = getTaskIdForEngine(PipelineJobService.LocationType.WebServer.name());
_taskPipelineId = getTaskIdForEngine();
_webserverJobDir = getOrCreateBaseDir(c, jobName);
setLogFile(getOrCreateLogFile(c, jobName));

Expand Down Expand Up @@ -140,19 +139,19 @@ public TaskId getActiveTaskId()
//ensure this TaskFactory is registered:
try
{
TaskId taskFactoryId = getTaskFactoryId(_location);
TaskId taskFactoryId = getTaskFactoryId();
try
{
if (PipelineJobService.get().getTaskFactory(taskFactoryId) == null)
{
registerTaskPipeline(_location);
registerTaskPipeline();
}
}
catch (NullPointerException e)
{
//this indicates the TaskFactory has not been registered yet
getLogger().error("A NullPointerException was thrown in XarTestPipelineJob", e);
registerTaskPipeline(_location);
registerTaskPipeline();
}
}
catch (CloneNotSupportedException e)
Expand All @@ -163,24 +162,24 @@ public TaskId getActiveTaskId()
return super.getActiveTaskId();
}

private static TaskId getTaskIdForEngine(String location)
private static TaskId getTaskIdForEngine()
{
return new TaskId(XarTestPipelineJob.class, location);
return new TaskId(XarTestPipelineJob.class, PipelineJobService.LocationType.WebServer.name());
}

private static TaskId getTaskFactoryId(String location)
private static TaskId getTaskFactoryId()
{
return new TaskId(XarTestTaskFactory.class, location);
return new TaskId(XarTestTaskFactory.class, PipelineJobService.LocationType.WebServer.name());
}

public static void registerTaskPipeline(String location) throws CloneNotSupportedException
public static void registerTaskPipeline() throws CloneNotSupportedException
{
//first register TaskFactory
TaskId taskFactoryId = getTaskFactoryId(location);
PipelineJobService.get().addTaskFactory(new XarTestTaskFactory(taskFactoryId, location));
TaskId taskFactoryId = getTaskFactoryId();
PipelineJobService.get().addTaskFactory(new XarTestTaskFactory(taskFactoryId));

//then TaskPipeline
TaskId taskPipelineId = getTaskIdForEngine(location);
TaskId taskPipelineId = getTaskIdForEngine();
TaskFactory<?> xarFact = PipelineJobService.get().getTaskFactory(new TaskId(XarGeneratorId.class));
if (xarFact == null)
{
Expand Down Expand Up @@ -216,11 +215,11 @@ public String getDescription()

private static class XarTestTaskFactory extends AbstractTaskFactory<AbstractTaskFactorySettings, XarTestTaskFactory>
{
public XarTestTaskFactory(TaskId id, String location)
public XarTestTaskFactory(TaskId id)
{
super(id);

setLocation(location);
setLocation(PipelineJobService.LocationType.WebServer.name());
}

@Override
Expand Down