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

io.ebeaninternal.server.deploy.PersistControllerManager Maven / Gradle / Ivy

There is a newer version: 15.8.0
Show newest version
package io.ebeaninternal.server.deploy;

import io.ebean.event.BeanPersistController;
import io.ebeaninternal.api.CoreLog;
import io.ebeaninternal.server.core.bootup.BootupClasses;
import io.ebeaninternal.server.deploy.meta.DeployBeanDescriptor;

import java.util.List;

import static java.lang.System.Logger.Level.DEBUG;

/**
 * Default implementation for creating BeanControllers.
 */
final class PersistControllerManager {

  private final List list;

  PersistControllerManager(BootupClasses bootupClasses) {
    list = bootupClasses.getBeanPersistControllers();
  }

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

  /**
   * Return the BeanPersistController for a given entity type.
   */
  void addPersistControllers(DeployBeanDescriptor deployDesc) {
    for (BeanPersistController c : list) {
      if (c.isRegisterFor(deployDesc.getBeanType())) {
        CoreLog.log.log(DEBUG, "BeanPersistController on[{0}] {1}", deployDesc.getFullName(), c.getClass().getName());
        deployDesc.addPersistController(c);
      }
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy