Package com.atomikos.icatch

Examples of com.atomikos.icatch.DataSerializable


        participants_=new Vector<Participant>();
        // intead of: participants_ = (Vector) in.readObject ();
        int size = in.readInt();
        for (int i = 0; i < size; i++) {
          String participantClassName=in.readUTF();
          DataSerializable participant = (DataSerializable) ClassLoadingHelper.newInstance(participantClassName);
          participant.readData(in);
          participants_.add((Participant)participant);
        }
      }

    } catch (InvalidClassException ex) {
View Full Code Here


        // NOTE: after restart, any previous and failed checkpoint files
        // will be overwritten here. That is perfectly OK.
        output_ = file_.openNewVersionForWriting();
        final DataByteArrayOutputStream dataByteArrayOutputStream = new DataByteArrayOutputStream();
        while (elements != null && elements.hasMoreElements()) {
          DataSerializable next = (DataSerializable) elements.nextElement();
          dataByteArrayOutputStream.restart();
          next.writeData(dataByteArrayOutputStream);
          output_.write(dataByteArrayOutputStream.getContent());
        }

        output_.getFD().sync();
        // NOTE: we do NOT close the object output, since the client
View Full Code Here

  }

  public void flushObject(Object o, boolean shouldSync) throws LogException {
    try {
      final DataByteArrayOutputStream dataByteArrayOutputStream = new DataByteArrayOutputStream();
      DataSerializable oo = (DataSerializable) o;
      oo.writeData(dataByteArrayOutputStream);
      dataByteArrayOutputStream.close();
      // take care of checkpoint...
      synchronized (file_) {
        if(output_!=null){
          output_.write(dataByteArrayOutputStream.getContent())
View Full Code Here

        participants_=new Vector<Participant>();
        // intead of: participants_ = (Vector) in.readObject ();
        int size = in.readInt();
        for (int i = 0; i < size; i++) {
          String participantClassName=in.readUTF();
          DataSerializable participant = (DataSerializable) ClassLoadingHelper.newInstance(participantClassName);
          participant.readData(in);
          participants_.add((Participant)participant);
        }
      }

    } catch (InvalidClassException ex) {
View Full Code Here

TOP

Related Classes of com.atomikos.icatch.DataSerializable

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.