本文整理汇总了Java中io.airlift.http.server.HttpServerModule类的典型用法代码示例。如果您正苦于以下问题:Java HttpServerModule类的具体用法?Java HttpServerModule怎么用?Java HttpServerModule使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
HttpServerModule类属于io.airlift.http.server包,在下文中一共展示了HttpServerModule类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: main
import io.airlift.http.server.HttpServerModule; //导入依赖的package包/类
public static void main(String[] args)
throws Exception
{
if (System.getProperty("config", null) == null) {
System.setProperty("config", "etc/agent.properties");
}
Bootstrap bootstrap = new Bootstrap(
new NodeModule(),
new DiscoveryModule(),
new HttpServerModule(),
new JsonModule(),
new JaxrsModule(true), // requireExplicitBindings = true
new HttpEventModule(),
new JsonReaderModule(false),
new DynamicAnnouncementModule(),
new AgentServerModule()
);
try {
Injector injector = bootstrap.strictConfig().initialize();
injector.getInstance(Announcer.class).start();
}
catch (Exception e) {
LOG.error(e, "Error starting server");
}
}
示例2: main
import io.airlift.http.server.HttpServerModule; //导入依赖的package包/类
public static void main(String[] args)
throws Exception
{
if (System.getProperty("config", null) == null) {
System.setProperty("config", "etc/controller.properties");
}
Bootstrap bootstrap = new Bootstrap(
new NodeModule(),
new DiscoveryModule(),
new DiscoveryServerModule(),
new HttpEventModule(),
new HttpServerModule(),
new JsonModule(),
new JaxrsModule(true), // requireExplicitBindings = true'
new JmxModule(),
new MBeanModule(),
new JsonReaderModule(false),
new ControllerServerModule()
);
try {
bootstrap.strictConfig().initialize();
}
catch (Exception e) {
LOG.error(e, "Error starting server");
}
}
示例3: run
import io.airlift.http.server.HttpServerModule; //导入依赖的package包/类
@Override
public void run()
{
verifyJvmRequirements();
verifySystemTimeIsReasonable();
Logger log = Logger.get(PrestoServer.class);
ImmutableList.Builder<Module> modules = ImmutableList.builder();
modules.add(
new NodeModule(),
new DiscoveryModule(),
new HttpServerModule(),
new JsonModule(),
new JaxrsModule(true),
new MBeanModule(),
new JmxModule(),
new JmxHttpModule(),
new LogJmxModule(),
new TraceTokenModule(),
new JsonEventModule(),
new HttpEventModule(),
new EmbeddedDiscoveryModule(),
new ServerSecurityModule(),
new AccessControlModule(),
new ServerMainModule(sqlParserOptions),
new GracefulShutdownModule(),
installModuleIf(
NodeSchedulerConfig.class,
config -> LEGACY_NETWORK_TOPOLOGY.equalsIgnoreCase(config.getNetworkTopology()),
binder -> binder.bind(NetworkTopology.class).to(LegacyNetworkTopology.class).in(Scopes.SINGLETON)),
installModuleIf(
NodeSchedulerConfig.class,
config -> "flat".equalsIgnoreCase(config.getNetworkTopology()),
binder -> binder.bind(NetworkTopology.class).to(FlatNetworkTopology.class).in(Scopes.SINGLETON))
);
modules.addAll(getAdditionalModules());
Bootstrap app = new Bootstrap(modules.build());
try {
Injector injector = app.strictConfig().initialize();
injector.getInstance(PluginManager.class).loadPlugins();
injector.getInstance(CatalogManager.class).loadCatalogs();
// TODO: remove this huge hack
updateDatasources(
injector.getInstance(Announcer.class),
injector.getInstance(Metadata.class),
injector.getInstance(ServerConfig.class),
injector.getInstance(NodeSchedulerConfig.class));
injector.getInstance(AccessControlManager.class).loadSystemAccessControl();
injector.getInstance(Announcer.class).start();
log.info("======== SERVER STARTED ========");
}
catch (Throwable e) {
log.error(e);
System.exit(1);
}
}