Skip to content

Instantly share code, notes, and snippets.

@komamitsu
Created February 9, 2014 15:56
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save komamitsu/8901066 to your computer and use it in GitHub Desktop.
[io.airlit.sample.Main.main()]
- Bootstrap app = new Bootstrap(
new NodeModule(),
new DiscoveryModule(),
new HttpServerModule(),
new JsonModule(),
new JaxrsModule(),
new MBeanModule(),
new JmxModule(),
new JmxHttpModule(),
new JmxHttpRpcModule(),
new LogJmxModule(),
new HttpEventModule(),
new TraceTokenModule(),
new MainModule());
- Injector injector = app.strictConfig().initialize();
- injector.getInstance(Announcer.class).start()
================
[io.airlift.bootstrap.Bootstrap]
- Bootstrap(Module... modules)
- Bootstrap#initialize()
- configuration(logging...)
- set moduleList
- LifeCycleModule
- ConfigurationModule
- ValidationErrorModule
- WarningsMonitor
- modules passed as constructor's arguments
- Injector injector = Guice.createInjector(Stage.PRODUCTION, moduleList.build());
- LifeCycleManager lifeCycleManager = injector.getInstance(LifeCycleManager.class);
- lifeCycleManager.start();
================
[NodeModule]
- NodeConfig#(set|getNodeId()), (set|getBinarySpec()) for "node.id", "node.binary-spec", etc...
the configuration is handled by ConfigurationModule.bindConfig(binder).to(NodeConfig.class) in NodeModule
- @Inject # <= injected by NodeModule
public NodeInfo(NodeConfig config)
{
this(config.getEnvironment(),
config.getPool(),
config.getNodeId(),
config.getNodeInternalIp(),
config.getNodeBindIp(),
config.getNodeExternalAddress(),
config.getLocation(),
config.getBinarySpec(),
config.getConfigSpec()
);
}
================
[DiscoveryModule]
- io.airlift.discovery.client.ServiceInventory
- start() : repeats calling updateServiceInventory()
- updateServiceInventory() : accesses serviceInventoryUri and gets list of ServiceDescripter
- ServiceInventoryConfig => "service-inventory.uri"
- DiscoveryClientConfig
- HttpDiscoveryLookupClient
- HttpDiscoveryAnnouncementClient
- ServiceDescriptorsRepresentation
- Announcement
- ForDiscoveryClient
- Announcer
- ServiceAnnouncement
- CachingServiceSelectorFactory
- MergingServiceSelectorFactory
- ServiceSelector
- ServiceSelectorManager
================
[HttpServerModule]
================
[JsonModule]
================
[JaxrsModule]
================
[MBeanModule]
================
[JmxModule]
================
[JmxHttpModule]
================
[JmxHttpRpcModule]
================
[LogJmxModule]
================
[HttpEventModule]
================
[TraceTokenModule]
================
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment