• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to trigger closing of PoolingClientConnectionManager?  RSS feed

 
Jano Frank
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I use org.apache.http.impl.conn.PoolingClientConnectionManager. When the application is undeployed I would like the connection manager to be shut down and release all resources. How to trigger this automatically during the app undeployment?

The app is deployed on WebLogic Server.

Thanks!

 
Steve Luke
Bartender
Posts: 4181
22
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you sure you should be using that? According to the documentation you should be using PoolingHttpClientConnectionManager.html. Either way, they both implement HttpClientConnectionManager which has a shutdown method which looks like it does exactly what you want.
 
Jano Frank
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am aware of the shutdown method. But what would trigger the shutdown method? I want to trigger it before the app is undeployed from the server.
 
Rob Spoor
Sheriff
Posts: 21135
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How about an @PreDestroy event on a singleton bean with @Startup so you'll be sure it's initiated?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!