Package com.gentics.cr.lucene.indexer.transformer

Source Code of com.gentics.cr.lucene.indexer.transformer.AbstractLuceneMonitoringTransformer

package com.gentics.cr.lucene.indexer.transformer;

import org.apache.lucene.index.IndexWriter;

import com.gentics.cr.CRResolvableBean;
import com.gentics.cr.configuration.GenericConfiguration;
import com.gentics.cr.exceptions.CRException;
import com.gentics.cr.monitoring.MonitorFactory;
import com.gentics.cr.monitoring.UseCase;

public abstract class AbstractLuceneMonitoringTransformer extends ContentTransformer implements
    LuceneContentTransformer {

  protected AbstractLuceneMonitoringTransformer(GenericConfiguration config) {
    super(config);
  }

  /**
   * Process the specified bean with monitoring.
   * @param bean
   * @throws CRException
   */
  public void processBeanWithMonitoring(CRResolvableBean bean, IndexWriter writer) throws CRException {
    UseCase pcase = MonitorFactory.startUseCase("Transformer:" + this.getClass());
    try {
      processBean(bean, writer);
    } finally {
      pcase.stop();
    }
  }

}
TOP

Related Classes of com.gentics.cr.lucene.indexer.transformer.AbstractLuceneMonitoringTransformer

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.