Examples of LongRunningTask


Examples of de.sub.goobi.helper.tasks.LongRunningTask


  public void addNewMasterTask() {
    Prozess p = new Prozess();
    p.setTitel("hallo Titel " + System.currentTimeMillis());
    this.task = new LongRunningTask();
    this.task.initialize(p);
    LongRunningTaskManager.getInstance().addTask(this.task);
  }
View Full Code Here

Examples of de.sub.goobi.helper.tasks.LongRunningTask

    if (this.task.getStatusProgress() == 0) {
      LongRunningTaskManager.getInstance().executeTask(this.task);
    } else {
      /* Thread lief schon und wurde abgebrochen */
      try {
        LongRunningTask lrt = this.task.getClass().newInstance();
        lrt.initialize(this.task.getProzess());
        LongRunningTaskManager.getInstance().replaceTask(this.task, lrt);
        LongRunningTaskManager.getInstance().executeTask(lrt);
      } catch (InstantiationException e) {
        logger.error(e);
      } catch (IllegalAccessException e) {
View Full Code Here

Examples of org.apache.cayenne.modeler.util.LongRunningTask

     */
    public void execute() {
        stoppingReverseEngineering = false;

        // load schemas...
        LongRunningTask loadSchemasTask = new LoadSchemasTask(Application
                .getFrame(), "Loading Schemas");

        loadSchemasTask.startAndWait();

        if (stoppingReverseEngineering) {
            return;
        }

        final DbLoaderOptionsDialog dialog = new DbLoaderOptionsDialog(
                schemas,
                dbUserName,
                false);

        try {
            // since we are not inside EventDisptahcer Thread, must run it via
            // SwingUtilities
            SwingUtilities.invokeAndWait(new Runnable() {

                public void run() {
                    dialog.setVisible(true);
                    dialog.dispose();
                }
            });
        }
        catch (Throwable th) {
            processException(th, "Error Reengineering Database");
            return;
        }

        if (dialog.getChoice() == DbLoaderOptionsDialog.CANCEL) {
            return;
        }

        this.schemaName = dialog.getSelectedSchema();
        this.tableNamePattern = dialog.getTableNamePattern();
        this.loadProcedures = dialog.isLoadingProcedures();
        this.procedureNamePattern = dialog.getProcedureNamePattern();

        // load DataMap...
        LongRunningTask loadDataMapTask = new LoadDataMapTask(Application
                .getFrame(), "Reengineering DB");
        loadDataMapTask.startAndWait();
    }
View Full Code Here

Examples of org.apache.cayenne.modeler.util.LongRunningTask

     */
    public void execute() {
        stoppingReverseEngineering = false;

        // load schemas...
        LongRunningTask loadSchemasTask = new LoadSchemasTask(
                Application.getFrame(),
                "Loading Schemas");

        loadSchemasTask.startAndWait();

        if (stoppingReverseEngineering) {
            return;
        }

        final DbLoaderOptionsDialog dialog = new DbLoaderOptionsDialog(
                schemas,
                dbUserName,
                false);

        try {
            // since we are not inside EventDisptahcer Thread, must run it via
            // SwingUtilities
            SwingUtilities.invokeAndWait(new Runnable() {

                public void run() {
                    dialog.setVisible(true);
                    dialog.dispose();
                }
            });
        }
        catch (Throwable th) {
            processException(th, "Error Reengineering Database");
            return;
        }

        if (dialog.getChoice() == DbLoaderOptionsDialog.CANCEL) {
            return;
        }

        this.schemaName = dialog.getSelectedSchema();
        this.tableNamePattern = dialog.getTableNamePattern();
        this.loadProcedures = dialog.isLoadingProcedures();
        this.meaningfulPk = dialog.isMeaningfulPk();
        this.procedureNamePattern = dialog.getProcedureNamePattern();
        this.addedObjEntities = new ArrayList<ObjEntity>();

        this.loader.setNamingStrategy(dialog.getNamingStrategy());

        // load DataMap...
        LongRunningTask loadDataMapTask = new LoadDataMapTask(
                Application.getFrame(),
                "Reengineering DB");
        loadDataMapTask.startAndWait();
    }
View Full Code Here

Examples of org.apache.cayenne.modeler.util.LongRunningTask

     */
    public void execute() {
        stoppingReverseEngineering = false;

        // load schemas...
        LongRunningTask loadSchemasTask = new LoadSchemasTask(Application
                .getFrame(), "Loading Schemas");

        loadSchemasTask.startAndWait();

        if (stoppingReverseEngineering) {
            return;
        }

        final DbLoaderOptionsDialog dialog = new DbLoaderOptionsDialog(
                schemas,
                dbUserName,
                false);

        try {
            // since we are not inside EventDisptahcer Thread, must run it via
            // SwingUtilities
            SwingUtilities.invokeAndWait(new Runnable() {

                public void run() {
                    dialog.setVisible(true);
                    dialog.dispose();
                }
            });
        }
        catch (Throwable th) {
            processException(th, "Error Reengineering Database");
            return;
        }

        if (dialog.getChoice() == DbLoaderOptionsDialog.CANCEL) {
            return;
        }

        this.schemaName = dialog.getSelectedSchema();
        this.tableNamePattern = dialog.getTableNamePattern();
        this.loadProcedures = dialog.isLoadingProcedures();
        this.meaningfulPk = dialog.isMeaningfulPk();
        this.procedureNamePattern = dialog.getProcedureNamePattern();
        this.addedObjEntities = new ArrayList<ObjEntity>();
       
        this.loader.setNamingStrategy(dialog.getNamingStrategy());

        // load DataMap...
        LongRunningTask loadDataMapTask = new LoadDataMapTask(Application
                .getFrame(), "Reengineering DB");
        loadDataMapTask.startAndWait();
    }
View Full Code Here

Examples of org.apache.cayenne.modeler.util.LongRunningTask

     */
    public void execute() {
        stoppingReverseEngineering = false;

        // load schemas...
        LongRunningTask loadSchemasTask = new LoadSchemasTask(
                Application.getFrame(),
                "Loading Schemas");

        loadSchemasTask.startAndWait();

        if (stoppingReverseEngineering) {
            return;
        }

        final DbLoaderOptionsDialog dialog = new DbLoaderOptionsDialog(
                schemas,
                dbUserName,
                false);

        try {
            // since we are not inside EventDisptahcer Thread, must run it via
            // SwingUtilities
            SwingUtilities.invokeAndWait(new Runnable() {

                public void run() {
                    dialog.setVisible(true);
                    dialog.dispose();
                }
            });
        }
        catch (Throwable th) {
            processException(th, "Error Reengineering Database");
            return;
        }

        if (dialog.getChoice() == DbLoaderOptionsDialog.CANCEL) {
            return;
        }

        this.schemaName = dialog.getSelectedSchema();
        this.tableNamePattern = dialog.getTableNamePattern();
        this.loadProcedures = dialog.isLoadingProcedures();
        this.meaningfulPk = dialog.isMeaningfulPk();
        this.procedureNamePattern = dialog.getProcedureNamePattern();
        this.addedObjEntities = new ArrayList<ObjEntity>();

        this.loader.setNamingStrategy(dialog.getNamingStrategy());

        // load DataMap...
        LongRunningTask loadDataMapTask = new LoadDataMapTask(
                Application.getFrame(),
                "Reengineering DB");
        loadDataMapTask.startAndWait();
    }
View Full Code Here

Examples of org.jboss.as.console.client.shared.schedule.LongRunningTask

        });
    }

    private void pollState() {

        LongRunningTask poll = new LongRunningTask(new AsyncCommand<Boolean>() {
            @Override
            public void execute(final AsyncCallback<Boolean> callback) {
                checkReloadState(callback);
            }
        }, 10);

        // kick of the polling request
        poll.schedule(500);
    }
