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


Java ExtendedActorSystem类代码示例

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


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

示例1: testDoLoadAsyncWithAkkaSerializedSnapshot

import akka.actor.ExtendedActorSystem; //导入依赖的package包/类
@Test
public void testDoLoadAsyncWithAkkaSerializedSnapshot() throws IOException {
    SnapshotSerializer snapshotSerializer = new SnapshotSerializer((ExtendedActorSystem) system);

    String name = toSnapshotName(PERSISTENCE_ID, 1, 1000);
    try (FileOutputStream fos = new FileOutputStream(new File(SNAPSHOT_DIR, name))) {
        fos.write(snapshotSerializer.toBinary(new Snapshot("one")));
    }

    SnapshotMetadata metadata = new SnapshotMetadata(PERSISTENCE_ID, 1, 1000);

    JavaTestKit probe = new JavaTestKit(system);
    snapshotStore.tell(new LoadSnapshot(PERSISTENCE_ID,
            SnapshotSelectionCriteria.latest(), Long.MAX_VALUE), probe.getRef());
    LoadSnapshotResult result = probe.expectMsgClass(LoadSnapshotResult.class);
    Option<SelectedSnapshot> possibleSnapshot = result.snapshot();

    assertEquals("SelectedSnapshot present", TRUE, possibleSnapshot.nonEmpty());
    assertEquals("SelectedSnapshot metadata", metadata, possibleSnapshot.get().metadata());
    assertEquals("SelectedSnapshot snapshot", "one", possibleSnapshot.get().snapshot());
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:22,代码来源:LocalSnapshotStoreTest.java

示例2: apply

import akka.actor.ExtendedActorSystem; //导入依赖的package包/类
@Override
public Ignite apply(ExtendedActorSystem system) {
    final IgniteProperties properties = igniteConfigProvider.apply(system);
    final IgniteConfiguration igniteConfiguration = new IgniteConfiguration();
    igniteConfiguration.setClientMode(properties.isClientNode());
    // durable file memory persistence
    if (properties.isEnableFilePersistence()) {
        DataStorageConfiguration persistentStoreConfiguration = new DataStorageConfiguration();
        persistentStoreConfiguration.setStoragePath(properties.getIgnitePersistenceFilePath() + "/data/store");
        persistentStoreConfiguration.setWalArchivePath(properties.getIgnitePersistenceFilePath() + "./data/walArchive");
        igniteConfiguration.setDataStorageConfiguration(persistentStoreConfiguration);
    }
    // connector configuration
    final ConnectorConfiguration connectorConfiguration = new ConnectorConfiguration();
    connectorConfiguration.setPort(properties.getIgniteConnectorPort());
    // common ignite configuration
    igniteConfiguration.setMetricsLogFrequency(properties.getMetricsLogFrequency());
    igniteConfiguration.setQueryThreadPoolSize(properties.getQueryThreadPoolSize());
    igniteConfiguration.setDataStreamerThreadPoolSize(properties.getDataStreamerThreadPoolSize());
    igniteConfiguration.setManagementThreadPoolSize(properties.getManagementThreadPoolSize());
    igniteConfiguration.setPublicThreadPoolSize(properties.getPublicThreadPoolSize());
    igniteConfiguration.setSystemThreadPoolSize(properties.getSystemThreadPoolSize());
    igniteConfiguration.setRebalanceThreadPoolSize(properties.getRebalanceThreadPoolSize());
    igniteConfiguration.setAsyncCallbackPoolSize(properties.getAsyncCallbackPoolSize());
    igniteConfiguration.setPeerClassLoadingEnabled(properties.isPeerClassLoadingEnabled());

    final BinaryConfiguration binaryConfiguration = new BinaryConfiguration();
    binaryConfiguration.setCompactFooter(false);
    igniteConfiguration.setBinaryConfiguration(binaryConfiguration);
    // cluster tcp configuration
    final TcpDiscoverySpi tcpDiscoverySpi = new TcpDiscoverySpi();
    final TcpDiscoveryVmIpFinder tcpDiscoveryVmIpFinder = new TcpDiscoveryVmIpFinder();
    // need to be changed when it come to real cluster configuration
    tcpDiscoveryVmIpFinder.setAddresses(Arrays.asList(properties.getTcpDiscoveryAddresses() + properties.getIgniteServerPortRange()));
    tcpDiscoverySpi.setIpFinder(tcpDiscoveryVmIpFinder);
    igniteConfiguration.setDiscoverySpi(new TcpDiscoverySpi());
    final Ignite ignite = Ignition.start(igniteConfiguration);
    Runtime.getRuntime().addShutdownHook(new Thread(ignite::close));
    return ignite;
}
 
开发者ID:Romeh,项目名称:akka-persistance-ignite,代码行数:41,代码来源:IgniteFactoryByConfig.java

示例3: tryDeserializeAkkaSnapshot

import akka.actor.ExtendedActorSystem; //导入依赖的package包/类
private Object tryDeserializeAkkaSnapshot(final File file) throws IOException {
    LOG.debug("tryDeserializeAkkaSnapshot {}", file);

    // The snapshot was probably previously stored via akka's LocalSnapshotStore which wraps the data
    // in a Snapshot instance and uses the SnapshotSerializer to serialize it to a byte[]. So we'll use
    // the SnapshotSerializer to try to de-serialize it.

    SnapshotSerializer snapshotSerializer = new SnapshotSerializer((ExtendedActorSystem) context().system());

    try (InputStream in = new BufferedInputStream(new FileInputStream(file))) {
        return ((Snapshot)snapshotSerializer.fromBinary(ByteStreams.toByteArray(in))).data();
    }
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:14,代码来源:LocalSnapshotStore.java

示例4: setUp

import akka.actor.ExtendedActorSystem; //导入依赖的package包/类
@Override
@Before
public void setUp() throws Exception {
    system = ActorSystem.apply();
    JavaSerializer.currentSystem().value_$eq((ExtendedActorSystem) system);
    super.setUp();
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:8,代码来源:RequestEnvelopeTest.java

示例5: createExtension

import akka.actor.ExtendedActorSystem; //导入依赖的package包/类
public DbmsLayerProvider createExtension(ExtendedActorSystem extendedActorSystem) {
    DbmsLayerProvider provider = null;
    try {
        provider = new DbmsLayerProvider(extendedActorSystem);
    } catch (Exception exc) {
        exc.printStackTrace();
        System.err.println("Unable to init DbmsLayer, halting: " + exc.getMessage());
        System.exit(123);
    }
    return provider;
}
 
开发者ID:disbrain,项目名称:BrainDAL,代码行数:12,代码来源:DbmsLayer.java

示例6: handleRequestAssemblerMessage

import akka.actor.ExtendedActorSystem; //导入依赖的package包/类
private void handleRequestAssemblerMessage(final Object message) {
    dispatchers.getDispatcher(DispatcherType.Serialization).execute(() -> {
        JavaSerializer.currentSystem().value_$eq((ExtendedActorSystem) context().system());
        requestMessageAssembler.handleMessage(message, self());
    });
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:7,代码来源:Shard.java

示例7: setUp

import akka.actor.ExtendedActorSystem; //导入依赖的package包/类
@Before
public void setUp() {
    JavaSerializer.currentSystem().value_$eq((ExtendedActorSystem) actorSystem);
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:5,代码来源:MessageSliceReplyTest.java

示例8: setUp

import akka.actor.ExtendedActorSystem; //导入依赖的package包/类
@Before
public void setUp() {
    JavaSerializer.currentSystem().value_$eq((ExtendedActorSystem) SYSTEM);
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:5,代码来源:ConnectClientSuccessTest.java

示例9: ApplicationStatusPersistenceQuery

import akka.actor.ExtendedActorSystem; //导入依赖的package包/类
public ApplicationStatusPersistenceQuery(ExtendedActorSystem system) {
    super(system);
}
 
开发者ID:jansoren,项目名称:akka-persistence-java-example,代码行数:4,代码来源:ApplicationStatusPersistenceQuery.java

示例10: createExtension

import akka.actor.ExtendedActorSystem; //导入依赖的package包/类
public SettingsImpl createExtension(ExtendedActorSystem system) {
    return new SettingsImpl(system.settings().config());
}
 
开发者ID:ferhtaydn,项目名称:akka-http-java-client,代码行数:4,代码来源:Settings.java

示例11: createExtension

import akka.actor.ExtendedActorSystem; //导入依赖的package包/类
public Replication createExtension(ExtendedActorSystem system) {
    return new Replication(system);
}
 
开发者ID:Tradeshift,项目名称:ts-reaktive,代码行数:4,代码来源:ReplicationId.java

示例12: createExtension

import akka.actor.ExtendedActorSystem; //导入依赖的package包/类
public SharedActorMaterializer createExtension(ExtendedActorSystem system) {
    return new SharedActorMaterializer(system);
}
 
开发者ID:Tradeshift,项目名称:ts-reaktive,代码行数:4,代码来源:SharedActorMaterializer.java

示例13: SharedActorMaterializer

import akka.actor.ExtendedActorSystem; //导入依赖的package包/类
private SharedActorMaterializer(ExtendedActorSystem system) {
    this.materializer = ActorMaterializer.create(system);
}
 
开发者ID:Tradeshift,项目名称:ts-reaktive,代码行数:4,代码来源:SharedActorMaterializer.java

示例14: createExtension

import akka.actor.ExtendedActorSystem; //导入依赖的package包/类
/**
 * Is used by Akka to instantiate the Extension identified by this
 * ExtensionId, internal use only.
 */
@Override
public SpringExt createExtension(ExtendedActorSystem system) {
    return new SpringExt();
}
 
开发者ID:PuspenduBanerjee,项目名称:akka-springctx-camel,代码行数:9,代码来源:SpringExtension.java

示例15: createExtension

import akka.actor.ExtendedActorSystem; //导入依赖的package包/类
@Override
public AkkaExtension createExtension(ExtendedActorSystem system) {
    return new AkkaExtension();
}
 
开发者ID:sdl,项目名称:odata,代码行数:5,代码来源:AkkaSpringExtension.java


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