com.caucho.server.cluster
Class ClusterStream

java.lang.Object
  extended by com.caucho.server.cluster.ClusterStream

public class ClusterStream
extends java.lang.Object

Defines a connection to the client.


Method Summary
 void clearRecycle()
          Clears the recycled connections.
 void close()
           
 void free()
          Recycles.
 java.lang.String getDebugId()
          Returns the debug id.
 long getFreeTime()
          Returns the free time, i.e.
 Hessian2StreamingInput getHessianInputStream()
          Returns the hessian input stream
 Hessian2StreamingOutput getHessianOutputStream()
          Returns the hessian output stream
 ServerPool getPool()
          Returns the owning pool
 ReadStream getReadStream()
          Returns the input stream.
 WriteStream getWriteStream()
          Returns the write stream.
 boolean isLongIdle()
          Returns true if nearing end of free time.
 boolean message(java.lang.String to, java.lang.String from, java.io.Serializable query)
           
 boolean queryGet(long id, java.lang.String to, java.lang.String from, java.io.Serializable query)
           
 boolean queryResult(long id, java.lang.String to, java.lang.String from, java.io.Serializable query)
           
 boolean querySet(long id, java.lang.String to, java.lang.String from, java.io.Serializable query)
           
 long readLongValue()
           
 java.io.Serializable readQueryResult(long id)
           
 java.lang.String readStringValue()
           
 void setFreeTime(long freeTime)
          Sets the free time.
 java.lang.String toString()
           
 void writeBinary(int code, byte[] value)
          Writes a hmux string to the target.
 void writeBinary(int code, byte[] value, int offset, int len)
          Writes a hmux string to the target.
 void writeExit()
          Writes a hmux exit to the target.
 void writeInt(int code, int value)
          Writes a hmux int to the target.
 void writeLong(int code, long id)
           
 void writeLong(long id)
           
 void writeQuit()
          Writes a hmux quit to the target.
 void writeString(int code, java.lang.String s)
           
 void writeString(java.lang.String s)
           
 void writeYield()
          Writes a hmux yield to the target, used for unidirectional messages
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getPool

public ServerPool getPool()
Returns the owning pool


getReadStream

public ReadStream getReadStream()
Returns the input stream.


getWriteStream

public WriteStream getWriteStream()
Returns the write stream.


getHessianInputStream

public Hessian2StreamingInput getHessianInputStream()
Returns the hessian input stream


getHessianOutputStream

public Hessian2StreamingOutput getHessianOutputStream()
Returns the hessian output stream


getFreeTime

public long getFreeTime()
Returns the free time, i.e. the time the connection was last idle.


setFreeTime

public void setFreeTime(long freeTime)
Sets the free time.


isLongIdle

public boolean isLongIdle()
Returns true if nearing end of free time.


message

public boolean message(java.lang.String to,
                       java.lang.String from,
                       java.io.Serializable query)
                throws java.io.IOException
Throws:
java.io.IOException

queryGet

public boolean queryGet(long id,
                        java.lang.String to,
                        java.lang.String from,
                        java.io.Serializable query)
                 throws java.io.IOException
Throws:
java.io.IOException

querySet

public boolean querySet(long id,
                        java.lang.String to,
                        java.lang.String from,
                        java.io.Serializable query)
                 throws java.io.IOException
Throws:
java.io.IOException

queryResult

public boolean queryResult(long id,
                           java.lang.String to,
                           java.lang.String from,
                           java.io.Serializable query)
                    throws java.io.IOException
Throws:
java.io.IOException

readQueryResult

public java.io.Serializable readQueryResult(long id)
                                     throws java.io.IOException
Throws:
java.io.IOException

getDebugId

public java.lang.String getDebugId()
Returns the debug id.


clearRecycle

public void clearRecycle()
Clears the recycled connections.


free

public void free()
Recycles.


close

public void close()

writeExit

public void writeExit()
               throws java.io.IOException
Writes a hmux exit to the target.

Throws:
java.io.IOException

writeQuit

public void writeQuit()
               throws java.io.IOException
Writes a hmux quit to the target.

Throws:
java.io.IOException

writeYield

public void writeYield()
                throws java.io.IOException
Writes a hmux yield to the target, used for unidirectional messages

Throws:
java.io.IOException

writeInt

public void writeInt(int code,
                     int value)
              throws java.io.IOException
Writes a hmux int to the target.

Throws:
java.io.IOException

writeLong

public void writeLong(long id)
               throws java.io.IOException
Throws:
java.io.IOException

writeLong

public void writeLong(int code,
                      long id)
               throws java.io.IOException
Throws:
java.io.IOException

writeString

public void writeString(java.lang.String s)
                 throws java.io.IOException
Throws:
java.io.IOException

writeString

public void writeString(int code,
                        java.lang.String s)
                 throws java.io.IOException
Throws:
java.io.IOException

writeBinary

public void writeBinary(int code,
                        byte[] value)
                 throws java.io.IOException
Writes a hmux string to the target.

Throws:
java.io.IOException

writeBinary

public void writeBinary(int code,
                        byte[] value,
                        int offset,
                        int len)
                 throws java.io.IOException
Writes a hmux string to the target.

Throws:
java.io.IOException

readLongValue

public long readLongValue()
                   throws java.io.IOException
Throws:
java.io.IOException

readStringValue

public java.lang.String readStringValue()
                                 throws java.io.IOException
Throws:
java.io.IOException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object