Package jadex.common
Class HttpConnectionManager
java.lang.Object
jadex.common.HttpConnectionManager
The connection manager allows asynchronously terminating
open connections to avoid hanging on e.g. platform shutdown.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
Close a connectionvoid
dispose()
Dispose the connection manager and close all open connections.openConnection
(String address) Open a receiving connection.void
remove
(HttpURLConnection con) Remove a connection.
-
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
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
Remove a connection.- Parameters:
con
- The previously opened connection.
-
closeConnection
Close a connection
-