@LoadLevel(name="atomic-long", order=999) public class AtomicLongSequenceServiceImpl extends Object implements ISequenceService
AtomicLong 实现的内存序列服务
主要用途: 1)单机单应用运行时才能使用此序列服务。 2)运行单元测试时,用于模拟Mock序列服务。
特点:性能高。
使用说明:应用启动时,需要指定其初始值。
| 构造器和说明 |
|---|
AtomicLongSequenceServiceImpl() |
AtomicLongSequenceServiceImpl(long initialValue) |
public AtomicLongSequenceServiceImpl(long initialValue)
public AtomicLongSequenceServiceImpl()
public long currVal(@NonNull
String seqName)
ISequenceServicecurrVal 在接口中 ISequenceServiceseqName - 序列名public long nextVal(@NonNull
String seqName)
ISequenceService注意:实现类中不允许抛出 NotSupportedException,该方法是序列服务必须要支持的功能。
nextVal 在接口中 ISequenceServiceseqName - 序列名public long setVal(@NonNull
String seqName,
long newVal)
ISequenceServicesetVal 在接口中 ISequenceServiceseqName - 序列名newVal - 新的序列值public AtomicLong getAtomicLong(String seqName)
Copyright © 2021 EasyJ寮�婧愮ぞ鍖�. All rights reserved.