ICEfaces
  1. ICEfaces
  2. ICE-5737

Factor and normalize use of system event listeners

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-Alpha2
    • Fix Version/s: 2.1-Beta, 3.0
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      ICEfaces 2 JSF 2
    • Assignee Priority:
      P3

      Description

      We're currently relying heavily on System Event Listeners to modify the component tree dynamically. We need to review the use of these listeners to ensure that we're using them properly and efficiently.

        Activity

        Hide
        Deryk Sinotte added a comment -

        Targetting for beta and assigning to Ted for now. This will likely be more of a group exercise and be part of a more general review process of the current product.

        Show
        Deryk Sinotte added a comment - Targetting for beta and assigning to Ted for now. This will likely be more of a group exercise and be part of a more general review process of the current product.
        Hide
        Ken Fyten added a comment -

        Task for 2.0 FCS is limited to testing / timing a specific System Event Listener to determine if there is significant overhead related to using multiple listeners vs. fewer.

        Show
        Ken Fyten added a comment - Task for 2.0 FCS is limited to testing / timing a specific System Event Listener to determine if there is significant overhead related to using multiple listeners vs. fewer.
        Hide
        Ted Goddard added a comment -

        Mojarra source code shows reflection for each invocation of a SystemEventListener, so there is definitely performance overhead that could be avoided. In any case, this is an optimization, so can be addressed after 2.0.

        Show
        Ted Goddard added a comment - Mojarra source code shows reflection for each invocation of a SystemEventListener, so there is definitely performance overhead that could be avoided. In any case, this is an optimization, so can be addressed after 2.0.
        Hide
        Ted Goddard added a comment -

        If profiling shows a clear need for performance improvements, this can be investigated sooner.

        Show
        Ted Goddard added a comment - If profiling shows a clear need for performance improvements, this can be investigated sooner.
        Hide
        Jack Van Ooststroom added a comment - - edited

        Initial check-in of improvements done for:

        • BridgeSetup
        • FormSubmit
        • HeadBodyListener
        • WindowAndViewIDSetup
        • faces-config.xml
        Show
        Jack Van Ooststroom added a comment - - edited Initial check-in of improvements done for: BridgeSetup FormSubmit HeadBodyListener WindowAndViewIDSetup faces-config.xml
        Hide
        Deryk Sinotte added a comment -

        The use of a specific Mojarra class in the ICEPushResourceHandler causes problems under MyFaces:

        if (projectStage != null && !projectStage.equals("Production"))

        { facesContext.getApplication().subscribeToEvent(PostAddToViewEvent.class, com.sun.faces.facelets.tag.ui.UIDebug.class, new DebugTagListener()); }

        ...
        Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at org.apache.myfaces.shared.util.ClassUtils.buildApplicationObject(ClassUtils.java:539)
        ... 15 more
        Caused by: java.lang.NoClassDefFoundError: com/sun/faces/facelets/tag/ui/UIDebug
        at org.icefaces.impl.push.servlet.ICEpushResourceHandler.<init>(ICEpushResourceHandler.java:80)
        ... 20 more
        Caused by: java.lang.ClassNotFoundException: com.sun.faces.facelets.tag.ui.UIDebug
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1676)
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1521)
        ... 21 more

        Show
        Deryk Sinotte added a comment - The use of a specific Mojarra class in the ICEPushResourceHandler causes problems under MyFaces: if (projectStage != null && !projectStage.equals("Production")) { facesContext.getApplication().subscribeToEvent(PostAddToViewEvent.class, com.sun.faces.facelets.tag.ui.UIDebug.class, new DebugTagListener()); } ... Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at org.apache.myfaces.shared.util.ClassUtils.buildApplicationObject(ClassUtils.java:539) ... 15 more Caused by: java.lang.NoClassDefFoundError: com/sun/faces/facelets/tag/ui/UIDebug at org.icefaces.impl.push.servlet.ICEpushResourceHandler.<init>(ICEpushResourceHandler.java:80) ... 20 more Caused by: java.lang.ClassNotFoundException: com.sun.faces.facelets.tag.ui.UIDebug at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1676) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1521) ... 21 more
        Hide
        Deryk Sinotte added a comment -

        Perhaps simply wrapping the relevant code in EnvUtil.isMojarra() check would suffice.

        Show
        Deryk Sinotte added a comment - Perhaps simply wrapping the relevant code in EnvUtil.isMojarra() check would suffice.
        Hide
        Jack Van Ooststroom added a comment -

        Reverted the HeadBodyListener and BridgeSetup optimizations as it broke our portlet support.

        Partly reverted one of the optimizations. It now checks for the String com.sun.faces.facelets.tag.ui.UIDebug again instead of the class.

        Originally the optimizations seemed to have improve performance of the lifecycle by a bit over 10%. After reverting some of the optimizations there is still a performance gain of about 5% left.

        Show
        Jack Van Ooststroom added a comment - Reverted the HeadBodyListener and BridgeSetup optimizations as it broke our portlet support. Partly reverted one of the optimizations. It now checks for the String com.sun.faces.facelets.tag.ui.UIDebug again instead of the class. Originally the optimizations seemed to have improve performance of the lifecycle by a bit over 10%. After reverting some of the optimizations there is still a performance gain of about 5% left.
        Hide
        Jack Van Ooststroom added a comment -

        No additional work has been done for this one lately. Some of the original improvements are still in causing the 5% performance increase. Marking this one as FIXED now.

        Show
        Jack Van Ooststroom added a comment - No additional work has been done for this one lately. Some of the original improvements are still in causing the 5% performance increase. Marking this one as FIXED now.

          People

          • Assignee:
            Jack Van Ooststroom
            Reporter:
            Deryk Sinotte
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: