2 Replies Latest reply on May 12, 2008 2:49 PM by Andrew Rubinger

    EJBContainer Validation on Deployment/Start

    Andrew Rubinger Master

      The current Proxy/ProxyFactory implementation tightly couples the Proxy generation code with a series of static utilities also used in validation of a deployment ie:

      * Same interface cannot be both business local and business remote (EJBTHREE-1025)
      * RemoteHome must have "create" methods of return type assignable to javax.ejb.EJBObject

      ...etc.

      I won't be including logic of this type within the "proxy" component, so I'll instead propose:

      * Create a new component "validation"
      * This component will contain a series of aspects, each tailored to one validation use case referencing back either to spec or JIRA
      * Interception to occur at (Session|MDB|Service)Container.start()

      Over time we may additionally move other validation checks out of Container code (EJB3 Core) and into the new component, but for now all I need is a good place to put the stuff coupled with Proxy generation.

      S,
      ALR

        • 1. Re: EJBContainer Validation on Deployment/Start
          Carlo de Wolf Master

          You still need to validate your preconditions in the proxy component. So might as well throw exceptions there.

          The place where we do these checks is mostly governed by the 'why is it now allowed'.

          I say a good place to put stuff coupled with proxy generation is the proxy component.

          • 2. Re: EJBContainer Validation on Deployment/Start
            Andrew Rubinger Master

            These are only preconditions if they prevent Proxy generation or lead to non-deterministic results upon lookup/invocation. For example, if @Remote specifies a class that is not an interface, Proxy component should throw the error.

            Adding a validation component to aspectize deployment rules based on available metadata can cover all cases and provide a pluggable mechanism looking forward. Less code in the Containers (EJB3 Core), less code in the Proxy stuff (where some of it doesn't belong).

            S,
            ALR