Set a new update synchronizer.

@param newsync Update synchronizer
519533
public synchronized void synchronizeWith(UpdateSynchronizer newsync) {
    // LoggingUtil.warning("Synchronizing: " + sync + " " + newsync, new
    // Throwable());
    if(synchronizer == newsync) {
      LoggingUtil.warning("Double-synced to the same plot!", new Throwable());
      return;
    }
    if(synchronizer != null) {
      LoggingUtil.warning("Attempting to synchronize to more than one synchronizer.");
      return;
    }
    synchronizer = newsync;
    newsync.addUpdateRunner(this);
  }
1281671
@Override
    public void update(IEntityLock lock, java.util.Date newExpiration, Integer newLockType)
            throws LockingException {
        if (find(lock) == null) {
            throw new LockingException("Problem updating " + lock + " : not found in store.");
        }
        primAdd(lock, newExpiration);
    }
588464
public void changeStatus(int newStatus)
    {
        if (tc.isEntryEnabled())
            Tr.entry(tc, "changeStatus", new java.lang.Object[] { this, new Integer(newStatus) });

        _status = newStatus;

        if (tc.isEntryEnabled())
            Tr.exit(tc, "changeStatus");
    }
489794
public void setSnapshots(java.util.Collection<Snapshot> snapshots) {
        if (snapshots == null) {
            this.snapshots = null;
            return;
        }

        this.snapshots = new com.amazonaws.internal.SdkInternalList<Snapshot>(snapshots);
    }
1344858
public synchronized void asyncSetPersistentTimestamp(final long newPersistentTimestamp) {
    new Thread() {
      @Override
      public void run() {
        try {
          chronosServerWatcher.setPersistentTimestamp(newPersistentTimestamp);
          isAsyncSetPersistentTimestamp = false;
        } catch (Exception e) {
          LOG.fatal("Error to set persistent timestamp, exit immediately");
          System.exit(0);
        }
      }
    }.start();
  }
825644
@Override
    public void sync( NativeObject jsRWB, Object data ) {
        synchronizationPoint(jsRWB, null, data);
    }
396024
function() {
    var self = this
    self._shouldSyncFromOpts = true
    self.on('update', function() {
      if (self._shouldSyncFromOpts) self.trigger('sync')
      self._shouldSyncFromOpts = true
    })
  }
1069833
private void updateConduitSyncHandlerConnection(List<String> sourceList, SynchronousHandler handler) {
        if (sourceList.contains("message")) {
            logConduit.addSyncHandler(handler);
        } else {
            logConduit.removeSyncHandler(handler);
        }

        if (sourceList.contains("trace")) {
            traceConduit.addSyncHandler(handler);
        } else {
            traceConduit.removeSyncHandler(handler);
        }
    }
59995
protected void setSyncConfig(SyncToolConfig syncConfig) {
        this.syncConfig = syncConfig;
        this.syncConfig.setVersion(version);
        File exclusionListFile = this.syncConfig.getExcludeList();
        if (exclusionListFile != null) {
            this.fileExclusionManager = new FileExclusionManager(exclusionListFile);
        } else {
            this.fileExclusionManager = new FileExclusionManager();
        }

        ChangedList.getInstance()
                   .setFileExclusionManager(this.fileExclusionManager);

    }
668118
public synchronized void removeSyncHandler(SynchronousHandler syncHandler) {
		Set<SynchronousHandler> synchronousHandlerSetCopy = new HashSet<SynchronousHandler>(synchronousHandlerSet);
		synchronousHandlerSetCopy.remove(syncHandler);
		Tr.event(tc, "Removed Synchronous Handler: " + syncHandler.getHandlerName());
		synchronousHandlerSet = synchronousHandlerSetCopy;
	}
53674
public static SyncListItemUpdater updater(final String pathServiceSid, 
                                              final String pathListSid, 
                                              final Integer pathIndex) {
        return new SyncListItemUpdater(pathServiceSid, pathListSid, pathIndex);
    }
642875
protected BAMTaskSummaryImpl createOrUpdateTask(TaskEvent event, Status newStatus) {
        return updateTask(event, newStatus, null);
    }
