Class ExtractorAdapter<E,M>
- java.lang.Object
-
- akka.cluster.sharding.typed.ShardingMessageExtractor<java.lang.Object,M>
-
- akka.cluster.sharding.typed.internal.ExtractorAdapter<E,M>
-
public class ExtractorAdapter<E,M> extends ShardingMessageExtractor<java.lang.Object,M>
INTERNAL API Extracts entityId and unwraps ShardingEnvelope and StartEntity messages. Other messages are delegated to the givenShardingMessageExtractor
.
-
-
Constructor Summary
Constructors Constructor Description ExtractorAdapter(ShardingMessageExtractor<E,M> delegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
entityId(java.lang.Object message)
Extract the entity id from an incomingmessage
.java.lang.String
shardId(java.lang.String entityId)
The shard identifier for a given entity id.java.lang.String
toString()
M
unwrapMessage(java.lang.Object message)
Extract the message to send to the entity from an incomingmessage
.-
Methods inherited from class akka.cluster.sharding.typed.ShardingMessageExtractor
apply, noEnvelope
-
-
-
-
Constructor Detail
-
ExtractorAdapter
public ExtractorAdapter(ShardingMessageExtractor<E,M> delegate)
-
-
Method Detail
-
entityId
public java.lang.String entityId(java.lang.Object message)
Description copied from class:ShardingMessageExtractor
Extract the entity id from an incomingmessage
. Ifnull
is returned the message will beunhandled
, i.e. posted asUnhandled
messages on the event stream- Specified by:
entityId
in classShardingMessageExtractor<java.lang.Object,M>
-
shardId
public java.lang.String shardId(java.lang.String entityId)
Description copied from class:ShardingMessageExtractor
The shard identifier for a given entity id. Only messages that passed theShardingMessageExtractor.entityId(E)
function will be used as input to this function.- Specified by:
shardId
in classShardingMessageExtractor<java.lang.Object,M>
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
unwrapMessage
public M unwrapMessage(java.lang.Object message)
Description copied from class:ShardingMessageExtractor
Extract the message to send to the entity from an incomingmessage
. Note that the extracted message does not have to be the same as the incoming message to support wrapping in message envelope that is unwrapped before sending to the entity actor.- Specified by:
unwrapMessage
in classShardingMessageExtractor<java.lang.Object,M>
-
-