Search in sources :

Example 1 with ActorCreator

use of im.actor.runtime.actors.ActorCreator in project actor-platform by actorapp.

the class EncryptedPeerActor method spawnSession.

private SessionActor spawnSession(final PeerSession session) {
    ActorRef res = system().actorOf(Props.create(new ActorCreator() {

        @Override
        public EncryptedSessionActor create() {
            return new EncryptedSessionActor(context(), session);
        }
    }), getPath() + "/k_" + RandomUtils.nextRid());
    SessionActor cont = new SessionActor(res, session);
    if (activeSessions.containsKey(session.getTheirKeyGroupId())) {
        activeSessions.get(session.getTheirKeyGroupId()).getSessions().add(cont);
    } else {
        ArrayList<SessionActor> l = new ArrayList<>();
        l.add(cont);
        activeSessions.put(session.getTheirKeyGroupId(), new SessionHolder(session.getTheirKeyGroupId(), l));
    }
    return cont;
}
Also used : ActorRef(im.actor.runtime.actors.ActorRef) ArrayList(java.util.ArrayList) ActorCreator(im.actor.runtime.actors.ActorCreator)

Example 2 with ActorCreator

use of im.actor.runtime.actors.ActorCreator in project actor-platform by actorapp.

the class EncryptionModule method run.

public void run() {
    keyManager = system().actorOf(Props.create(new ActorCreator() {

        @Override
        public KeyManagerActor create() {
            return new KeyManagerActor(context());
        }
    }), "encryption/keys");
    keyManagerInt = new KeyManagerInt(keyManager);
    sessionManager = system().actorOf(Props.create(new ActorCreator() {

        @Override
        public SessionManagerActor create() {
            return new SessionManagerActor(context());
        }
    }), "encryption/sessions");
    sessionManagerInt = new SessionManagerInt(sessionManager);
    messageEncryptor = system().actorOf(Props.create(new ActorCreator() {

        @Override
        public EncryptedMsgActor create() {
            return new EncryptedMsgActor(context());
        }
    }), "encryption/messaging");
}
Also used : KeyManagerActor(im.actor.core.modules.encryption.KeyManagerActor) EncryptedMsgActor(im.actor.core.modules.encryption.EncryptedMsgActor) KeyManagerInt(im.actor.core.modules.encryption.KeyManagerInt) ActorCreator(im.actor.runtime.actors.ActorCreator)

Example 3 with ActorCreator

use of im.actor.runtime.actors.ActorCreator in project actor-platform by actorapp.

the class CallBackgroundAvatarView method init.

public void init() {
    if (blurActor == null) {
        blurActor = system().actorOf(Props.create(new ActorCreator() {

            @Override
            public BlurActor create() {
                return new BlurActor();
            }
        }), "actor/call_blur");
    }
    GenericDraweeHierarchyBuilder builder = new GenericDraweeHierarchyBuilder(getResources());
    GenericDraweeHierarchy hierarchy = builder.setFadeDuration(200).build();
    setHierarchy(hierarchy);
}
Also used : GenericDraweeHierarchyBuilder(com.facebook.drawee.generic.GenericDraweeHierarchyBuilder) GenericDraweeHierarchy(com.facebook.drawee.generic.GenericDraweeHierarchy) ActorCreator(im.actor.runtime.actors.ActorCreator)

Example 4 with ActorCreator

use of im.actor.runtime.actors.ActorCreator in project actor-platform by actorapp.

the class AuthActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    authActor = ActorSystem.system().actorOf(Props.create(new ActorCreator() {

        @Override
        public Actor create() {
            return new Actor();
        }
    }), "actor/auth_promises_actor");
    signType = getIntent().getIntExtra(SIGN_TYPE_KEY, SIGN_TYPE_IN);
    PreferencesStorage preferences = messenger().getPreferences();
    currentPhone = preferences.getLong("currentPhone", 0);
    currentEmail = preferences.getString("currentEmail");
    transactionHash = preferences.getString("transactionHash");
    isRegistered = preferences.getBool("isRegistered", false);
    codeValidated = preferences.getBool("codeValidated", false);
    currentName = preferences.getString("currentName");
    signType = preferences.getInt("signType", signType);
    String savedState = preferences.getString("auth_state");
    state = Enum.valueOf(AuthState.class, savedState != null ? savedState : "AUTH_START");
    updateState(state, true);
}
Also used : AuthState(im.actor.core.AuthState) Actor(im.actor.runtime.actors.Actor) ActorCreator(im.actor.runtime.actors.ActorCreator) PreferencesStorage(im.actor.runtime.storage.PreferencesStorage)

Example 5 with ActorCreator

use of im.actor.runtime.actors.ActorCreator in project actor-platform by actorapp.

the class AudioPlayerActor method preStart.

@Override
public void preStart() {
    androidPlayerActor = ActorSystem.system().actorOf(Props.create(new ActorCreator() {

        @Override
        public AndroidPlayerActor create() {
            return new AndroidPlayerActor(context, callback);
        }
    }), "actor/android_player");
    opusPlayerActor = ActorSystem.system().actorOf(Props.create(new ActorCreator() {

        @Override
        public OpusPlayerActor create() {
            return new OpusPlayerActor(callback);
        }
    }), "actor/opus_player");
}
Also used : ActorCreator(im.actor.runtime.actors.ActorCreator)

Aggregations

ActorCreator (im.actor.runtime.actors.ActorCreator)6 AudioRecord (android.media.AudioRecord)1 GenericDraweeHierarchy (com.facebook.drawee.generic.GenericDraweeHierarchy)1 GenericDraweeHierarchyBuilder (com.facebook.drawee.generic.GenericDraweeHierarchyBuilder)1 AuthState (im.actor.core.AuthState)1 EncryptedMsgActor (im.actor.core.modules.encryption.EncryptedMsgActor)1 KeyManagerActor (im.actor.core.modules.encryption.KeyManagerActor)1 KeyManagerInt (im.actor.core.modules.encryption.KeyManagerInt)1 Actor (im.actor.runtime.actors.Actor)1 ActorRef (im.actor.runtime.actors.ActorRef)1 PreferencesStorage (im.actor.runtime.storage.PreferencesStorage)1 ArrayList (java.util.ArrayList)1