本文整理匯總了Java中com.google.inject.assistedinject.FactoryModuleBuilder類的典型用法代碼示例。如果您正苦於以下問題:Java FactoryModuleBuilder類的具體用法?Java FactoryModuleBuilder怎麽用?Java FactoryModuleBuilder使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
FactoryModuleBuilder類屬於com.google.inject.assistedinject包,在下文中一共展示了FactoryModuleBuilder類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: configure
import com.google.inject.assistedinject.FactoryModuleBuilder; //導入依賴的package包/類
@Override
protected void configure() {
install(new FactoryModuleBuilder().implement(IMailer.class, Mailer.class).build(MailerFactory.class));
bind(Resolver.class).to(MyResolver.class);
bind(DataInitializer.class).asEagerSingleton();
bind(MyUserService.class).asEagerSingleton();
//bind(GoogleAuthProvider.class).asEagerSingleton();
//bind(FacebookAuthProvider.class).asEagerSingleton();
//bind(FoursquareAuthProvider.class).asEagerSingleton();
bind(MyUsernamePasswordAuthProvider.class).asEagerSingleton();
bind(OpenIdAuthProvider.class).asEagerSingleton();
//bind(TwitterAuthProvider.class).asEagerSingleton();
//bind(LinkedinAuthProvider.class).asEagerSingleton();
//bind(VkAuthProvider.class).asEagerSingleton();
//bind(XingAuthProvider.class).asEagerSingleton();
//bind(UntappdAuthProvider.class).asEagerSingleton();
//bind(PocketAuthProvider.class).asEagerSingleton();
//bind(GithubAuthProvider.class).asEagerSingleton();
bind(MyStupidBasicAuthProvider.class).asEagerSingleton();
//bind(SpnegoAuthProvider.class).asEagerSingleton();
//bind(EventBriteAuthProvider.class).asEagerSingleton();
}
示例2: configure
import com.google.inject.assistedinject.FactoryModuleBuilder; //導入依賴的package包/類
@Override
protected void configure() {
install(new ResolutionModule());
install(new OutputModule());
bind(TreeLogger.class).toInstance(logger);
bind(GeneratorContext.class).toInstance(ctx);
bind(new TypeLiteral<Class<? extends Ginjector>>(){})
.annotatedWith(GinjectorInterfaceType.class)
.toInstance(ginjectorInterface);
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));
}
示例3: registerInput
import com.google.inject.assistedinject.FactoryModuleBuilder; //導入依賴的package包/類
public void registerInput(String type,
Class<? extends Input> inputClass,
Class<? extends Input.Factory<? extends Input, ? extends InputConfiguration>> inputFactoryClass,
Class<? extends InputConfiguration> inputConfigurationClass,
Class<? extends InputConfiguration.Factory<? extends InputConfiguration>> inputConfigurationFactoryClass) {
if (inputsMapBinder == null) {
this.inputsMapBinder = MapBinder.newMapBinder(binder(),
TypeLiteral.get(String.class),
new TypeLiteral<InputConfiguration.Factory<? extends InputConfiguration>>() {
});
}
install(new FactoryModuleBuilder().implement(Input.class, inputClass).build(inputFactoryClass));
install(new FactoryModuleBuilder().implement(Configuration.class, inputConfigurationClass).build(inputConfigurationFactoryClass));
inputsMapBinder.addBinding(type).to(inputConfigurationFactoryClass);
}
示例4: registerOutput
import com.google.inject.assistedinject.FactoryModuleBuilder; //導入依賴的package包/類
public void registerOutput(String type,
Class<? extends Output> outputClass,
Class<? extends Output.Factory<? extends Output, ? extends OutputConfiguration>> outputFactoryClass,
Class<? extends OutputConfiguration> outputConfigurationClass,
Class<? extends OutputConfiguration.Factory<? extends OutputConfiguration>> outputConfigurationFactoryClass) {
if (outputsMapBinder == null) {
this.outputsMapBinder = MapBinder.newMapBinder(binder(),
TypeLiteral.get(String.class),
new TypeLiteral<OutputConfiguration.Factory<? extends OutputConfiguration>>() {
});
}
install(new FactoryModuleBuilder().implement(Output.class, outputClass).build(outputFactoryClass));
install(new FactoryModuleBuilder().implement(Configuration.class, outputConfigurationClass).build(outputConfigurationFactoryClass));
outputsMapBinder.addBinding(type).to(outputConfigurationFactoryClass);
}
示例5: setUp
import com.google.inject.assistedinject.FactoryModuleBuilder; //導入依賴的package包/類
@Before
public void setUp() {
this.injector = Guice.createInjector(new AbstractModule() {
@Override
protected void configure() {
bind(ModulesVariablesProcessor.class).annotatedWith(PageScoped.class).to(ModulesVariablesProcessor.class).in(Singleton.class);
bind(AnswerEvaluationSupplier.class).annotatedWith(PageScoped.class).to(AnswerEvaluationSupplier.class).in(Singleton.class);
bind(GroupedAnswersManager.class).annotatedWith(PageScoped.class).to(GroupedAnswersManager.class).in(Singleton.class);
bind(ModulesProcessingResults.class).annotatedWith(PageScoped.class).to(ModulesProcessingResults.class).in(Singleton.class);
bind(StyleSocket.class).toInstance(mock(StyleSocket.class));
install(new FactoryModuleBuilder().build(ProcessingResultsToOutcomeMapConverterFactory.class));
}
});
defaultVariableProcessor = injector.getInstance(VariablesProcessingInitializingWrapper.class);
answerEvaluationProvider = injector.getInstance(Key.get(AnswerEvaluationSupplier.class, PageScoped.class));
processingMode = ProcessingMode.USER_INTERACT;
}
示例6: configure
import com.google.inject.assistedinject.FactoryModuleBuilder; //導入依賴的package包/類
@Override
protected void configure() {
bind(Parameters.class).toInstance(params);
// declare that people can provide scoring observer plugins, even though none are
// provided by default
MapBinder.newMapBinder(binder(), TypeLiteral.get(String.class),
new TypeLiteral<ScoringEventObserver<DocLevelEventArg, DocLevelEventArg>>() {
});
try {
bind(EREToKBPEventOntologyMapper.class)
.toInstance(EREToKBPEventOntologyMapper.create2016Mapping());
} catch (IOException ioe) {
throw new TACKBPEALException(ioe);
}
install(new ResponsesAndLinkingFromEREExtractor.Module());
install(new FactoryModuleBuilder()
.build(ResponsesAndLinkingFromKBPExtractorFactory.class));
}
示例7: init
import com.google.inject.assistedinject.FactoryModuleBuilder; //導入依賴的package包/類
@Override
public void init(List<Module> list) throws Exception {
list.add(
new AbstractModule() {
@Override
protected void configure() {
bind(Stage.class).annotatedWith(Names.named("mainStage")).toProvider(PRIMARY_STAGE::get);
bind(EditorController.class);
}
}
);
list.add(new FactoryModuleBuilder()
.implement(DisassemblerView.class, DisassemblerView.class)
.build(DisassemblerViewFactory.class)
);
}
示例8: configure
import com.google.inject.assistedinject.FactoryModuleBuilder; //導入依賴的package包/類
@Override
protected void configure() {
addPeriodical(LegacyDefaultStreamMigration.class);
addMessageProcessor(PipelineInterpreter.class, PipelineInterpreter.Descriptor.class);
addRestResource(RuleResource.class);
addRestResource(PipelineResource.class);
addRestResource(PipelineConnectionsResource.class);
addRestResource(SimulatorResource.class);
addPermissions(PipelineRestPermissions.class);
install(new ProcessorFunctionsModule());
installSearchResponseDecorator(searchResponseDecoratorBinder(),
PipelineProcessorMessageDecorator.class,
PipelineProcessorMessageDecorator.Factory.class);
install(new FactoryModuleBuilder().build(PipelineInterpreter.State.Factory.class));
addAuditEventTypes(PipelineProcessorAuditEventTypes.class);
addConfigBeans();
}
示例9: configure
import com.google.inject.assistedinject.FactoryModuleBuilder; //導入依賴的package包/類
@Override
protected void configure() {
install(new FactoryModuleBuilder().implement(CmdRun.class, CmdRun.class)
.build(CmdRunFactory.class));
install(new FactoryModuleBuilder()
.implement(SshMaster.class, SshMaster.class)
.build(SshMasterFactory.class));
install(new FactoryModuleBuilder()
.implement(CmdArgs.class, CmdArgs.class)
.build(CmdArgsFactory.class));
install(new FactoryModuleBuilder()
.implement(SshOptions.class, SshOptions.class)
.build(SshOptionsFactory.class));
install(new FactoryModuleBuilder()
.implement(ArgsMap.class, ArgsMap.class)
.build(ArgsMapFactory.class));
}
示例10: configure
import com.google.inject.assistedinject.FactoryModuleBuilder; //導入依賴的package包/類
@Override
protected void configure() {
// Create the required DirectoryResourceFactory implementation
install(new FactoryModuleBuilder()
.implement(
new TypeLiteral<DirectoryResource<SharingProfile, APISharingProfile>>() {},
SharingProfileDirectoryResource.class
)
.build(new TypeLiteral<DirectoryResourceFactory<SharingProfile, APISharingProfile>>() {}));
// Create the required DirectoryObjectResourceFactory implementation
install(new FactoryModuleBuilder()
.implement(
new TypeLiteral<DirectoryObjectResource<SharingProfile, APISharingProfile>>() {},
SharingProfileResource.class
)
.build(new TypeLiteral<DirectoryObjectResourceFactory<SharingProfile, APISharingProfile>>() {}));
// Bind translator for converting between SharingProfile and APISharingProfile
bind(new TypeLiteral<DirectoryObjectTranslator<SharingProfile, APISharingProfile>>() {})
.to(SharingProfileObjectTranslator.class);
}
示例11: configure
import com.google.inject.assistedinject.FactoryModuleBuilder; //導入依賴的package包/類
@Override
protected void configure() {
// Create the required DirectoryResourceFactory implementation
install(new FactoryModuleBuilder()
.implement(
new TypeLiteral<DirectoryResource<User, APIUser>>() {},
UserDirectoryResource.class
)
.build(new TypeLiteral<DirectoryResourceFactory<User, APIUser>>() {}));
// Create the required DirectoryObjectResourceFactory implementation
install(new FactoryModuleBuilder()
.implement(
new TypeLiteral<DirectoryObjectResource<User, APIUser>>() {},
UserResource.class
)
.build(new TypeLiteral<DirectoryObjectResourceFactory<User, APIUser>>() {}));
// Bind translator for converting between User and APIUser
bind(new TypeLiteral<DirectoryObjectTranslator<User, APIUser>>() {})
.to(UserObjectTranslator.class);
}
示例12: configure
import com.google.inject.assistedinject.FactoryModuleBuilder; //導入依賴的package包/類
@Override
protected void configure() {
// Create the required DirectoryResourceFactory implementation
install(new FactoryModuleBuilder()
.implement(
new TypeLiteral<DirectoryResource<Connection, APIConnection>>() {},
ConnectionDirectoryResource.class
)
.build(new TypeLiteral<DirectoryResourceFactory<Connection, APIConnection>>() {}));
// Create the required DirectoryObjectResourceFactory implementation
install(new FactoryModuleBuilder()
.implement(
new TypeLiteral<DirectoryObjectResource<Connection, APIConnection>>() {},
ConnectionResource.class
)
.build(new TypeLiteral<DirectoryObjectResourceFactory<Connection, APIConnection>>() {}));
// Bind translator for converting between Connection and APIConnection
bind(new TypeLiteral<DirectoryObjectTranslator<Connection, APIConnection>>() {})
.to(ConnectionObjectTranslator.class);
}
示例13: configure
import com.google.inject.assistedinject.FactoryModuleBuilder; //導入依賴的package包/類
@Override
protected void configure() {
// Create the required DirectoryResourceFactory implementation
install(new FactoryModuleBuilder()
.implement(
new TypeLiteral<DirectoryResource<ConnectionGroup, APIConnectionGroup>>() {},
ConnectionGroupDirectoryResource.class
)
.build(new TypeLiteral<DirectoryResourceFactory<ConnectionGroup, APIConnectionGroup>>() {}));
// Create the required DirectoryObjectResourceFactory implementation
install(new FactoryModuleBuilder()
.implement(
new TypeLiteral<DirectoryObjectResource<ConnectionGroup, APIConnectionGroup>>() {},
ConnectionGroupResource.class
)
.build(new TypeLiteral<DirectoryObjectResourceFactory<ConnectionGroup, APIConnectionGroup>>() {}));
// Bind translator for converting between ConnectionGroup and APIConnectionGroup
bind(new TypeLiteral<DirectoryObjectTranslator<ConnectionGroup, APIConnectionGroup>>() {})
.to(ConnectionGroupObjectTranslator.class);
}
示例14: configure
import com.google.inject.assistedinject.FactoryModuleBuilder; //導入依賴的package包/類
@Override
protected void configure() {
// Create the required DirectoryResourceFactory implementation
install(new FactoryModuleBuilder()
.implement(
new TypeLiteral<DirectoryResource<ActiveConnection, APIActiveConnection>>() {},
ActiveConnectionDirectoryResource.class
)
.build(new TypeLiteral<DirectoryResourceFactory<ActiveConnection, APIActiveConnection>>() {}));
// Create the required DirectoryObjectResourceFactory implementation
install(new FactoryModuleBuilder()
.implement(
new TypeLiteral<DirectoryObjectResource<ActiveConnection, APIActiveConnection>>() {},
ActiveConnectionResource.class
)
.build(new TypeLiteral<DirectoryObjectResourceFactory<ActiveConnection, APIActiveConnection>>() {}));
// Bind translator for converting between ActiveConnection and APIActiveConnection
bind(new TypeLiteral<DirectoryObjectTranslator<ActiveConnection, APIActiveConnection>>() {})
.to(ActiveConnectionObjectTranslator.class);
}
示例15: bindDeltaStore
import com.google.inject.assistedinject.FactoryModuleBuilder; //導入依賴的package包/類
private void bindDeltaStore() {
switch (deltaStoreType.toLowerCase()) {
case CoreSettings.STORE_TYPE_MEMORY:
bind(DeltaStore.class).to(MemoryDeltaStore.class).in(Singleton.class);
bind(SnapshotStore.class).to(MemorySnapshotStore.class).in(Singleton.class);
break;
case CoreSettings.STORE_TYPE_FILE:
bind(DeltaStore.class).to(FileDeltaStore.class).in(Singleton.class);
bind(SnapshotStore.class).to(FileSnapshotStore.class).in(Singleton.class);
break;
default:
throw new RuntimeException("Invalid delta store type: '" + deltaStoreType + "'");
}
bind(DeltaWaveletStateMap.class).in(Singleton.class);
install(new FactoryModuleBuilder().implement(DeltaWaveletState.class, DeltaWaveletStateImpl.class).build(
DeltaWaveletState.GuiceFactory.class));
}