Package org.eigengo.monitor.agent.akka

Source Code of org.eigengo.monitor.agent.akka.DispatcherTagger

package org.eigengo.monitor.agent.akka;

import akka.actor.ActorCell;
import akka.actor.ActorPath;

import java.util.ArrayList;
import java.util.List;

/**
* Contains logic that performs tagging of the dispatcher.
*/
public class DispatcherTagger extends AbstractTagger {

    /**
     * Constructs this instance, assigns the {@code includeRoutees} field.
     *
     * @param includeRoutees {@code true} if the tagging should include the routees
     * @see org.eigengo.monitor.agent.akka.AbstractTagger#addActorPathTagsTo(akka.actor.ActorPath, java.util.List)
     */
    DispatcherTagger(boolean includeRoutees) {
        super(includeRoutees);
    }

    /**
     * Computes the tags for the dispatcher associated with subsequent operations on the
     * given {@code actorCell}.
     *
     * @param actorCell the ActorCell that will perform some operation later
     * @return the tags
     */
    final String[] getTags(final ActorCell actorCell) {
        final List<String> tags = new ArrayList<String>(3);
        final ActorPath actorPath = actorCell.self().path();

        addActorPathTagsTo(actorPath, tags);
        addSystemTagsTo(actorPath, tags);
        tags.add(String.format("akka.dispatcher:%s", actorCell.dispatcher().id()));

        return tags.toArray(new String[tags.size()]);

    }
}
TOP

Related Classes of org.eigengo.monitor.agent.akka.DispatcherTagger

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.