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(java.lang.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.
|
java.util.concurrent.Executor |
getExecutor()
The executor, provide access to the underlying thread pool.
|
default java.lang.String |
getId()
The default behavior is to identify connectors uniquely with address
and port.
|
java.util.concurrent.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(java.util.concurrent.Executor executor)
Set the optional executor that will be used by the connector.
|
void |
setUtilityExecutor(java.util.concurrent.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 associatejava.util.concurrent.Executor getExecutor()
void setExecutor(java.util.concurrent.Executor executor)
executor - the executorjava.util.concurrent.ScheduledExecutorService getUtilityExecutor()
void setUtilityExecutor(java.util.concurrent.ScheduledExecutorService utilityExecutor)
utilityExecutor - the executorvoid init() throws java.lang.Exception
java.lang.Exception - If the protocol handler fails to initialisevoid start()
throws java.lang.Exception
java.lang.Exception - If the protocol handler fails to startvoid pause()
throws java.lang.Exception
java.lang.Exception - If the protocol handler fails to pausevoid resume()
throws java.lang.Exception
java.lang.Exception - If the protocol handler fails to resumevoid stop() throws java.lang.Exception
java.lang.Exception - If the protocol handler fails to stopvoid destroy()
throws java.lang.Exception
java.lang.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 falseboolean isSendfileSupported()
true if this Protocol Handler supports sendfile,
otherwise falsevoid addSslHostConfig(SSLHostConfig sslHostConfig)
sslHostConfig - the configurationSSLHostConfig[] findSslHostConfigs()
void addUpgradeProtocol(UpgradeProtocol upgradeProtocol)
upgradeProtocol - the protocolUpgradeProtocol[] findUpgradeProtocols()
default int getDesiredBufferSize()
default java.lang.String getId()
static ProtocolHandler create(java.lang.String protocol, boolean apr) throws java.lang.ClassNotFoundException, java.lang.InstantiationException, java.lang.IllegalAccessException, java.lang.IllegalArgumentException, java.lang.reflect.InvocationTargetException, java.lang.NoSuchMethodException, java.lang.SecurityException
protocol - the protocolapr - if true the APR protcol handler will be usedjava.lang.ClassNotFoundException - Specified protocol was not foundjava.lang.InstantiationException - Specified protocol could not be instantiatedjava.lang.IllegalAccessException - Exception occurredjava.lang.IllegalArgumentException - Exception occurredjava.lang.reflect.InvocationTargetException - Exception occurredjava.lang.NoSuchMethodException - Exception occurredjava.lang.SecurityException - Exception occurredCopyright © 2000-2024 Apache Software Foundation. All Rights Reserved.