Skip to content

Instantly share code, notes, and snippets.

@DImuthuUpe
Created November 17, 2017 03:00
Show Gist options
  • Save DImuthuUpe/872c432935b8d33944dd571b3ac4207b to your computer and use it in GitHub Desktop.
Save DImuthuUpe/872c432935b8d33944dd571b3ac4207b to your computer and use it in GitHub Desktop.
Map<String, TaskFactory> taskRegistry = new HashMap<String, TaskFactory>();
/*
taskRegistry.put(CommandTask.NAME, new TaskFactory() {
@Override
public Task createNewTask(TaskCallbackContext context) {
return new CommandTask(context);
}
});
*/
/*
taskRegistry.put(DataCollectingTask.NAME, new TaskFactory() {
@Override
public Task createNewTask(TaskCallbackContext context) {
return new DataCollectingTask(context);
}
});
*/
taskRegistry.put(DataPushingTask.NAME, new TaskFactory() {
@Override
public Task createNewTask(TaskCallbackContext context) {
return new DataPushingTask(context);
}
});
machineEngine.registerStateModelFactory("Task", new TaskStateModelFactory(zkHelixManager, taskRegistry));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment