- Notifications
You must be signed in to change notification settings - Fork10
Concepts: Useful Annotations
@StatelessWorkerinterfaceMyActorextendsActor {}
Causes your actor to be a stateless worker. Seestateless workers.
@NoIdentityinterfaceMyActorextendsActor {}
Denotes that this actor does not have an identity and acts as a singleton. Actor is accessed using Actor.getReference(clazz) instead of Actor.getReference(clazz, id).
@PreferLocalPlacement(percentile=100)interfaceMyActorextendsActor {}
Denotes that this actor should prefer to be placed locally if not already activated and the local node is capable of hosting it. Optional percentile value allows developers to define the likelihood of preferring local placement (default 100).
@NeverDeactivateinterfaceMyActorextendsActor {}
Denotes that this actor should prefer not to deactivate once it has been activated, overriding the default deactivation due to inactivity.Please Note: This is a hint, the actor will not start automatically and may still be deactivated in the case of node failure. Applications should ping the actor regularly if they need to ensure it is always alive.
@TimeToLive(value=10,timeUnit=TimeUnit.MINUTES)interfaceMyActorextendsActor {}
Overrides the default time to live on an actor type.
@OneWayTasksomeMessage();
This message is OneWay. No result (value or status) will be returned, no guarantee that message will be processed.The Task might contain an exception if there was a problem locating the target object or serializing the message.
@OnlyIfActivatedTasksomeMessage();
This message is only executed if the actor has already been activated. Unlike normal messages, this will not cause an actor to activate.
@CacheResponse(maxEntries =1000,ttlDuration =5,ttlUnit =TimeUnit.SECONDS)Task<String>getAccountName(intid);
This message caches its result, on a per actor, per parameter-set basis. The data persists for the given duration, or until at least the specified number of entries has been reached (whichever constraint is encountered first). Cached values are not guaranteed to immediately evict once maxEntries has been reached.
Caches can be force-flushed using ExecutionCacheFlushManager.
@Timeout(value=10,timeUnit=TimeUnit.SECONDS)Task <String>getAccountName();
Overrides the default message timeout for the given actor message.
@ReentrantTask<Void>doSomething() {}
Causes your message to be reentrant. Seereentrancy.
@SkipUpdateLastAccessTask<Void>doSomething() {}
Does not update the actors last access time thus preventing the message from extending the actor time to live.
@ImmutableclassSomeMessageDTO {}
Denotes that an object is considered immutable and therefore the framework does not need to clone it. The application must ensure that the object is actually immutable and does not change once it has been passed to the framework.
Developed byElectronic Arts.Licensed under theBSD 3-Clause License.