Codota Logo
DirectReplyToMessageListenerContainer$ChannelHolder.<init>
Code IndexAdd Codota to your IDE (free)

How to use
org.springframework.amqp.rabbit.listener.DirectReplyToMessageListenerContainer$ChannelHolder
constructor

Best Java code snippets using org.springframework.amqp.rabbit.listener.DirectReplyToMessageListenerContainer$ChannelHolder.<init> (Showing top 2 results out of 315)

  • Common ways to obtain DirectReplyToMessageListenerContainer$ChannelHolder
private void myMethod () {
DirectReplyToMessageListenerContainer$ChannelHolder d =
  • Codota IconDirectReplyToMessageListenerContainer directReplyToMessageListenerContainer;directReplyToMessageListenerContainer.getChannelHolder()
  • Smart code suggestions by Codota
}
origin: spring-projects/spring-amqp

/**
 * Get the channel holder associated with a direct reply-to consumer; contains a
 * consumer epoch to prevent inappropriate releases.
 * @return the channel holder.
 */
public ChannelHolder getChannelHolder() {
  synchronized (this.consumersMonitor) {
    ChannelHolder channelHolder = null;
    while (channelHolder == null) {
      if (!isRunning()) {
        throw new IllegalStateException("Direct reply-to container is not running");
      }
      for (SimpleConsumer consumer : this.consumers) {
        Channel candidate = consumer.getChannel();
        if (candidate.isOpen() && this.inUseConsumerChannels.putIfAbsent(candidate, consumer) == null) {
          channelHolder = new ChannelHolder(candidate, consumer.incrementAndGetEpoch());
          this.whenUsed.put(consumer, System.currentTimeMillis());
          break;
        }
      }
      if (channelHolder == null) {
        this.consumerCount++;
        super.setConsumersPerQueue(this.consumerCount);
      }
    }
    return channelHolder;
  }
}
origin: org.springframework.amqp/spring-rabbit

/**
 * Get the channel holder associated with a direct reply-to consumer; contains a
 * consumer epoch to prevent inappropriate releases.
 * @return the channel holder.
 */
public ChannelHolder getChannelHolder() {
  synchronized (this.consumersMonitor) {
    ChannelHolder channelHolder = null;
    while (channelHolder == null) {
      if (!isRunning()) {
        throw new IllegalStateException("Direct reply-to container is not running");
      }
      for (SimpleConsumer consumer : this.consumers) {
        Channel candidate = consumer.getChannel();
        if (candidate.isOpen() && this.inUseConsumerChannels.putIfAbsent(candidate, consumer) == null) {
          channelHolder = new ChannelHolder(candidate, consumer.incrementAndGetEpoch());
          this.whenUsed.put(consumer, System.currentTimeMillis());
          break;
        }
      }
      if (channelHolder == null) {
        this.consumerCount++;
        super.setConsumersPerQueue(this.consumerCount);
      }
    }
    return channelHolder;
  }
}
org.springframework.amqp.rabbit.listenerDirectReplyToMessageListenerContainer$ChannelHolder<init>

Popular methods of DirectReplyToMessageListenerContainer$ChannelHolder

  • getChannel
  • getConsumerEpoch

Popular in Java

  • Updating database using SQL prepared statement
  • getApplicationContext (Context)
  • requestLocationUpdates (LocationManager)
  • findViewById (Activity)
  • Kernel (java.awt.image)
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • HashSet (java.util)
    This class implements the Set interface, backed by a hash table (actually a HashMap instance). It m
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now