View Full Code Here

Examples of org.jboss.as.console.client.shared.schedule.LongRunningTask

    @Override
    public void onSuccess(final Boolean wasSuccessful)
    {
        if (wasSuccessful)
        {
            LongRunningTask poll = new LongRunningTask(new AsyncCommand<Boolean>()
            {
                @Override
                public void execute(final AsyncCallback<Boolean> callback)
                {
                    final List<Server> finishedServers = new ArrayList<Server>();

                    for (Map.Entry<HostInfo, List<ServerInstance>> entry : serversPerHost
                            .entrySet())
                    {
                        HostInfo hostInfo = entry.getKey();
                        List<ServerInstance> serverInstances = entry.getValue();
                        for (ServerInstance serverInstance : serverInstances)
                        {
                            hostInfoStore.getServerConfiguration(hostInfo.getName(), serverInstance.getServer(),
                                    new SimpleCallback<Server>()
                                    {
                                        @Override
                                        public void onSuccess(final Server server)
                                        {
                                            finishedServers.add(server);
                                            boolean keepPolling = lifecycleOp == START || lifecycleOp == RESTART ? !server
                                                    .isStarted() : server.isStarted();
                                            if (!keepPolling && finishedServers.size() == servers)
                                            {
                                                ServerGroupLifecycleCallback.this.callback.onSuccess(finishedServers);
                                            }
                                            callback.onSuccess(keepPolling);
                                        }
                                    });
                        }
                    }
                }
            }, lifecycleOp.limit());
            poll.schedule(500);
        }
    }
View Full Code Here

Examples of org.jboss.as.console.client.shared.schedule.LongRunningTask

    @Override
    public void onSuccess(final Boolean wasSuccessful)
    {
        if (wasSuccessful)
        {
            LongRunningTask poll = new LongRunningTask(new AsyncCommand<Boolean>()
            {
                @Override
                public void execute(final AsyncCallback<Boolean> callback)
                {
                    hostInfoStore.getServerConfiguration(host, server, new SimpleCallback<Server>()
                    {
                        @Override
                        public void onSuccess(final Server server)
                        {
                            boolean keepPolling = lifecycleOp == START || lifecycleOp == RELOAD ? !server
                                    .isStarted() : server.isStarted();
                            if (!keepPolling)
                            {
                                ServerInstanceLifecycleCallback.this.callback.onSuccess(server);
                            }
                            callback.onSuccess(keepPolling);
                        }
                    });
                }
            }, lifecycleOp.limit());
            poll.schedule(500);
        }
    }
View Full Code Here

Examples of org.jboss.as.console.client.shared.schedule.LongRunningTask

        });
    }

    private void pollState() {

        LongRunningTask poll = new LongRunningTask(new AsyncCommand<Boolean>() {
            @Override
            public void execute(final AsyncCallback<Boolean> callback) {
                checkReloadState(callback);
            }
        }, 10);

        // kick of the polling request
        poll.schedule(500);
    }
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.