ConnectionBuilderFactory
Provides an API for creating an object that is capable of building a connection.
Methods
Modifier & Type | Method Name | Description |
---|---|---|
static ConnectionBuilderFactory |
newInstance() |
Acquire a new instance of ConnectionBuilderFactory. |
ConnectionBuilder |
newConnectionBuilder() |
Create a new ConnectionBuilder using the configured settings. |
void |
setBufferSize(int buffSize) |
Set the buffer size to be buffSize bytes. |
void |
setParser(ConnectionResponseParser resParser) |
Set the response parser to be resParser . |
Second section
This class is usable for:
- Connection setup
- Connection buffering
- Transfer protocols
- Network actions
send
recv
Note:
Use the static newInstance()
method since there is no constructor.
Example usage
For simply getting a ConnectionBuilder object, try the following:
ConnectionBuilderFactory cbf = ConnectionBuilderFactory.newInstance();
cbf.setBufferSize(4096);
ConnectionBuilder connBuilder = cbf.newConnectionBuilder();
Summary
Methods |
---|
newInstance |
newConnectionBuilder |
setBufferSize |
setParser |
Subclasses |
HttpConnectionBuilderFactory |
FtpConnectionBuilderFactory |