|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectcom.alibaba.rocketmq.store.ReferenceResource
public abstract class ReferenceResource
引用计数基类,类似于C++智能指针实现
| 字段摘要 | |
|---|---|
protected boolean |
available
|
protected boolean |
cleanupOver
|
protected AtomicLong |
refCount
|
| 构造方法摘要 | |
|---|---|
ReferenceResource()
|
|
| 方法摘要 | |
|---|---|
abstract boolean |
cleanup(long currentRef)
|
long |
getRefCount()
|
boolean |
hold()
资源是否能HOLD住 |
boolean |
isAvailable()
资源是否可用,即是否可被HOLD |
boolean |
isCleanupOver()
资源是否被清理完成 |
void |
release()
释放资源 |
void |
shutdown(long intervalForcibly)
禁止资源被访问 shutdown不允许调用多次,最好是由管理线程调用 |
| 从类 java.lang.Object 继承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 字段详细信息 |
|---|
protected final AtomicLong refCount
protected volatile boolean available
protected volatile boolean cleanupOver
| 构造方法详细信息 |
|---|
public ReferenceResource()
| 方法详细信息 |
|---|
public boolean hold()
public boolean isAvailable()
public void shutdown(long intervalForcibly)
public long getRefCount()
public void release()
public abstract boolean cleanup(long currentRef)
public boolean isCleanupOver()
|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||