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

io.vertx.up.uca.web.thread.SockThread Maven / Gradle / Ivy

The newest version!
package io.vertx.up.uca.web.thread;

import io.vertx.up.atom.worker.Remind;
import io.horizon.uca.log.Annal;
import io.vertx.up.uca.rs.Extractor;
import io.vertx.up.uca.rs.config.SockExtractor;
import io.vertx.up.util.Ut;

import java.util.HashSet;
import java.util.Set;

/**
 * @author Lang
 */
public class SockThread extends Thread {
    private static final Annal LOGGER = Annal.get(SockThread.class);
    private final Set reminds = new HashSet<>();


    private final transient Extractor> extractor =
        Ut.instance(SockExtractor.class);

    private final transient Class reference;

    public SockThread(final Class clazz) {
        this.setName("zero-web-socket-scanner-" + this.getId());
        this.reference = clazz;
    }


    @Override
    public void run() {
        if (null != this.reference) {
            this.reminds.addAll(this.extractor.extract(this.reference));
            LOGGER.info(Info.SCANNED_SOCKS, this.reference.getName(),
                this.reminds.size());
        }
    }

    public Set getEvents() {
        return this.reminds;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy