Uploaded image for project: 'CDI Specification Issues'
  1. CDI Specification Issues
  2. CDI-187

Clarify serializability requirements for interceptors/decorators

    XMLWordPrintable

    Details

    • Affects:
      Release Notes

      Description

      The spec says:

      A managed bean is passivation capable if and only if the bean class is serializable and all interceptors and decorators of
      the bean are serializable.

      The "interceptors and decorators of the bean are serializable" part is problematic. While it is fine to examine the defining class in case of standard interceptors/decorators, the question is: How to find out whether an extension-provided interceptor/decorator in serializable? It does not make sense to check the implementation of the Interceptor/Decorator interfaces nor to examine the class returned by Bean.getBeanClass() as that would break the abstraction.

      IMHO, the spec should say that:

      A managed bean is passivation capable if and only if the bean class is serializable and all interceptors and decorators of
      the bean are passivation capable.

      Where a standard interceptor/decorator would be passivation capable if and only if it implemented the Serializable interface whereas the following section of the spec would handle extension-provided interceptors/decorators.

      A custom implementation of Bean is passivation capable if it implements the interface PassivationCapable. An imple-
      mentation of Contextual that is not a bean is passivation capable if it implements both PassivationCapable and Serial-
      izable.

        Attachments

          Activity

            People

            Assignee:
            pmuiratbleepbleep Pete Muir
            Reporter:
            rhn-engineering-jharting Jozef Hartinger
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: