Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4809008

Introspector cache should be cleared without explicit flush methods calls

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      tiger
    • CPU:
      sparc
    • OS:
      solaris_8

      Description

      JDK 1.4.1 API doc has following description about Introspector cache.
      --------------------------------------------------------------------------------------
      http://java.sun.com/j2se/1.4.1/docs/api/java/beans/Introspector.html

      Because the Introspector caches BeanInfo classes for better performance,
      take care if you use it in an application that uses multiple class loaders.
      In general, when you destroy a ClassLoader that has been used to introspect classes,
      you should use the Introspector.flushCaches or Introspector.flushFromCaches method
      to flush all of the introspected classes out of the cache.
      --------------------------------------------------------------------------------------
      A licensee had a server crash issue on their J2EE application server
      using many class loaders and wants us to improve the way Introspector
      flushes its cache.

      They claim that an application server does not know if user application
      uses Introspector or not. Thus, they want Introspector to flush cache by itself.

      I have discussed this request with the responsible engineer and
      got two suggestions for Tiger (J2SE 1.5) from him.

      1. Adding new flushCaches(ClassLoader) method to API.
          This will be useful for short life time ClassLoaders.
          Current two methods, flushCaches() and flushCache(Class) have
          room for improvement. The flushCaches() clears everything and
          it is often too aggressive. To use the flushCache(Class),
          users have to keep references to all class objects.

      2. Making Introspector detect removed ClassLoaders and call above
         method internally (by itself).
          
      I believe those two enhancements solve a licensee issue and would
      like the bean team to work on it.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              mdavidsosunw Mark Davidson (Inactive)
              Reporter:
              duke J. Duke (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: