Guest User

Untitled

a guest
Nov 19th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. Map<String, TaskFactory> taskRegistry = new HashMap<String, TaskFactory>();
  2. taskRegistry.put(CommandTask.NAME, new TaskFactory() {
  3. @Override
  4. public Task createNewTask(TaskCallbackContext context) {
  5. return new CommandTask(context);
  6. }
  7. });
  8. taskRegistry.put(DataCollectingTask.NAME, new TaskFactory() {
  9. @Override
  10. public Task createNewTask(TaskCallbackContext context) {
  11. return new DataCollectingTask(context);
  12. }
  13. });
  14. taskRegistry.put(DataPushingTask.NAME, new TaskFactory() {
  15. @Override
  16. public Task createNewTask(TaskCallbackContext context) {
  17. return new DataPushingTask(context);
  18. }
  19. });
  20.  
  21. machineEngine.registerStateModelFactory("Task", new TaskStateModelFactory(zkHelixManager, taskRegistry));
Add Comment
Please, Sign In to add comment