mirror of
https://github.com/google/nomulus
synced 2026-01-10 07:57:58 +00:00
Convert request factory components into a module
Move all of the code to create the request factories into RequestFactoryModule. Also add the --force_http_connection flag to allow us to force the use of HTTP connections instead of HTTPOverRPC for our internal connections. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=146116640
This commit is contained in:
@@ -118,19 +118,9 @@ final class RegistryCli {
|
||||
}
|
||||
loggingParams.configureLogging(); // Must be called after parameters are parsed.
|
||||
|
||||
// Decide which HTTP connection to use for App Engine
|
||||
HttpRequestFactoryComponent requestFactoryComponent;
|
||||
if (appEngineConnectionFlags.getServer().getHostText().equals("localhost")) {
|
||||
requestFactoryComponent = new LocalhostRequestFactoryComponent();
|
||||
} else {
|
||||
requestFactoryComponent = new BasicHttpRequestFactoryComponent();
|
||||
}
|
||||
|
||||
// Create the main component and use it to inject the command class.
|
||||
RegistryToolComponent component = DaggerRegistryToolComponent.builder()
|
||||
.httpRequestFactoryComponent(requestFactoryComponent)
|
||||
.appEngineConnectionFlagsModule(
|
||||
new AppEngineConnectionFlagsModule(appEngineConnectionFlags))
|
||||
.flagsModule(new AppEngineConnectionFlags.FlagsModule(appEngineConnectionFlags))
|
||||
.build();
|
||||
injectReflectively(RegistryToolComponent.class, component, command);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user