Class LocalActor


  • public final class LocalActor
    extends java.lang.Object
    Static methods that provide access to Actor's functionality through an ActorRef if the actor is local. With the exception of the self() method, application code shouldn't normally use these methods. They are provided mainly for testing, and defining sophisticated behaviors.

    These services are provided as static methods rather than return a reference to the actor, as references to the actor should not leak outside the actor itself.

    • Method Detail

      • self

        public static <T extends ActorRef<M>,​M> T self()
        Returns the ActorRef of the actor currently running in the current strand.
        Type Parameters:
        T -
        M -
        Returns:
        The ActorRef of the current actor (caller of this method)
      • isLocal

        public static boolean isLocal​(ActorRef<?> actor)
      • join

        @Suspendable
        public static void join​(ActorRef<?> actor)
                         throws java.util.concurrent.ExecutionException,
                                java.lang.InterruptedException
        Throws:
        java.util.concurrent.ExecutionException
        java.lang.InterruptedException
      • join

        @Suspendable
        public static void join​(ActorRef<?> actor,
                                long timeout,
                                java.util.concurrent.TimeUnit unit)
                         throws java.util.concurrent.ExecutionException,
                                java.lang.InterruptedException,
                                java.util.concurrent.TimeoutException
        Throws:
        java.util.concurrent.ExecutionException
        java.lang.InterruptedException
        java.util.concurrent.TimeoutException
      • get

        @Suspendable
        public static <V> V get​(ActorRef<?> actor)
                         throws java.util.concurrent.ExecutionException,
                                java.lang.InterruptedException
        Throws:
        java.util.concurrent.ExecutionException
        java.lang.InterruptedException
      • get

        @Suspendable
        public static <V> V get​(ActorRef<?> actor,
                                long timeout,
                                java.util.concurrent.TimeUnit unit)
                         throws java.util.concurrent.ExecutionException,
                                java.lang.InterruptedException,
                                java.util.concurrent.TimeoutException
        Throws:
        java.util.concurrent.ExecutionException
        java.lang.InterruptedException
        java.util.concurrent.TimeoutException
      • isDone

        public static boolean isDone​(ActorRef<?> actor)
      • getDeathCause

        public static java.lang.Throwable getDeathCause​(ActorRef<?> actor)
      • getMonitor

        public static co.paralleluniverse.actors.ActorMonitor getMonitor​(ActorRef<?> actor)
      • stopMonitor

        public static void stopMonitor​(ActorRef<?> actor)
      • unregister

        public static void unregister​(ActorRef<?> actor)
      • getQueueLength

        public static int getQueueLength​(ActorRef<?> actor)
      • unlink

        public static void unlink​(ActorRef<?> actor1,
                                  ActorRef<?> actor2)
      • actorToString

        public static java.lang.String actorToString​(ActorRef<?> actor)
      • isInstance

        public static boolean isInstance​(ActorRef<?> actor,
                                         java.lang.Class<? extends Actor> type)
      • getClass

        public static java.lang.Class<? extends Actor> getClass​(ActorRef<?> actor)
      • toActorBuilder

        public static <M,​V> ActorBuilder<M,​V> toActorBuilder​(ActorRef<M> actor)