当前位置: 首页>>代码示例>>Java>>正文


Java ClusterClientReceptionist类代码示例

本文整理汇总了Java中akka.cluster.client.ClusterClientReceptionist的典型用法代码示例。如果您正苦于以下问题:Java ClusterClientReceptionist类的具体用法?Java ClusterClientReceptionist怎么用?Java ClusterClientReceptionist使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ClusterClientReceptionist类属于akka.cluster.client包,在下文中一共展示了ClusterClientReceptionist类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: Master

import akka.cluster.client.ClusterClientReceptionist; //导入依赖的package包/类
public Master(FiniteDuration workTimeout, AgentConfig agentConfig) {
    this.workTimeout = workTimeout;
    this.agentConfig = agentConfig;
    this.reportExecutor = getContext().watch(getContext().actorOf(Props.create(ReportExecutor.class, agentConfig), "report"));
    ClusterClientReceptionist.get(getContext().system()).registerService(getSelf());
    this.cleanupTask = getContext().system().scheduler().schedule(workTimeout.div(2), workTimeout.div(2), getSelf(), CleanupTick, getContext().dispatcher(), getSelf());
}
 
开发者ID:Abiy,项目名称:distGatling,代码行数:8,代码来源:Master.java

示例2: Master

import akka.cluster.client.ClusterClientReceptionist; //导入依赖的package包/类
public Master(FiniteDuration workTimeout) {
  this.workTimeout = workTimeout;
  ClusterClientReceptionist.get(getContext().system()).registerService(getSelf());
  this.cleanupTask = getContext().system().scheduler().schedule(workTimeout.div(2), workTimeout.div(2), getSelf(), CleanupTick, getContext().dispatcher(), getSelf());
}
 
开发者ID:typesafehub,项目名称:activator-akka-distributed-workers-java,代码行数:6,代码来源:Master.java

示例3: createClientActors

import akka.cluster.client.ClusterClientReceptionist; //导入依赖的package包/类
/**
 * Create ClientActor for each region.
 */
private void createClientActors( ActorSystem system ) {

    for ( String region : getSeedsByRegion().keySet() ) {

        if ( currentRegion.equals( region )) {

            logger.info( "Creating clientActor for region [{}]", region );

            // Each clientActor needs to know path to ClusterSingletonProxy and region
            clientActor = system.actorOf(
                Props.create( ClientActor.class, routersByMessageType ), "clientActor" );

            ClusterClientReceptionist.get(system).registerService( clientActor );

        } else {

            logger.info( "Creating clusterClient for region [{}]", region );

            Set<ActorPath> seedPaths = new HashSet<>(20);
            for ( String seed : getSeedsByRegion().get( region ) ) {
                seedPaths.add( ActorPaths.fromString( seed + "/system/receptionist") );
            }

            ActorRef clusterClient = system.actorOf( ClusterClient.props(
                ClusterClientSettings.create(system).withInitialContacts( seedPaths )), "client");

            clusterClientsByRegion.put( region, clusterClient );
        }
    }
}
 
开发者ID:apache,项目名称:usergrid,代码行数:34,代码来源:ActorSystemManagerImpl.java


注:本文中的akka.cluster.client.ClusterClientReceptionist类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。