Class NetServerHelper

Direct Known Subclasses:
HttpServerHelper, HttpsServerHelper

@Deprecated public abstract class NetServerHelper extends HttpServerHelper
Deprecated.
Will be removed in the next 2.7/3.0 release.
Abstract Internal web server connector based on com.sun.net.httpserver package. Here is the list of parameters that are supported. They should be set in the Server's context before it is started:
list of supported parameters
Parameter name Value type Default value Description
minThreads int 1 Minimum number of worker threads waiting to service calls, even if they are idle. Technically speaking, this is a core number of threads that are pre-started.
maxThreads int 10 Maximum number of worker threads that can service calls. If this number is reached then additional calls are queued if the "maxQueued" value hasn't been reached.
maxQueued int 0 Maximum number of calls that can be queued if there aren't any worker thread available to service them. If the value is '0', then no queue is used and calls are rejected if no worker thread is immediately available. If the value is '-1', then an unbounded queue is used and calls are never rejected.

Note: make sure that this value is consistent with getMinThreads() and the behavior of the ThreadPoolExecutor configured internally.
maxThreadIdleTimeMs int 300 000 Time for an idle thread to wait for an operation before being collected.
Author:
Jerome Louvel
  • Constructor Details

    • NetServerHelper

      public NetServerHelper(Server server)
      Deprecated.
      Constructor.
      Parameters:
      server - The server to help.
  • Method Details

    • createThreadPool

      protected ThreadPoolExecutor createThreadPool()
      Deprecated.
      Creates the handler service.
      Returns:
      The handler service.
    • getAddress

      protected InetSocketAddress getAddress()
      Deprecated.
      Returns the socket address this server is listening to.
      Returns:
      The socket address this server is listening to.
    • getMaxQueued

      public int getMaxQueued()
      Deprecated.
      Returns the maximum number of calls that can be queued if there aren't any worker thread available to service them. If the value is '0', then no queue is used and calls are rejected if no worker thread is immediately available. If the value is '-1', then an unbounded queue is used and calls are never rejected.

      Note: make sure that this value is consistent with getMinThreads() and the behavior of the ThreadPoolExecutor configured internally.
      Returns:
      The maximum number of calls that can be queued.
    • getMaxThreadIdleTimeMs

      public int getMaxThreadIdleTimeMs()
      Deprecated.
      Returns the time for an idle thread to wait for an operation before being collected.
      Returns:
      The time for an idle thread to wait for an operation before being collected.
    • getMaxThreads

      public int getMaxThreads()
      Deprecated.
      Returns the maximum threads that will service requests.
      Returns:
      The maximum threads that will service requests.
    • getMinThreads

      public int getMinThreads()
      Deprecated.
      Returns the minimum threads waiting to service requests. Technically speaking, this is a core number of threads that are pre-started.
      Returns:
      The minimum threads waiting to service requests.
    • isConfidential

      public boolean isConfidential()
      Deprecated.
      Indicates if this service is acting in HTTP or HTTPS mode.
      Returns:
      True if this service is acting in HTTP or HTTPS mode.
    • setAddress

      protected void setAddress(InetSocketAddress address)
      Deprecated.
      Sets the socket address this server is listening to.
      Parameters:
      address - The socket address this server is listening to.
    • setConfidential

      protected void setConfidential(boolean confidential)
      Deprecated.
      Indicates if this service is acting in HTTP or HTTPS mode.
      Parameters:
      confidential - True if this service is acting in HTTP or HTTPS mode.
    • start

      public void start() throws Exception
      Deprecated.
      Description copied from class: RestletHelper
      Start callback.
      Overrides:
      start in class ConnectorHelper<Server>
      Throws:
      Exception
    • stop

      public void stop() throws Exception
      Deprecated.
      Description copied from class: RestletHelper
      Stop callback.
      Overrides:
      stop in class ServerHelper
      Throws:
      Exception