Class AbstractActorGroup

java.lang.Object
net.sodacan.core.actorgroup.AbstractActorGroup
All Implemented Interfaces:
Closeable, AutoCloseable, ActorGroup
Direct Known Subclasses:
DefaultActorGroup

public abstract class AbstractActorGroup extends Object implements ActorGroup
  • Field Details

  • Constructor Details

    • AbstractActorGroup

      public AbstractActorGroup(Config config, int actorGroupNumber)
  • Method Details

    • sendStartMessage

      protected void sendStartMessage(ActorId actorId)
    • setHost

      public void setHost(Host host)
      Specified by:
      setHost in interface ActorGroup
    • getScheduler

      public Scheduler getScheduler()
      Specified by:
      getScheduler in interface ActorGroup
    • close

      public void close() throws IOException, RuntimeException
      This works in two ways: For normal ActorGroups, close waits for the actor to finish processing messages. For Host-Bound Actors, we need to exchange close and closed messages to ensure each is properly shut down.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException
      RuntimeException
    • getConfig

      public Config getConfig()
    • getActorGroupNumber

      public int getActorGroupNumber()
      Description copied from interface: ActorGroup
      A actorGroup has a unique id.
      Specified by:
      getActorGroupNumber in interface ActorGroup
      Returns:
      The unique id of the actorGroup
    • increaseMessageLoad

      public void increaseMessageLoad()
    • reduceMessageLoad

      public void reduceMessageLoad()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • addMessage

      public void addMessage(Jug jug)

      Queue this message for processing by scheduler

      Specified by:
      addMessage in interface ActorGroup
      Parameters:
      jug -