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

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

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

import io.ebean.event.BeanPostConstructListener;
import io.ebeaninternal.server.core.bootup.BootupClasses;
import io.ebeaninternal.server.deploy.meta.DeployBeanDescriptor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.List;

/**
 * Default implementation for creating BeanControllers.
 */
class PostConstructManager {

  private static final Logger logger = LoggerFactory.getLogger(PostConstructManager.class);

  private final List list;

  PostConstructManager(BootupClasses bootupClasses) {
    this.list = bootupClasses.getBeanPostConstructoListeners();
  }

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

  /**
   * Register BeanPostLoad listeners for a given entity type.
   */
  void addPostConstructListeners(DeployBeanDescriptor deployDesc) {

    for (BeanPostConstructListener c : list) {
      if (c.isRegisterFor(deployDesc.getBeanType())) {
        logger.debug("BeanPostLoad on[{}] {}", deployDesc.getFullName(), c.getClass().getName());
        deployDesc.addPostConstructListener(c);
      }
    }
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy