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;
}
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");
}
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);
}
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);
}
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");
}
Aggregations