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


Java ChannelListener类代码示例

本文整理汇总了Java中net.jodah.lyra.event.ChannelListener的典型用法代码示例。如果您正苦于以下问题:Java ChannelListener类的具体用法?Java ChannelListener怎么用?Java ChannelListener使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ChannelListener类属于net.jodah.lyra.event包,在下文中一共展示了ChannelListener类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addChannelListener

import net.jodah.lyra.event.ChannelListener; //导入依赖的package包/类
@Override
public void addChannelListener(final Channel channel,final ChannelListener channelListener) {
    Set<ChannelListener> listeners = this.channelListenerRegistry.get(channel);
    if(listeners == null) {
        listeners = Collections.newSetFromMap(new ConcurrentHashMap<ChannelListener, Boolean>());
        if(this.channelListenerRegistry.putIfAbsent(channel,listeners) != null) {
            // was already created
            listeners = this.channelListenerRegistry.get(channel);
        }
    }
    listeners.add(channelListener);
}
 
开发者ID:elasticsoftwarefoundation,项目名称:elasticactors,代码行数:13,代码来源:RabbitMQMessagingService.java

示例2: removeChannelListener

import net.jodah.lyra.event.ChannelListener; //导入依赖的package包/类
@Override
public void removeChannelListener(final Channel channel,final ChannelListener channelListener) {
    final Set<ChannelListener> listeners = this.channelListenerRegistry.get(channel);
    if(listeners != null) {
        listeners.remove(channelListener);
    }
}
 
开发者ID:elasticsoftwarefoundation,项目名称:elasticactors,代码行数:8,代码来源:RabbitMQMessagingService.java

示例3: propagateChannelEvent

import net.jodah.lyra.event.ChannelListener; //导入依赖的package包/类
private void propagateChannelEvent(final Channel channel, final Consumer<ChannelListener> channelEvent, final String channelEventName) {
    final Set<ChannelListener> listeners = this.channelListenerRegistry.get(channel);
    if(listeners != null) {
        for (ChannelListener listener : listeners) {
            try {
                channelEvent.accept(listener);
            } catch(Exception e) {
                logger.error(format("Exception while calling [%s] on ChannelListener [%s]", channelEventName, listener.toString()),e);
            }
        }
    }
}
 
开发者ID:elasticsoftwarefoundation,项目名称:elasticactors,代码行数:13,代码来源:RabbitMQMessagingService.java

示例4: notifyRecoveryStarted

import net.jodah.lyra.event.ChannelListener; //导入依赖的package包/类
private void notifyRecoveryStarted() {
  for (ChannelListener listener : config.getChannelListeners())
    try {
      listener.onRecoveryStarted(proxy);
    } catch (Exception ignore) {
    }
}
 
开发者ID:jhalterman,项目名称:lyra,代码行数:8,代码来源:ChannelHandler.java

示例5: notifyRecovery

import net.jodah.lyra.event.ChannelListener; //导入依赖的package包/类
private void notifyRecovery() {
  for (ChannelListener listener : config.getChannelListeners())
    try {
      if (!recoveryPending.get())
        listener.onRecovery(proxy);
    } catch (Exception ignore) {
    }
}
 
开发者ID:jhalterman,项目名称:lyra,代码行数:9,代码来源:ChannelHandler.java

示例6: notifyRecoveryCompleted

import net.jodah.lyra.event.ChannelListener; //导入依赖的package包/类
private void notifyRecoveryCompleted() {
  for (ChannelListener listener : config.getChannelListeners())
    try {
      listener.onRecoveryCompleted(proxy);
    } catch (Exception ignore) {
    }
}
 
开发者ID:jhalterman,项目名称:lyra,代码行数:8,代码来源:ChannelHandler.java

示例7: recoveryFailed

import net.jodah.lyra.event.ChannelListener; //导入依赖的package包/类
private void recoveryFailed(Exception e) {
  log.error("Failed to recover {}", this, e);
  recoveryComplete();
  interruptWaiters();
  for (ChannelListener listener : config.getChannelListeners())
    try {
      listener.onRecoveryFailure(proxy, e);
    } catch (Exception ignore) {
    }
}
 
开发者ID:jhalterman,项目名称:lyra,代码行数:11,代码来源:ChannelHandler.java

示例8: getChannelListeners

import net.jodah.lyra.event.ChannelListener; //导入依赖的package包/类
@Override
public Collection<ChannelListener> getChannelListeners() {
  return channelListeners != null ? channelListeners : parent != null ? parent.getChannelListeners()
    : Collections.<ChannelListener>emptyList();
}
 
开发者ID:jhalterman,项目名称:lyra,代码行数:6,代码来源:Config.java

示例9: withChannelListeners

import net.jodah.lyra.event.ChannelListener; //导入依赖的package包/类
@Override
public Config withChannelListeners(ChannelListener... channelListeners) {
  this.channelListeners = Arrays.asList(channelListeners);
  return this;
}
 
开发者ID:jhalterman,项目名称:lyra,代码行数:6,代码来源:Config.java

示例10: getChannelListeners

import net.jodah.lyra.event.ChannelListener; //导入依赖的package包/类
/**
 * Returns the channel's listeners else empty list if none were configured.
 * 
 * @see #withChannelListeners(ChannelListener...)
 */
Collection<ChannelListener> getChannelListeners();
 
开发者ID:jhalterman,项目名称:lyra,代码行数:7,代码来源:ChannelConfig.java

示例11: withChannelListeners

import net.jodah.lyra.event.ChannelListener; //导入依赖的package包/类
/**
 * Sets the {@code channelListeners} to call on channel related events.
 */
ChannelConfig withChannelListeners(ChannelListener... channelListeners);
 
开发者ID:jhalterman,项目名称:lyra,代码行数:5,代码来源:ChannelConfig.java

示例12: addChannelListener

import net.jodah.lyra.event.ChannelListener; //导入依赖的package包/类
void addChannelListener(Channel channel,ChannelListener channelListener); 
开发者ID:elasticsoftwarefoundation,项目名称:elasticactors,代码行数:2,代码来源:ChannelListenerRegistry.java

示例13: removeChannelListener

import net.jodah.lyra.event.ChannelListener; //导入依赖的package包/类
void removeChannelListener(Channel channel, ChannelListener channelListener); 
开发者ID:elasticsoftwarefoundation,项目名称:elasticactors,代码行数:2,代码来源:ChannelListenerRegistry.java


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