Package org.codehaus.activemq.message

Examples of org.codehaus.activemq.message.CachedValue


            case Packet.KEEP_ALIVE :
              return readPacket(dataIn, keepAliveReader);
            case Packet.BROKER_ADMIN_COMMAND :
              return readPacket(dataIn, brokerAdminCommandReader);
            case Packet.CACHED_VALUE_COMMAND :
                CachedValue cv =  (CachedValue)readPacket(dataIn,cachedValueReader);
                handleCachedValue(cv);
                return null;
            case Packet.CLEANUP_CONNECTION_INFO :
                return readPacket(dataIn, cleanupConnectionAndSessionInfoReader);
            default :
View Full Code Here


   
    private synchronized void updateCachedValue(short key,Object value) throws IOException{
        if (cachedValueWriter == null){
            cachedValueWriter = new CachedValueWriter();
        }
        CachedValue cv = new CachedValue();
        cv.setId(key);
        cv.setValue(value);
        cachedBytesOut.reset();
        cachedValueWriter.writePacket(cv,cachedDataOut);
        cachedDataOut.flush();
        byte[] data = cachedBytesOut.getData();
        int count = cachedBytesOut.size();
        getTransportDataOut().writeByte(cv.getPacketType());
        getTransportDataOut().writeInt(count);
        getTransportDataOut().write(data,0,count);
       
       
    }
View Full Code Here

    /**
     * @return a new Packet instance
     */

    public Packet createPacket() {
        return new CachedValue();
    }
View Full Code Here

     * @param dataIn the data input stream to build the packet from
     * @throws IOException
     */

    public void buildPacket(Packet packet, DataInput dataIn) throws IOException {
        CachedValue cv = (CachedValue)packet;
        super.buildPacket(cv, dataIn);
        cv.setValue(super.readObject(dataIn));
       
    }
View Full Code Here

   * @throws IOException
   *             thrown if an error occurs
   */

  public void writePacket(Packet packet, DataOutput dataOut) throws IOException {
        CachedValue cv = (CachedValue)packet;
    super.writePacket(cv, dataOut);
        super.writeObject(cv.getValue(), dataOut);
  }
View Full Code Here

            case Packet.KEEP_ALIVE :
              return readPacket(dataIn, keepAliveReader);
            case Packet.BROKER_ADMIN_COMMAND :
              return readPacket(dataIn, brokerAdminCommandReader);
            case Packet.CACHED_VALUE_COMMAND :
                CachedValue cv =  (CachedValue)readPacket(dataIn,cachedValueReader);
                handleCachedValue(cv);
                return null;
            case Packet.CLEANUP_CONNECTION_INFO :
                return readPacket(dataIn, cleanupConnectionAndSessionInfoReader);
            default :
View Full Code Here

   
    private synchronized void updateCachedValue(short key,Object value) throws IOException{
        if (cachedValueWriter == null){
            cachedValueWriter = new CachedValueWriter();
        }
        CachedValue cv = new CachedValue();
        cv.setId(key);
        cv.setValue(value);
        cachedBytesOut.reset();
        cachedValueWriter.writePacket(cv,cachedDataOut);
        cachedDataOut.flush();
        byte[] data = cachedBytesOut.getData();
        int count = cachedBytesOut.size();
        getTransportDataOut().writeByte(cv.getPacketType());
        getTransportDataOut().writeInt(count);
        getTransportDataOut().write(data,0,count);
       
       
    }
View Full Code Here

TOP

Related Classes of org.codehaus.activemq.message.CachedValue

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.