Search in sources :

Example 1 with GuiceWebpiecesListener

use of org.webpieces.router.impl.mgmt.GuiceWebpiecesListener in project webpieces by deanhiller.

the class ProdRouterModule method configure.

@Override
public void configure(Binder binder) {
    binder.bind(BufferPool.class).to(TwoPools.class).asEagerSingleton();
    // done with annotation..
    // binder.bind(RouterService.class).to(RouterServiceImpl.class).asEagerSingleton();
    // binder.bind(AbstractRouterService.class).to(ProdRouterService.class).asEagerSingleton();;
    // binder.bind(MetaLoaderProxy.class).to(ProdLoader.class).asEagerSingleton();
    // binder.bind(RouteInvoker.class).to(ProdRouteInvoker.class).asEagerSingleton();
    // binder.bind(ClassForName.class).to(ProdClassForName.class).asEagerSingleton();
    // binder.bind(CompressionCacheSetup.class).to(ProdCompressionCacheSetup.class).asEagerSingleton();;
    binder.bind(RouterConfig.class).toInstance(config);
    // We write all meta for platform managed beans into ManagedBeanMeta such that 'any' plugin could
    // inject ManagedBeanMeta into itself to access and use all that meta data and wrap those beans to modify them
    // The properties plugin does this to expose platform beans as well as app beans
    ManagedBeanMeta beanMeta = new ManagedBeanMeta();
    binder.bind(ManagedBeanMeta.class).toInstance(beanMeta);
    binder.bindListener(Matchers.any(), new GuiceWebpiecesListener(beanMeta));
    binder.bind(PortConfigLookup.class).toInstance(portLookup);
    Validator validator = javax.validation.Validation.buildDefaultValidatorFactory().getValidator();
    ExecutableValidator execValidator = validator.forExecutables();
    binder.bind(Validator.class).toInstance(validator);
    binder.bind(ExecutableValidator.class).toInstance(execValidator);
}
Also used : ExecutableValidator(javax.validation.executable.ExecutableValidator) GuiceWebpiecesListener(org.webpieces.router.impl.mgmt.GuiceWebpiecesListener) TwoPools(org.webpieces.data.api.TwoPools) ManagedBeanMeta(org.webpieces.router.impl.mgmt.ManagedBeanMeta) Validator(javax.validation.Validator) ExecutableValidator(javax.validation.executable.ExecutableValidator)

Aggregations

Validator (javax.validation.Validator)1 ExecutableValidator (javax.validation.executable.ExecutableValidator)1 TwoPools (org.webpieces.data.api.TwoPools)1 GuiceWebpiecesListener (org.webpieces.router.impl.mgmt.GuiceWebpiecesListener)1 ManagedBeanMeta (org.webpieces.router.impl.mgmt.ManagedBeanMeta)1