I have not done this myself but here is how I would attempt it.
Add a local property to your object and call it something like lastUsedTime$ and add a method to the object called something like isTimedOut(). The method would compare the current time to the lastUsedTime and if the difference exceeds a certain amount return 1 else return 0. Then in the other methods you can set lastUsedTime to the current time. This was a program can simply call isTimedOut() and no if it has been too long since it was last used they can drop the object. This program can simply just check periodically if the object is timed out.