Package com.ibm.mq

Examples of com.ibm.mq.MQQueue


   }

   public synchronized Map getStatistics(DestinationConfig dConfig) throws JMSException
   {
      final Map stats = new LinkedHashMap();
      MQQueue queue = null ;
     
      try
      {
         final String queueName = getRealDestinationName(dConfig);
         queue = getQueueManager().accessQueue(queueName, MQC.MQOO_INQUIRE | MQC.MQOO_INPUT_AS_Q_DEF, null, null, null);

         stats.put("Description", queue.getDescription().trim());
         stats.put("CurrentDepth", new Integer(queue.getCurrentDepth()));
         stats.put("OpenOutputCount", new Integer(queue.getOpenOutputCount()));
         stats.put("OpenInputCount", new Integer(queue.getOpenInputCount()));

         if (queue.getInhibitGet() == MQC.MQQA_GET_INHIBITED)
         {
            stats.put("InhibitGet", Boolean.TRUE);
         }
         else
         {
            stats.put("InhibitGet", Boolean.FALSE);
         }

         if (queue.getInhibitPut() == MQC.MQQA_PUT_INHIBITED)
         {
            stats.put("InhibitPut", Boolean.TRUE);
         }
         else
         {
            stats.put("InhibitPut", Boolean.FALSE);
         }

         if (queue.getShareability() == MQC.MQQA_SHAREABLE)
         {
            stats.put("Sharable", Boolean.TRUE);
         }
         else
         {
            stats.put("Sharable", Boolean.FALSE);
         }

         if (queue.getTriggerControl() == MQC.MQTC_ON)
         {
            stats.put("TriggerControl", Boolean.TRUE);
            stats.put("TriggerData", queue.getTriggerData());
            stats.put("TriggerDepth", new Integer(queue.getTriggerDepth()));
            stats.put("TriggerMessagePriority", new Integer(queue.getTriggerMessagePriority()));

            switch (queue.getTriggerType())
            {
               case MQC.MQTT_NONE:
                  stats.put("TriggerType", "None");
                  break;

               case MQC.MQTT_DEPTH:
                  stats.put("TriggerType", "Depth");
                  break;

               case MQC.MQTT_EVERY:
                  stats.put("TriggerType", "Every");
                  break;

               case MQC.MQTT_FIRST:
                  stats.put("TriggerType", "First");
                  break;

               default:
                  stats.put("TriggerType", "Unknown");
            }
         }
         else
         {
            stats.put("TriggerControl", Boolean.FALSE);
         }

         stats.put("MaximumDepth", new Integer(queue.getMaximumDepth()));
         stats.put("MaximumMessageLength", new Integer(queue.getMaximumMessageLength()));
      }
      catch (MQException ex)
      {
         if (ex.reasonCode != 2033)
         {
            throw new HermesException(ex) ;
         }
         else
         {
            log.debug("PCF calls gave a 2033 reason code, ignoring") ;
         }
      }
      catch (Exception ex) {
        throw new HermesException(ex) ;
      }
      finally
      {
         if (queue != null)
         {
            try
            {
               queue.close() ;
            }
            catch (MQException ex)
            {
               log.error("ignoring error closing queue: " + ex.getMessage(), ex) ;
            }
View Full Code Here


   public int getDepth(DestinationConfig dConfig) throws JMSException
   {
      try
      {
         final String queueName = getRealDestinationName(dConfig);
         final MQQueue queue = getQueueManager().accessQueue(queueName, MQC.MQOO_INQUIRE | MQC.MQOO_INPUT_AS_Q_DEF, null, null, null);
         final int depth = queue.getCurrentDepth();

         queue.close();

         return depth;
      }
      catch (Exception e)
      {
View Full Code Here

TOP

Related Classes of com.ibm.mq.MQQueue

Copyright © 2018 www.massapicom. 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.