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


Java Persistence类代码示例

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


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

示例1: sayHello

import io.atomix.primitive.Persistence; //导入依赖的package包/类
@GET
@Timed
@Path("/hello-world")
public Saying sayHello(@QueryParam("name") Optional<String> name) {
    final AtomicCounter counter = atomix.atomicCounterBuilder("counter")
            .withPersistence(Persistence.EPHEMERAL).build();

    final String value = String.format(template, name.orElse(defaultName));
    return new Saying(counter.incrementAndGet(), value);
}
 
开发者ID:smoketurner,项目名称:dropwizard-atomix,代码行数:11,代码来源:HelloWorldResource.java

示例2: getAsyncMultiMap

import io.atomix.primitive.Persistence; //导入依赖的package包/类
@Override
public <K, V> void getAsyncMultiMap(String name, Handler<AsyncResult<AsyncMultiMap<K, V>>> handler) {
  atomix.<K, V>consistentMultimapBuilder(name)
      .withSerializer(createSerializer())
      .withConsistency(Consistency.LINEARIZABLE)
      .withPersistence(Persistence.PERSISTENT)
      .withReplication(Replication.SYNCHRONOUS)
      .withRecovery(Recovery.RECOVER)
      .withMaxRetries(5)
      .buildAsync()
      .whenComplete(VertxFutures.convertHandler(
          handler, map -> new AtomixAsyncMultiMap<>(vertx, map.async()), vertx.getOrCreateContext()));
}
 
开发者ID:atomix,项目名称:atomix-vertx,代码行数:14,代码来源:AtomixClusterManager.java

示例3: getAsyncMap

import io.atomix.primitive.Persistence; //导入依赖的package包/类
@Override
public <K, V> void getAsyncMap(String name, Handler<AsyncResult<AsyncMap<K, V>>> handler) {
  atomix.<K, V>consistentMapBuilder(name)
      .withSerializer(createSerializer())
      .withConsistency(Consistency.LINEARIZABLE)
      .withPersistence(Persistence.PERSISTENT)
      .withReplication(Replication.SYNCHRONOUS)
      .withRecovery(Recovery.RECOVER)
      .withMaxRetries(5)
      .buildAsync()
      .whenComplete(VertxFutures.convertHandler(
          handler, map -> new AtomixAsyncMap<>(vertx, map.async()), vertx.getOrCreateContext()));
}
 
开发者ID:atomix,项目名称:atomix-vertx,代码行数:14,代码来源:AtomixClusterManager.java

示例4: getSyncMap

import io.atomix.primitive.Persistence; //导入依赖的package包/类
@Override
public <K, V> Map<K, V> getSyncMap(String name) {
  return new AtomixMap<>(vertx, atomix.<K, V>consistentMapBuilder(name)
      .withSerializer(createSerializer())
      .withConsistency(Consistency.LINEARIZABLE)
      .withPersistence(Persistence.PERSISTENT)
      .withReplication(Replication.SYNCHRONOUS)
      .withRecovery(Recovery.RECOVER)
      .withMaxRetries(5)
      .build());
}
 
开发者ID:atomix,项目名称:atomix-vertx,代码行数:12,代码来源:AtomixClusterManager.java

示例5: defaultPersistence

import io.atomix.primitive.Persistence; //导入依赖的package包/类
@Override
protected Persistence defaultPersistence() {
  return Persistence.PERSISTENT;
}
 
开发者ID:atomix,项目名称:atomix,代码行数:5,代码来源:AtomicIdGeneratorBuilder.java

示例6: defaultPersistence

import io.atomix.primitive.Persistence; //导入依赖的package包/类
@Override
protected Persistence defaultPersistence() {
  return Persistence.EPHEMERAL;
}
 
开发者ID:atomix,项目名称:atomix,代码行数:5,代码来源:ConsistentTreeMapBuilder.java

示例7: withPersistence

import io.atomix.primitive.Persistence; //导入依赖的package包/类
@Override
public DistributedSetBuilder<E> withPersistence(Persistence persistence) {
  mapBuilder.withPersistence(persistence);
  return this;
}
 
开发者ID:atomix,项目名称:atomix,代码行数:6,代码来源:DelegatingDistributedSetBuilder.java

示例8: persistence

import io.atomix.primitive.Persistence; //导入依赖的package包/类
@Override
public Persistence persistence() {
  return mapBuilder.persistence();
}
 
开发者ID:atomix,项目名称:atomix,代码行数:5,代码来源:DelegatingDistributedSetBuilder.java


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