Package com.sun.messaging.jmq.util

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


    DestinationList(FileStore p, File topDir, boolean clear)
  throws BrokerException {

  this.parent = p;

  SizeString filesize = config.getSizeProperty(DEST_FILE_SIZE_PROP,
          DEFAULT_DEST_FILE_SIZE);

  if (clear && Store.getDEBUG()) {
      logger.log(logger.DEBUGHIGH,
      "DestinationList initialized with clear option");
  }

  backingFile = new File(topDir, BASENAME);
  try {
      // pass in safe=false; caller decide when to sync
      dstMap = new PHashMap(backingFile, filesize.getBytes(), false, clear);
  } catch (IOException e) {
      logger.log(logger.ERROR, br.X_LOAD_DESTINATIONS_FAILED, e);
      throw new BrokerException(
      br.getString(br.X_LOAD_DESTINATIONS_FAILED), e);
  }
View Full Code Here


    public void setTxlogSuffix(String suffix) {
        _logsuffix = suffix;
    }

    public void setTxlogSize(String size) throws Exception {
        SizeString ss = new SizeString(size);
        if (ss.getBytes() <= 0) {
            throw new IllegalArgumentException("Illegal txlog file size "+size);
        }
        _logsize = ss.getBytes();
    }
View Full Code Here

        logger.log(logger.INFO, BrokerResources.I_TXNLOG_ENABLED);

        // create txn log writers
        String filename = null;
        try {
            SizeString filesize = config.getSizeProperty(TXNLOG_FILE_SIZE_PROP,
                DEFAULT_TXNLOG_FILE_SIZE);

            filename = MSG_LOG_FILENAME;
            msgLogWriter = new FileTransactionLogWriter(
                rootDir, filename, filesize.getBytes());
            msgLogWriter.setCheckPointListener(this);

            filename = ACK_LOG_FILENAME;
            ackLogWriter = new FileTransactionLogWriter(
                rootDir, filename, filesize.getBytes());
            ackLogWriter.setCheckPointListener(this);

            if (resetMessage || resetStore) {
                msgLogWriter.reset();
                ackLogWriter.reset();
View Full Code Here

    private LoadException loadException = null;

    // when instantiated, all data are loaded
    TidList(File topDir, boolean clear) throws BrokerException {

  SizeString filesize = config.getSizeProperty(TXN_FILE_SIZE_PROP,
          DEFAULT_TXN_FILE_SIZE);

  backingFile = new File(topDir, BASENAME);
  try {
            useMemoryMappedFile = config.getBooleanProperty(
                TXN_USE_MEMORY_MAPPED_FILE_PROP,
                DEFAULT_TXN_USE_MEMORY_MAPPED_FILE);
            updateOptimization = useMemoryMappedFile &&
                config.getBooleanProperty(
                    TXN_UPDATE_OPTIMIZATION_PROP,
                    DEFAULT_TXN_UPDATE_OPTIMIZATION);

            // safe = false; caller controls data synchronization
            if (useMemoryMappedFile) {
                tidMap = new PHashMapMMF(
                    backingFile, filesize.getBytes(), 1024, false, clear);
                if (updateOptimization) {
                    ((PHashMapMMF)tidMap).intClientData(CLIENT_DATA_SIZE);
                }
            } else {
                tidMap = new PHashMap(
                    backingFile, filesize.getBytes(), 1024, false, clear);
            }
  } catch (IOException e) {
      logger.log(logger.ERROR, br.X_LOAD_TRANSACTIONS_FAILED, e);
      throw new BrokerException(
      br.getString(br.X_LOAD_TRANSACTIONS_FAILED), e);
View Full Code Here

    private LoadException loadException = null;

    // when instantiated, all data are loaded
    TxnAckList(File topDir, boolean clear) throws BrokerException {

  SizeString filesize = config.getSizeProperty(TidList.TXN_FILE_SIZE_PROP,
          TidList.DEFAULT_TXN_FILE_SIZE);

  backingFile = new File(topDir, BASENAME);

  try {
      // safe=false; caller controls data synchronization
            useMemoryMappedFile = config.getBooleanProperty(
                TidList.TXN_USE_MEMORY_MAPPED_FILE_PROP,
                TidList.DEFAULT_TXN_USE_MEMORY_MAPPED_FILE);

            if (useMemoryMappedFile) {
          tidMap = new PHashMapMMF(
                    backingFile, filesize.getBytes(), 1024, false, clear);
            } else {
                tidMap = new PHashMap(
                    backingFile, filesize.getBytes(), 1024, false, clear);
            }
  } catch (IOException e) {
      logger.log(logger.ERROR, br.X_LOAD_TXNACK_FAILED, e);
      throw new BrokerException(
      br.getString(br.X_LOAD_TXNACK_FAILED), e);
View Full Code Here

    private LoadException loadException = null;

    // when instantiated, all data are loaded
    PropertiesFile(File topDir, boolean clear) throws BrokerException {
  SizeString filesize = config.getSizeProperty(PROP_FILE_SIZE_PROP,
          DEFAULT_PROP_FILE_SIZE);

  backingFile = new File(topDir, BASENAME);
  try {
      // safe=false; caller controls data synchronization
      propMap = new PHashMap(backingFile, filesize.getBytes(),
                false, clear);
  } catch (IOException e) {
      logger.logStack(logger.ERROR, br.X_LOAD_PROPERTIES_FAILED, e);
      throw new BrokerException(
      br.getString(br.X_LOAD_PROPERTIES_FAILED), e);
View Full Code Here

     *           maximum)
     */
    public static void setIndividualMessageMax(SizeString size)
    {
        if (size == null)
            size = new SizeString();

        individual_max_size = size;
        long bytesize = size.getBytes();
  //
  // Bug id = 6366551
View Full Code Here

     */
    public  static void setMaxSize(SizeString size)
    {

        if (size == null)
            size = new SizeString();
        max_size = size;
    }
View Full Code Here

            sf.setSpecialValueSet(false);
  }
    }

    private boolean valueIsUnlimited0(String val)  {
  SizeString ss;

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

  if (ss.getBytes() == 0)  {
      return (true);
  }

  return (false);
    }
View Full Code Here

     *      value if it can not be converted or doesnt exist)
     * @see #getIntProperty(String)
     */
    public SizeString getSizeProperty(String name, long defval) {
        String prop = getProperty(name);
        if (prop == null) return new SizeString(defval);
        try {
            return  new SizeString(prop);
        } catch (Exception ex) {
            logger.log(Logger.INFO,
                BrokerResources.E_BAD_PROPERTY_VALUE,
                name, ex);
        }
        return new SizeString(defval);
    }
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.