users@jersey.java.net

[Jersey] InjectableProviders and clean-up after Resource destruction

From: Neil Bartlett <njbartlett_at_gmail.com>
Date: Sat, 21 Apr 2012 10:17:03 +0100

I am using an InjectableProvider to implement my own injection into fields annotated with @javax.inject.Inject. So far this works fine.

However I additionally need to perform some clean-up of the injected value after the resource has finished using it. Since the injection is happening in the PerRequest scope, it seems I should be able to hook into the destruction of the resource instance after the HTTP processing has completed. Unfortunately I have not yet been able to work out how to do this. Could somebody please provide some pointers?

Many thanks,
Neil