public interface Connector extends LifeCycle
LifeCycle.Listener
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
customize(EndPoint endpoint,
Request request)
Customize a request for an endpoint.
|
int |
getConfidentialPort() |
String |
getConfidentialScheme() |
Object |
getConnection() |
int |
getConnections() |
long |
getConnectionsDurationMax() |
double |
getConnectionsDurationMean() |
double |
getConnectionsDurationStdDev() |
long |
getConnectionsDurationTotal() |
int |
getConnectionsOpen() |
int |
getConnectionsOpenMax() |
int |
getConnectionsRequestsMax() |
double |
getConnectionsRequestsMean() |
double |
getConnectionsRequestsStdDev() |
String |
getHost() |
int |
getIntegralPort() |
String |
getIntegralScheme() |
int |
getLocalPort() |
int |
getLowResourceMaxIdleTime() |
int |
getMaxIdleTime() |
String |
getName() |
int |
getPort() |
Buffers |
getRequestBuffers() |
int |
getRequestBufferSize() |
int |
getRequestHeaderSize() |
int |
getRequests() |
boolean |
getResolveNames() |
Buffers |
getResponseBuffers() |
int |
getResponseBufferSize() |
int |
getResponseHeaderSize() |
Server |
getServer() |
boolean |
getStatsOn() |
long |
getStatsOnMs() |
boolean |
isConfidential(Request request) |
boolean |
isIntegral(Request request) |
boolean |
isLowResources()
Check if low on resources.
|
void |
open()
Opens the connector
|
void |
persist(EndPoint endpoint)
Persist an endpoint.
|
void |
setHost(String hostname)
Set the hostname of the interface to bind to.
|
void |
setLowResourceMaxIdleTime(int ms) |
void |
setMaxIdleTime(int ms) |
void |
setPort(int port) |
void |
setRequestBufferSize(int requestBufferSize)
Set the size of the content buffer for receiving requests.
|
void |
setRequestHeaderSize(int size)
Set the size of the buffer to be used for request headers.
|
void |
setResponseBufferSize(int responseBufferSize)
Set the size of the content buffer for sending responses.
|
void |
setResponseHeaderSize(int size)
Set the size of the buffer to be used for request headers.
|
void |
setServer(Server server) |
void |
setStatsOn(boolean on) |
void |
statsReset()
Reset statistics.
|
addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
String getName()
void open() throws IOException
IOException
void close() throws IOException
IOException
void setServer(Server server)
Server getServer()
int getRequestHeaderSize()
void setRequestHeaderSize(int size)
size
- The size in bytes.int getResponseHeaderSize()
void setResponseHeaderSize(int size)
size
- The size in bytes.Buffers getRequestBuffers()
Buffers getResponseBuffers()
int getRequestBufferSize()
void setRequestBufferSize(int requestBufferSize)
requestBufferSize
- The requestBufferSize to set.int getResponseBufferSize()
void setResponseBufferSize(int responseBufferSize)
responseBufferSize
- The responseBufferSize to set.int getIntegralPort()
Constraint
String getIntegralScheme()
Constraint
boolean isIntegral(Request request)
request
- A requestint getConfidentialPort()
Constraint
String getConfidentialScheme()
Constraint
boolean isConfidential(Request request)
request
- A requestvoid customize(EndPoint endpoint, Request request) throws IOException
endpoint
- request
- IOException
void persist(EndPoint endpoint) throws IOException
endpoint
- IOException
String getHost()
void setHost(String hostname)
hostname
- The hostname representing the interface to which
this connector will bind, or null for all interfaces.void setPort(int port)
port
- The port to listen of for connections or 0 if any available
port may be used.int getPort()
int getLocalPort()
int getMaxIdleTime()
void setMaxIdleTime(int ms)
ms
- Max Idle time for connections in millisecondsint getLowResourceMaxIdleTime()
void setLowResourceMaxIdleTime(int ms)
Object getConnection()
boolean getResolveNames()
int getRequests()
long getConnectionsDurationTotal()
int getConnections()
int getConnectionsOpen()
int getConnectionsOpenMax()
long getConnectionsDurationMax()
double getConnectionsDurationMean()
double getConnectionsDurationStdDev()
double getConnectionsRequestsMean()
double getConnectionsRequestsStdDev()
int getConnectionsRequestsMax()
void statsReset()
void setStatsOn(boolean on)
boolean getStatsOn()
long getStatsOnMs()
boolean isLowResources()
ThreadPool.isLowOnThreads()
on the connector threadpool
or the server threadpool if there is no connector threadpool.
For blocking connectors, low resources is used to trigger
usage of getLowResourceMaxIdleTime()
for the timeout
of an idle connection.
for non-blocking connectors, the number of connections is used instead of this method, to select the timeout of an idle connection.
For all connectors, low resources is used to trigger the
usage of getLowResourceMaxIdleTime()
for read and
write operations.
Copyright © 1995-2013 Mort Bay Consulting. All Rights Reserved.