MessageHandler.Whole .
For the first received message MessageHandler. is called within a new executor to
allow blocking reading of passed Reader.
| Modifier and Type | Field and Description |
|---|---|
| private volatile StringBuffer | |
| private final AtomicBoolean | |
| private volatile int | |
| private final Condition | |
| private volatile int | |
| private final ExecutorService | |
| private final ReentrantLock | |
| private static final Logger | |
| private volatile MessageHandler. | |
| private volatile BufferedStringReader | |
| private volatile boolean | |
| private volatile boolean |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | appendMessagePart(String
the message. message, boolean should be last)true iff this is the last part of the message, false otherwise.Append next message part to the buffer. |
| private void | |
| public void | |
| public char[] | |
| pack-priv void | |
| public void | |
| public void | setMessageHandler(MessageHandler.
MessageHandler that will consume the constructed java..Set the |
| buffer | back to summary |
|---|---|
| private volatile StringBuffer buffer | |
| buffering | back to summary |
|---|---|
| private final AtomicBoolean buffering | |
| bufferSize | back to summary |
|---|---|
| private volatile int bufferSize | |
| condition | back to summary |
|---|---|
| private final Condition condition | |
| currentlyBuffered | back to summary |
|---|---|
| private volatile int currentlyBuffered | |
| executorService | back to summary |
|---|---|
| private final ExecutorService executorService | |
| lock | back to summary |
|---|---|
| private final ReentrantLock lock | |
| LOGGER | back to summary |
|---|---|
| private static final Logger LOGGER | |
| messageHandler | back to summary |
|---|---|
| private volatile MessageHandler. | |
| reader | back to summary |
|---|---|
| private volatile BufferedStringReader reader | |
| receivedLast | back to summary |
|---|---|
| private volatile boolean receivedLast | |
| sessionClosed | back to summary |
|---|---|
| private volatile boolean sessionClosed | |
| ReaderBuffer | back to summary |
|---|---|
| public ReaderBuffer(ExecutorService executorService) Constructor. | |
| appendMessagePart | back to summary |
|---|---|
| public void appendMessagePart(String message, boolean last) Append next message part to the buffer.
| |
| checkClosedSession | back to summary |
|---|---|
| private void checkClosedSession() throws IOException | |
| finishReading | back to summary |
|---|---|
| public void finishReading() Finish reading of the buffer. | |
| getNextChars | back to summary |
|---|---|
| public char[] getNextChars(int number) throws IOException Get next received chars.
| |
| onSessionClosed | back to summary |
|---|---|
| pack-priv void onSessionClosed() | |
| resetBuffer | back to summary |
|---|---|
| public void resetBuffer(int bufferSize) Reset the buffer size.
| |
| setMessageHandler | back to summary |
|---|---|
| public void setMessageHandler(MessageHandler. Set the
| |