Examples of Task


Examples of com.sun.sgs.app.Task

                CellDescription cell = processList.remove(0);
                processCell(cell);
            }
           
            // figure out the next task
            Task next;
            if (!processList.isEmpty()) {
                // still ids to process
                next = new CellResourcesTask(processList, cells, rm, task);
            } else {
                // all done -- perform task
View Full Code Here

Examples of com.sun.star.wizards.ui.event.Task

     */
    public void loadSession(final String sessionToLoad) {
    try {
        final StatusDialog sd = getStatusDialog();
       
        final Task task = new Task("LoadDocs", "", 10);
       
        sd.execute(this, task, resources.resLoadingSession );
        task.start();
       
        setSelectedDoc(EMPTY_SHORT_ARRAY);
        Helper.setUnoPropertyValue(getModel(lstDocuments), "SelectedItems", EMPTY_SHORT_ARRAY);
        Helper.setUnoPropertyValue(getModel(lstDocuments),"StringItemList", EMPTY_STRING_ARRAY);
       
        Object view = null;
       
        if (sessionToLoad.equals(""))
            view=  Configuration.getConfigurationRoot(xMSF, CONFIG_PATH + "/DefaultSession", false);
        else {
            view = Configuration.getConfigurationRoot(xMSF, CONFIG_PATH + "/SavedSessions", false);
            view = Configuration.getNode(sessionToLoad, view);
        }
       
        CGSession session = new CGSession();
        session.setRoot(settings);
        session.readConfiguration(view, CONFIG_READ_PARAM);
        task.setMax(session.cp_Content.cp_Documents.getSize() * 5 + 7);
        task.advance(true);
       
        if (sessionToLoad.equals(""))
              setSaveSessionName(session);
       
        mount(session, task, false, sd.xControl);
       
        checkSteps();
        currentSession = sessionToLoad;
           
        while (task.getStatus() <= task.getMax())
                task.advance(false);
        task.removeTaskListener(sd);
    } catch (Exception ex) {
        unexpectedError(ex);
    }
       
    try {
View Full Code Here

Examples of com.tapsterrock.mpx.Task

     *            Currenct MPXFile instance
     */
    private void processRelationships(MPXFile mpx) {
        TaskManager tm = m_project.getTaskManager();
        Iterator taskIter = mpx.getAllTasks().iterator();
        Task task;
        RelationList rels;
        Iterator relIter;
        Relation rel;

        GanttTask gTask1;
        int gTaskNumber1;
        GanttTask gTask2;
        int gTaskNumber2;
        TaskDependency gTaskDependency;
        int gConstraintType;
        while (taskIter.hasNext() == true) {
            task = (Task) taskIter.next();
            gTaskNumber1 = mapTaskNumber(task.getID());

            if (gTaskNumber1 == -1) {
                continue;
            }

            rels = (RelationList)task.getPredecessors();

            if (rels != null) {
                relIter = rels.iterator();

                while (relIter.hasNext() == true) {
View Full Code Here

Examples of com.totsp.gwittir.client.keyboard.Task

        }

        if (count < 10) {
            SuggestedKeyBinding kb = new SuggestedKeyBinding(Integer.toString(
                    count).charAt(0), false, true, false);
            Task task = new Task() {

                public void run() {
                    List newSelected = new ArrayList(getSelected());

                    if (newSelected.contains(o)) {
View Full Code Here

Examples of com.tulskiy.musique.gui.dialogs.Task

    }
  }

  private void writeTracks() {
        ProgressDialog dialog = new ProgressDialog(this, "Writing tags");
        dialog.show(new Task() {
            String status;
            boolean abort = false;
            public int processed;

            @Override
View Full Code Here

Examples of com.vmware.vim.binding.vim.Task

    */
   public static void dumpRecentTasks() throws Exception {
      TaskManager taskManager = VcContext.getService().getTaskManager();
      ManagedObjectReference taskMoRefs[] = taskManager.getRecentTask();
      for (ManagedObjectReference moRef : taskMoRefs) {
         Task task = MoUtil.getManagedObject(moRef);
         dumpTask(task);
      }
   }
View Full Code Here

Examples of com.vmware.vim25.mo.Task

            vmsnap = getSnapshotInTree(snapName);
            if (vmsnap == null) { return false; }
        }

        try {
            Task task = null;
            switch (type) {
            case CREATE:
                task = vm_.createSnapshot_Task(snapName, null, false, false);
                break;
            case DELETE:
                task = vmsnap.removeSnapshot_Task(true);
                break;
            case REVERT:
                task = vmsnap.revertToSnapshot_Task(null, true);
                break;
            default:
                throw new Exception("Snapshot TaskType is wrong.");
            }
            assert task != null;
            String ret = task.waitForTask();
            if (ret.equals("success")) {
                logger_.info(messageInSuccess);
                return true;
            } else {
                logger_.info(messageInFailure);
View Full Code Here

Examples of com.xensource.xenapi.Task

        Connection connection = getConnection();
        VirtualMachineTO vmSpec = cmd.getVirtualMachine();
        Map<VolumeTO, StorageFilerTO> volumeToFiler = cmd.getVolumeToFiler();
        final String vmName = vmSpec.getName();
        State state = s_vms.getState(_cluster, vmName);
        Task task = null;

        synchronized (_cluster.intern()) {
            s_vms.put(_cluster, _name, vmName, State.Stopping);
        }

        try {
            prepareISO(connection, vmSpec.getName());
            Map<String, String> other = new HashMap<String, String>();
            other.put("live", "true");
            Network networkForSm = getNativeNetworkForTraffic(connection, TrafficType.Storage, null).getNetwork();
            Host host = Host.getByUuid(connection, _host.uuid);
            Map<String,String> token = host.migrateReceive(connection, networkForSm, other);

            // Get the vm to migrate.
            Set<VM> vms = VM.getByNameLabel(connection, vmSpec.getName());
            VM vmToMigrate = vms.iterator().next();

            // Create the vif map. The vm stays in the same cluster so we have to pass an empty vif map.
            Map<VIF, Network> vifMap = new HashMap<VIF, Network>();
            Map<VDI, SR> vdiMap = new HashMap<VDI, SR>();
            for (Map.Entry<VolumeTO, StorageFilerTO> entry : volumeToFiler.entrySet()) {
                vdiMap.put(getVDIbyUuid(connection, entry.getKey().getPath()),
                        getStorageRepository(connection, entry.getValue().getUuid()));
            }

            // Check migration with storage is possible.
            task = vmToMigrate.assertCanMigrateAsync(connection, token, true, vdiMap, vifMap, other);
            try {
                // poll every 1 seconds
                long timeout = (_migratewait) * 1000L;
                waitForTask(connection, task, 1000, timeout);
                checkForSuccess(connection, task);
            } catch (Types.HandleInvalid e) {
                s_logger.error("Error while checking if vm " + vmName + " can be migrated to the destination host " +
                        host, e);
                throw new CloudRuntimeException("Error while checking if vm " + vmName + " can be migrated to the " +
                        "destination host " + host, e);
            }

            // Migrate now.
            task = vmToMigrate.migrateSendAsync(connection, token, true, vdiMap, vifMap, other);
            try {
                // poll every 1 seconds.
                long timeout = (_migratewait) * 1000L;
                waitForTask(connection, task, 1000, timeout);
                checkForSuccess(connection, task);
            } catch (Types.HandleInvalid e) {
                s_logger.error("Error while migrating vm " + vmName + " to the destination host " + host, e);
                throw new CloudRuntimeException("Error while migrating vm " + vmName + " to the destination host " +
                        host, e);
            }

            // Volume paths would have changed. Return that information.
            List<VolumeObjectTO> volumeToList = getUpdatedVolumePathsOfMigratedVm(connection, vmToMigrate, vmSpec.getDisks());
            vmToMigrate.setAffinity(connection, host);
            state = State.Stopping;

            return new MigrateWithStorageAnswer(cmd, volumeToList);
        } catch (Exception e) {
            s_logger.warn("Catch Exception " + e.getClass().getName() + ". Storage motion failed due to " +
                    e.toString(), e);
            return new MigrateWithStorageAnswer(cmd, e);
        } finally {
            if (task != null) {
                try {
                    task.destroy(connection);
                } catch (Exception e) {
                    s_logger.debug("Unable to destroy task " + task.toString() + " on host " + _host.uuid +" due to " +
                            e.toString());
                }
            }

            synchronized (_cluster.intern()) {
View Full Code Here

Examples of com.zhangwoo.spider.po.Task

    try {
      tmpResult = dao
          .query("select tid,tname,turl,updatetime,sleeptime from task where runable=1 and nextstart<=now()");
      for (Object[] tmp : tmpResult) {
        Task t = new Task();
        t.setTid(tmp[0].toString());
        t.setTname(tmp[1].toString());
        t.setTurl(tmp[2].toString());
        t.setUpdatetime(tmp[3].toString());
        t.setSleeptime(tmp[4].toString());
        result.add(t);
      }
    } catch (Exception e) {
      logger.error("", e);
    }
View Full Code Here

Examples of de.arago.rike.commons.data.Task

    @Override
    public void execute(IDataWrapper data) {

        if (data.getRequestAttribute("id") != null) {

            Task task = TaskHelper.getTask(data.getRequestAttribute("id"));

            String user = SecurityHelper.getUserEmail(data.getUser());

            if (task.getStatusEnum() == Task.Status.UNKNOWN || task.getStatusEnum() == Task.Status.OPEN) {
                task.setMilestone(new DataHelperRike<Milestone>(Milestone.class).find(data.getRequestAttribute("milestone")));
                task.setArtifact(new DataHelperRike<Artifact>(Artifact.class).find(data.getRequestAttribute("artifact")));

                task.setDescription(data.getRequestAttribute("description"));

                try {
                    task.setSizeEstimated(Integer.valueOf(data.getRequestAttribute("size_estimated"), 10));
                } catch (Exception ignored) {
                }

                try {
                    SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
                    task.setDueDate(format.parse(data.getRequestAttribute("due_date")));
                } catch(Exception ignored) {}

                task.setTitle(data.getRequestAttribute("title"));
                task.setUrl(data.getRequestAttribute("url"));
                int priority = Integer.parseInt(GlobalConfig.get(PRIORITY_NORMAL));

                try {
                    priority = Integer.valueOf(data.getRequestAttribute("priority"), 10);
                } catch (Exception ignored) {
                }

                task.setPriority(priority);
                task.setRated(new Date());
                task.setRatedBy(user);
                task.setStatus(Task.Status.OPEN);
                if(GlobalConfig.get(WORKFLOW_TYPE).equalsIgnoreCase("arago Technologies")&&priority==1) {
                    GregorianCalendar c = new GregorianCalendar();
                    c.setTime(task.getRated());
                    c.add(Calendar.DAY_OF_MONTH, Integer.parseInt(GlobalConfig.get(WORKFLOW_DAYS_TOP_PRIO_TASK)));
                    task.setDueDate(c.getTime());
                }

                TaskHelper.save(task);

                StatisticHelper.update();

                data.setSessionAttribute("task", task);

                HashMap<String, Object> notificationParam = new HashMap<String, Object>();

                notificationParam.put("id", data.getRequestAttribute("id"));
                data.setEvent("TaskUpdateNotification", notificationParam);

                data.removeSessionAttribute("targetView");

                ActivityLogHelper.log(" rated Task #" + task.getId() + " <a href=\"/web/guest/rike/-/show/task/" + task.getId() + "\">" + StringEscapeUtils.escapeHtml(task.getTitle()) + "</a> ", task.getStatus(), SecurityHelper.getUserEmail(data.getUser()), data, task.toMap());
            }
        }
    }
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.