All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.avaje.ebeaninternal.server.deploy.BeanFinderManager Maven / Gradle / Ivy

There is a newer version: 8.1.1
Show newest version
package com.avaje.ebeaninternal.server.deploy;

import com.avaje.ebean.event.BeanFindController;
import com.avaje.ebeaninternal.server.core.BootupClasses;
import com.avaje.ebeaninternal.server.deploy.meta.DeployBeanDescriptor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.List;

/**
 * Default implementation for BeanFinderFactory.
 */
public class BeanFinderManager {

  final Logger logger = LoggerFactory.getLogger(BeanFinderManager.class);

  private final List list;

  public BeanFinderManager(BootupClasses bootupClasses) {
    list = bootupClasses.getBeanFindControllers();
  }

  public int getRegisterCount() {
    return list.size();
  }

  /**
   * Return the BeanPersistController for a given entity type.
   */
  public void addFindControllers(DeployBeanDescriptor deployDesc) {

    for (int i = 0; i < list.size(); i++) {
      BeanFindController c = list.get(i);
      if (c.isRegisterFor(deployDesc.getBeanType())) {
        logger.debug("BeanFindController on[" + deployDesc.getFullName() + "] " + c.getClass().getName());
        deployDesc.setBeanFinder(c);
      }
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy