abstract class Request extends Object
Modifier and Type | Class and Description |
---|---|
private class |
Request.ContentInputStream
Stream for reading inbound request/response data.
|
private class |
Request.ContentOutputStream
Stream for writing outbound request/response data.
|
Modifier and Type | Field and Description |
---|---|
private boolean |
aborted |
private static int |
CLOSED |
private static int |
EOF |
private Request.ContentInputStream |
in |
private IOException |
inException |
private Object |
inLock |
private int |
inState |
private static int |
INVALID |
private static int |
OPEN |
private Request.ContentOutputStream |
out |
private IOException |
outException |
private Object |
outLock |
private int |
outState |
private Object |
stateLock |
private static Executor |
systemThreadPool |
private static int |
UNUSED |
Constructor and Description |
---|
Request()
Creates new Request, initializes content input/output streams.
|
Modifier and Type | Method and Description |
---|---|
void |
abort()
Terminates request.
|
(package private) abstract void |
addAckListener(AcknowledgmentSource.Listener listener)
Method called internally to register acknowledgment listener.
|
(package private) boolean |
addAcknowledgmentListener(AcknowledgmentSource.Listener l)
Method called internally to implement AcknowledgmentSource;
checks state and delegates to addAckListener method.
|
(package private) abstract int |
available()
Method called internally to gauge available inbound data.
|
(package private) abstract void |
done(boolean corrupt)
Method called internally when request is finished.
|
(package private) abstract void |
endInput()
Method called internally when finished reading inbound data.
|
(package private) abstract void |
endOutput()
Method called internally to signal the end of outbound data.
|
(package private) void |
finish()
Finishes request, if not finished or aborted already.
|
boolean |
getDeliveryStatus()
Returns true if any data sent.
|
(package private) InputStream |
getInputStream()
Returns InputStream used for reading inbound request/response data.
|
(package private) OutputStream |
getOutputStream()
Returns OutputStream used for writing outbound request/response data.
|
(package private) abstract int |
read(byte[] b,
int off,
int len)
Method called internally to read inbound request/response data.
|
(package private) abstract boolean |
startInput()
Method called internally before any inbound data is read.
|
(package private) abstract void |
startOutput()
Method called internally before any outbound data is written.
|
(package private) abstract void |
write(byte[] b,
int off,
int len)
Method called internally to write outbound request/response data.
|
private static final Executor systemThreadPool
private static final int UNUSED
private static final int OPEN
private static final int EOF
private static final int CLOSED
private static final int INVALID
private final Object stateLock
private final Object outLock
private final Object inLock
private final Request.ContentOutputStream out
private final Request.ContentInputStream in
private boolean aborted
private int outState
private int inState
private IOException outException
private IOException inException
public boolean getDeliveryStatus()
public void abort()
void finish()
OutputStream getOutputStream()
InputStream getInputStream()
abstract void startOutput() throws IOException
IOException
abstract void write(byte[] b, int off, int len) throws IOException
IOException
abstract void endOutput() throws IOException
IOException
abstract boolean startInput() throws IOException
IOException
abstract int read(byte[] b, int off, int len) throws IOException
IOException
abstract int available() throws IOException
IOException
abstract void endInput() throws IOException
IOException
abstract void addAckListener(AcknowledgmentSource.Listener listener)
abstract void done(boolean corrupt)
final boolean addAcknowledgmentListener(AcknowledgmentSource.Listener l)
Copyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.