|
From: <jue...@we...> - 2004-02-12 15:30:52
|
You mean the current version from Commons Attributes CVS? We plan to =
update to the current Commons Attributes snapshot for RC2; an official =
CA release would be preferable, but I guess we won't get that in time.
=20
BTW, I tried to update to a current Commons Attributes snapshot already =
for RC1, but our test suite failed then. Might be some minor semantic =
change in the CA API or compiler; I haven't had the time to figure this =
out.
=20
Juergen
=20
-----Original Message-----
From: spr...@li... =
[mailto:spr...@li...]On Behalf =
Of Cameron Braid
Sent: Thursday, February 12, 2004 3:27 PM
To: spr...@li...
Subject: RE: [Springframework-developer] Attributes - any alternative =
for commons-attributes ?
Well.. I managed to get jakarta-commons-attributes to work by using the =
CVS version.
=20
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
=20
On a side note, I wish to use a =
org.springframework.transaction.interceptor.NameMatchTransactionAttribute=
Source as the default attribute source, allowing me to specify something =
like :
=20
<bean id=3D"matchMethodNamePattern" =
class=3D"org.springframework.transaction.interceptor.NameMatchTransaction=
AttributeSource">
<property name=3D"properties">
<props>
<!-- read only methods -->
<prop key=3D"list*">PROPAGATION_REQUIRED,readOnly</prop>
<prop key=3D"find*">PROPAGATION_REQUIRED,readOnly</prop>
<prop key=3D"get*">PROPAGATION_REQUIRED,readOnly</prop>
<prop key=3D"load*">PROPAGATION_REQUIRED,readOnly</prop>
<prop key=3D"read*">PROPAGATION_REQUIRED,readOnly</prop>
<!-- the default is transactional (least specific, match =
everything) -->
<prop key=3D"*">PROPAGATION_REQUIRED</prop>
</props>
</property>
</bean>
Then, I wish to use a commons attributes attribute source to override =
these defaults.
=20
How would I achieve this.
=20
I saw the jpetstore attribuites sample, using :
=20
<bean id=3D"transactionAttributeSource"
=
class=3D"org.springframework.transaction.interceptor.AttributesTransactio=
nAttributeSource"
autowire=3D"constructor">
</bean>
<bean id=3D"attributes" =
class=3D"org.springframework.metadata.commons.CommonsAttributes"/>
=20
but I can't work out how to 'nest' attribute sources as seems to be =
possible as described at=20
=20
http://www.springframework.org/docs/api/org/springframework/metadata/Attr=
ibutes.html
"...as it allows for hierarchical attribute sources..."
=20
Thanks,
=20
Cameron.
=20
_____ =20
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.
=20
I can't seem to get the commons-attributes compiler to work .. it =
doesn't like my source code, see stack trace below.
=20
Before I dive into the source code for commons-attributes, I would like =
to ask if there are plans to support another metadata system.
=20
If there aren't plans, can you recommend another metadata system that I =
could investigate implementing myself.
=20
I have had a look at=20
* 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.
=20
stacktrace :
compile.attributes:
[attribute-compiler] java.lang.StringIndexOutOfBoundsException: String =
index out of range: 0
[attribute-compiler] at =
org.apache.commons.attributes.compiler.AttributeCompiler.start(AttributeC=
ompiler.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(Attr=
ibuteCompiler.java:439)
[attribute-compiler] at =
org.apache.commons.attributes.compiler.AttributeCompiler.tagHasAttributes=
(AttributeCompiler.java:464)
[attribute-compiler] at =
org.apache.commons.attributes.compiler.AttributeCompiler.elementHasAttrib=
utes(AttributeCompiler.java:206)
=20
[attribute-compiler] at =
org.apache.commons.attributes.compiler.AttributeCompiler.hasAttributes(At=
tributeCompiler.java:420)
[attribute-compiler] at =
org.apache.commons.attributes.compiler.AttributeCompiler.generateClass(At=
tributeCompiler.java:257)
[attribute-compiler] at =
org.apache.commons.attributes.compiler.AttributeCompiler.start(AttributeC=
ompiler.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(Attr=
ibuteCompiler.java:439)
[attribute-compiler] at =
org.apache.commons.attributes.compiler.AttributeCompiler.tagHasAttributes=
(AttributeCompiler.java:464)
[attribute-compiler] at =
org.apache.commons.attributes.compiler.AttributeCompiler.elementHasAttrib=
utes(AttributeCompiler.java:206)
=20
[attribute-compiler] at =
org.apache.commons.attributes.compiler.AttributeCompiler.hasAttributes(At=
tributeCompiler.java:420)
[attribute-compiler] at =
org.apache.commons.attributes.compiler.AttributeCompiler.generateClass(At=
tributeCompiler.java:257)
[attribute-compiler] at =
org.apache.commons.attributes.compiler.AttributeCompiler.start(AttributeC=
ompiler.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:
=20
|