From: Cameron B. <ca...@da...> - 2004-02-12 14:28:33
|
Well.. I managed to get jakarta-commons-attributes to work by using the CVS version. Would it be possible to upgrade spring to use this by default ? The version number of the jar that the cvs version builds is commons-attributes-compiler-2.0alpha.jar On a side note, I wish to use a org.springframework.transaction.interceptor.NameMatchTransactionAttributeSou rce as the default attribute source, allowing me to specify something like : <bean id="matchMethodNamePattern" class="org.springframework.transaction.interceptor.NameMatchTransactionAttri buteSource"> <property name="properties"> <props> <!-- read only methods --> <prop key="list*">PROPAGATION_REQUIRED,readOnly</prop> <prop key="find*">PROPAGATION_REQUIRED,readOnly</prop> <prop key="get*">PROPAGATION_REQUIRED,readOnly</prop> <prop key="load*">PROPAGATION_REQUIRED,readOnly</prop> <prop key="read*">PROPAGATION_REQUIRED,readOnly</prop> <!-- the default is transactional (least specific, match everything) --> <prop key="*">PROPAGATION_REQUIRED</prop> </props> </property> </bean> Then, I wish to use a commons attributes attribute source to override these defaults. How would I achieve this. I saw the jpetstore attribuites sample, using : <bean id="transactionAttributeSource" class="org.springframework.transaction.interceptor.AttributesTransactionAttr ibuteSource" autowire="constructor"> </bean> <bean id="attributes" class="org.springframework.metadata.commons.CommonsAttributes"/> but I can't work out how to 'nest' attribute sources as seems to be possible as described at http://www.springframework.org/docs/api/org/springframework/metadata/Attribu tes.html "...as it allows for hierarchical attribute sources..." Thanks, Cameron. _____ From: spr...@li... [mailto:spr...@li...] On Behalf Of Cameron Braid Sent: Thursday, 12 February 2004 10:52 PM To: spr...@li... Subject: [Springframework-developer] Attributes - any alternative for commons-attributes ? I am trying to use commons-attributes to create transactional attributes for some beans. I can't seem to get the commons-attributes compiler to work .. it doesn't like my source code, see stack trace below. Before I dive into the source code for commons-attributes, I would like to ask if there are plans to support another metadata system. If there aren't plans, can you recommend another metadata system that I could investigate implementing myself. I have had a look at * attrib4j - it modifies the classes, which makes using eclipse a pain. * nanning attributes may work, though they don't offer instance based attributes ( only strings as far as I can see) * I am currently trying qdox attributes, but the jar they provide doesn't have the right classes.. I am trying a source build. stacktrace : compile.attributes: [attribute-compiler] java.lang.StringIndexOutOfBoundsException: String index out of range: 0 [attribute-compiler] at org.apache.commons.attributes.compiler.AttributeCompiler.start(AttributeComp iler.java:455) [attribute-compiler] at xjavadoc.ant.XJavadocTask.execute(XJavadocTask.java:96) [attribute-compiler] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:166) [attribute-compiler] at org.apache.tools.ant.Task.perform(Task.java:319) [attribute-compiler] at org.apache.tools.ant.Target.execute(Target.java:309) [attribute-compiler] at org.apache.tools.ant.Target.performTasks(Target.java:336) [attribute-compiler] at org.apache.tools.ant.Project.executeTarget(Project.java:1306) [attribute-compiler] at org.apache.tools.ant.Project.executeTargets(Project.java:1250) [attribute-compiler] at org.apache.tools.ant.Main.runBuild(Main.java:610) [attribute-compiler] at org.apache.tools.ant.Main.start(Main.java:196) [attribute-compiler] at org.apache.tools.ant.Main.main(Main.java:235) [attribute-compiler] Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: 0 [attribute-compiler] at java.lang.String.charAt(String.java:444) [attribute-compiler] at org.apache.commons.attributes.compiler.AttributeCompiler.isAttribute(Attribu teCompiler.java:439) [attribute-compiler] at org.apache.commons.attributes.compiler.AttributeCompiler.tagHasAttributes(At tributeCompiler.java:464) [attribute-compiler] at org.apache.commons.attributes.compiler.AttributeCompiler.elementHasAttribute s(AttributeCompiler.java:206) [attribute-compiler] at org.apache.commons.attributes.compiler.AttributeCompiler.hasAttributes(Attri buteCompiler.java:420) [attribute-compiler] at org.apache.commons.attributes.compiler.AttributeCompiler.generateClass(Attri buteCompiler.java:257) [attribute-compiler] at org.apache.commons.attributes.compiler.AttributeCompiler.start(AttributeComp iler.java:452) [attribute-compiler] ... 10 more [attribute-compiler] --- Nested Exception --- [attribute-compiler] java.lang.StringIndexOutOfBoundsException: String index out of range: 0 [attribute-compiler] at java.lang.String.charAt(String.java:444) [attribute-compiler] at org.apache.commons.attributes.compiler.AttributeCompiler.isAttribute(Attribu teCompiler.java:439) [attribute-compiler] at org.apache.commons.attributes.compiler.AttributeCompiler.tagHasAttributes(At tributeCompiler.java:464) [attribute-compiler] at org.apache.commons.attributes.compiler.AttributeCompiler.elementHasAttribute s(AttributeCompiler.java:206) [attribute-compiler] at org.apache.commons.attributes.compiler.AttributeCompiler.hasAttributes(Attri buteCompiler.java:420) [attribute-compiler] at org.apache.commons.attributes.compiler.AttributeCompiler.generateClass(Attri buteCompiler.java:257) [attribute-compiler] at org.apache.commons.attributes.compiler.AttributeCompiler.start(AttributeComp iler.java:452) [attribute-compiler] at xjavadoc.ant.XJavadocTask.execute(XJavadocTask.java:96) [attribute-compiler] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:166) [attribute-compiler] at org.apache.tools.ant.Task.perform(Task.java:319) [attribute-compiler] at org.apache.tools.ant.Target.execute(Target.java:309) [attribute-compiler] at org.apache.tools.ant.Target.performTasks(Target.java:336) [attribute-compiler] at org.apache.tools.ant.Project.executeTarget(Project.java:1306) [attribute-compiler] at org.apache.tools.ant.Project.executeTargets(Project.java:1250) [attribute-compiler] at org.apache.tools.ant.Main.runBuild(Main.java:610) [attribute-compiler] at org.apache.tools.ant.Main.start(Main.java:196) [attribute-compiler] at org.apache.tools.ant.Main.main(Main.java:235) [attribute-compiler] WARNING: Some classes refer to other classes that were not found among the sources or on the classpath. [attribute-compiler] (Perhaps the referred class doesn't exist? Hasn't been generated yet?) [attribute-compiler] The referring classes do not import any fully qualified classes matching these classes. [attribute-compiler] Since at least one package is imported, it is impossible for xjavadoc to figure out [attribute-compiler] what package the referred classes belong to. The classes are: |