Package jadex.common

Class HttpConnectionManager

java.lang.Object
jadex.common.HttpConnectionManager

public class HttpConnectionManager extends Object
The connection manager allows asynchronously terminating open connections to avoid hanging on e.g. platform shutdown.
  • Constructor Details

    • HttpConnectionManager

      public HttpConnectionManager()
      Create a new connection manager.
  • Method Details

    • dispose

      public void dispose()
      Dispose the connection manager and close all open connections.
    • openConnection

      public HttpURLConnection openConnection(String address) throws IOException
      Open a receiving connection. The connection should be removed when it is closed to avoid memory leaks.
      Parameters:
      address - The address to connect to.
      Returns:
      The connection.
      Throws:
      IOException - on connection failures
    • remove

      public void remove(HttpURLConnection con)
      Remove a connection.
      Parameters:
      con - The previously opened connection.
    • closeConnection

      public static void closeConnection(HttpURLConnection con)
      Close a connection