Package akka.actor.typed.receptionist
Class ServiceKey<T>
- java.lang.Object
-
- akka.actor.typed.internal.receptionist.AbstractServiceKey
-
- akka.actor.typed.receptionist.ServiceKey<T>
-
- Direct Known Subclasses:
DefaultServiceKey
public abstract class ServiceKey<T> extends AbstractServiceKey
Scala API: Provides a type safe pattern match for listings.Using it for pattern match like this will return the reachable service instances:
case MyServiceKey.Listing(reachable) =>
In a non-clustered
ActorSystem
this will always be all registered instances for a service key. For a clustered environment services on nodes that have been observed unreachable are not among these (note that they could have become unreachable between this message being sent and the receiving actor processing it).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
ServiceKey.Listing$
Scala API: Provides a type safe pattern match for listings.class
ServiceKey.Registered$
-
Constructor Summary
Constructors Constructor Description ServiceKey()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static <T> ServiceKey<T>
apply(java.lang.String id, scala.reflect.ClassTag<T> classTag)
ServiceKey<T>
asServiceKey()
static <T> ServiceKey<T>
create(java.lang.Class<T> clazz, java.lang.String id)
Java API: Creates a service key.abstract java.lang.String
id()
ServiceKey.Listing$
Listing()
Accessor for nested Scala objectServiceKey.Registered$
Registered()
Accessor for nested Scala object
-
-
-
Method Detail
-
apply
public static <T> ServiceKey<T> apply(java.lang.String id, scala.reflect.ClassTag<T> classTag)
-
create
public static <T> ServiceKey<T> create(java.lang.Class<T> clazz, java.lang.String id)
Java API: Creates a service key. The given ID should uniquely define a service with a given protocol.- Parameters:
clazz
- (undocumented)id
- (undocumented)- Returns:
- (undocumented)
-
Listing
public ServiceKey.Listing$ Listing()
Accessor for nested Scala object- Returns:
- (undocumented)
-
Registered
public ServiceKey.Registered$ Registered()
Accessor for nested Scala object- Returns:
- (undocumented)
-
id
public abstract java.lang.String id()
-
asServiceKey
public ServiceKey<T> asServiceKey()
-
-