W
Will
Hi,
I have a webapp which uses an in-memory queue to hold requests for
processing.
I'm trying to come up with a way to persist the contents of the queue
to disk when the webapp is gracefully shutdown.
I know that the JVM can call the finalize() method on an object just
before garbage collection, however, when I put some serialization code
into the finalize() method of the queue, it never seems to get called.
To me, using finalize() in this fashion seems quite clunky anyway.
Would anybody be able to suggest a better way of doing this? I just
need to ensure that the queue is persisted to disk when the app is
shutdown.
Many thanks in advance,
Will
I have a webapp which uses an in-memory queue to hold requests for
processing.
I'm trying to come up with a way to persist the contents of the queue
to disk when the webapp is gracefully shutdown.
I know that the JVM can call the finalize() method on an object just
before garbage collection, however, when I put some serialization code
into the finalize() method of the queue, it never seems to get called.
To me, using finalize() in this fashion seems quite clunky anyway.
Would anybody be able to suggest a better way of doing this? I just
need to ensure that the queue is persisted to disk when the app is
shutdown.
Many thanks in advance,
Will