public interface ProtocolHandler
Adapter
Modifier and Type | Method and Description |
---|---|
void |
addSslHostConfig(SSLHostConfig sslHostConfig)
Add a new SSL configuration for a virtual host.
|
void |
addUpgradeProtocol(UpgradeProtocol upgradeProtocol)
Add a new protocol for used by HTTP/1.1 upgrade or ALPN.
|
long |
awaitConnectionsClose(long waitMillis)
Wait for the client connections to the server to close gracefully.
|
void |
closeServerSocketGraceful()
|
static ProtocolHandler |
create(String protocol,
boolean apr)
Create a new ProtocolHandler for the given protocol.
|
void |
destroy()
Destroy the protocol (optional).
|
SSLHostConfig[] |
findSslHostConfigs()
Find all configured SSL virtual host configurations which will be used
by SNI.
|
UpgradeProtocol[] |
findUpgradeProtocols()
Return all configured upgrade protocols.
|
Adapter |
getAdapter()
Return the adapter associated with the protocol handler.
|
default int |
getDesiredBufferSize()
Some protocols, like AJP, have a packet length that
shouldn't be exceeded, and this can be used to adjust the buffering
used by the application layer.
|
Executor |
getExecutor()
The executor, provide access to the underlying thread pool.
|
ScheduledExecutorService |
getUtilityExecutor()
Get the utility executor that should be used by the protocol handler.
|
void |
init()
Initialise the protocol.
|
boolean |
isAprRequired()
Requires APR/native library
|
boolean |
isSendfileSupported()
Does this ProtocolHandler support sendfile?
|
void |
pause()
Pause the protocol (optional).
|
void |
resume()
Resume the protocol (optional).
|
void |
setAdapter(Adapter adapter)
The adapter, used to call the connector.
|
void |
setExecutor(Executor executor)
Set the optional executor that will be used by the connector.
|
void |
setUtilityExecutor(ScheduledExecutorService utilityExecutor)
Set the utility executor that should be used by the protocol handler.
|
void |
start()
Start the protocol.
|
void |
stop()
Stop the protocol.
|
Adapter getAdapter()
void setAdapter(Adapter adapter)
adapter
- The adapter to associateExecutor getExecutor()
void setExecutor(Executor executor)
executor
- the executorScheduledExecutorService getUtilityExecutor()
void setUtilityExecutor(ScheduledExecutorService utilityExecutor)
utilityExecutor
- the executorvoid init() throws Exception
Exception
- If the protocol handler fails to initialisevoid start() throws Exception
Exception
- If the protocol handler fails to startvoid pause() throws Exception
Exception
- If the protocol handler fails to pausevoid resume() throws Exception
Exception
- If the protocol handler fails to resumevoid stop() throws Exception
Exception
- If the protocol handler fails to stopvoid destroy() throws Exception
Exception
- If the protocol handler fails to destroyvoid closeServerSocketGraceful()
long awaitConnectionsClose(long waitMillis)
waitTimeMillis
.waitMillis
- The maximum time to wait in milliseconds for the
client connections to close.boolean isAprRequired()
true
if this Protocol Handler requires the
APR/native library, otherwise false
boolean isSendfileSupported()
true
if this Protocol Handler supports sendfile,
otherwise false
void addSslHostConfig(SSLHostConfig sslHostConfig)
sslHostConfig
- the configurationSSLHostConfig[] findSslHostConfigs()
void addUpgradeProtocol(UpgradeProtocol upgradeProtocol)
upgradeProtocol
- the protocolUpgradeProtocol[] findUpgradeProtocols()
default int getDesiredBufferSize()
static ProtocolHandler create(String protocol, boolean apr) throws ClassNotFoundException, InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException
protocol
- the protocolapr
- if true
the APR protcol handler will be usedClassNotFoundException
- Specified protocol was not foundInstantiationException
- Specified protocol could not be instantiatedIllegalAccessException
- Exception occurredIllegalArgumentException
- Exception occurredInvocationTargetException
- Exception occurredNoSuchMethodException
- Exception occurredSecurityException
- Exception occurredCopyright © 2000-2021 Apache Software Foundation. All Rights Reserved.