sys.actorOf(Props.create(TestActor.class), "mytest"); ActorSelection sel = sys.actorSelection("/user/mytest");
public ActorSelection actorSelection(String actorPath) { return actorSystem.actorSelection(actorPath); }
public ActorSelection actorSelection(ActorPath actorPath) { return actorSystem.actorSelection(actorPath); }
@PostConstruct private void init() { mapCacheDB = system.actorSelection(dbUrl + CacheType.Map.getName()); }
private ActorSelection actorSelection(ActorSystem actorSystem) { return actorSystem.actorSelection("/" + actorPath + "/" + actorName); }
@Override public CompletableFuture<MetricQueryServiceGateway> retrieveService(String queryServicePath) { ActorSelection selection = actorSystem.actorSelection(queryServicePath); return FutureUtils.toJava(selection.resolveOne(FutureUtils.toFiniteDuration(lookupTimeout))).thenApply(AkkaQueryServiceGateway::new); } }
protected final ActorSelection selectActor(ActorPath path) { return shard.getContext().system().actorSelection(path); }
@Override public CompletableFuture<MetricQueryServiceGateway> retrieveService(String queryServicePath) { ActorSelection selection = actorSystem.actorSelection(queryServicePath); return FutureUtils.toJava(selection.resolveOne(FutureUtils.toFiniteDuration(lookupTimeout))).thenApply(AkkaQueryServiceGateway::new); } }
@Override public CompletableFuture<MetricQueryServiceGateway> retrieveService(String queryServicePath) { ActorSelection selection = actorSystem.actorSelection(queryServicePath); return FutureUtils.toJava(selection.resolveOne(FutureUtils.toFiniteDuration(lookupTimeout))).thenApply(AkkaQueryServiceGateway::new); } }
private void addPeer(final Address address) { if (!clusterMembers.contains(address)) { clusterMembers.add(address); } peers.computeIfAbsent(address, input -> getContext().system() .actorSelection(input.toString() + getSelf().path().toStringWithoutAddress())); }
private PrimaryShardInfo onPrimaryShardFound(String shardName, String primaryActorPath, short primaryVersion, DataTree localShardDataTree) { ActorSelection actorSelection = actorSystem.actorSelection(primaryActorPath); PrimaryShardInfo info = localShardDataTree == null ? new PrimaryShardInfo(actorSelection, primaryVersion) : new PrimaryShardInfo(actorSelection, primaryVersion, localShardDataTree); primaryShardInfoCache.putSuccessful(shardName, info); return info; }
protected final ActorSelection selectActor(ActorRef ref) { return shard.getContext().system().actorSelection(ref.path()); }
@Override public void run() { LOG.debug("Retrying identify message from master to node {} , full path {}", ((ActorIdentity) message).correlationId(), path); context.system().actorSelection(path).tell(new Identify(((ActorIdentity) message).correlationId()), self); } }, system.dispatcher());
protected AbstractUntypedActor() { LOG.debug("Actor created {}", getSelf()); getContext().system().actorSelection("user/termination-monitor").tell(new Monitor(getSelf()), getSelf()); }
protected AbstractUntypedPersistentActor() { LOG.trace("Actor created {}", getSelf()); getContext().system().actorSelection("user/termination-monitor").tell(new Monitor(getSelf()), getSelf()); }
protected AbstractUntypedActor() { LOG.debug("Actor created {}", getSelf()); getContext().system().actorSelection("user/termination-monitor").tell(new Monitor(getSelf()), getSelf()); }
protected AbstractUntypedPersistentActor() { LOG.trace("Actor created {}", getSelf()); getContext().system().actorSelection("user/termination-monitor").tell(new Monitor(getSelf()), getSelf()); }
/** * Gets bucket versions from bucket store and sends to the supplied address * * @param remoteActorSystemAddress remote gossiper to send to */ void getLocalStatusAndSendTo(Address remoteActorSystemAddress){ //Get local status from bucket store and send to remote Future<Object> futureReply = Patterns.ask(getContext().parent(), new GetBucketVersions(), config.getAskDuration()); //Find gossiper on remote system ActorSelection remoteRef = getContext().system().actorSelection( remoteActorSystemAddress.toString() + getSelf().path().toStringWithoutAddress()); if(log.isTraceEnabled()) { log.trace("Sending bucket versions to [{}]", remoteRef); } futureReply.map(getMapperToSendLocalStatus(remoteRef), getContext().dispatcher()); }
@Override public void preStart(){ Cluster cluster = Cluster.get(actorSystem); for(Member node : cluster.state().getMembers()) { if(!node.address().equals(cluster.selfAddress())) { final NetconfTopologyPathCreator pathCreator = new NetconfTopologyPathCreator(node.address().toString(), topologyId); final String path = pathCreator.withSuffix(nodeId).withSuffix(NetconfTopologyPathCreator.MASTER_SOURCE_PROVIDER).build(); actorSystem.actorSelection(path).tell(new AnnounceClusteredDeviceSourcesResolverUp(), TypedActor.context().self()); } } }
public void unregisterMountPoint() { salProvider.getMountInstance().onTopologyDeviceDisconnected(); if (deviceDataBroker != null) { LOG.debug("Stopping master data broker for device {}", id.getName()); for (final Member member : Cluster.get(actorSystem).state().getMembers()) { if (member.address().equals(Cluster.get(actorSystem).selfAddress())) { continue; } final NetconfTopologyPathCreator pathCreator = new NetconfTopologyPathCreator(member.address().toString(), topologyId); final String path = pathCreator.withSuffix(id.getName()).build(); actorSystem.actorSelection(path).tell(new AnnounceMasterMountPointDown(), null); } TypedActor.get(actorSystem).stop(deviceDataBroker); deviceDataBroker = null; } }