}
// Finding dispatcher for actor
String dispatcherId = props.getDispatcher() == null ? DEFAULT_DISPATCHER : props.getDispatcher();
AbsActorDispatcher mailboxesDispatcher;
synchronized (dispatchers) {
if (!dispatchers.containsKey(dispatcherId)) {
throw new RuntimeException("Unknown dispatcherId '" + dispatcherId + "'");
}
mailboxesDispatcher = dispatchers.get(dispatcherId);
}
// Creating actor scope
scope = mailboxesDispatcher.createScope(path, props);
// Saving actor in collection
actors.put(path, scope);
return scope.getActorRef();