initLogger(); props = createProps();
@Override public JoyProps addPropsProfiles(final String... profiles) { requireNotStarted(props); Collections.addAll(propsProfiles, profiles); return this; }
/** * Returns application Props. */ public Props getProps() { return requireStarted(props); }
final Props allProps = joyPropsSupplier.get().getProps();
/** * Stops the Joy. */ public void stop() { joyProps.stop(); try { joyDb.stop(); joyPetite.stop(); } catch (Exception ignore) { } if (log != null) { log.info("Joy is down. Bye, bye!"); } }
public JoddJoy() { appName = "joy"; joyPaths = new JoyPaths(); joyPaths.start(); joyScanner = new JoyScanner(); joyProps = new JoyProps(() -> appName); joyProxetta = new JoyProxetta(); joyPetite = new JoyPetite( () -> appName, () -> joyProxetta, () -> joyProps, () -> joyScanner ); joyDb = new JoyDb( () -> appName, () -> joyPetite, () -> joyProxetta, () -> joyScanner); joyMadvoc = new JoyMadvoc( () -> appName, () -> joyPetite, () -> joyProxetta, () -> joyProps, () -> joyScanner ); }
/** * Creates and initializes Petite container. * It will be auto-magically configured by scanning the classpath. */ @Override public void start() { initLogger(); log.info("PETITE start ----------"); petiteContainer = createPetiteContainer(); if (externalsCache) { petiteContainer.setExternalsCache(TypeCache.createDefault()); } log.info("Web application? " + isWebApplication); if (!isWebApplication) { // make session scope to act as singleton scope // if this is not a web application (and http session is not available). petiteContainer.registerScope(SessionScope.class, new SingletonScope(petiteContainer)); } // load parameters from properties files petiteContainer.defineParameters(joyPropsSupplier.get().getProps()); // automagic configuration if (autoConfiguration) { final AutomagicPetiteConfigurator automagicPetiteConfigurator = new AutomagicPetiteConfigurator(petiteContainer); automagicPetiteConfigurator.registerAsConsumer(joyScannerSupplier.get().getClassScanner()); } petiteContainerConsumers.accept(this.petiteContainer); log.info("PETITE OK!"); }
/** * Stops the Joy. */ public void stop() { joyProps.stop(); try { joyDb.stop(); joyPetite.stop(); } catch (Exception ignore) { } if (log != null) { log.info("Joy is down. Bye, bye!"); } }
public JoddJoy() { appName = "joy"; joyPaths = new JoyPaths(); joyPaths.start(); joyScanner = new JoyScanner(); joyProps = new JoyProps(() -> appName); joyProxetta = new JoyProxetta(); joyPetite = new JoyPetite( () -> appName, () -> joyProxetta, () -> joyProps, () -> joyScanner ); joyDb = new JoyDb( () -> appName, () -> joyPetite, () -> joyProxetta, () -> joyScanner); joyMadvoc = new JoyMadvoc( () -> appName, () -> joyPetite, () -> joyProxetta, () -> joyProps, () -> joyScanner ); }
initLogger(); props = createProps();
/** * Adds props files or patterns. */ @Override public JoyProps addPropsFile(final String namePattern) { requireNotStarted(props); this.propsNamePatterns.add(namePattern); return this; }
final Props allProps = joyPropsSupplier.get().getProps();
/** * Returns application Props. */ public Props getProps() { return requireStarted(props); }
/** * Adds props files or patterns. */ @Override public JoyProps addPropsFile(final String namePattern) { requireNotStarted(props); this.propsNamePatterns.add(namePattern); return this; }
/** * Creates and initializes Petite container. * It will be auto-magically configured by scanning the classpath. */ @Override public void start() { initLogger(); log.info("PETITE start ----------"); petiteContainer = createPetiteContainer(); if (externalsCache) { petiteContainer.setExternalsCache(TypeCache.createDefault()); } log.info("Web application? " + isWebApplication); if (!isWebApplication) { // make session scope to act as singleton scope // if this is not a web application (and http session is not available). petiteContainer.registerScope(SessionScope.class, new SingletonScope(petiteContainer)); } // load parameters from properties files petiteContainer.defineParameters(joyPropsSupplier.get().getProps()); // automagic configuration if (autoConfiguration) { final AutomagicPetiteConfigurator automagicPetiteConfigurator = new AutomagicPetiteConfigurator(petiteContainer); automagicPetiteConfigurator.registerAsConsumer(joyScannerSupplier.get().getClassScanner()); } petiteContainerConsumers.accept(this.petiteContainer); log.info("PETITE OK!"); }
@Override public JoyProps addPropsProfiles(final String... profiles) { requireNotStarted(props); Collections.addAll(propsProfiles, profiles); return this; }