public abstract class AbstractProtocol<S> extends Object implements ProtocolHandler, MBeanRegistration
Modifier and Type | Class and Description |
---|---|
protected class |
AbstractProtocol.AsyncTimeout
Async timeout thread
|
protected static class |
AbstractProtocol.ConnectionHandler<S> |
protected static class |
AbstractProtocol.RecycledProcessors |
Modifier and Type | Field and Description |
---|---|
protected Adapter |
adapter
The adapter provides the link between the ProtocolHandler and the
connector.
|
protected String |
clientCertProvider
When client certificate information is presented in a form other than
instances of
X509Certificate it needs to be
converted before it can be used and this property controls which JSSE
provider is used to perform the conversion. |
protected String |
domain |
protected MBeanServer |
mserver |
protected ObjectName |
oname |
protected int |
processorCache
The maximum number of idle processors that will be retained in the cache
and re-used with a subsequent request.
|
protected ObjectName |
rgOname
Name of MBean for the Global Request Processor.
|
protected ObjectName |
tpOname
Name of MBean for the ThreadPool.
|
Constructor and Description |
---|
AbstractProtocol(AbstractEndpoint<S> endpoint) |
Modifier and Type | Method and Description |
---|---|
void |
addWaitingProcessor(Processor processor) |
protected abstract Processor |
createProcessor()
Create and configure a new Processor instance for the current protocol
implementation.
|
protected abstract Processor |
createUpgradeProcessor(SocketWrapperBase<?> socket,
UpgradeToken upgradeToken) |
void |
destroy()
Destroy the protocol (optional).
|
int |
getAcceptorThreadCount() |
int |
getAcceptorThreadPriority() |
Adapter |
getAdapter() |
InetAddress |
getAddress() |
AbstractProtocol.AsyncTimeout |
getAsyncTimeout() |
int |
getBacklog() |
String |
getClientCertProvider() |
long |
getConnectionCount() |
int |
getConnectionTimeout() |
String |
getDomain() |
protected AbstractEndpoint<S> |
getEndpoint() |
Executor |
getExecutor()
The executor, provide access to the underlying thread pool.
|
protected AbstractEndpoint.Handler<S> |
getHandler() |
int |
getKeepAliveTimeout() |
int |
getLocalPort() |
protected abstract Log |
getLog()
Concrete implementations need to provide access to their logger to be
used by the abstract classes.
|
int |
getMaxConnections() |
int |
getMaxHeaderCount() |
int |
getMaxThreads() |
int |
getMinSpareThreads() |
String |
getName()
The name will be prefix-address-port if address is non-null and
prefix-port if the address is null.
|
int |
getNameIndex() |
protected abstract String |
getNamePrefix()
Obtain the prefix to be used when construction a name for this protocol
handler.
|
protected abstract UpgradeProtocol |
getNegotiatedProtocol(String name)
Find a suitable handler for the protocol negotiated
at the network layer.
|
ObjectName |
getObjectName() |
int |
getPort() |
int |
getProcessorCache() |
String |
getProperty(String name)
Generic property getter used by the digester.
|
protected abstract String |
getProtocolName()
Obtain the name of the protocol, (Http, Ajp, etc.).
|
int |
getSoLinger() |
int |
getSoTimeout() |
boolean |
getTcpNoDelay() |
int |
getThreadPriority() |
protected abstract UpgradeProtocol |
getUpgradeProtocol(String name)
Find a suitable handler for the protocol upgraded name specified.
|
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 |
postDeregister() |
void |
postRegister(Boolean registrationDone) |
void |
preDeregister() |
ObjectName |
preRegister(MBeanServer server,
ObjectName name) |
void |
removeWaitingProcessor(Processor processor) |
void |
resume()
Resume the protocol (optional).
|
void |
setAcceptorThreadCount(int threadCount) |
void |
setAcceptorThreadPriority(int threadPriority) |
void |
setAdapter(Adapter adapter)
The adapter, used to call the connector.
|
void |
setAddress(InetAddress ia) |
void |
setBacklog(int backlog) |
void |
setClientCertProvider(String s) |
void |
setConnectionTimeout(int timeout) |
void |
setExecutor(Executor executor) |
protected void |
setHandler(AbstractEndpoint.Handler<S> handler) |
void |
setKeepAliveTimeout(int keepAliveTimeout) |
void |
setMaxConnections(int maxConnections) |
void |
setMaxHeaderCount(int maxHeaderCount) |
void |
setMaxThreads(int maxThreads) |
void |
setMinSpareThreads(int minSpareThreads) |
void |
setPort(int port) |
void |
setProcessorCache(int processorCache) |
boolean |
setProperty(String name,
String value)
Generic property setter used by the digester.
|
void |
setSoLinger(int soLinger) |
void |
setSoTimeout(int timeout) |
void |
setTcpNoDelay(boolean tcpNoDelay) |
void |
setThreadPriority(int threadPriority) |
void |
start()
Start the protocol.
|
void |
stop()
Stop the protocol.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addSslHostConfig, addUpgradeProtocol, findSslHostConfigs, findUpgradeProtocols
protected ObjectName rgOname
protected ObjectName tpOname
protected Adapter adapter
protected int processorCache
getMaxConnections()
although it will
usually be closer to getMaxThreads()
.protected String clientCertProvider
X509Certificate
it needs to be
converted before it can be used and this property controls which JSSE
provider is used to perform the conversion. For example it is used with
the AJP connectors, the HTTP APR connector and with the
SSLValve
. If not specified, the
default provider will be used.protected String domain
protected ObjectName oname
protected MBeanServer mserver
public AbstractProtocol(AbstractEndpoint<S> endpoint)
public boolean setProperty(String name, String value)
name
- The name of the property to setvalue
- The value, in string form, to set for the propertytrue
if the property was set successfully, otherwise
false
public String getProperty(String name)
name
- The name of the property to getpublic void setAdapter(Adapter adapter)
ProtocolHandler
setAdapter
in interface ProtocolHandler
adapter
- The adapter to associatepublic Adapter getAdapter()
getAdapter
in interface ProtocolHandler
public int getProcessorCache()
public void setProcessorCache(int processorCache)
public String getClientCertProvider()
public void setClientCertProvider(String s)
public boolean isAprRequired()
ProtocolHandler
isAprRequired
in interface ProtocolHandler
true
if this Protocol Handler requires the
APR/native library, otherwise false
public boolean isSendfileSupported()
ProtocolHandler
isSendfileSupported
in interface ProtocolHandler
true
if this Protocol Handler supports sendfile,
otherwise false
public AbstractProtocol.AsyncTimeout getAsyncTimeout()
public Executor getExecutor()
ProtocolHandler
getExecutor
in interface ProtocolHandler
public void setExecutor(Executor executor)
public int getMaxThreads()
public void setMaxThreads(int maxThreads)
public int getMaxConnections()
public void setMaxConnections(int maxConnections)
public int getMinSpareThreads()
public void setMinSpareThreads(int minSpareThreads)
public int getThreadPriority()
public void setThreadPriority(int threadPriority)
public int getBacklog()
public void setBacklog(int backlog)
public boolean getTcpNoDelay()
public void setTcpNoDelay(boolean tcpNoDelay)
public int getSoLinger()
public void setSoLinger(int soLinger)
public int getKeepAliveTimeout()
public void setKeepAliveTimeout(int keepAliveTimeout)
public InetAddress getAddress()
public void setAddress(InetAddress ia)
public int getPort()
public void setPort(int port)
public int getLocalPort()
public int getConnectionTimeout()
public void setConnectionTimeout(int timeout)
public int getSoTimeout()
public void setSoTimeout(int timeout)
public int getMaxHeaderCount()
public void setMaxHeaderCount(int maxHeaderCount)
public long getConnectionCount()
public void setAcceptorThreadCount(int threadCount)
public int getAcceptorThreadCount()
public void setAcceptorThreadPriority(int threadPriority)
public int getAcceptorThreadPriority()
public int getNameIndex()
public String getName()
public void addWaitingProcessor(Processor processor)
public void removeWaitingProcessor(Processor processor)
protected AbstractEndpoint<S> getEndpoint()
protected AbstractEndpoint.Handler<S> getHandler()
protected void setHandler(AbstractEndpoint.Handler<S> handler)
protected abstract Log getLog()
protected abstract String getNamePrefix()
protected abstract String getProtocolName()
protected abstract UpgradeProtocol getNegotiatedProtocol(String name)
name
- The name of the requested negotiated protocol.UpgradeProtocol.getAlpnName()
matches
the requested protocolprotected abstract UpgradeProtocol getUpgradeProtocol(String name)
name
- The name of the requested negotiated protocol.UpgradeProtocol.getAlpnName()
matches
the requested protocolprotected abstract Processor createProcessor()
protected abstract Processor createUpgradeProcessor(SocketWrapperBase<?> socket, UpgradeToken upgradeToken)
public ObjectName getObjectName()
public String getDomain()
public ObjectName preRegister(MBeanServer server, ObjectName name) throws Exception
preRegister
in interface MBeanRegistration
Exception
public void postRegister(Boolean registrationDone)
postRegister
in interface MBeanRegistration
public void preDeregister() throws Exception
preDeregister
in interface MBeanRegistration
Exception
public void postDeregister()
postDeregister
in interface MBeanRegistration
public void init() throws Exception
ProtocolHandler
init
in interface ProtocolHandler
Exception
- If the protocol handler fails to initialisepublic void start() throws Exception
ProtocolHandler
start
in interface ProtocolHandler
Exception
- If the protocol handler fails to startpublic void pause() throws Exception
ProtocolHandler
pause
in interface ProtocolHandler
Exception
- If the protocol handler fails to pausepublic void resume() throws Exception
ProtocolHandler
resume
in interface ProtocolHandler
Exception
- If the protocol handler fails to resumepublic void stop() throws Exception
ProtocolHandler
stop
in interface ProtocolHandler
Exception
- If the protocol handler fails to stoppublic void destroy()
ProtocolHandler
destroy
in interface ProtocolHandler
Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.