Examples of Synchronizer


Examples of com.projity.pm.graphic.views.synchro.Synchronizer

          adjustSizes();
      }
    }
  public Synchronizer getSynchronizer() {
    if (synchronizer == null)
      synchronizer = new Synchronizer();
    return synchronizer;
  }
View Full Code Here

Examples of net.sourceforge.fullsync.Synchronizer

    GridData labelProgressLData = new GridData();
    labelProgressLData.horizontalAlignment = SWT.FILL;
    labelProgressLData.horizontalIndent = 5;
    labelProgressLData.grabExcessHorizontalSpace = true;
    labelProgress.setLayoutData(labelProgressLData);
    Synchronizer synchronizer = GuiController.getInstance().getSynchronizer();
    IoStatistics stats = synchronizer.getIoStatistics(taskTree);
    labelProgress.setText("Totals: " + stats.getCountActions() + " tasks, " + UISettings.formatSize(stats.getBytesTransferred()));

    list = new TaskDecisionList(content, SWT.NULL);
    list.setTaskTree(taskTree);
    GridData listLayoutData = new GridData(SWT.FILL, SWT.FILL, true, true);
View Full Code Here

Examples of net.sourceforge.fullsync.Synchronizer

        final Display display = getDisplay();
        try {
          processing = true;
          list.setChangeAllowed(false);

          Synchronizer synchronizer = GuiController.getInstance().getSynchronizer();
          IoStatistics stats = synchronizer.getIoStatistics(taskTree);
          tasksTotal = stats.getCountActions();
          tasksFinished = 0;

          final Color colorFinishedSuccessful = new Color(null, 150, 255, 150);
          final Color colorFinishedUnsuccessful = new Color(null, 255, 150, 150);

          display.syncExec(new Runnable() {
            @Override
            public void run() {
              setOkButtonEnabled(false);
            }
          });

          final GUIUpdateQueue<TaskFinishedEvent> updateQueue = new GUIUpdateQueue<TaskFinishedEvent>(display, new GUIUpdateQueue.GUIUpdateTask<TaskFinishedEvent>(){
            @Override
            public void doUpdate(Display display, LinkedList<TaskFinishedEvent> items) {
              TableItem item = null;
              System.err.println("GUIUpdateQueue<TaskFinishedEvent>::doUpdate: " + items.size());
              for (TaskFinishedEvent event : items) {
                tasksFinished++;
                // TODO: move this into one translatable string with arguments
                labelProgress
                  .setText(tasksFinished
                      + " " + Messages.getString("TaskDecisionPage.of") + " " + tasksTotal + " " + Messages.getString("TaskDecisionPage.tasksFinished")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
                Task task = event.getTask();
                item = list.getTableItemForTask(task);
                // FIXME This doesn't seams to work. Even if there is an exception in the sync of one item
                // the item is colored with the "successful" color.
                if (item != null) {
                  if (event.isSuccessful()) {
                    item.setBackground(colorFinishedSuccessful);
                  }
                  else {
                    item.setBackground(colorFinishedUnsuccessful);
                  }
                }
              }
              if (null != item) {
                list.showItem(item);
              }
            }
          });

          synchronizer.performActions(taskTree, new TaskFinishedListener() {
            @Override
            public void taskFinished(final TaskFinishedEvent event) {
              updateQueue.add(event);
            }
          });
View Full Code Here

Examples of net.sourceforge.fullsync.Synchronizer

    statusLine.setMessage(Messages.getString("MainWindow.Sync_Finished")); //$NON-NLS-1$
  }

  @Override
  public void profileExecutionScheduled(Profile profile) {
    Synchronizer sync = guiController.getSynchronizer();
    TaskTree tree = sync.executeProfile(profile, false);
    if (tree == null) {
      profile.setLastError(1, Messages.getString("MainWindow.Error_Comparing_Filesystems")); //$NON-NLS-1$
    }
    else {
      int errorLevel = sync.performActions(tree);
      if (errorLevel > 0) {
        profile.setLastError(errorLevel, Messages.getString("MainWindow.Error_Copying_Files")); //$NON-NLS-1$
      }
      else {
        profile.beginUpdate();
View Full Code Here

Examples of net.sourceforge.fullsync.Synchronizer

          }
        }
      }
      ProfileManager profileManager = new ProfileManager(profilesFile);

      final Synchronizer sync = new Synchronizer();

      // Apply executing options
      if (line.hasOption("r")) {
        Profile p = profileManager.getProfile(line.getOptionValue("r"));
        TaskTree tree = sync.executeProfile(p, false);
        sync.performActions(tree);
        p.setLastUpdate(new Date());
        profileManager.save();
        return;
      }

      boolean activateRemote = false;
      int port = 10000;
      String password = "admin";
      RemoteException listenerStarupException = null;

      if (line.hasOption("p")) {
        activateRemote = true;
        try {
          String portStr = line.getOptionValue("p");
          port = Integer.parseInt(portStr);
        }
        catch (NumberFormatException e) {
        }

        if (line.hasOption("a")) {
          password = line.getOptionValue("a");
        }
      }
      else {
        activateRemote = preferences.listeningForRemoteConnections();
        port = preferences.getRemoteConnectionsPort();
        password = preferences.getRemoteConnectionsPassword();
      }
      if (activateRemote) {
        try {
          Logger logger = LoggerFactory.getLogger("FullSync");

          RemoteController.getInstance().startServer(port, password, profileManager, sync);
          logger.info("Remote Interface available on port: " + port);
        }
        catch (RemoteException e) {
          ExceptionHandler.reportException(e);
          listenerStarupException = e;
        }
      }

      if (line.hasOption("d")) {
        profileManager.addSchedulerListener(new ProfileSchedulerListener() {
          @Override
          public void profileExecutionScheduled(Profile profile) {
            TaskTree tree = sync.executeProfile(profile, false);
            if (tree == null) {
              profile.setLastError(1, "An error occured while comparing filesystems.");
            }
            else {
              int errorLevel = sync.performActions(tree);
              if (errorLevel > 0) {
                profile.setLastError(errorLevel, "An error occured while copying files.");
              }
              else {
                profile.setLastUpdate(new Date());
View Full Code Here

Examples of net.sourceforge.htmlunit.corejs.javascript.Synchronizer

   * spawn(function() {o.f(5);}); Thread[Thread-1,5,main] js> exit entry exit
   */
  @GlobalFunction
  public static Object sync( Context cx, Scriptable thisObj, Object[] args, Function funObj ) {
    if ( args.length == 1 && args[ 0 ] instanceof Function ) {
      return new Synchronizer( (Function) args[ 0 ] );
    }
    else {
      throw reportRuntimeError( "msg.sync.args" );
    }
  }
View Full Code Here

Examples of org.apache.commons.configuration.sync.Synchronizer

     * @since 2.0
     */
    @Override
    public final Synchronizer getSynchronizer()
    {
        Synchronizer sync = synchronizer;
        return (sync != null) ? sync : NoOpSynchronizer.INSTANCE;
    }
View Full Code Here

Examples of org.apache.commons.configuration2.sync.Synchronizer

     * @since 2.0
     */
    @Override
    public final Synchronizer getSynchronizer()
    {
        Synchronizer sync = synchronizer;
        return (sync != null) ? sync : NoOpSynchronizer.INSTANCE;
    }
View Full Code Here

Examples of org.apache.commons.configuration2.sync.Synchronizer

            config.addConfiguration(new BaseHierarchicalConfiguration());
        }
        config.getConfiguration(0).addProperty(KEY_CONCURRENT, TEST_NAME);

        // Set a single synchronizer for all involved configurations
        Synchronizer sync = new ReadWriteSynchronizer();
        config.setSynchronizer(sync);
        for (Configuration c : config.getConfigurations())
        {
            c.setSynchronizer(sync);
        }
View Full Code Here

Examples of org.apache.commons.configuration2.sync.Synchronizer

     * Tests whether a Synchronizer can be set.
     */
    @Test
    public void testSetSynchronizer()
    {
        Synchronizer sync = EasyMock.createMock(Synchronizer.class);
        EasyMock.replay(sync);
        assertSame("Wrong result", params, params.setSynchronizer(sync));
        assertSame("Synchronizer not set", sync,
                params.getParameters().get("synchronizer"));
    }
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.