All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.droidkit.actors.ActorContext Maven / Gradle / Ivy

Go to download

DroidKit Actors is simple actor model implementation for java and Android

There is a newer version: 0.6.1
Show newest version
package com.droidkit.actors;

/**
 * Context of actor
 *
 * @author Stepan Ex3NDR Korshakov ([email protected])
 */
public class ActorContext {
    private final ActorScope actorScope;

    /**
     * 

INTERNAL API

* Creating of actor context * * @param scope actor scope */ public ActorContext(ActorScope scope) { this.actorScope = scope; } /** * Actor Reference * * @return reference */ public ActorRef getSelf() { return actorScope.getActorRef(); } /** * Actor system * * @return Actor system */ public ActorSystem getSystem() { return actorScope.getActorSystem(); } /** * Sender of last received message * * @return sender's ActorRef */ public ActorRef sender() { return actorScope.getSender(); } /** * Stopping actor */ public void stopSelf() { try { actorScope.getDispatcher().killGracefully(actorScope); } catch (Exception e) { e.printStackTrace(); } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy