Package ca.eandb.jdcp.remote

Examples of ca.eandb.jdcp.remote.JobService


    workerThread.start();

  }

  private JobService waitForService(String host, String username, String password, int retryInterval) {
    JobService service = null;
    while (true) {
      reconnectCountdown = 0;
      service = connect(host, username, password);
      if (service != null) {
        break;
View Full Code Here


    reconnectCountdown = -1;
    return service;
  }

  private JobService connect(String host, String username, String password) {
    JobService service = null;
    try {
      Registry registry = LocateRegistry.getRegistry(host, JdcpUtil.DEFAULT_PORT);
      AuthenticationService auth = (AuthenticationService) registry.lookup("AuthenticationService");
      service = auth.authenticate(username, password, JdcpUtil.PROTOCOL_VERSION_ID);
    } catch (NotBoundException e) {
View Full Code Here

      String host, String username, String password)
      throws SecurityException, RemoteException, ClassNotFoundException,
      JobExecutionException, LoginException, NotBoundException, ProtocolVersionException {

    Serialized<ParallelizableJob> payload = new Serialized<ParallelizableJob>(job);
    JobService service = connect(host, username, password);

    return service.submitJob(payload, description);

  }
View Full Code Here

  public static void registerTaskService(String name, TaskService taskService,
      String host, String username, String password)
      throws SecurityException, RemoteException, ClassNotFoundException,
      JobExecutionException, LoginException, NotBoundException, ProtocolVersionException {

    JobService service = connect(host, username, password);
    service.registerTaskService(name, taskService);

  }
View Full Code Here

  private interface ServiceOperation<T> {
    T run(JobService service) throws Exception;
  };

  private <T> T run(ServiceOperation<T> operation) throws DelegationException {
    JobService service = this.service;
    if (service != null) {
      try {
        if (logger.isInfoEnabled()) {
          logger.info(String.format("Running operation: %s", operation));
        }
View Full Code Here

    return connect(0);
  }

  private JobService connect(int timeout) {
    final ConnectionDialog dialog = getConnectionDialog();
    JobService service = null;
    boolean showMessages = true;
    do {
      if (MainWindow.this.isVisible()) {
        dialog.setTimeout(timeout);
        try {
View Full Code Here

        SwingUtilities.invokeLater(new Runnable() {
          public void run() {
            setStatus("Connecting...");
          }
        });
        JobService service = first ? MainWindow.this.connect()
            : reconnect();
        if (service == null) {
          setVisible(false);
          throw new RuntimeException("Unable to connect");
        }
View Full Code Here

  /* (non-Javadoc)
   * @see ca.eandb.jdcp.remote.JobService#cancelJob(java.util.UUID)
   */
  public void cancelJob(UUID jobId) throws IllegalArgumentException,
      SecurityException {
    JobService service = null;
    while (true) {
      try {
        service = getJobService(service);
        service.cancelJob(jobId);
        return;
      } catch (RemoteException e) {
        logger.error("Lost connection", e);
      }
    }
View Full Code Here

  /* (non-Javadoc)
   * @see ca.eandb.jdcp.remote.JobService#createJob(java.lang.String)
   */
  public UUID createJob(String description) throws SecurityException {
    JobService service = null;
    while (true) {
      try {
        service = getJobService(service);
        return service.createJob(description);
      } catch (RemoteException e) {
        logger.error("Lost connection", e);
      }
    }
  }
View Full Code Here

  /* (non-Javadoc)
   * @see ca.eandb.jdcp.remote.JobService#getClassDefinition(java.lang.String, java.util.UUID)
   */
  public byte[] getClassDefinition(String name, UUID jobId)
      throws SecurityException {
    JobService service = null;
    while (true) {
      try {
        service = getJobService(service);
        return service.getClassDefinition(name, jobId);
      } catch (RemoteException e) {
        logger.error("Lost connection", e);
      }
    }
  }
View Full Code Here

TOP

Related Classes of ca.eandb.jdcp.remote.JobService

Copyright © 2018 www.massapicom. 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.