Class ConnectionHandler

java.lang.Object
org.apache.tika.pipes.core.server.ConnectionHandler
All Implemented Interfaces:
Closeable, AutoCloseable, Runnable

public class ConnectionHandler extends Object implements Runnable, Closeable
Handles a single client connection in shared server mode.

Each ConnectionHandler runs in its own thread and processes requests from one PipesClient. It shares resources (parser, fetcher manager, etc.) with other handlers but has its own socket, streams, and executor.

Unlike the per-client PipesServer, a ConnectionHandler does not call System.exit() for most errors — it just closes the connection and terminates its thread. However, OOM and TIMEOUT require a JVM restart, so those still call System.exit(). For all other crashes the shared server continues running for other clients.

  • Constructor Details

    • ConnectionHandler

      public ConnectionHandler(Socket socket, SharedServerResources resources, PipesConfig pipesConfig) throws IOException
      Creates a new ConnectionHandler.
      Parameters:
      socket - the connected client socket
      resources - shared server resources (parser, managers, etc.)
      pipesConfig - the pipes configuration
      Throws:
      IOException - if streams cannot be created
  • Method Details