Skip to content

Commit 2a396b9

Browse files
Shutdown runnable when no longer needed
1 parent a15eaa7 commit 2a396b9

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

java/src/main/java/com/genexus/internet/CustomPoolingHttpClientConnectionManager.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,12 @@ private void notifyConnectionDestroyed(HttpRoute route) {
7979
for (IConnectionObserver observer : observers)
8080
observer.onConnectionDestroyed(route);
8181
}
82+
83+
@Override
84+
protected void finalize() throws Throwable {
85+
super.finalize();
86+
scheduler.shutdown();
87+
}
8288
}
8389

8490

java/src/main/java/com/genexus/management/MBeanUtils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ public static void createMBean(HttpRoute httpRoute) {
145145
if (mbs == null)
146146
return;
147147
HTTPConnectionJMX mbean = new HTTPConnectionJMX(httpRoute);
148-
registerBean(mbean, "com.genexus.management:type=GeneXusApplicationServer.HTTPPool.HTTPConnection,ApplicationName=" + httpRoute.getTargetHost().getHostName() + ",Port=" + httpRoute.getTargetHost().getPort() + ",name=http connection");
148+
registerBean(mbean, "com.genexus.management:type=GeneXusApplicationServer.HTTPPool.HTTPConnection,ApplicationName=" + httpRoute.getTargetHost().getHostName() + ",Port=" + httpRoute.getTargetHost().getPort() + ",name=Http connection");
149149
}
150150

151151
public static void createMBean(GXConnection connection)
@@ -265,7 +265,7 @@ public static void destroyMBean(HttpRoute httpRoute) {
265265
return;
266266

267267
try {
268-
ObjectName name = new ObjectName("com.genexus.management:type=GeneXusApplicationServer.HTTPPool.HTTPConnection,ApplicationName=" + httpRoute.getTargetHost().getHostName() + ",Port=" + httpRoute.getTargetHost().getPort() + ",name=http connection");
268+
ObjectName name = new ObjectName("com.genexus.management:type=GeneXusApplicationServer.HTTPPool.HTTPConnection,ApplicationName=" + httpRoute.getTargetHost().getHostName() + ",Port=" + httpRoute.getTargetHost().getPort() + ",name=Http connection");
269269
registeredObjects.removeElement(name);
270270

271271
mbs.unregisterMBean(name);

0 commit comments

Comments
 (0)