Examples of VRecordRAF


Examples of com.sun.messaging.jmq.io.VRecordRAF

                    vrecord.rewind();
                    byte data[] = new byte[INT_SIZE+packetSize];
                    vrecord.read(data);

                    // the existing one is not big enough; get another one
                    VRecordRAF newrecord = (VRecordRAF)vrfile.allocate(total);

                    // copy message
                    newrecord.write(data);

                    // free old
                    vrfile.free(vrecord);

                    // cache new
View Full Code Here

Examples of com.sun.messaging.jmq.io.VRecordRAF

      Set msgs = vrfile.getRecords();

      Iterator itr = msgs.iterator();
      while (itr.hasNext()) {
    // get all packetSize
    VRecordRAF record = (VRecordRAF)itr.next();

    // sanity check
    short cookie = record.getCookie();
    if (cookie == MessageInfo.PENDING ||
        cookie != MessageInfo.DONE) {

        // writing not finish: log error, free record
        String warning = myDestination + ": found a " +
        "corrupted message at vrecord(" + record +
        "), a message might be lost";
        logger.log(logger.WARNING, warning);

        // free the bad VRecord
        try {
      vrfile.free(record);
        } catch (IOException e) {
      logger.log(logger.ERROR,
        "Failed to free the corrupted vrecord: " + e);
        }

    } else {

        try {
      msgCount++;
      byteCount += record.readInt();
        } catch (Throwable t) {
      logger.log(logger.ERROR, br.X_READ_FROM_VRECORD_FAILED,
          vrfile.getFile(), t);
      throw new BrokerException(br.getString(
          br.X_READ_FROM_VRECORD_FAILED,
View Full Code Here

Examples of com.sun.messaging.jmq.io.VRecordRAF

      Set msgs = vrfile.getRecords();

      Iterator itr = msgs.iterator();
      while (itr.hasNext()) {
        // get all packetSize
        VRecordRAF record = (VRecordRAF) itr.next();

        // sanity check
        short cookie = record.getCookie();
        if (cookie == MessageInfo.PENDING || cookie != MessageInfo.DONE) {

          // writing not finish: log error, free record
          String warning = storeName + ": found a "
              + "corrupted message at vrecord(" + record
              + "), a message might be lost";
          logger.log(logger.WARNING, warning);

          // free the bad VRecord
          try {
            vrfile.free(record);
          } catch (IOException e) {
            logger.log(logger.ERROR,
                "Failed to free the corrupted vrecord: " + e);
          }

        } else {

          try {
            txnCount++;
            byteCount += record.readInt();
          } catch (Throwable t) {
            logger.log(logger.ERROR, br.X_READ_FROM_VRECORD_FAILED,
                vrfile.getFile(), t);
            throw new BrokerException(br
                .getString(br.X_READ_FROM_VRECORD_FAILED,
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.