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

PassivationCapable producer method/field definition is ambiguous

    Details

    • Type: Clarification
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 1.0
    • Fix Version/s: 1.1.EDR
    • Component/s: Resolution
    • Labels:
      None

      Description

      Currently the spec paragraph 6.6.1 and 6.6.4 contradict themselfs a bit

      6.6.1 (which is an overview) defines:

      • A producer method is passivation capable if and only if it never returns a value which is not passivation capable at runtime. A producer method with a primitive return type or a return type that implements or extends Serializable is passivation capable. A producer method with a return type that is declared final and does not implement Serializable is not passivation capable.
      • A producer field is passivation capable if and only if it never refers to a value which is not passivation capable at runtime. A producer field with a primitive type or a type that implements or extends Serializable is passivation cap- able. A producer field with a type that is declared final and does not implement Serializable is not passivation cap- able.

      and 6.6.4:
      If a producer field declares a passivating scope and:
      • the container is able to determine that it is not passivation capable by inspecting its type,
      then the container automatically detects the problem and treats it as a deployment problem.
      In some cases, the container is not able to determine whether a producer method or field is passivation capable. If a produ- cer method or field which declares a passivating scope returns an unserializable object at runtime, the container must throw an IllegalProductException. If a producer method or field of scope @Dependent returns an unserializable object for injection into an injection point that requires a passivation capable dependency, the container must throw an Illegal- ProductException

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            struberg Mark Struberg added a comment -

            We should move the 'more detailed' criteria specification from 6.6.1 down to 6.6.4.

            6.6.1 would look like the following:

            • A producer method is passivation capable if and only if it never returns a value which is not passivation capable at runtime.
            • A producer field is passivation capable if and only if it never refers to a value which is not passivation capable at runtime.

            and 6.6.4 would get the more specific description of what to check.

            Show
            struberg Mark Struberg added a comment - We should move the 'more detailed' criteria specification from 6.6.1 down to 6.6.4. 6.6.1 would look like the following: • A producer method is passivation capable if and only if it never returns a value which is not passivation capable at runtime. • A producer field is passivation capable if and only if it never refers to a value which is not passivation capable at runtime. and 6.6.4 would get the more specific description of what to check.
            Show
            struberg Mark Struberg added a comment - https://github.com/jboss/cdi/pull/48
            Hide
            struberg Mark Struberg added a comment -

            Just a note why I was able to cut down so many conditions:

            I originally have had:
            If a producer method declares a passivating scope and:

            • doesn't have a primitive return type, and
            • doesn't have a return type that implements or extends Serializable, and
            • doesn't only return Serializable types at runtime
              then the container the container must throw an IllegalProductException

            But the first two conditions are imo already covered by the 3rd one and cannot get tested at startup anyway.

            Show
            struberg Mark Struberg added a comment - Just a note why I was able to cut down so many conditions: I originally have had: If a producer method declares a passivating scope and: doesn't have a primitive return type, and doesn't have a return type that implements or extends Serializable, and doesn't only return Serializable types at runtime then the container the container must throw an IllegalProductException But the first two conditions are imo already covered by the 3rd one and cannot get tested at startup anyway.

              People

              • Assignee:
                struberg Mark Struberg
                Reporter:
                struberg Mark Struberg
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Development