|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.synapse.transport.passthru.connections.TargetConnections
public class TargetConnections
Manages the connection from transport to the back end servers. It keeps track of the connections for host:port pair.
| Constructor Summary | |
|---|---|
TargetConnections(org.apache.http.nio.reactor.ConnectingIOReactor ioReactor,
TargetConfiguration targetConfiguration,
ConnectCallback callback)
Create a TargetConnections with the given IO-Reactor |
|
| Method Summary | |
|---|---|
void |
addConnection(org.apache.http.nio.NHttpClientConnection conn)
This method is called when a new connection is made. |
org.apache.http.nio.NHttpClientConnection |
getConnection(org.apache.http.conn.routing.HttpRoute route)
Return a connection to the host:port pair. |
org.apache.http.nio.NHttpClientConnection |
getExistingConnection(org.apache.http.conn.routing.HttpRoute route)
|
void |
releaseConnection(org.apache.http.nio.NHttpClientConnection conn)
Release an active connection to the pool |
void |
shutdownConnection(org.apache.http.nio.NHttpClientConnection conn)
This connection is no longer valid. |
void |
shutdownConnection(org.apache.http.nio.NHttpClientConnection conn,
boolean isError)
This connection is no longer valid. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TargetConnections(org.apache.http.nio.reactor.ConnectingIOReactor ioReactor,
TargetConfiguration targetConfiguration,
ConnectCallback callback)
ioReactor - the IO-ReactortargetConfiguration - the configuration of the sendercallback - the callback| Method Detail |
|---|
public org.apache.http.nio.NHttpClientConnection getConnection(org.apache.http.conn.routing.HttpRoute route)
null. If the particular host:port allows to create more connections
this method will try to connect asynchronously. If the connection is successful it will
be notified in a separate thread.
host - hostport - port
public org.apache.http.nio.NHttpClientConnection getExistingConnection(org.apache.http.conn.routing.HttpRoute route)
public void shutdownConnection(org.apache.http.nio.NHttpClientConnection conn)
conn - connection to shutdownConnection
public void shutdownConnection(org.apache.http.nio.NHttpClientConnection conn,
boolean isError)
conn - connection to shutdownConnectionisError - 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 releaseConnection(org.apache.http.nio.NHttpClientConnection conn)
conn - connection to be releasedpublic void addConnection(org.apache.http.nio.NHttpClientConnection conn)
conn - connection to the target server
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||