Package com.dotmarketing.business.cluster.mbeans

Source Code of com.dotmarketing.business.cluster.mbeans.Cluster

package com.dotmarketing.business.cluster.mbeans;

import com.dotcms.enterprise.ClusterThreadProxy;
import com.dotmarketing.business.APILocator;
import com.dotmarketing.common.business.journal.DistributedJournalAPI;
import com.dotmarketing.util.Config;

public class Cluster implements ClusterMBean {

  public void startCluster() {
    ClusterThreadProxy.startThread(Config.getIntProperty("DIST_INDEXATION_SLEEP",5000),Config.getIntProperty("DIST_INDEXATION_INIT_DELAY",1000));
    DistributedJournalAPI distJournal=APILocator.getDistributedJournalAPI();
    distJournal.setIndexationEnabled(true);
  }

  public void startCluster(int sleep, int delay) {
    ClusterThreadProxy.startThread(sleep,delay);
    DistributedJournalAPI distJournal=APILocator.getDistributedJournalAPI();
    distJournal.setIndexationEnabled(true);
  }

  public void stopCluster() {
    ClusterThreadProxy.stopThread();
    DistributedJournalAPI distJournal=APILocator.getDistributedJournalAPI();
    distJournal.setIndexationEnabled(false);

  }

}
TOP

Related Classes of com.dotmarketing.business.cluster.mbeans.Cluster

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.