本文整理汇总了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());
}
示例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;
}
示例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();
}
}
示例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();
}
示例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;
}
示例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());
});
}
示例7: setUp
import akka.actor.ExtendedActorSystem; //导入依赖的package包/类
@Before
public void setUp() {
JavaSerializer.currentSystem().value_$eq((ExtendedActorSystem) actorSystem);
}
示例8: setUp
import akka.actor.ExtendedActorSystem; //导入依赖的package包/类
@Before
public void setUp() {
JavaSerializer.currentSystem().value_$eq((ExtendedActorSystem) SYSTEM);
}
示例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());
}
示例11: createExtension
import akka.actor.ExtendedActorSystem; //导入依赖的package包/类
public Replication createExtension(ExtendedActorSystem system) {
return new Replication(system);
}
示例12: createExtension
import akka.actor.ExtendedActorSystem; //导入依赖的package包/类
public SharedActorMaterializer createExtension(ExtendedActorSystem system) {
return new SharedActorMaterializer(system);
}
示例13: SharedActorMaterializer
import akka.actor.ExtendedActorSystem; //导入依赖的package包/类
private SharedActorMaterializer(ExtendedActorSystem system) {
this.materializer = ActorMaterializer.create(system);
}
示例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();
}
示例15: createExtension
import akka.actor.ExtendedActorSystem; //导入依赖的package包/类
@Override
public AkkaExtension createExtension(ExtendedActorSystem system) {
return new AkkaExtension();
}