org.apache.thrift.protocol
Class TProtocolDecorator

java.lang.Object
  extended by org.apache.thrift.protocol.TProtocol
      extended by org.apache.thrift.protocol.TProtocolDecorator
Direct Known Subclasses:
TMultiplexedProtocol

public abstract class TProtocolDecorator
extends TProtocol

TProtocolDecorator forwards all requests to an enclosed TProtocol instance, providing a way to author concise concrete decorator subclasses. While it has no abstract methods, it is marked abstract as a reminder that by itself, it does not modify the behaviour of the enclosed TProtocol.

See p.175 of Design Patterns (by Gamma et al.)

See Also:
TMultiplexedProtocol

Field Summary
 
Fields inherited from class org.apache.thrift.protocol.TProtocol
trans_
 
Constructor Summary
TProtocolDecorator(TProtocol protocol)
          Encloses the specified protocol.
 
Method Summary
 java.nio.ByteBuffer readBinary()
           
 boolean readBool()
           
 byte readByte()
           
 double readDouble()
           
 TField readFieldBegin()
           
 void readFieldEnd()
           
 short readI16()
           
 int readI32()
           
 long readI64()
           
 TList readListBegin()
           
 void readListEnd()
           
 TMap readMapBegin()
           
 void readMapEnd()
           
 TMessage readMessageBegin()
          Reading methods.
 void readMessageEnd()
           
 TSet readSetBegin()
           
 void readSetEnd()
           
 java.lang.String readString()
           
 TStruct readStructBegin()
           
 void readStructEnd()
           
 void writeBinary(java.nio.ByteBuffer buf)
           
 void writeBool(boolean b)
           
 void writeByte(byte b)
           
 void writeDouble(double v)
           
 void writeFieldBegin(TField tField)
           
 void writeFieldEnd()
           
 void writeFieldStop()
           
 void writeI16(short i)
           
 void writeI32(int i)
           
 void writeI64(long l)
           
 void writeListBegin(TList tList)
           
 void writeListEnd()
           
 void writeMapBegin(TMap tMap)
           
 void writeMapEnd()
           
 void writeMessageBegin(TMessage tMessage)
          Writing methods.
 void writeMessageEnd()
           
 void writeSetBegin(TSet tSet)
           
 void writeSetEnd()
           
 void writeString(java.lang.String s)
           
 void writeStructBegin(TStruct tStruct)
           
 void writeStructEnd()
           
 
Methods inherited from class org.apache.thrift.protocol.TProtocol
getScheme, getTransport, reset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TProtocolDecorator

public TProtocolDecorator(TProtocol protocol)
Encloses the specified protocol.

Parameters:
protocol - All operations will be forward to this protocol. Must be non-null.
Method Detail

writeMessageBegin

public void writeMessageBegin(TMessage tMessage)
                       throws TException
Description copied from class: TProtocol
Writing methods.

Specified by:
writeMessageBegin in class TProtocol
Throws:
TException

writeMessageEnd

public void writeMessageEnd()
                     throws TException
Specified by:
writeMessageEnd in class TProtocol
Throws:
TException

writeStructBegin

public void writeStructBegin(TStruct tStruct)
                      throws TException
Specified by:
writeStructBegin in class TProtocol
Throws:
TException

writeStructEnd

public void writeStructEnd()
                    throws TException
Specified by:
writeStructEnd in class TProtocol
Throws:
TException

writeFieldBegin

public void writeFieldBegin(TField tField)
                     throws TException
Specified by:
writeFieldBegin in class TProtocol
Throws:
TException

writeFieldEnd

public void writeFieldEnd()
                   throws TException
Specified by:
writeFieldEnd in class TProtocol
Throws:
TException

writeFieldStop

public void writeFieldStop()
                    throws TException
Specified by:
writeFieldStop in class TProtocol
Throws:
TException

writeMapBegin

public void writeMapBegin(TMap tMap)
                   throws TException
Specified by:
writeMapBegin in class TProtocol
Throws:
TException

writeMapEnd

public void writeMapEnd()
                 throws TException
Specified by:
writeMapEnd in class TProtocol
Throws:
TException

writeListBegin

