akka.japi.pf
Class DeciderBuilder

java.lang.Object
  extended by akka.japi.pf.DeciderBuilder

public class DeciderBuilder
extends java.lang.Object

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:


Method Summary
static
<P extends java.lang.Throwable>
PFBuilder<java.lang.Throwable,SupervisorStrategy.Directive>
match(java.lang.Class<P> type, FI.Apply<P,SupervisorStrategy.Directive> apply)
          Return a new PFBuilder with a case statement added.
static
<P extends java.lang.Throwable>
PFBuilder<java.lang.Throwable,SupervisorStrategy.Directive>
match(java.lang.Class<P> type, FI.TypedPredicate<P> predicate, FI.Apply<P,SupervisorStrategy.Directive> apply)
          Return a new PFBuilder with a case statement added.
static PFBuilder<java.lang.Throwable,SupervisorStrategy.Directive> matchAny(FI.Apply<java.lang.Object,SupervisorStrategy.Directive> apply)
          Return a new PFBuilder with a case statement added.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

match

public static <P extends java.lang.Throwable> PFBuilder<java.lang.Throwable,SupervisorStrategy.Directive> match(java.lang.Class<P> type,
                                                                                                                FI.Apply<P,SupervisorStrategy.Directive> apply)
Return a new PFBuilder with a case statement added.

Parameters:
type - a type to match the argument against
apply - an action to apply to the argument if the type matches
Returns:
a builder with the case statement added

match

public static <P extends java.lang.Throwable> PFBuilder<java.lang.Throwable,SupervisorStrategy.Directive> match(java.lang.Class<P> type,
                                                                                                                FI.TypedPredicate<P> predicate,
                                                                                                                FI.Apply<P,SupervisorStrategy.Directive> apply)
Return a new PFBuilder with a case statement added.

Parameters:
type - a type to match the argument against
predicate - a predicate that will be evaluated on the argument if the type matches
apply - an action to apply to the argument if the type matches and the predicate returns true
Returns:
a builder with the case statement added

matchAny

public static PFBuilder<java.lang.Throwable,SupervisorStrategy.Directive> matchAny(FI.Apply<java.lang.Object,SupervisorStrategy.Directive> apply)
Return a new PFBuilder with a case statement added.

Parameters:
apply - an action to apply to the argument
Returns:
a builder with the case statement added