Java ArrayBlockingQueue getParameterQueueSize(String queueName)

Here you can find the source of getParameterQueueSize(String queueName)

Description

get Parameter Queue Size

License

GNU General Public License

Declaration

public static int getParameterQueueSize(String queueName)
        throws Exception 

Method Source Code

//package com.java2s;
/**/*from  ww w. ja  v a  2s .  c  o m*/
 * Helper???????????????????????????.<br>
 *
 * @author T.Okuyama
 * @license GPL(Lv3)
 */

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ConcurrentHashMap;

public class Main {
    private static ConcurrentHashMap serviceParameterQueueMap = new ConcurrentHashMap(
            1024, 1000, 512);

    public static int getParameterQueueSize(String queueName)
            throws Exception {
        int ret = -1;
        try {
            ret = ((ArrayBlockingQueue) serviceParameterQueueMap
                    .get(queueName)).size();
        } catch (Exception e) {
            e.printStackTrace();
            throw e;
        }
        return ret;
    }
}

Related

  1. createUniqueHelperParamQueue(String uniqueQueueName, int size)
  2. getArrayBlockingQueue(final Object o, final Class clazz, final int capacity)
  3. newArrayBlockingQueue()
  4. newArrayBlockingQueue(final int capacity)
  5. newArrayBlockingQueue(int capacity)