org.apache.synapse.transport.nhttp

## Class ServerWorker

- java.lang.Object
- - org.apache.synapse.transport.nhttp.ServerWorker

- All Implemented Interfaces:
    java.lang.Runnable

      public class ServerWorker
      extends java.lang.Object
      implements java.lang.Runnable

  Processes an incoming request through Axis2. An instance of this class would be created to process each unique request

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ServerWorker(org.apache.axis2.context.ConfigurationContext cfgCtx, java.lang.String schemeName, org.apache.axis2.transport.base.MetricsCollector metrics, org.apache.http.nio.NHttpServerConnection conn, ServerHandler serverHandler, org.apache.http.HttpRequest request, java.io.InputStream is, org.apache.http.HttpResponse response, java.io.OutputStream os, boolean isRestDispatching, HttpGetRequestProcessor httpGetRequestProcessor)` Create a new server side worker to process an incoming message and optionally begin creating its output.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `org.apache.http.nio.NHttpServerConnection` | `getConn()`
    `java.io.InputStream` | `getIs()`
    `java.io.OutputStream` | `getOutputStream()`
    `java.lang.String` | `getRemoteAddress()`
    `org.apache.http.HttpResponse` | `getResponse()`
    `ServerHandler` | `getServiceHandler()`
    `void` | `run()` Process the incoming request

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ServerWorker

          public ServerWorker(org.apache.axis2.context.ConfigurationContext cfgCtx,
                              java.lang.String schemeName,
                              org.apache.axis2.transport.base.MetricsCollector metrics,
                              org.apache.http.nio.NHttpServerConnection conn,
                              ServerHandler serverHandler,
                              org.apache.http.HttpRequest request,
                              java.io.InputStream is,
                              org.apache.http.HttpResponse response,
                              java.io.OutputStream os,
                              boolean isRestDispatching,
                              HttpGetRequestProcessor httpGetRequestProcessor)

      Create a new server side worker to process an incoming message and optionally begin creating its output. This however does not force the processor to write a response back as the traditional servlet service() method, but creates the background required to write the response, if one would be created.
      Parameters:
        `cfgCtx` - the configuration context
        `metrics` - metrics collector
        `conn` - the underlying http connection
        `serverHandler` - the handler of the server side messages
        `request` - the http request received (might still be in the process of being streamed)
        `is` - the stream input stream to read the request body
        `response` - the response to be populated if applicable
        `os` - the output stream to write the response body if one is applicable

  - ### Method Detail

    - #### run

          public void run()

      Process the incoming request
      Specified by:
        `run` in interface `java.lang.Runnable`

    - #### getResponse

          public org.apache.http.HttpResponse getResponse()

    - #### getOutputStream

          public java.io.OutputStream getOutputStream()

    - #### getIs

          public java.io.InputStream getIs()

    - #### getServiceHandler

          public ServerHandler getServiceHandler()

    - #### getConn

          public org.apache.http.nio.NHttpServerConnection getConn()

    - #### getRemoteAddress

          public java.lang.String getRemoteAddress()

Copyright © 2005-2022 Apache Software Foundation. All Rights Reserved.