https://issues.apache.org/bugzilla/show_bug.cgi?id=53085

--- Comment #3 from Konstantin Kolinko <knst.koli...@gmail.com> 2012-04-19 
12:19:47 UTC ---
Created attachment 28641
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=28641
2012-04-19_tc8_53085_DefaultInstanceManager.patch

I added ManagedConcurrentWeakHashMap class to trunk in r1327915

Here is a patch for trunk that uses that new class to fix this issue. I have
not committed it yet.

Things that I am not sure:

1. Should DefaultInstanceManager implement LifecycleListener just to catch
periodic events?

There is PeriodicEventListener interface that seems more suitable.

The only "problem" though is ugliness in TestDefaultInstanceManager part of the
patch where I need to call this maintenance processing. Simulating a
LifecycleEvent is more than it is worth.

The good thing though is that I do not need to override
StandardContext#backgroundProcessing() to fire the event, nor invent a
LifecycleListener -> PeriodicEventListener adapter.

2. Looking for calls of DefaultInstanceManager constructor, there are 3 such
places. Only the instanceManager instance owned by StandardContext is handled
by this patch.  I wonder whether 2 other places are actually needed.

Maybe amend the Context interface by adding #getInstanceManager() method, at
least in Tomcat 8?

The 3 places:
 - StandardContext#startInternal()
 - ApplicationFilterConfig#getInstanceManager()
 - AsyncContextImpl#getInstanceManager()

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to