use of io.airlift.event.client.EventTypeMetadata in project airlift by airlift.
the class HttpEventModule method configure.
@Override
public void configure(Binder binder) {
// for backwards compatibility
binder.install(new EventModule());
binder.bind(JsonEventWriter.class).in(Scopes.SINGLETON);
binder.bind(HttpEventClient.class).in(Scopes.SINGLETON);
newSetBinder(binder, EventClient.class).addBinding().to(Key.get(HttpEventClient.class)).in(Scopes.SINGLETON);
newExporter(binder).export(EventClient.class).withGeneratedName();
discoveryBinder(binder).bindHttpSelector("collector");
// bind the http client
httpClientBinder(binder).bindHttpClient("event", ForEventClient.class);
// Kick off the binding of Set<EventTypeMetadata> in case no events are bound
newSetBinder(binder, new TypeLiteral<EventTypeMetadata<?>>() {
});
}
use of io.airlift.event.client.EventTypeMetadata in project airlift by airlift.
the class TestHttpEventClient method newEventClient.
private HttpEventClient newEventClient(List<URI> uris) {
HttpServiceSelector selector = new StaticHttpServiceSelector("collector", "general", uris);
Set<EventTypeMetadata<?>> eventTypes = getValidEventTypeMetaDataSet(FixedDummyEventClass.class);
JsonEventWriter eventWriter = new JsonEventWriter(eventTypes);
return new HttpEventClient(selector, eventWriter, new NodeInfo("test"), httpClient);
}
Aggregations