3 Replies Latest reply on Nov 24, 2009 8:07 AM by swd847

    XML Exensions

    swd847

      I have created a portable extension to allow configuration of beans via XML. The first pre-alpha release can be downloaded from https://launchpad.net/jbraze. This is still very early days, but any feedback would be appreciated.


      The readme contains instructions, and the tests contain example XML code. The file syntax looks like:


         <test:OtherQualifier>
              <Qualifier/>
          </test:OtherQualifier>
           
          <test:QualifiedBean1>
              <test:OtherQualifier value1="AA" value2="1">A</test:OtherQualifier>
          </test:QualifiedBean1>
          
          <test:QualifiedBean2>
              <test:OtherQualifier value1="BB" value2="2" value="B" />
          </test:QualifiedBean2>
          
          <test:QualifierTestBean>
              <test:bean1>
                  <test:OtherQualifier value1="AA" value2="1" value="A" />
                  <Inject/>
              </test:bean1>
              <test:bean2>
                  <test:OtherQualifier value1="BB" value2="2">B</test:OtherQualifier>
                  <Inject/>
              </test:bean2>
          </test:QualifierTestBean>
      
          <test:InterceptorBinding1>
              <InterceptorBinding/>
           </test:InterceptorBinding1>
         
          <test:InterceptorBean1>
              <Interceptor/>
              <test:InterceptorBinding1/>
              <test:myMethod>
                  <!-- AroundInvoke does not actually work due to what appears to be a weld bug, the annotation must be physically present -->
                  <AroundInvoke/>
              </test:myMethod>
          </test:InterceptorBean1>
      
          <test:InterceptedBean>
              <test:method>
                  <test:InterceptorBinding1/>
              </test:method>
          </test:InterceptedBean>
      
      



        • 1. Re: XML Exensions
          asookazian

          This was one of the questions I had.  Using XML to override the annotational configs.  So is this a custom XML file?  What is the name of the file and in what location is it packaged in the WAR/EAR?

          • 2. Re: XML Exensions
            nickarls

            Well, the concept of beans.xml is quite well-known so it will probably go there.

            • 3. Re: XML Exensions
              swd847

              beans.xml is already defined by the spec. At the moment it is braze-beans.xml, but I am not overly fussed where it goes. XML files are supplied by classes implementing XmlDocumentResolver so the file could really go anywhere.