I don't have a problem with this, but I'd wait for comment from Ben first ...
CachedType in theory should be internal. But I guess in this case, we will have to then. Can you create a Jira for 1.4? I will add it next week.
From very briefly looking at it, it seems that what the use of getCachedType() is fundamentally doing for us in JBossCacheService is:
1) Analyzing the fields of the entire class hierarchy
2) avoiding adding the session as an Observer to static/transient/final fields in the Pojo.
3) Caching the results of the analysis so it doesn't have to be done again.
Theoretically that could be done in JBossCacheService itself, although it's ugly.
BTW, I believe the cachedTypes WeakHashMap in PojoCache will leak Classloaders. The Class is the key, so that is held in a WeakReference -- no problem there. But the value CachedType also has a reference to the Class, and the value in WeakHashMap is held with a strong reference. That chain of strong references will prevent GC of the Class and thus of the Classloader.
Brian, good catch. Maybe I should turn the CachedType Class reference into weak one. Will fix it and have Clebert review it.