Package org.glassfish.grizzly.streams
Class BufferedInput
- java.lang.Object
-
- org.glassfish.grizzly.streams.BufferedInput
-
- All Implemented Interfaces:
Input
- Direct Known Subclasses:
DefaultStreamReader.Input,TransformerInput
public abstract class BufferedInput extends Object implements Input
- Author:
- Alexey Stashok
-
-
Field Summary
Fields Modifier and Type Field Description protected CompletionHandler<Integer>completionHandlerprotected CompositeBuffercompositeBufferprotected Conditionconditionprotected FutureImpl<Integer>futureprotected booleanisCompletionHandlerRegisteredprotected ReentrantReadWriteLocklockprotected ExceptionregistrationStackTrace
-
Constructor Summary
Constructors Constructor Description BufferedInput()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleanappend(Buffer buffer)voidclose()BuffergetBuffer()Return the Input'sBuffer.booleanisBuffered()protected voidnotifyCompleted(CompletionHandler<Integer> completionHandler)GrizzlyFuture<Integer>notifyCondition(Condition condition, CompletionHandler<Integer> completionHandler)protected voidnotifyFailure(CompletionHandler<Integer> completionHandler, Throwable failure)protected abstract voidonCloseInputSource()protected abstract voidonOpenInputSource()booleanprepend(Buffer buffer)byteread()intsize()voidskip(int length)BuffertakeBuffer()Takes the Input'sBuffer.
-
-
-
Field Detail
-
compositeBuffer
protected final CompositeBuffer compositeBuffer
-
lock
protected final ReentrantReadWriteLock lock
-
isCompletionHandlerRegistered
protected boolean isCompletionHandlerRegistered
-
registrationStackTrace
protected Exception registrationStackTrace
-
condition
protected Condition condition
-
completionHandler
protected CompletionHandler<Integer> completionHandler
-
future
protected FutureImpl<Integer> future
-
-
Method Detail
-
onOpenInputSource
protected abstract void onOpenInputSource() throws IOException- Throws:
IOException
-
onCloseInputSource
protected abstract void onCloseInputSource() throws IOException- Throws:
IOException
-
append
public boolean append(Buffer buffer)
-
prepend
public boolean prepend(Buffer buffer)
-
read
public byte read() throws IOException- Specified by:
readin interfaceInput- Throws:
IOException
-
isBuffered
public final boolean isBuffered()
- Specified by:
isBufferedin interfaceInput
-
getBuffer
public Buffer getBuffer()
Description copied from interface:InputReturn the Input'sBuffer.
-
takeBuffer
public Buffer takeBuffer()
Description copied from interface:Input- Specified by:
takeBufferin interfaceInput- Returns:
- the Input's
Buffer. This Input should never try to access thisBuffer.
-
notifyCondition
public GrizzlyFuture<Integer> notifyCondition(Condition condition, CompletionHandler<Integer> completionHandler)
- Specified by:
notifyConditionin interfaceInput
-
notifyCompleted
protected void notifyCompleted(CompletionHandler<Integer> completionHandler)
-
notifyFailure
protected void notifyFailure(CompletionHandler<Integer> completionHandler, Throwable failure)
-
-