public class SourceConnections extends Object
Constructor and Description |
---|
SourceConnections() |
Modifier and Type | Method and Description |
---|---|
void |
addConnection(org.apache.http.nio.NHttpServerConnection conn)
Add a connection to the pool.
|
void |
closeConnection(org.apache.http.nio.NHttpServerConnection conn)
Close a connection gracefully.
|
void |
destroy() |
void |
releaseConnection(org.apache.http.nio.NHttpServerConnection conn)
This method should be called after a connection is being used for a request-response.
|
void |
shutDownConnection(org.apache.http.nio.NHttpServerConnection conn)
Shutdown a connection
|
void |
shutDownConnection(org.apache.http.nio.NHttpServerConnection conn,
boolean isError)
Shutdown a connection
|
void |
useConnection(org.apache.http.nio.NHttpServerConnection conn)
This method should be called when ever a connection being used for processing
a request-response.
|
public void addConnection(org.apache.http.nio.NHttpServerConnection conn)
conn
- connection to be addedpublic void useConnection(org.apache.http.nio.NHttpServerConnection conn)
conn
- the connection to be usedpublic void releaseConnection(org.apache.http.nio.NHttpServerConnection conn)
conn
- the connection being usedpublic void shutDownConnection(org.apache.http.nio.NHttpServerConnection conn)
conn
- the connection that needs to be shut downpublic void shutDownConnection(org.apache.http.nio.NHttpServerConnection conn, boolean isError)
conn
- the connection that needs to be shut downisError
- whether an error is causing this shutdown of the connection
It is very important to set this flag correctly.
When an error causing the shutdown of the connections we should not
release associated writer buffer to the pool as it might lead into
situations like same buffer is getting released to both source and target
buffer factoriespublic void closeConnection(org.apache.http.nio.NHttpServerConnection conn)
conn
- the connection that needs to be closed.public void destroy()
Copyright © 2005-2017 Apache Software Foundation. All Rights Reserved.