1 Reply Latest reply on Feb 28, 2006 1:41 PM by Bill Burke

    Hierarchical Domains/DomainDefinitions

    Kabir Khan Master

      There already is some support for hierarchical domains used by ejb3, and the "extends" mechanism

       <domain name="Base Stateful Bean">
       ...
       </domain>
      
       <domain name="Stateful Bean" extends="Base Stateful Bean" inheritBindings="true">
       ...
       </domain>
      


      However, this only allows for one level of domains to be referencable by name. e.g. there is no way to say I want to create a new domain extending from "Stateful Beaan". So, I think we need a global naming lookup mechanism, maybe something similar to what jboss cache uses. AOP 2.0 uses domains extensively internally for its

      AspectManager
       Domain (org.acme.Foo) - Domain used for class advisor
       Domain (Foo - instance 1) - Domain used for instance advisor
       Domain (Foo - instance 2)
       Domain (org.acme.Bar)
       Domain (Bar - instance 1)
       Domain (Bar - instance 2)
      

      for the ejb 3 stuff I would like to be able to say

       <domain name="Base Stateful Bean">
       ...
       </domain>
      
       <domain name="Stateful Bean" extends="Base Stateful Bean" inheritBindings="true">
       ...
       </domain>
      
       <domain name="Another Stateful Bean" extends="Base Stateful Bean/Stateful Bean" inheritBindings="true">
       ...
       </domain>
      
      


      The main reason for bringing this up is something Adrian mentioned for the mc where we might have the following situation:
      AspectManager
       Domain (JCA) - a set of bindings for all beans used within JCA
       Domain (org.acme.Foo)
       Domain (Bean Foo-A)
       Domain (Bean Foo-B)
       Domain (org.acme.Bar)
       Domain (Bean Bar-A)
       Domain (Bean Bar-B)
      


      Similarly, the generated proxies use a domain for the proxy class advisors, and if instance advised one for each advised instance. This should will be useful when serializing/deserializing the proxies. It should be enough to serialize the name of the domain when the proxy is serialized, and when unserializing we can attach to the correct domain by its name to make sure that the correct bindings are applied. We will need to support something more advanced than simple strings for names though.