i'm not sure if there is a "simpler" solution, but one options is a custom mbean that registers itself w/ the EARDeployer to listen for deployment notifications.
when your mbean gets notified that a deployment occurred, you could do whatever is necessary to clean up those connections/threads.
Can we configure the existing Mbean to do that. I don't have any idea about which Mbean it is and where the configure to be done.Could you give some information on it.
what do you mean by "existing" mbean? you can't modify the EARDeployer to handle this, you need to write your own mbean to handle this.
basically you create an mbean and register it w/ the EARDeployer w/ a filter so you only get the events you want. when the EARDeployer sends a notification, it will determine if you should get the message (via the filter) and if yes, your mbean will be notified.
once your mbean is notified, it can invoke whatever methods are necessary to do the cleanup work.
i've did some experimentation w/ this the other day to solve a problem i was having, but just opted for a custom deployer - so if you ask me more "specific" questions, i can continue to provide some support.