本文整理汇总了Java中com.lmax.disruptor.LifecycleAware类的典型用法代码示例。如果您正苦于以下问题:Java LifecycleAware类的具体用法?Java LifecycleAware怎么用?Java LifecycleAware使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
LifecycleAware类属于com.lmax.disruptor包,在下文中一共展示了LifecycleAware类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: start
import com.lmax.disruptor.LifecycleAware; //导入依赖的package包/类
@Override
protected void start() {
super.start();
if (delegate instanceof LifecycleAware) {
try {
((LifecycleAware) delegate).onStart();
} catch (final Throwable ex) {
exceptionHandler.handleOnStartException(ex);
}
}
}
示例2: shutdown
import com.lmax.disruptor.LifecycleAware; //导入依赖的package包/类
@Override
protected void shutdown() {
super.shutdown();
if (delegate instanceof LifecycleAware) {
try {
((LifecycleAware) delegate).onShutdown();
} catch (final Throwable ex) {
exceptionHandler.handleOnShutdownException(ex);
}
}
}
示例3: onStart
import com.lmax.disruptor.LifecycleAware; //导入依赖的package包/类
@Override
public synchronized void onStart() {
if (!started) {
if (delegate instanceof LifecycleAware) {
((LifecycleAware) delegate).onStart();
}
started = true;
}
}
示例4: onShutdown
import com.lmax.disruptor.LifecycleAware; //导入依赖的package包/类
@Override
public synchronized void onShutdown() {
if (started) {
started = false;
if (delegate instanceof LifecycleAware) {
((LifecycleAware) delegate).onShutdown();
}
}
}
示例5: notifyStart
import com.lmax.disruptor.LifecycleAware; //导入依赖的package包/类
private void notifyStart() {
if (eventHandler instanceof LifecycleAware) {
try {
((LifecycleAware) eventHandler).onStart();
} catch (final Throwable ex) {
exceptionHandler.handleOnStartException(ex);
}
}
}
示例6: notifyShutdown
import com.lmax.disruptor.LifecycleAware; //导入依赖的package包/类
private void notifyShutdown() {
if (eventHandler instanceof LifecycleAware) {
try {
((LifecycleAware) eventHandler).onShutdown();
} catch (final Throwable ex) {
exceptionHandler.handleOnShutdownException(ex);
}
}
}
示例7: AccessorEventHandler
import com.lmax.disruptor.LifecycleAware; //导入依赖的package包/类
private AccessorEventHandler(EventHandler<T> handler)
{
this.handler = handler;
lifecycle = handler instanceof LifecycleAware ? (LifecycleAware) handler : null;
}