public void writeListBegin(TList tList)
                    throws TException
Specified by:
writeListBegin in class TProtocol
Throws:
TException

writeListEnd

public void writeListEnd()
                  throws TException
Specified by:
writeListEnd in class TProtocol
Throws:
TException

writeSetBegin

public void writeSetBegin(TSet tSet)
                   throws TException
Specified by:
writeSetBegin in class TProtocol
Throws:
TException

writeSetEnd

public void writeSetEnd()
                 throws TException
Specified by:
writeSetEnd in class TProtocol
Throws:
TException

writeBool

public void writeBool(boolean b)
               throws TException
Specified by:
writeBool in class TProtocol
Throws:
TException

writeByte

public void writeByte(byte b)
               throws TException
Specified by:
writeByte in class TProtocol
Throws:
TException

writeI16

public void writeI16(short i)
              throws TException
Specified by:
writeI16 in class TProtocol
Throws:
TException

writeI32

public void writeI32(int i)
              throws TException
Specified by:
writeI32 in class TProtocol
Throws:
TException

writeI64

public void writeI64(long l)
              throws TException
Specified by:
writeI64 in class TProtocol
Throws:
TException

writeDouble

public void writeDouble(double v)
                 throws TException
Specified by:
writeDouble in class TProtocol
Throws:
TException

writeString

public void writeString(java.lang.String s)
                 throws TException
Specified by:
writeString in class TProtocol
Throws:
TException

writeBinary

public void writeBinary(java.nio.ByteBuffer buf)
                 throws TException
Specified by:
writeBinary in class TProtocol
Throws:
TException

readMessageBegin

public TMessage readMessageBegin()
                          throws TException
Description copied from class: TProtocol
Reading methods.

Specified by:
readMessageBegin in class TProtocol
Throws:
TException

readMessageEnd

public void readMessageEnd()
                    throws TException
Specified by:
readMessageEnd in class TProtocol
Throws:
TException

readStructBegin

public TStruct readStructBegin()
                        throws TException
Specified by:
readStructBegin in class TProtocol
Throws:
TException

readStructEnd

public void readStructEnd()
                   throws TException
Specified by:
readStructEnd in class TProtocol
Throws:
TException

readFieldBegin

public TField readFieldBegin()
                      throws TException
Specified by:
readFieldBegin in class TProtocol
Throws:
TException

readFieldEnd

public void readFieldEnd()
                  throws TException
Specified by:
readFieldEnd in class TProtocol
Throws:
TException

readMapBegin

public TMap readMapBegin()
                  throws TException
Specified by:
readMapBegin in class TProtocol
Throws:
TException

readMapEnd

public void readMapEnd()
                throws TException
Specified by:
readMapEnd in class TProtocol
Throws:
TException

readListBegin

public TList readListBegin()
                    throws TException
Specified by:
readListBegin in class TProtocol
Throws:
TException

readListEnd

public void readListEnd()
                 throws TException
Specified by:
readListEnd in class TProtocol
Throws:
TException

readSetBegin

public TSet readSetBegin()
                  throws TException
Specified by:
readSetBegin in class TProtocol
Throws:
TException

readSetEnd

public void readSetEnd()
                throws TException
Specified by:
readSetEnd in class TProtocol
Throws:
TException

readBool

public boolean readBool()
                 throws TException
Specified by:
readBool in class TProtocol
Throws:
TException

readByte

public byte readByte()
              throws TException
Specified by:
readByte in class TProtocol
Throws:
TException

readI16

public short readI16()
              throws TException
Specified by:
readI16 in class TProtocol
Throws:
TException

readI32

public int readI32()
            throws TException
Specified by:
readI32 in class TProtocol
Throws:
TException

readI64

public long readI64()
             throws TException
Specified by:
readI64 in class TProtocol
Throws:
TException

readDouble

public double readDouble()
                  throws TException
Specified by:
readDouble in class TProtocol
Throws:
TException

readString

public java.lang.String readString()
                            throws TException
Specified by:
readString in class TProtocol
Throws:
TException

readBinary

public java.nio.ByteBuffer readBinary()
                               throws TException
Specified by:
readBinary in class TProtocol
Throws:
TException