All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.vertx.up.uca.web.origin.AgentInquirer Maven / Gradle / Ivy

There is a newer version: 0.9.0
Show newest version
package io.vertx.up.uca.web.origin;

import io.vertx.up.annotations.Agent;
import io.vertx.up.eon.em.ServerType;
import io.vertx.up.util.Ut;
import io.vertx.up.runtime.ZeroHelper;

import java.util.List;
import java.util.Set;
import java.util.concurrent.ConcurrentMap;
import java.util.stream.Collectors;

/**
 * This component is for @Agent annotated class
 */
public class AgentInquirer implements
        Inquirer>>> {

    @Override
    public ConcurrentMap>> scan(final Set> classes) {
        final Set> agents =
                classes.stream()
                        .filter((item) -> item.isAnnotationPresent(Agent.class))
                        .collect(Collectors.toSet());
        return Ut.elementGroup(agents, ZeroHelper::getAgentKey,
                (item) -> item);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy