io.vertx.up.uca.web.anima.AffluxScatter Maven / Gradle / Ivy
package io.vertx.up.uca.web.anima;
import io.vertx.core.Vertx;
import io.vertx.up.unity.Uobj;
import io.vertx.up.atom.agent.Event;
import io.vertx.up.atom.worker.Receipt;
import io.vertx.up.util.Ut;
import io.vertx.up.runtime.Runner;
import io.vertx.up.runtime.ZeroAnno;
import java.util.Set;
/**
* Injection system
*/
public class AffluxScatter implements Scatter {
@Override
public void connect(final Vertx vertx) {
final Uobj injector = Uobj.create(this.getClass());
// Extract all events.
final Set events = ZeroAnno.getEvents();
Ut.itSet(events, (item, index) ->
Runner.run(() -> injector.singleton(item.getProxy())
, "event-afflux-" + index));
// Extract all receipts.
final Set receipts = ZeroAnno.getReceipts();
Ut.itSet(receipts, (item, index) ->
Runner.run(() -> injector.singleton(item.getProxy())
, "receipt-afflux-" + index));
// Extract non - event/receipts Objects
final Set> injects = ZeroAnno.getInjects();
Ut.itSet(injects, (item, index) ->
Runner.run(() -> injector.singleton(item),
"injects-afflux-" + index));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy