Package ninja.ebean

Class NinjaEbeanServerLifecycle


  • public class NinjaEbeanServerLifecycle
    extends Object
    This is an internal class of Ninja Ebeans support. It is responsible for creating db connections and shutting them down upon server start / stop. As end-user you should NOT use this method directly. Instead simply inject EbeanServer into the class you want to use. The interface EbeanServer is configured by this class and provided by a provider.
    • Constructor Detail

      • NinjaEbeanServerLifecycle

        @Inject
        public NinjaEbeanServerLifecycle​(org.slf4j.Logger logger,
                                         ninja.utils.NinjaProperties ninjaProperties)
    • Method Detail

      • startServer

        public final void startServer()
        This method reads the configuration properties from your application.conf file and configures Ebean accordingly.
      • createEbeanServer

        public io.ebean.EbeanServer createEbeanServer​(io.ebean.config.ServerConfig serverConfig)
        Creates the Ebean server with the prepared server config. Provides a last chance to modify the config in a subclass if you'd like to customize the config further.
        Parameters:
        serverConfig - The prepared server config
        Returns:
        The newly created Ebean server
      • getEbeanServer

        public io.ebean.EbeanServer getEbeanServer()