918539
void updateRack(HeartbeatImpl heartbeat,
                  UpdateRackHeartbeat updateRack)
  {
    for (UpdateServerHeartbeat serverUpdate : updateRack.getServers()) {
      if (serverUpdate == null) {
        continue;
      }
 
      update(serverUpdate);
      // updateTargetServers();
 
      ServerHeartbeat peerServer = findServer(serverUpdate.getAddress(),
                                              serverUpdate.getPort());
 
      if (peerServer.isSelf()) {
        continue;
      }
      
      heartbeat.updateServer(peerServer, serverUpdate);
      /*
      String externalId = serverUpdate.getExternalId();

      heartbeat.updateExternal(peerServer, externalId);

      if (peerServer.onHeartbeatUpdate(serverUpdate)) {
        if (peerServer.isUp()) {
          onServerStart(peerServer);
        }
        else {
          onServerStop(peerServer);
        }
      }
      */
    }

    update();
  }
55736
public void setNewInThisVersionBulletPoints(java.util.Collection<String> newInThisVersionBulletPoints) {
        if (newInThisVersionBulletPoints == null) {
            this.newInThisVersionBulletPoints = null;
            return;
        }

        this.newInThisVersionBulletPoints = new java.util.ArrayList<String>(newInThisVersionBulletPoints);
    }
184268
public static void update(final FileUpdater updater, final File destFile) throws UpdateException {
        final File lockFile = new File(destFile.getAbsolutePath() + ".lock");
        final File newDestFile = new File(destFile.getAbsolutePath() + ".new");

        try {
            // synchronize writing to file within this jvm
            synchronized (UpdateUtils.class) {
                final FileChannel channel = new RandomAccessFile(lockFile, "rw").getChannel();

                //acquire file lock to block external jvm (commandline) from writing to file
                final FileLock lock = channel.lock();
                try {
                    FileUtils.copyFileStreams(destFile, newDestFile);
                    updater.updateFile(newDestFile);
                    if (newDestFile.isFile() && newDestFile.length() > 0) {
                        moveFile(newDestFile, destFile);
                    } else {
                        throw new UpdateException("Result file was empty or not present: " + newDestFile);
                    }
                } catch (FileUpdaterException e) {
                    throw new UpdateException(e);
                } finally {
                    lock.release();
                    channel.close();
                }
            }
        } catch (IOException e) {
            throw new UpdateException("Unable to get and write file: " +
                    e.toString(), e);
        }
    }
1300176
@Override
  public void startSync(AlluxioURI ufsUri) {
    LOG.debug("Add {} as a sync point", ufsUri.toString());
    mUfsUriList.add(ufsUri);
  }
