Class HttpFactory
java.lang.Object
org.apache.axis2.transport.http.server.HttpFactory
Factory used to configure and create the various instances required in http transports.
Either configure this class in axis2.xml, or in code via the setters, or subclass it and specialize some factory methods to gain more control.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringName of axis2.xml hostname parameter for SimpleHTTPServer configurationstatic final StringName of axis2.xml originServer parameter for SimpleHTTPServer configurationstatic final StringName of axis2.xml port parameter for SimpleHTTPServer configurationstatic final StringName of axis2.xml requestCoreThreadPoolSize parameter for SimpleHTTPServer configurationstatic final StringName of axis2.xml requestMaxThreadPoolSize parameter for SimpleHTTPServer configurationstatic final StringName of axis2.xml requestTimeout parameter for SimpleHTTPServer configurationstatic final StringName of axis2.xml requestTcpNoDelay parameter for SimpleHTTPServer configurationstatic final StringName of axis2.xml threadKeepAliveTime parameter for SimpleHTTPServer configurationstatic final StringName of axis2.xml threadKeepAliveTimeUnit parameter for SimpleHTTPServer configuration -
Constructor Summary
ConstructorsConstructorDescriptionHttpFactory(org.apache.axis2.context.ConfigurationContext configurationContext) Create and configure a new HttpFactoryHttpFactory(org.apache.axis2.context.ConfigurationContext configurationContext, int port) Create and configure a new HttpFactoryHttpFactory(org.apache.axis2.context.ConfigurationContext configurationContext, int port, WorkerFactory requestWorkerFactory) Create and configure a new HttpFactory -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.axis2.context.ConfigurationContextGetter for configurationContextGetter for hostAddressorg.apache.axis2.description.TransportInDescriptionGetter for httpConfigurationorg.apache.axis2.engine.ListenerManagerReturn the configured listener manager or create and configure one with configurationContextGetter for originServerintgetPort()Getter for port return the port on which to listen for http connections (default = 6060)intGetter for RequestCoreThreadPoolSizeintGetter for requestMaxThreadPoolSizeintGetter for requestSocketTimeoutbooleanGetter for requestTcpNoDelay return false iff Nagle's algorithm should be used to conserve bandwidth by minimizing segments at the cost of latency and performance (default true, i.e. maximize performance at the cost of bandwidth)longGetter for threadKeepAliveTimeGetter for threadKeepAliveTimeUnit return the time unit for threadKeepAliveTime (default SECONDS)org.apache.hc.core5.http.ConnectionReuseStrategyorg.apache.hc.core5.http.protocol.HttpProcessornewListenerExecutor(int port) Create the executor used to launch the single requestConnectionListenerCreate the queue used to hold incoming requests when requestCoreThreadPoolSize threads are busy.org.apache.hc.core5.http.config.Http1ConfigCreate and set the parameters applied to incoming HTTP request connectionsnewRequestConnectionListener(String scheme, int port, HttpConnectionManager manager, org.apache.hc.core5.http.config.Http1Config http1Config, org.apache.hc.core5.http.io.SocketConfig socketConfig) Create the listener for request connectionsnewRequestConnectionManager(ExecutorService requestExecutor, WorkerFactory workerFactory, org.apache.hc.core5.http.config.Http1Config h1Config) Create the connection manager used to launch request threadsnewRequestExecutor(int port) Create the executor use the manage request processing threadsCreate the factory for request workersorg.apache.hc.core5.http.impl.io.DefaultClassicHttpResponseFactoryorg.apache.hc.core5.http.io.SocketConfigCreate and set the parameters applied to socket connectionsvoidsetHostAddress(String hostAddress) Setter for hostAddressvoidsetOriginServer(String originServer) Setter for originServervoidsetPort(int port) Setter for portvoidsetRequestCoreThreadPoolSize(int requestCoreThreadPoolSize) Setter for RequestCoreThreadPoolSizevoidsetRequestMaxThreadPoolSize(int requestMaxThreadPoolSize) Setter for requestMaxThreadPoolSizevoidsetRequestSocketTimeout(int requestSocketTimeout) Setter for requestSocketTimeoutvoidsetRequestTcpNoDelay(boolean requestTcpNoDelay) Setter for requestTcpNoDelayvoidsetThreadKeepAliveTime(long threadKeepAliveTime) Setter for threadKeepAliveTimevoidsetThreadKeepAliveTimeUnit(TimeUnit threadKeepAliveTimeUnit) Setter for threadKeepAliveTimeUnit
-
Field Details
-
PARAMETER_PORT
Name of axis2.xml port parameter for SimpleHTTPServer configuration- See Also:
-
PARAMETER_HOST_ADDRESS
Name of axis2.xml hostname parameter for SimpleHTTPServer configuration- See Also:
-
PARAMETER_ORIGIN_SERVER
Name of axis2.xml originServer parameter for SimpleHTTPServer configuration- See Also:
-
PARAMETER_REQUEST_SOCKET_TIMEOUT
Name of axis2.xml requestTimeout parameter for SimpleHTTPServer configuration- See Also:
-
PARAMETER_REQUEST_TCP_NO_DELAY
Name of axis2.xml requestTcpNoDelay parameter for SimpleHTTPServer configuration- See Also:
-
PARAMETER_REQUEST_CORE_THREAD_POOL_SIZE
Name of axis2.xml requestCoreThreadPoolSize parameter for SimpleHTTPServer configuration- See Also:
-
PARAMETER_REQUEST_MAX_THREAD_POOL_SIZE
Name of axis2.xml requestMaxThreadPoolSize parameter for SimpleHTTPServer configuration- See Also:
-
PARAMETER_THREAD_KEEP_ALIVE_TIME
Name of axis2.xml threadKeepAliveTime parameter for SimpleHTTPServer configuration- See Also:
-
PARAMETER_THREAD_KEEP_ALIVE_TIME_UNIT
Name of axis2.xml threadKeepAliveTimeUnit parameter for SimpleHTTPServer configuration- See Also:
-
-
Constructor Details
-
HttpFactory
public HttpFactory(org.apache.axis2.context.ConfigurationContext configurationContext) throws org.apache.axis2.AxisFault Create and configure a new HttpFactory- Throws:
org.apache.axis2.AxisFault
-
HttpFactory
public HttpFactory(org.apache.axis2.context.ConfigurationContext configurationContext, int port) throws org.apache.axis2.AxisFault Create and configure a new HttpFactory- Throws:
org.apache.axis2.AxisFault
-
HttpFactory
public HttpFactory(org.apache.axis2.context.ConfigurationContext configurationContext, int port, WorkerFactory requestWorkerFactory) throws org.apache.axis2.AxisFault Create and configure a new HttpFactory- Throws:
org.apache.axis2.AxisFault
-
-
Method Details
-
getListenerManager
public org.apache.axis2.engine.ListenerManager getListenerManager()Return the configured listener manager or create and configure one with configurationContext -
newListenerExecutor
Create the executor used to launch the single requestConnectionListener -
newRequestConnectionListener
public IOProcessor newRequestConnectionListener(String scheme, int port, HttpConnectionManager manager, org.apache.hc.core5.http.config.Http1Config http1Config, org.apache.hc.core5.http.io.SocketConfig socketConfig) throws IOException Create the listener for request connections- Throws:
IOException
-
newRequestConnectionHttp1Config
public org.apache.hc.core5.http.config.Http1Config newRequestConnectionHttp1Config()Create and set the parameters applied to incoming HTTP request connections -
newSocketConfig
public org.apache.hc.core5.http.io.SocketConfig newSocketConfig()Create and set the parameters applied to socket connections -
newRequestConnectionManager
public HttpConnectionManager newRequestConnectionManager(ExecutorService requestExecutor, WorkerFactory workerFactory, org.apache.hc.core5.http.config.Http1Config h1Config) Create the connection manager used to launch request threads -
newRequestExecutor
Create the executor use the manage request processing threads -
newRequestBlockingQueue
Create the queue used to hold incoming requests when requestCoreThreadPoolSize threads are busy. Default is an unbounded queue. -
newRequestWorkerFactory
Create the factory for request workers -
newHttpProcessor
public org.apache.hc.core5.http.protocol.HttpProcessor newHttpProcessor() -
newConnStrategy
public org.apache.hc.core5.http.ConnectionReuseStrategy newConnStrategy() -
newResponseFactory
public org.apache.hc.core5.http.impl.io.DefaultClassicHttpResponseFactory newResponseFactory() -
getConfigurationContext
public org.apache.axis2.context.ConfigurationContext getConfigurationContext()Getter for configurationContext -
getHttpConfiguration
public org.apache.axis2.description.TransportInDescription getHttpConfiguration()Getter for httpConfiguration -
getPort
public int getPort()Getter for port return the port on which to listen for http connections (default = 6060) -
setPort
public void setPort(int port) Setter for port -
getHostAddress
Getter for hostAddress- Returns:
- the host address (or name) to be use in reply-to endpoint references, or null if not specified (default = null)
-
setHostAddress
Setter for hostAddress -
getOriginServer
Getter for originServer- Returns:
- the Server header string for outgoing messages (default "Simple-Server/1.1")
-
setOriginServer
Setter for originServer -
getRequestSocketTimeout
public int getRequestSocketTimeout()Getter for requestSocketTimeout- Returns:
- the maximum time in millis to wait for data on a request socket (default 20000)
-
setRequestSocketTimeout
public void setRequestSocketTimeout(int requestSocketTimeout) Setter for requestSocketTimeout -
getRequestTcpNoDelay
public boolean getRequestTcpNoDelay()Getter for requestTcpNoDelay return false iff Nagle's algorithm should be used to conserve bandwidth by minimizing segments at the cost of latency and performance (default true, i.e. maximize performance at the cost of bandwidth) -
setRequestTcpNoDelay
public void setRequestTcpNoDelay(boolean requestTcpNoDelay) Setter for requestTcpNoDelay -
getRequestCoreThreadPoolSize
public int getRequestCoreThreadPoolSize()Getter for RequestCoreThreadPoolSize- Returns:
- the size of the thread pool use to process requests assuming there is adequate queue space (default 25)
-
setRequestCoreThreadPoolSize
public void setRequestCoreThreadPoolSize(int requestCoreThreadPoolSize) Setter for RequestCoreThreadPoolSize -
getRequestMaxThreadPoolSize
public int getRequestMaxThreadPoolSize()Getter for requestMaxThreadPoolSize- Returns:
- the maximum size of the thread pool used to process requests if the queue fills up (default 150). Since the default queue is unbounded this parameter is meaningless unless you override newRequestBlockingQueue()
-
setRequestMaxThreadPoolSize
public void setRequestMaxThreadPoolSize(int requestMaxThreadPoolSize) Setter for requestMaxThreadPoolSize -
getThreadKeepAliveTime
public long getThreadKeepAliveTime()Getter for threadKeepAliveTime- Returns:
- how long a request processing thread in excess of the core pool size will be kept alive it if is inactive (default with threadKeepAliveTimeUnit to 180 seconds)
-
setThreadKeepAliveTime
public void setThreadKeepAliveTime(long threadKeepAliveTime) Setter for threadKeepAliveTime -
getThreadKeepAliveTimeUnit
Getter for threadKeepAliveTimeUnit return the time unit for threadKeepAliveTime (default SECONDS) -
setThreadKeepAliveTimeUnit
Setter for threadKeepAliveTimeUnit
-