use of io.vertx.up.atom.agent.Depot in project vertx-zero by silentbalanceyh.
the class EventAxis method mount.
/**
* Secreter for security limitation
* 1. Authorization
* 2. Authorize
*/
@Override
public void mount(final Router router) {
// Extract Event foreach
EVENTS.forEach(event -> {
// Build Route and connect to each Action
Fn.safeSemi(null == event, LOGGER, () -> LOGGER.warn(Info.NULL_EVENT, getClass().getName()), () -> {
// 1. Verify
Verifier.verify(event);
final Route route = router.route();
// 2. Path, Method, Order
Hub<Route> hub = Fn.poolThread(Pool.URIHUBS, () -> Instance.instance(UriHub.class));
hub.mount(route, event);
// 3. Consumes/Produces
hub = Fn.poolThread(Pool.MEDIAHUBS, () -> Instance.instance(MediaHub.class));
hub.mount(route, event);
// 4. Request validation
final Depot depot = Depot.create(event);
// 5. Request workflow executor: handler
final Aim<RoutingContext> aim = this.splitter.distribute(event);
/**
* 6. Handler chain
* 1) Mime Analyzer ( Build arguments )
* 2) Validation
* 3) Execute handler ( Code Logical )
* 4) Uniform failure handler
*/
route.handler(this.verifier.signal(depot)).handler(aim.attack(event)).failureHandler(CommonEndurer.create());
});
});
}
use of io.vertx.up.atom.agent.Depot in project vertx-zero by silentbalanceyh.
the class EventAxis method mount.
@Override
public void mount(final Router router) {
// Extract Event foreach
EVENTS.forEach(event -> {
// Build Route and connect to each Action
Fn.safeSemi(null == event, LOGGER, () -> LOGGER.warn(Info.NULL_EVENT, getClass().getName()), () -> {
// 1. Verify
Verifier.verify(event);
final Route route = router.route();
// 2. Path, Method, Order
Hub<Route> hub = Fn.poolThread(Pool.URIHUBS, () -> Instance.instance(UriHub.class));
hub.mount(route, event);
// 3. Consumes/Produces
hub = Fn.poolThread(Pool.MEDIAHUBS, () -> Instance.instance(MediaHub.class));
hub.mount(route, event);
// 4. Request validation
final Depot depot = Depot.create(event);
// 5. Request workflow executor: handler
final Aim aim = this.splitter.distribute(event);
route.handler(this.verifier.signal(depot)).failureHandler(ZeroRxEndurer.create());
});
});
}
Aggregations