Package edu.emory.mathcs.backport.java.util.concurrent.atomic

Examples of edu.emory.mathcs.backport.java.util.concurrent.atomic.AtomicInteger.incrementAndGet()


        Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
        destination = createDestination(session, destinationType);
        MessageConsumer consumer = session.createConsumer(destination);
        consumer.setMessageListener(new MessageListener() {
            public void onMessage(Message m) {
                counter.incrementAndGet();
                if( counter.get()==4 )
                    done.countDown();
            }
        });
View Full Code Here


                Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
                MessageConsumer consumer = session.createConsumer(destination);

                consumer.setMessageListener(new MessageListener() {
                    public void onMessage(Message msg) {
                        receivedMessages.incrementAndGet();
                    }
                });
                connection.start();

                connectionsEstablished.release();
View Full Code Here

            public Thread newThread(Runnable runnable) {
                Thread t = originalThreadFactory.newThread(
                        new NamePreservingRunnable(
                                runnable,
                                ExecutorThreadModel.this.threadNamePrefix + '-' +
                                threadId.incrementAndGet()));
                t.setDaemon(true);
                return t;
            }
        };
        tpe.setThreadFactory(newThreadFactory);
View Full Code Here

        final AtomicInteger recvCount = new AtomicInteger(0);
        getJmsConsumer().setMessageListener(new MessageListener() {
            public void onMessage(Message msg) {
                incThroughput();
                recvCount.incrementAndGet();
                recvCount.notify();
            }
        });

        try {
View Full Code Here

                throws JMSException {

              final BytesMessage message = session.createBytesMessage();

              message.writeBytes(bytes);
              message.setIntProperty("count", count.incrementAndGet());
              message.setStringProperty("producer", "pooled");
              return message;
            }
          });
View Full Code Here

              final BytesMessage message = session
                  .createBytesMessage();

              message.writeBytes(bytes);
              message.setIntProperty("count", count
                  .incrementAndGet());
              message.setStringProperty("producer", "non-pooled");
              return message;
            }
          });
View Full Code Here

            private final AtomicInteger threadId = new AtomicInteger(0);

            public Thread newThread(Runnable runnable) {
                Thread t = originalThreadFactory.newThread(runnable);
                t.setName(ExecutorThreadModel.this.threadNamePrefix + '-'
                        + threadId.incrementAndGet());
                t.setDaemon(true);
                return t;
            }
        };
        tpe.setThreadFactory(newThreadFactory);
View Full Code Here

            public Thread newThread(Runnable runnable) {
                Thread t = originalThreadFactory.newThread(
                        new NamePreservingRunnable(
                                runnable,
                                ExecutorThreadModel.this.threadNamePrefix + '-' +
                                threadId.incrementAndGet()));
                t.setDaemon(true);
                return t;
            }
        };
        tpe.setThreadFactory(newThreadFactory);
View Full Code Here

            private final AtomicInteger threadId = new AtomicInteger( 0 );

            public Thread newThread( Runnable runnable )
            {
                Thread t = originalThreadFactory.newThread( runnable );
                t.setName( ExecutorThreadModel.this.threadNamePrefix + '-' + threadId.incrementAndGet() );
                t.setDaemon( true );
                return t;
            }
        };
        tpe.setThreadFactory( newThreadFactory );
View Full Code Here

                // ignored
            }

            public void actionProxyCreationRequest(ProxyEvent event) throws AdminLimitExceeded
            {
                _counter.incrementAndGet();
            }
        };

        objectUnderTest_.addProxyEventListener(_listener);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.