Package com.google.inject.assistedinject

Examples of com.google.inject.assistedinject.FactoryModuleBuilder


* Provides the bindings for the factories of our models to avoid having lots of static methods everywhere.
*/
public class ModelFactoryModule extends AbstractModule {
    @Override
    protected void configure() {
        install(new FactoryModuleBuilder().build(Node.Factory.class));
        install(new FactoryModuleBuilder().build(Input.Factory.class));
        install(new FactoryModuleBuilder().build(SystemJob.Factory.class));
        install(new FactoryModuleBuilder().build(UniversalSearch.Factory.class));
        install(new FactoryModuleBuilder().build(User.Factory.class));
        install(new FactoryModuleBuilder().build(Extractor.Factory.class));
        install(new FactoryModuleBuilder().build(Dashboard.Factory.class));
        install(new FactoryModuleBuilder().build(LdapSettings.Factory.class));
        install(new FactoryModuleBuilder().build(Stream.Factory.class));
        install(new FactoryModuleBuilder().build(StreamRule.Factory.class));
        install(new FactoryModuleBuilder().build(Radio.Factory.class));
        install(new FactoryModuleBuilder().build(Index.Factory.class));
        install(new FactoryModuleBuilder().build(SavedSearch.Factory.class));
        install(new FactoryModuleBuilder().build(AlertCondition.Factory.class));
        install(new FactoryModuleBuilder().build(InputState.Factory.class));
        install(new FactoryModuleBuilder().build(AlarmCallback.Factory.class));
        install(new FactoryModuleBuilder().build(Output.Factory.class));

        // TODO crutch, because we need the factory for systemjobs in all().
        // can this be done with a second factory for the list?
        // or possibly with a factory method returning List<SystemJob> ?
        requestStaticInjection(SystemJob.class);
View Full Code Here


        bind(ObjectMapper.class).toProvider(ServerObjectMapperProvider.class);
        bind(RotationStrategy.class).toProvider(RotationStrategyProvider.class);
    }

    private void bindFactoryModules() {
        install(new FactoryModuleBuilder().build(OutputBufferProcessor.Factory.class));
        install(new FactoryModuleBuilder().build(ServerProcessBufferProcessor.Factory.class));
        install(new FactoryModuleBuilder().build(RebuildIndexRangesJob.Factory.class));
        install(new FactoryModuleBuilder().build(OptimizeIndexJob.Factory.class));
        install(new FactoryModuleBuilder().build(CreateNewSingleIndexRangeJob.Factory.class));
        install(new FactoryModuleBuilder().build(FixDeflectorByDeleteJob.Factory.class));
        install(new FactoryModuleBuilder().build(FixDeflectorByMoveJob.Factory.class));
        install(new FactoryModuleBuilder().build(LdapSettingsImpl.Factory.class));
        install(new FactoryModuleBuilder().build(FieldValueAlertCondition.Factory.class));
        install(new FactoryModuleBuilder().build(MessageCountAlertCondition.Factory.class));
    }
View Full Code Here

        bind(ThroughputStats.class).toInstance(new ThroughputStats());
        bind(ProcessBufferWatermark.class).toInstance(new ProcessBufferWatermark());

        bind(InstantiationService.class).toInstance(instantiationService);

        install(new FactoryModuleBuilder().build(ProcessBuffer.Factory.class));

        bind(ProcessBuffer.class).toProvider(ProcessBufferProvider.class);
        bind(NodeId.class).toProvider(NodeIdProvider.class);

        bind(ServiceManager.class).toProvider(ServiceManagerProvider.class).asEagerSingleton();
View Full Code Here

    @Override
    protected void configure() {
        bindProviders();
        bindSingletons();
        bindTransport();
        install(new FactoryModuleBuilder().build(RadioProcessBufferProcessor.Factory.class));
        SecurityContextFactory instance = null;
        bind(SecurityContextFactory.class).toProvider(Providers.of(instance));
        bindDynamicFeatures();
        bindContainerResponseFilters();
        bindExceptionMappers();
View Full Code Here

            String name,
            Class<? extends Transport> transportClass,
            Class<? extends Transport.Config> configClass,
            Class<? extends Transport.Factory<? extends Transport>> factoryClass) {
        final Key<? extends Transport.Factory<? extends Transport>> factoryKey = Key.get(factoryClass);
        install(new FactoryModuleBuilder()
                        .implement(Transport.class, transportClass)
                        .implement(Transport.Config.class, configClass)
                        .build(factoryClass));

        mapBinder.addBinding(name).to(factoryKey);
View Full Code Here

            Class<? extends Codec.Config> configClass,
            Class<? extends Codec.Factory<? extends Codec>> factoryClass) {

        final Key<? extends Codec.Factory<? extends Codec>> factoryKey = Key.get(factoryClass);

        install(new FactoryModuleBuilder()
                        .implement(Codec.class, codecClass)
                        .implement(Codec.Config.class, configClass)
                        .build(factoryClass));

        mapBinder.addBinding(name).to(factoryKey);
View Full Code Here

    }

    protected <T extends MessageInput> void installInput(MapBinder<String, MessageInput.Factory<? extends MessageInput>> inputMapBinder,
                                                         Class<T> target,
                                                         Class<? extends MessageInput.Factory<T>> targetFactory) {
        install(new FactoryModuleBuilder().implement(MessageInput.class, target).build(targetFactory));
        inputMapBinder.addBinding(target.getCanonicalName()).to(Key.get(targetFactory));
    }
View Full Code Here

* Guice module binding the components of the output package.
*/
public class OutputModule extends PrivateModule {

  public void configure() {
    install(new FactoryModuleBuilder()
        .build(FragmentPackageName.Factory.class));
    install(new FactoryModuleBuilder()
        .implement(InjectorWriteContext.class, GinjectorFragmentContext.class)
        .build(GinjectorFragmentContext.Factory.class));
    install(new FactoryModuleBuilder()
        .build(GinjectorFragmentOutputter.Factory.class));

    bind(GinjectorImplOutputter.class);
    bind(ReachabilityAnalyzer.class).in(Singleton.class);

View Full Code Here

    bind(GinjectorBindings.class).annotatedWith(RootBindings.class)
        .to(GinjectorBindings.class).in(Singleton.class);
    bind(BindingIndex.class)
        .to(Key.get(GinjectorBindings.class, RootBindings.class))
        .in(Singleton.class);
    install(new FactoryModuleBuilder()
        .build(GuiceElementVisitor.GuiceElementVisitorFactory.class));
    bind(new TypeLiteral<Set<Class<? extends GinModule>>>(){})
        .annotatedWith(ModuleClasses.class)
        .toInstance(moduleClasses);
    bind(BindingFactory.class).to(BindingFactoryImpl.class);
    install(new FactoryModuleBuilder()
        .build(SourceWriteUtil.Factory.class));
  }
View Full Code Here

*/
public class ResolutionModule extends PrivateModule {

  @Override
  protected void configure() {
    install(new FactoryModuleBuilder()
        .build(BindingInstaller.Factory.class));
    install(new FactoryModuleBuilder()
        .build(BindingPositioner.Factory.class));
    install(new FactoryModuleBuilder()
        .build(DependencyExplorer.Factory.class));
    install(new FactoryModuleBuilder()
        .build(ImplicitBindingCreator.Factory.class));
    install(new FactoryModuleBuilder()
        .build(UnresolvedBindingValidator.Factory.class));

    bind(BindingResolver.class);
    expose(BindingResolver.class);
  }
View Full Code Here

TOP

Related Classes of com.google.inject.assistedinject.FactoryModuleBuilder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.