662140
@Override
    public boolean addSync() throws ResourceException {

        if (tc.isEntryEnabled()) {
            Tr.entry(this, tc, "addSync");
        }

        try {

            UOWCoordinator uowCoord = mcWrapper.getUOWCoordinator();
            if (uowCoord != null) {
                if (uowCoord.isGlobal()) {
                    if (mcWrapper.isConnectionSynchronizationProvider()) {
                        throw new UnsupportedOperationException("com.ibm.ws.Transaction.SynchronizationProvider");
                        /*
                         * Use the Synchronization object from the managed connection to
                         * register.
                         */
                        //Synchronization s = ((SynchronizationProvider)mcWrapper.getManagedConnection()).getSynchronization();
                        //LocationSpecificFunction.instance.getTransactionManager().registerSynchronization(uowCoord, s, EmbeddableWebSphereTransactionManager.SYNC_TIER_INNER);
                    }
                    /*
                     * This code will remain here just in case we run into this
                     * case. We should not be isEnlistmentDisabled in this code.
                     *
                     * Log a message and return, if isEnlistmentDisabled is true.
                     */
                    if (mcWrapper.isEnlistmentDisabled()) {
                        if (tc.isDebugEnabled()) {
                            Tr.debug(this, tc, "Managed connection isEnlistmentDisabled is true.");
                            Tr.debug(this, tc, "Returning without registering.");
                        }
                        if (tc.isEntryEnabled()) {
                            Tr.exit(this, tc, "addSync", false);
                        }
                        return false;
                    }
                    /*
                     * Use our XATransactionWrapper
                     */
                    // Global Transaction
                    EmbeddableWebSphereTransactionManager tranMgr = mcWrapper.pm.connectorSvc.transactionManager;
                    tranMgr.registerSynchronization(uowCoord, this);
                    mcWrapper.markLocalTransactionWrapperInUse();
                    registeredForSync = true;
                } else {
                    // Local Transaction
                    // No need to register for synchronization for unshared/LTC/res-control=Application.
                    //  Instead of cleanup being done via after completion it will either happen at close or
                    //  commit/rollback which ever happens last.  This will allow the connection to be returned
                    //  to the pool prior to the end of the LTC scope allowing better utilization of the connection.
                    boolean shareable = mcWrapper.getConnectionManager().shareable();
                    if (!shareable && !J2CUtilityClass.isContainerAtBoundary(mcWrapper.pm.connectorSvc.transactionManager)) {
                        // Register an instance of an RRS no-transaction wrapper
                        // so the TM will create an RRS NativeLocalTranasction.  The wrapper
                        // provides "empty" TransactioWrapper and Synchronization behaviors,
                        // but indicates to the TM that the LTC requires RRS support.

                        //if (tc.isEntryEnabled()) {
                        //  Tr.exit(this, tc, "addSync: returning without registering.");
                        //}
                        //return false;
                        if (this.isRRSTransactional()) {
                            ((SynchronizationRegistryUOWScope) uowCoord).registerInterposedSynchronization(
                                                                                                           new RRSNoTransactionWrapper());
                        } else {
                            if (tc.isEntryEnabled()) {
                                Tr.exit(this, tc, "addSync", "returning without registering");
                            }
                            return false;
                        }
                    } else {

                        if (mcWrapper.isConnectionSynchronizationProvider()) {
                            throw new UnsupportedOperationException("com.ibm.ws.Transaction.SynchronizationProvider");
                            /*
                             * Use the Synchronization object from the managed connection to
                             * register.
                             */
                            //Synchronization s = ((SynchronizationProvider)mcWrapper.getManagedConnection()).getSynchronization();
                            //((SynchronizationRegistryUOWScope) uowCoord).registerInterposedSynchronization(s);
                            //registeredForSync = false;
                        } else {

                            /*
                             * In order
                             * to take advantage of the new level of code in which MCWrapper has the isEnlistmentDisabled()
                             */
                            if (mcWrapper.isEnlistmentDisabled()) {
                                if (tc.isDebugEnabled()) {
                                    Tr.debug(this, tc, "Managed connection isEnlistmentDisabled is true.");
                                    Tr.debug(this, tc, "Returning without registering.");
                                }
                                if (tc.isEntryEnabled()) {
                                    Tr.exit(this, tc, "addSync", false);
                                }
                                return false;
                            }
                            ((SynchronizationRegistryUOWScope) uowCoord).registerInterposedSynchronization(this);
                            mcWrapper.markLocalTransactionWrapperInUse();
                            registeredForSync = true;
                        }

                    }
                }
            } else {
                // No transaction context.  Should never happen.
                Tr.error(tc, "NO_VALID_TRANSACTION_CONTEXT_J2CA0040", "addSync", null, mcWrapper.gConfigProps.cfName);
                throw new ResourceException("INTERNAL ERROR: No valid transaction context present");
            }

        } catch (ResourceException e) {
            com.ibm.ws.ffdc.FFDCFilter.processException(
                                                        e,
                                                        "com.ibm.ejs.j2c.LocalTransactionWrapper.addSync",
                                                        "594",
                                                        this);
            Tr.error(tc, "REGISTER_WITH_SYNCHRONIZATION_EXCP_J2CA0026", "addSync", e, "Exception");
            throw e;
        } catch (Exception e) {
            com.ibm.ws.ffdc.FFDCFilter.processException(
                                                        e,
                                                        "com.ibm.ejs.j2c.LocalTransactionWrapper.addSync",
                                                        "605",
                                                        this);
            Tr.error(tc, "REGISTER_WITH_SYNCHRONIZATION_EXCP_J2CA0026", "addSync", e, "Exception");
            ResourceException re = new ResourceException("addSync: caught Exception");
            re.initCause(e);
            throw re;
        }
        if (tc.isEntryEnabled()) {
            Tr.exit(this, tc, "addSync", registeredForSync);
        }

        return registeredForSync;

    }