Packages

package pf

Type Members

  1. class DeciderBuilder extends AnyRef

    Used for building a partial function for Actor.supervisorStrategy().

    Used for building a partial function for Actor.supervisorStrategy(). * Inside an actor you can use it like this with Java 8 to define your supervisorStrategy.

    Example:

    @Override
    private static SupervisorStrategy strategy =
      new OneForOneStrategy(10, Duration.ofMinutes(1), DeciderBuilder.
        match(ArithmeticException.class, e -> resume()).
        match(NullPointerException.class, e -> restart()).
        match(IllegalArgumentException.class, e -> stop()).
        matchAny(o -> escalate()).build());
    
    @Override
    public SupervisorStrategy supervisorStrategy() {
      return strategy;
    }
    

  2. final class FI extends AnyRef

    Class that encapsulates Functional Interfaces used for creating partial functions.

    Class that encapsulates Functional Interfaces used for creating partial functions.

    These classes are kept for compatibility, but for future API's please prefer the ones in org.apache.pekko.japi.function.

  3. class FSMStateFunctionBuilder[S, D] extends AnyRef

    Builder used to create a partial function for org.apache.pekko.actor.FSM#whenUnhandled.

    Builder used to create a partial function for org.apache.pekko.actor.FSM#whenUnhandled.

    Annotations
    @SuppressWarnings()
  4. class FSMStopBuilder[S, D] extends AnyRef

    Builder used to create a partial function for org.apache.pekko.actor.FSM#onTermination.

  5. class FSMTransitionHandlerBuilder[S] extends AnyRef

    Builder used to create a partial function for org.apache.pekko.actor.FSM#onTransition.

  6. class Match[I, R] extends AbstractMatch[I, R]

    Version of scala.PartialFunction that can be built during runtime from Java.

  7. final class PFBuilder[I, R] extends AbstractPFBuilder[I, R]

    A builder for scala.PartialFunction.

  8. class ReceiveBuilder extends AnyRef

    Used for building a partial function for org.apache.pekko.actor.AbstractActor#createReceive() AbstractActor.createReceive().

    Used for building a partial function for org.apache.pekko.actor.AbstractActor#createReceive() AbstractActor.createReceive().

    There is both a match on type only, and a match on type and predicate.

    Inside an actor you can use it like this:

    Example:

    @Override
    public Receive createReceive() {
      return receiveBuilder()
        .match(Double.class, d -> {
          getSender().tell(d.isNaN() ? 0 : d, self());
        })
        .match(Integer.class, i -> {
          getSender().tell(i * 10, self());
        })
        .match(String.class, s -> s.startsWith("foo"), s -> {
          getSender().tell(s.toUpperCase(), self());
        })
        .build()
      );
    }
    

  9. class UnitMatch[I] extends AbstractMatch[I, BoxedUnit]

    Version of scala.PartialFunction that can be built during runtime from Java.

    Version of scala.PartialFunction that can be built during runtime from Java. This is a specialized version of UnitMatch to map java void methods to scala.runtime.BoxedUnit.

  10. final class UnitPFBuilder[I] extends AbstractPFBuilder[I, BoxedUnit]

    A builder for scala.PartialFunction.

    A builder for scala.PartialFunction. This is a specialized version of PFBuilder to map java void methods to scala.runtime.BoxedUnit.

Ungrouped