Package com.sun.messaging.jmq.util

Examples of com.sun.messaging.jmq.util.SizeString


            if (info.isModified(info.MAX_MESSAGES)) {
                int maxMessages = info.maxMessages;
                d.setCapacity(maxMessages);
            }
            if (info.isModified(info.MAX_MESSAGE_SIZE)) {
                SizeString maxSize = new SizeString();
                maxSize.setBytes(info.maxMessageSize);
                d.setMaxByteSize(maxSize);
            }
            if (info.isModified(info.MAX_MESSAGE_BYTES)) {
                SizeString maxBytes = new SizeString();
                maxBytes.setBytes(info.maxMessageBytes);
                d.setByteCapacity(maxBytes);
            }
            if (info.isModified(info.DEST_SCOPE)) {
                int scope = info.destScope;
                d.setScope(scope);
View Full Code Here


                dmq.maxProducerLimit = 0;
                dmq.scope=(Globals.getHAEnabled() ? DestScope.CLUSTER
                           :DestScope.LOCAL);
                dmq.msgSizeLimit= null;
                dmq.setLimitBehavior(DestLimitBehavior.REMOVE_OLDEST);
                dmq.memoryLimit = new SizeString(1024*10);
                dmq.countLimit = 1000;
                dmq.setCapacity(1000);
                dmq.maxPrefetch=1000;
                // deal with remaining properties
                dmq.isDMQ=true;
View Full Code Here

        }
        if (m.get(MAX_MESSAGES) != null) {
            setCapacity(((Integer)m.get(MAX_MESSAGES)).intValue());
        }
        if (m.get(MAX_BYTES) != null) {
            SizeString ss = new SizeString();
            ss.setBytes(((Long)m.get(MAX_BYTES)).longValue());
            setByteCapacity(ss);
        }
        if (m.get(MAX_MSG_BYTES) != null) {
            SizeString ss = new SizeString();
            ss.setBytes(((Long)m.get(MAX_MSG_BYTES)).longValue());
            setMaxByteSize(ss);
        }
        if (m.get(BEHAVIOUR) != null) {
            setLimitBehavior(((Integer)m.get(BEHAVIOUR)).intValue());
        }
View Full Code Here

  Globals.stdOutPrintln(ar.getString(ar.I_JMQCMD_SPECIFY_BKR));
  printBrokerInfo(broker);

  try {
      SizeString  ss;
      long  byteValue;

      destInfo = new DestinationInfo();

      destInfo.setType(destTypeMask);
      destInfo.setName(destName);

        // Check for optional destination attributes
      if ((prop = destAttrs.getProperty
    (PROP_NAME_OPTION_MAX_MESG_BYTE)) != null) {
    try  {
        ss = new SizeString(prop);
        byteValue = ss.getBytes();
              destInfo.setMaxMessageBytes(byteValue);
    } catch (NumberFormatException nfe)  {
        /*
         * Do nothing. We shouldn't ever get here since
         * we do input validation prior to all this.
         */
    }

      }
      if ((prop = destAttrs.getProperty
    (PROP_NAME_OPTION_MAX_MESG)) != null) {
          destInfo.setMaxMessages(Integer.parseInt(prop));
      }
      if ((prop = destAttrs.getProperty
    (PROP_NAME_OPTION_MAX_PER_MESG_SIZE)) != null) {
    try  {
        ss = new SizeString(prop);
        byteValue = ss.getBytes();
              destInfo.setMaxMessageSize(byteValue);
    } catch (NumberFormatException nfe)  {
        /*
         * Do nothing. We shouldn't ever get here since
         * we do input validation prior to all this.
View Full Code Here

  DestinationInfo di = new DestinationInfo();

  for (Enumeration e = destAttrs.propertyNames();  e.hasMoreElements() ;) {
      String propName = (String)e.nextElement(),
       value = destAttrs.getProperty(propName);
      SizeString  ss;
      int    intValue = 0;
      long  longValue = 0;
      boolean  valueOK = true;
     
      /*
       * maxTotalMsgBytes
       */
      if (propName.equals(PROP_NAME_OPTION_MAX_MESG_BYTE))  {
    try  {
        ss = new SizeString(value);
        longValue = ss.getBytes();
    } catch (NumberFormatException nfe)  {
        valueOK = false;
    }

    if (valueOK)  {
        di.setMaxMessageBytes(longValue);
    }
    continue;
      }

      /*
       * maxNumMsgs
       */
      if (propName.equals(PROP_NAME_OPTION_MAX_MESG))  {
    try  {
        intValue = Integer.parseInt(value);
    } catch (NumberFormatException nfe)  {
        valueOK = false;
    }

    if (valueOK)  {
        di.setMaxMessages(intValue);
    }
    continue;
      }

      /*
       * maxBytesPerMsg
       */
      if (propName.equals(PROP_NAME_OPTION_MAX_PER_MESG_SIZE))  {
    try  {
        ss = new SizeString(value);
        longValue = ss.getBytes();
    } catch (NumberFormatException nfe)  {
        valueOK = false;
    }

    if (valueOK)  {
View Full Code Here

   return (ret);
    }


    private String checkAndPrintUnlimitedBytes(String s, long unlimitedValues[])  {
   SizeString  ss;
         String ret = null, value = s.trim();

   try {
      ss = new SizeString(value);
   } catch (Exception e)  {
      /*
       * Should not get here
       */
      return (value);
   }

   for (int i = 0; i < unlimitedValues.length; ++i)  {
             if (ss.getBytes() == unlimitedValues[i])  {
                 ret = ar.getString(ar.I_UNLIMITED) + " (-1)";
     break;
             }
   }

View Full Code Here

    public Long getMaxBytesPerMsg() throws MBeanException  {
  String s = brokerProps.getProperty("imq.message.max_size");
  Long l = null;

  try  {
      SizeString ss = new SizeString(s);
      l = new Long(ss.getBytes());
  } catch (Exception e)  {
      handleGetterException(
    DestinationAttributes.MAX_BYTES_PER_MSG,
    e);
  }
View Full Code Here

            notifyAttrChange(DestinationAttributes.LOG_DEAD_MSGS,
        newVal, oldVal);
  } else if (name.equals("imq.message.max_size"))  {
      try  {
    SizeString ss = new SizeString(value);
          newVal = new Long(ss.getBytes());
      } catch (NumberFormatException nfe)  {
          logger.log(Logger.ERROR,
        getMBeanName()
        + ": cannot parse internal value of "
        + DestinationAttributes.MAX_BYTES_PER_MSG
View Full Code Here

TOP

Related Classes of com.sun.messaging.jmq.util.SizeString

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.