Examples of TaskExeception


Examples of org.japura.task.TaskExeception

    taskExecutionUI = taskExecutionUIs.get(task.getId());
    } else if (TaskManagerEvent.AFTER_EXECUTE.equals(event)) {
    taskExecutionUI = taskExecutionUIs.remove(task.getId());
    }
  } catch (Exception e) {
    Application.getHandlerExceptionManager().handle(new TaskExeception(e));
  }

  if (taskExecutionUI == null) {
    taskExecutionUI = getTaskExecutionUI();
  }
View Full Code Here

Examples of org.japura.task.TaskExeception

      } else if (TaskManagerEvent.SUBMITTED.equals(event)) {
        taskExecutionUI.submitted(uievent);
      }
      } catch (Exception e) {
      Application.getHandlerExceptionManager().handle(
        new TaskExeception(e));
      }
    }
    });

  }
View Full Code Here

Examples of org.japura.task.TaskExeception

  @Override
  public void submitNestedTask(Task... tasks) {
  for (Task task : tasks) {
    if (task.getParentId() == null) {
    throw new TaskExeception("The nested task " + task.getClass().getName()
      + " has not been submitted through a parent task.");
    }
  }

  submit(Type.NESTED, null, tasks);
View Full Code Here

Examples of org.japura.task.TaskExeception

    return;
  }

  for (Task task : tasks) {
    if (task == null) {
    throw new TaskExeception("Task is NULL");
    }

    // TODO verificar outros status

    if (task.getStatus().equals(TaskStatus.SUBMITTED)) {
    throw new TaskExeception("The task " + task.toString()
      + " has already been submitted");
    }
    if (task.getStatus().equals(TaskStatus.EXECUTING)) {
    throw new TaskExeception("The task " + task.toString()
      + " is executing");
    }
  }

  if (type.equals(Type.NESTED)) {
    long currentThreadId = Thread.currentThread().getId();

    if (this.serialExecutor.getCurrentThreadIdExecution() == null
      || this.serialExecutor.getCurrentThreadIdExecution().longValue() != currentThreadId) {
    // TODO msg
    throw new TaskExeception("");
    }
  }

  if (type.equals(Type.NESTED)) {
    session = this.serialExecutor.getCurrentTaskSession();
View Full Code Here

Examples of org.japura.task.TaskExeception

  }

  public void addNestedTask(Task task) {
  if (finished) {
    // TODO f
    throw new TaskExeception("");
  }
  if (this.cancelToken.isCanceled()) {
    // TODO f
    throw new TaskExeception("");
  }
  int index = queueTasks.size() - 1;
  while (index > -1) {
    Task qt = queueTasks.get(index);
    if (qt.getParentId() != null
View Full Code Here

Examples of org.japura.task.TaskExeception

  long currentThreadId = Thread.currentThread().getId();
  if (runnable == null || runnable.getThreadId() == null
    || runnable.getThreadId().longValue() != currentThreadId) {
    // TODO msg
    throw new TaskExeception("");
  }

  // TODO verificar se task possui parent aqui tb?

  TaskSessionWrapper w = runnable.getTaskSessionWrapper();
View Full Code Here

Examples of org.japura.task.TaskExeception

      sb.append("Tasks with different sessions: ");
      for (Class<? extends TaskSession> clss : sessionClasses) {
      sb.append(clss.getName());
      sb.append(" ");
      }
      throw new TaskExeception(sb.toString());
    }
    }
  }

  return new TaskSession();
View Full Code Here

Examples of org.japura.task.TaskExeception

  private TaskSession buildTaskSession(Class<? extends TaskSession> clss) {
  if (clss != null) {
    try {
    return (TaskSession) clss.newInstance();
    } catch (Exception e) {
    throw new TaskExeception(e);
    }
  }
  return null;
  }
View Full Code Here

Examples of org.japura.task.TaskExeception

  return false;
  }

  public static void checkSession(Task task, TaskSession session) {
  if (session == null) {
    throw new TaskExeception("NULL TaskSession");
  }

  SessionRequired sr = task.getClass().getAnnotation(SessionRequired.class);
  if (sr != null && session.getClass().equals(sr.sessionClass()) == false) {
    throw new TaskExeception("Task '" + task.getClass().getName()
      + "' requires the session class '" + sr.sessionClass()
      + "' but is using '" + session.getClass() + "'");
  }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.