ICEfaces
  1. ICEfaces
  2. ICE-5848

Refactor dynamic resource registration

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-Alpha3
    • Fix Version/s: 2.0-Beta1, 2.0.0
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      server
    • Affects:
      Documentation (User Guide, Ref. Guide, etc.)

      Description

      Dynamic resource registration need to be refactored so that resources are not kept in the session anymore and the the corresponding registrations create during render phase are expired before next render phase is executed.

        Activity

        Hide
        Ken Fyten added a comment -

        As a reference, the following ICEfaces 1.8 components are using dynamic resource API:

        1. OutputResource:
        Uses it to server various types of resources. Since there is a callback API for this ultimately the scoping decision should belong to the application for each resource.

        2. DataExporter:
        Uses a FileResource to server generated report. (Application control).

        3. HtmlGraphicImage:
        Uses a ByteArrayResource to support byte array to generate an image. (Application control)

        4. InputRichText:
        Using various Resource utilities(e.g.)

        • JarResource: to server custom JS from jar
        • ResourceLinker to serve resources of zip from the jar.
          ( These are under component control, and should probably be Application scope. )
        Show
        Ken Fyten added a comment - As a reference, the following ICEfaces 1.8 components are using dynamic resource API: 1. OutputResource: Uses it to server various types of resources. Since there is a callback API for this ultimately the scoping decision should belong to the application for each resource. 2. DataExporter: Uses a FileResource to server generated report. (Application control). 3. HtmlGraphicImage: Uses a ByteArrayResource to support byte array to generate an image. (Application control) 4. InputRichText: Using various Resource utilities(e.g.) JarResource: to server custom JS from jar ResourceLinker to serve resources of zip from the jar. ( These are under component control, and should probably be Application scope. )
        Hide
        Deryk Sinotte added a comment -

        Currently, it looks as if the DynamicResourceDispatcher is having problems with session serialization as well. I see the following INFO level logging when shutting down an ICEfaces application on Glassfish v3:

        [#|2010-06-29T11:00:54.255-0700|INFO|glassfishv3.0|org.apache.catalina.session.ManagerBase|_ThreadID=35;_ThreadName=Thread-1;|PWC2785: Cannot serialize session attribute org.icefaces.push.DynamicResourceDispatcher for session 4da0ec490ef5a54f700bd44f21e0
        java.io.NotSerializableException: org.apache.catalina.session.StandardSessionFacade
        at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1156)
        at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
        at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
        at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
        ...

        Show
        Deryk Sinotte added a comment - Currently, it looks as if the DynamicResourceDispatcher is having problems with session serialization as well. I see the following INFO level logging when shutting down an ICEfaces application on Glassfish v3: [#|2010-06-29T11:00:54.255-0700|INFO|glassfishv3.0|org.apache.catalina.session.ManagerBase|_ThreadID=35;_ThreadName=Thread-1;|PWC2785: Cannot serialize session attribute org.icefaces.push.DynamicResourceDispatcher for session 4da0ec490ef5a54f700bd44f21e0 java.io.NotSerializableException: org.apache.catalina.session.StandardSessionFacade at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1156) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392) ...
        Hide
        Mircea Toma added a comment -

        Refactored DynamicResourceDispatcher to use weak references for resource registrations. References that are not strongly referenced by application or components are garbaged collected right away.

        Show
        Mircea Toma added a comment - Refactored DynamicResourceDispatcher to use weak references for resource registrations. References that are not strongly referenced by application or components are garbaged collected right away.

          People

          • Assignee:
            Mircea Toma
            Reporter:
            Mircea Toma
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: