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


Java LifecycleAware类代码示例

本文整理汇总了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);
        }
    }
}
 
开发者ID:andymalakov,项目名称:f1x,代码行数:12,代码来源:AbstractByteRingConsumerEx.java

示例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);
        }
    }
}
 
开发者ID:andymalakov,项目名称:f1x,代码行数:13,代码来源:AbstractByteRingConsumerEx.java

示例3: onStart

import com.lmax.disruptor.LifecycleAware; //导入依赖的package包/类
@Override
public synchronized void onStart() {
    if (!started) {
        if (delegate instanceof LifecycleAware) {
            ((LifecycleAware) delegate).onStart();
        }
        started = true;
    }
}
 
开发者ID:trautonen,项目名称:logback-ext,代码行数:10,代码来源:DisruptorAppender.java

示例4: onShutdown

import com.lmax.disruptor.LifecycleAware; //导入依赖的package包/类
@Override
public synchronized void onShutdown() {
    if (started) {
        started = false;
        if (delegate instanceof LifecycleAware) {
            ((LifecycleAware) delegate).onShutdown();
        }
    }
}
 
开发者ID:trautonen,项目名称:logback-ext,代码行数:10,代码来源:DisruptorAppender.java

示例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);
        }
    }
}
 
开发者ID:wso2,项目名称:andes,代码行数:10,代码来源:ConcurrentContentReadTaskBatchProcessor.java

示例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);
        }
    }
}
 
开发者ID:wso2,项目名称:andes,代码行数:10,代码来源:ConcurrentContentReadTaskBatchProcessor.java

示例7: AccessorEventHandler

import com.lmax.disruptor.LifecycleAware; //导入依赖的package包/类
private AccessorEventHandler(EventHandler<T> handler)
{
    this.handler = handler;
    lifecycle = handler instanceof LifecycleAware ? (LifecycleAware) handler : null;
}
 
开发者ID:winwill2012,项目名称:disruptor-code-analysis,代码行数:6,代码来源:CustomRingBuffer.java


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