Java 类com.lmax.disruptor.LifecycleAware 实例源码

项目:f1x    文件:AbstractByteRingConsumerEx.java   
@Override
protected void start() {
    super.start();
    if (delegate instanceof LifecycleAware) {
        try {
            ((LifecycleAware) delegate).onStart();
        } catch (final Throwable ex) {
            exceptionHandler.handleOnStartException(ex);
        }
    }
}
项目:f1x    文件:AbstractByteRingConsumerEx.java   
@Override
protected void shutdown() {
    super.shutdown();

    if (delegate instanceof LifecycleAware) {
        try {
            ((LifecycleAware) delegate).onShutdown();
        } catch (final Throwable ex) {
            exceptionHandler.handleOnShutdownException(ex);
        }
    }
}
项目:logback-ext    文件:DisruptorAppender.java   
@Override
public synchronized void onStart() {
    if (!started) {
        if (delegate instanceof LifecycleAware) {
            ((LifecycleAware) delegate).onStart();
        }
        started = true;
    }
}
项目:logback-ext    文件:DisruptorAppender.java   
@Override
public synchronized void onShutdown() {
    if (started) {
        started = false;
        if (delegate instanceof LifecycleAware) {
            ((LifecycleAware) delegate).onShutdown();
        }
    }
}
项目:andes    文件:ConcurrentContentReadTaskBatchProcessor.java   
private void notifyStart() {
    if (eventHandler instanceof LifecycleAware) {
        try {
            ((LifecycleAware) eventHandler).onStart();
        } catch (final Throwable ex) {
            exceptionHandler.handleOnStartException(ex);
        }
    }
}
项目:andes    文件:ConcurrentContentReadTaskBatchProcessor.java   
private void notifyShutdown() {
    if (eventHandler instanceof LifecycleAware) {
        try {
            ((LifecycleAware) eventHandler).onShutdown();
        } catch (final Throwable ex) {
            exceptionHandler.handleOnShutdownException(ex);
        }
    }
}
项目:disruptor-code-analysis    文件:CustomRingBuffer.java   
private AccessorEventHandler(EventHandler<T> handler)
{
    this.handler = handler;
    lifecycle = handler instanceof LifecycleAware ? (LifecycleAware) handler : null;
}