|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object php.java.bridge.http.FCGIConnectionPool
public class FCGIConnectionPool
A connection pool. Example:
ConnectionPool pool = new ConnectionPool("127.0.0.1", 8080, 20, 5000, new IOFactory());
ConnectionPool.Connection conn = pool.openConnection();
InputStream in = conn.getInputStream();
OutputStream out = conn.getOutputStream();
...
in.close();
out.close();
...
pool.destroy();
Instead of using delegation (decorator pattern), it is possible to pass a factory
which may create custom In- and OutputStreams. Example:
new ConnectionPool(..., new IOFactory() {
public InputStream getInputStream() {
return new DefaultInputStream() {
...
}
}
}
Nested Class Summary | |
---|---|
class |
FCGIConnectionPool.Connection
Represents the connection kept by the pool. |
Constructor Summary | |
---|---|
FCGIConnectionPool(FCGIConnectionFactory channelName,
int limit,
int maxRequests,
FCGIIOFactory factory,
long timeout)
Create a new connection pool. |
Method Summary | |
---|---|
void |
destroy()
Destroy the connection pool. |
FCGIConnectionPool.Connection |
openConnection()
Opens a connection to the back end. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FCGIConnectionPool(FCGIConnectionFactory channelName, int limit, int maxRequests, FCGIIOFactory factory, long timeout) throws FCGIConnectException
channelName
- The channel namelimit
- The max. number of physical connectionsmaxRequests
- factory
- A factory for creating In- and OutputStreams.timeout
- The pool timeout in milliseconds.
FCGIConnectException
FCGIIOFactory
Method Detail |
---|
public FCGIConnectionPool.Connection openConnection() throws java.lang.InterruptedException, FCGIConnectException
java.lang.InterruptedException
FCGIConnectException
public void destroy()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |