Search in sources :

Example 1 with BootOptions

use of org.commonjava.indy.boot.BootOptions in project indy by Commonjava.

the class JaxRsBooter method initialize.

@Override
public boolean initialize(final BootOptions bootOptions) {
    this.bootOptions = bootOptions;
    boolean initialized;
    try {
        bootOptions.setSystemProperties();
        weld = new Weld();
        container = weld.initialize();
        // injectable version.
        final BootOptions cdiOptions = container.instance().select(BootOptions.class).get();
        cdiOptions.copyFrom(bootOptions);
        final BeanManager bmgr = container.getBeanManager();
        logger.info("\n\n\nStarted BeanManager: {}\n\n\n", bmgr);
        initialized = true;
    } catch (final Throwable e) {
        logger.error("Failed to initialize Booter: " + e.getMessage(), e);
        exit = ERR_CANT_INIT_BOOTER;
        status = new BootStatus(exit, e);
        initialized = false;
    }
    return initialized;
}
Also used : BootStatus(org.commonjava.indy.boot.BootStatus) BootOptions(org.commonjava.indy.boot.BootOptions) BeanManager(javax.enterprise.inject.spi.BeanManager) Weld(org.jboss.weld.environment.se.Weld)

Aggregations

BeanManager (javax.enterprise.inject.spi.BeanManager)1 BootOptions (org.commonjava.indy.boot.BootOptions)1 BootStatus (org.commonjava.indy.boot.BootStatus)1 Weld (org.jboss.weld.environment.se.Weld)1