Package org.activeio.adapter

Examples of org.activeio.adapter.PacketInputStream


        log.info("Journal Recovery Started.");

        // While we have records in the journal.
        while ((pos = journal.getNextRecordLocation(pos)) != null) {
            org.activeio.Packet data = journal.read(pos);
            DataInputStream is = new DataInputStream(new PacketInputStream(data));

            // Read the destination and packate from the record.
            String destination = null;
            Packet packet = null;
            try {
View Full Code Here


     * @throws JMSException
     */
    public Packet readPacket(RecordLocation location) throws JMSException {
        try {
            org.activeio.Packet data = journal.read(location);
            DataInputStream is = new DataInputStream(new PacketInputStream(data));
            byte type = is.readByte();
            if (type != PACKET_RECORD_TYPE) {
                throw new IOException("Record is not a packet type.");
            }
            String destination = is.readUTF();
View Full Code Here

     * @throws JMSException
     */
    public Packet readPacket(RecordLocation location) throws JMSException {
        try {
            org.activeio.Packet data = journal.read(location);
            DataInputStream is = new DataInputStream(new PacketInputStream(data));
            byte type = is.readByte();
            if (type != PACKET_RECORD_TYPE) {
                throw new IOException("Record is not a packet type.");
            }
            String destination = is.readUTF();
View Full Code Here

        log.info("Journal Recovery Started.");

        // While we have records in the journal.
        while ((pos = journal.getNextRecordLocation(pos)) != null) {
            org.activeio.Packet data = journal.read(pos);
            DataInputStream is = new DataInputStream(new PacketInputStream(data));

            // Read the destination and packate from the record.
            String destination = null;
            Packet packet = null;
            try {
View Full Code Here

     * @throws JMSException
     */
    public Packet readPacket(RecordLocation location) throws JMSException {
        try {
            org.activeio.Packet data = journal.read(location);
            DataInputStream is = new DataInputStream(new PacketInputStream(data));
            byte type = is.readByte();
            if (type != PACKET_RECORD_TYPE) {
                throw new IOException("Record is not a packet type.");
            }
            String destination = is.readUTF();
View Full Code Here

        log.info("Journal Recovery Started.");

        // While we have records in the journal.
        while ((pos = journal.getNextRecordLocation(pos)) != null) {
            org.activeio.Packet data = journal.read(pos);
            DataInputStream is = new DataInputStream(new PacketInputStream(data));

            // Read the destination and packate from the record.
            String destination = null;
            Packet packet = null;
            try {
View Full Code Here

        if( controlFile.load() ) {
            Packet controlData = controlFile.getControlData();
            if( controlData.remaining() == 0 )
                return;
           
            DataInput data = new DataInputStream(new PacketInputStream(controlData));
   
            lastLogFileId =data.readInt();
            if( data.readBoolean() )
                lastMark = Location.readFromDataInput(data);
            else
View Full Code Here

        this.recordType = recordType;
        this.mark = mark;
        this.payload = payload.slice();
        this.payloadLength = payload.remaining();
        if( isChecksumingEnabled() ) {
            checksum(new DataInputStream(new PacketInputStream(this.payload)));
        }

        writeHeader(headerFooterData);
        writeFooter(headerFooterData);
    }   
View Full Code Here

    public boolean readFromPacket(Packet packet) throws IOException {
        Packet dup = packet.duplicate();

        if( dup.remaining() < RECORD_HEADER_SIZE )
            return false;
        DataInputStream is = new DataInputStream(new PacketInputStream(dup));
        readHeader( is );
        if( dup.remaining() < payloadLength+RECORD_FOOTER_SIZE ) {
            return false;
        }
       
        // Set limit to create a slice of the payload.
        dup.limit(dup.position()+payloadLength);
        this.payload = dup.slice();       
      if( isChecksumingEnabled() ) {
          checksum(new DataInputStream(new PacketInputStream(payload)));
      }
     
      // restore the limit and seek to the footer.
        dup.limit(packet.limit());
        dup.position(dup.position()+payloadLength);
View Full Code Here

     * @throws JMSException
     */
    public Packet readPacket(RecordLocation location) throws JMSException {
        try {
            org.activeio.Packet data = journal.read(location);
            DataInputStream is = new DataInputStream(new PacketInputStream(data));
            byte type = is.readByte();
            if (type != PACKET_RECORD_TYPE) {
                throw new IOException("Record is not a packet type.");
            }
            String destination = is.readUTF();
View Full Code Here

TOP

Related Classes of org.activeio.adapter.PacketInputStream

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.