Codota Logo
ActiveObjectCounter.add
Code IndexAdd Codota to your IDE (free)

How to use
add
method
in
org.springframework.amqp.rabbit.listener.ActiveObjectCounter

Best Java code snippets using org.springframework.amqp.rabbit.listener.ActiveObjectCounter.add (Showing top 7 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Connection c =
  • Codota IconDataSource dataSource;dataSource.getConnection()
  • Codota IconString url;DriverManager.getConnection(url)
  • Codota IconIdentityDatabaseUtil.getDBConnection()
  • Smart code suggestions by Codota
}
origin: spring-projects/spring-amqp

public void start() throws AmqpException {
  if (logger.isDebugEnabled()) {
    logger.debug("Starting consumer " + this);
  }
  this.thread = Thread.currentThread();
  try {
    this.resourceHolder = ConnectionFactoryUtils.getTransactionalResourceHolder(this.connectionFactory,
        this.transactional);
    this.channel = this.resourceHolder.getChannel();
    ClosingRecoveryListener.addRecoveryListenerIfNecessary(this.channel); // NOSONAR never null here
  }
  catch (AmqpAuthenticationException e) {
    throw new FatalListenerStartupException("Authentication failure", e);
  }
  this.deliveryTags.clear();
  this.activeObjectCounter.add(this);
  passiveDeclarations();
  setQosAndreateConsumers();
}
origin: org.springframework.amqp/spring-rabbit

public void start() throws AmqpException {
  if (logger.isDebugEnabled()) {
    logger.debug("Starting consumer " + this);
  }
  this.thread = Thread.currentThread();
  try {
    this.resourceHolder = ConnectionFactoryUtils.getTransactionalResourceHolder(this.connectionFactory,
        this.transactional);
    this.channel = this.resourceHolder.getChannel();
    ClosingRecoveryListener.addRecoveryListenerIfNecessary(this.channel); // NOSONAR never null here
  }
  catch (AmqpAuthenticationException e) {
    throw new FatalListenerStartupException("Authentication failure", e);
  }
  this.deliveryTags.clear();
  this.activeObjectCounter.add(this);
  passiveDeclarations();
  setQosAndreateConsumers();
}
origin: spring-projects/spring-amqp

@Test
public void testTimeoutWaitForLocks() throws Exception {
  final Object object1 = new Object();
  counter.add(object1);
  assertEquals(false, counter.await(200L, TimeUnit.MILLISECONDS));
}
origin: spring-projects/spring-amqp

@Test
public void testWaitForLocks() throws Exception {
  final Object object1 = new Object();
  final Object object2 = new Object();
  counter.add(object1);
  counter.add(object2);
  Future<Boolean> future = Executors.newSingleThreadExecutor().submit(() -> {
    counter.release(object1);
    counter.release(object2);
    counter.release(object2);
    return true;
  });
  assertEquals(true, counter.await(1000L, TimeUnit.MILLISECONDS));
  assertEquals(true, future.get());
}
origin: spring-projects/spring-amqp

synchronized (this.consumersMonitor) {
  if (consumer != null) {
    this.cancellationLock.add(consumer);
    this.consumers.add(consumer);
    this.consumersByQueue.add(queue, consumer);
origin: org.springframework.amqp/spring-rabbit

synchronized (this.consumersMonitor) {
  if (consumer != null) {
    this.cancellationLock.add(consumer);
    this.consumers.add(consumer);
    this.consumersByQueue.add(queue, consumer);
origin: spring-projects/spring-amqp

@Test
public void testActiveCount() throws Exception {
  final Object object1 = new Object();
  final Object object2 = new Object();
  counter.add(object1);
  counter.add(object2);
  assertEquals(2, counter.getCount());
  counter.release(object2);
  assertEquals(1, counter.getCount());
  counter.release(object1);
  counter.release(object1);
  assertEquals(0, counter.getCount());
}
org.springframework.amqp.rabbit.listenerActiveObjectCounteradd

Popular methods of ActiveObjectCounter

  • await
  • getCount
  • release
  • deactivate
  • isActive
  • reset
  • <init>

Popular in Java

  • Start an intent from android
  • getApplicationContext (Context)
  • setRequestProperty (URLConnection)
    Sets the general request property. If a property with the key already exists, overwrite its value wi
  • compareTo (BigDecimal)
    Compares this BigDecimal with the specified BigDecimal. Two BigDecimal objects that are equal in val
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • StringTokenizer (java.util)
    The string tokenizer class allows an application to break a string into tokens. The tokenization met
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
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