I have a web service deployed using Axis in JBOSS 3.2.1. The service uses a class, SocketConnection, which has a static reference to a socket which always remains open. I need to gracefully close this socket if the JBOSS server is brought down. I tried adding a finalize method to the SocketConnection class but it isn't getting invoked. Does anyone know how I can accomplish this? Again, I have the classes deployed using Axis as defined in the wsdd file.