You can subscribe to this list here.
| 2003 |
Jan
|
Feb
(55) |
Mar
(100) |
Apr
(203) |
May
(330) |
Jun
(190) |
Jul
(302) |
Aug
(323) |
Sep
(197) |
Oct
(245) |
Nov
(490) |
Dec
(330) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(194) |
Feb
(400) |
Mar
(416) |
Apr
(415) |
May
(359) |
Jun
(381) |
Jul
(491) |
Aug
(311) |
Sep
(291) |
Oct
(273) |
Nov
(355) |
Dec
(266) |
| 2005 |
Jan
(306) |
Feb
(303) |
Mar
(520) |
Apr
(346) |
May
(255) |
Jun
(221) |
Jul
(171) |
Aug
(247) |
Sep
(147) |
Oct
(125) |
Nov
(165) |
Dec
(65) |
| 2006 |
Jan
(90) |
Feb
(53) |
Mar
(121) |
Apr
(103) |
May
(113) |
Jun
(103) |
Jul
(104) |
Aug
(67) |
Sep
(78) |
Oct
(82) |
Nov
(78) |
Dec
(70) |
| 2007 |
Jan
(77) |
Feb
(76) |
Mar
(63) |
Apr
(30) |
May
(47) |
Jun
(41) |
Jul
(44) |
Aug
(44) |
Sep
(49) |
Oct
(33) |
Nov
(25) |
Dec
(21) |
| 2008 |
Jan
(45) |
Feb
(13) |
Mar
(15) |
Apr
(12) |
May
(9) |
Jun
(33) |
Jul
(30) |
Aug
(7) |
Sep
(20) |
Oct
(17) |
Nov
(20) |
Dec
(10) |
| 2009 |
Jan
(8) |
Feb
(5) |
Mar
(12) |
Apr
(17) |
May
(19) |
Jun
(97) |
Jul
(77) |
Aug
(33) |
Sep
(24) |
Oct
(41) |
Nov
(16) |
Dec
(32) |
| 2010 |
Jan
(24) |
Feb
(14) |
Mar
(50) |
Apr
(71) |
May
(70) |
Jun
(64) |
Jul
(45) |
Aug
(62) |
Sep
(32) |
Oct
(4) |
Nov
(12) |
Dec
(2) |
| 2011 |
Jan
(1) |
Feb
(3) |
Mar
(4) |
Apr
(3) |
May
(6) |
Jun
(1) |
Jul
(4) |
Aug
(3) |
Sep
(4) |
Oct
(6) |
Nov
(3) |
Dec
(3) |
| 2012 |
Jan
(4) |
Feb
(8) |
Mar
(6) |
Apr
(10) |
May
(2) |
Jun
(3) |
Jul
(11) |
Aug
(10) |
Sep
(4) |
Oct
|
Nov
(1) |
Dec
(1) |
| 2013 |
Jan
(4) |
Feb
(1) |
Mar
(9) |
Apr
(1) |
May
(8) |
Jun
(2) |
Jul
(5) |
Aug
(2) |
Sep
|
Oct
(3) |
Nov
(10) |
Dec
(8) |
| 2014 |
Jan
(3) |
Feb
(12) |
Mar
(9) |
Apr
(12) |
May
(2) |
Jun
|
Jul
(3) |
Aug
(1) |
Sep
(1) |
Oct
(4) |
Nov
|
Dec
(2) |
| 2015 |
Jan
(1) |
Feb
(3) |
Mar
(4) |
Apr
(9) |
May
(2) |
Jun
(2) |
Jul
|
Aug
(2) |
Sep
(7) |
Oct
(9) |
Nov
(7) |
Dec
(9) |
| 2016 |
Jan
(7) |
Feb
(5) |
Mar
(5) |
Apr
(5) |
May
(8) |
Jun
(4) |
Jul
(5) |
Aug
(4) |
Sep
(6) |
Oct
(7) |
Nov
(2) |
Dec
(3) |
| 2017 |
Jan
(7) |
Feb
(8) |
Mar
(7) |
Apr
(3) |
May
(4) |
Jun
(3) |
Jul
(5) |
Aug
(8) |
Sep
(4) |
Oct
(2) |
Nov
(3) |
Dec
|
| 2018 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2019 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
| 2021 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2022 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
| 2024 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2025 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
(2) |
Aug
(5) |
Sep
(2) |
Oct
|
Nov
|
Dec
(1) |
| 2026 |
Jan
(1) |
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Colin S. <col...@ex...> - 2005-10-23 12:22:55
|
My understanding is that Generics-based types map to completely standard
(non-Generics) byte code for those types. So if you have a List<String>
and you pass that to somebody, at the bytecode level it's a completely
normal List. This is part of the reason why Generics in Java are
somewhat half-assed; some of the limitations could have been removed if
the basic class related bytcode had had enhancements to support some
concepts needed for templating.
Here's some info on this aspect:
http://www.langer.camelot.de/GenericsFAQ/FAQSections/TechnicalDetails.html#How%20does%20the%20compiler%20translate%20Java%20generics?
On the other hand, when it comes to method signatures, my understanding
is that the bounding information is available through reflection. So you
can tell that a method takes a List<String> and not a List. I'm not 100%
sure on this (and confirmation by anybody would be good), but I presume
this is what Rob is basing his statement below on.
Regards,
Colin
Peter Backlund wrote:
>On Sat, 2005-10-22 at 16:52 +0100, Rob Harrop wrote:
>
>
>>That's not a bad idea - can you raise an JIRA issue for this? Also, in
>>Spring 1.3 we will actually autodetect the element types when using
>>generics definitions like you have here so you won't need to specify the
>>element types.
>>
>>
>
>Sure, but would that really be necessary if you can autodetect it in
>1.3? Besides, is it possible to detect generics definitions in bytecode?
>I was under the impression that it wasn't possible, or will it require
>processing of the corresponding source code?
>
>/Peter
>
>
>
>>Rob
>>
>>Peter Backlund wrote:
>>
>>
>>
>>>Hello.
>>>
>>>Would it make sense to add key-class and value-class attributes to the
>>><map> element, and feed the strings in the key/value elements (or
>>>attributes) to the appropriate PropertyEditor, to allow setting key and
>>>value of the correct class when using maps with generics?
>>>
>>>For example, consider this example:
>>>
>>>public Map<Locale, String> getHeadsOfState() { ... }
>>>
>>>configured like this:
>>>
>>><property name="headsOfState">
>>> <map key-class="java.util.Locale" value-class="java.lang.String">
>>> <entry key="en_US" value="George W. Bush"/>
>>> <entry key="en_GB" value="Tony Blair"/>
>>> <entry key="sv_SE" value="Göran Persson"/>
>>> </map>
>>></property>
>>>
>>>I've glanced at modifying the xml parsing and subclassing or modifying
>>>MapFactoryBean, but I thought I'd ask here first if it's possible to do
>>>this any other way, or if it's a bad idea altogether.
>>>
>>>What do you think?
>>>
>>>/Peter Backlund
>>>
>>>
>>>
>>>
>>>
>>>-------------------------------------------------------
>>>This SF.Net email is sponsored by:
>>>Power Architecture Resource Center: Free content, downloads, discussions,
>>>and more. http://solutions.newsforge.com/ibmarch.tmpl
>>>_______________________________________________
>>>Springframework-developer mailing list
>>>Spr...@li...
>>>https://lists.sourceforge.net/lists/listinfo/springframework-developer
>>>
>>>
>>>
>>>
>
>
>
>
>-------------------------------------------------------
>This SF.Net email is sponsored by the JBoss Inc.
>Get Certified Today * Register for a JBoss Training Course
>Free Certification Exam for All Training Attendees Through End of 2005
>Visit http://www.jboss.com/services/certification for more information
>_______________________________________________
>Springframework-developer mailing list
>Spr...@li...
>https://lists.sourceforge.net/lists/listinfo/springframework-developer
>
>
>
|
|
From: <al...@in...> - 2005-10-22 22:36:01
|
View results here -> http://opensource.jteam.nl/build/buildresults/spring?log=log20051023001721Lbuild.363 |
|
From: Peter B. <pet...@ho...> - 2005-10-22 18:52:44
|
On Sat, 2005-10-22 at 16:52 +0100, Rob Harrop wrote:
> That's not a bad idea - can you raise an JIRA issue for this? Also, in
> Spring 1.3 we will actually autodetect the element types when using
> generics definitions like you have here so you won't need to specify the
> element types.
Sure, but would that really be necessary if you can autodetect it in
1.3? Besides, is it possible to detect generics definitions in bytecode?
I was under the impression that it wasn't possible, or will it require
processing of the corresponding source code?
/Peter
>
> Rob
>
> Peter Backlund wrote:
>
> >Hello.
> >
> >Would it make sense to add key-class and value-class attributes to the
> ><map> element, and feed the strings in the key/value elements (or
> >attributes) to the appropriate PropertyEditor, to allow setting key and
> >value of the correct class when using maps with generics?
> >
> >For example, consider this example:
> >
> >public Map<Locale, String> getHeadsOfState() { ... }
> >
> >configured like this:
> >
> ><property name="headsOfState">
> > <map key-class="java.util.Locale" value-class="java.lang.String">
> > <entry key="en_US" value="George W. Bush"/>
> > <entry key="en_GB" value="Tony Blair"/>
> > <entry key="sv_SE" value="Göran Persson"/>
> > </map>
> ></property>
> >
> >I've glanced at modifying the xml parsing and subclassing or modifying
> >MapFactoryBean, but I thought I'd ask here first if it's possible to do
> >this any other way, or if it's a bad idea altogether.
> >
> >What do you think?
> >
> >/Peter Backlund
> >
> >
> >
> >
> >
> >-------------------------------------------------------
> >This SF.Net email is sponsored by:
> >Power Architecture Resource Center: Free content, downloads, discussions,
> >and more. http://solutions.newsforge.com/ibmarch.tmpl
> >_______________________________________________
> >Springframework-developer mailing list
> >Spr...@li...
> >https://lists.sourceforge.net/lists/listinfo/springframework-developer
> >
> >
>
|
|
From: Rob H. <rob...@in...> - 2005-10-22 15:53:06
|
That's not a bad idea - can you raise an JIRA issue for this? Also, in
Spring 1.3 we will actually autodetect the element types when using
generics definitions like you have here so you won't need to specify the
element types.
Rob
Peter Backlund wrote:
>Hello.
>
>Would it make sense to add key-class and value-class attributes to the
><map> element, and feed the strings in the key/value elements (or
>attributes) to the appropriate PropertyEditor, to allow setting key and
>value of the correct class when using maps with generics?
>
>For example, consider this example:
>
>public Map<Locale, String> getHeadsOfState() { ... }
>
>configured like this:
>
><property name="headsOfState">
> <map key-class="java.util.Locale" value-class="java.lang.String">
> <entry key="en_US" value="George W. Bush"/>
> <entry key="en_GB" value="Tony Blair"/>
> <entry key="sv_SE" value="Göran Persson"/>
> </map>
></property>
>
>I've glanced at modifying the xml parsing and subclassing or modifying
>MapFactoryBean, but I thought I'd ask here first if it's possible to do
>this any other way, or if it's a bad idea altogether.
>
>What do you think?
>
>/Peter Backlund
>
>
>
>
>
>-------------------------------------------------------
>This SF.Net email is sponsored by:
>Power Architecture Resource Center: Free content, downloads, discussions,
>and more. http://solutions.newsforge.com/ibmarch.tmpl
>_______________________________________________
>Springframework-developer mailing list
>Spr...@li...
>https://lists.sourceforge.net/lists/listinfo/springframework-developer
>
>
--
Rob Harrop
Principal Consultant
Interface21 - Spring Services from the Source
http://www.springframework.com
|
|
From: Darren D. <da...@sh...> - 2005-10-22 14:23:28
|
1129991006
FAILED
[junit] Tests run: 17, Failures: 1, Errors: 0, Time elapsed: 49.829 sec
[junit] Testsuite: org.springframework.aop.framework.CglibProxyTests
[junit] Tests run: 17, Failures: 1, Errors: 0, Time elapsed: 49.829 sec
[junit] ------------- Standard Output ---------------
[junit] StopWatch '': running time (millis) = 29431
[junit] [class org.springframework.aop.framework.CglibProxyTests.testManyProxies: create 10000 proxies] took 29431=100%
[junit] ------------- ---------------- ---------------
[junit] Testcase: testNullConfig took 0.326 sec
[junit] Testcase: testNoTarget took 0.222 sec
[junit] Testcase: testProtectedMethodInvocation took 3.439 sec
[junit] Testcase: testProxyCanBeClassNotInterface took 2.208 sec
[junit] Testcase: testCglibProxyingGivesMeaningfulExceptionIfAskedToProxyNonvisibleClass took 0.053 sec
[junit] Testcase: testMethodInvocationDuringConstructor took 0.74 sec
[junit] Testcase: testUnadvisedProxyCreationWithCallDuringConstructor took 0.576 sec
[junit] Testcase: testMultipleProxies took 1.614 sec
[junit] Testcase: testWithNoArgConstructor took 0.401 sec
[junit] Testcase: testProxyAProxy took 1.394 sec
[junit] Testcase: testExceptionHandling took 0.503 sec
[junit] Testcase: testWithDependencyChecking took 6.603 sec
[junit] Testcase: testAddAdviceAtRuntime took 0.926 sec
[junit] Testcase: testProxyClassWithFinalMethods took 0.762 sec
[junit] Testcase: testNoInterceptorsAndNoTarget took 0 sec
[junit] Testcase: testValuesStick took 0.025 sec
[junit] Testcase: testManyProxies took 29.458 sec
[junit] FAILED
[junit] Proxy creation was too slow
[junit] junit.framework.AssertionFailedError: Proxy creation was too slow
[junit] at org.springframework.aop.framework.AbstractAopProxyTests.testManyProxies(AbstractAopProxyTests.java:151)
This is an automated mail from one of the SF Compile Farm machines.
The machine name noted in the subject encountered a failure building
or running the Spring test suite. The last few lines of the output
were included for info.
NB: No further mail will be sent from this machine until a
manual reset occurs on the cf-shell machine, although builds will
continue as scheduled.
See http://springframework.sourceforge.net/test/ for further
information.
|
|
From: <al...@in...> - 2005-10-21 22:34:03
|
View results here -> http://opensource.jteam.nl/build/buildresults/spring?log=log20051022001546Lbuild.362 |
|
From: Darren D. <da...@sh...> - 2005-10-21 20:38:28
|
1129927091
FAILED
[junit] ------------- ---------------- ---------------
[junit] Testcase: testDeclaredException took 0.722 sec
[junit] Testcase: testTargetCanGetInvocationEvenIfNoAdviceChain took 0 sec
[junit] Testcase: testExistingProxyChangesTarget took 0.048 sec
[junit] Testcase: testDynamicMethodPointcutThatAppliesStaticallyOnlyToSetters took 0.34 sec
[junit] Testcase: testStaticMethodPointcut took 0.684 sec
[junit] Testcase: testProxyIsBoundBeforeTargetSourceInvoked took 0.424 sec
[junit] Testcase: testNullConfig took 0 sec
[junit] Testcase: testNoTarget took 0.001 sec
[junit] Testcase: testProtectedMethodInvocation took 0.001 sec
[junit] Testcase: testProxyCanBeClassNotInterface took 0.013 sec
[junit] Testcase: testCglibProxyingGivesMeaningfulExceptionIfAskedToProxyNonvisibleClass took 0.013 sec
[junit] Testcase: testMethodInvocationDuringConstructor took 0.103 sec
[junit] Testcase: testUnadvisedProxyCreationWithCallDuringConstructor took 0.013 sec
[junit] Testcase: testMultipleProxies took 0.521 sec
[junit] Testcase: testWithNoArgConstructor took 0.014 sec
[junit] Testcase: testProxyAProxy took 0.019 sec
[junit] Testcase: testExceptionHandling took 0.269 sec
[junit] Testcase: testWithDependencyChecking took 0.356 sec
[junit] Testcase: testAddAdviceAtRuntime took 0.122 sec
[junit] Testcase: testProxyClassWithFinalMethods took 0.002 sec
[junit] Testcase: testNoInterceptorsAndNoTarget took 0 sec
[junit] Testcase: testValuesStick took 0 sec
[junit] Testcase: testManyProxies took 40.154 sec
[junit] FAILED
[junit] Proxy creation was too slow
[junit] junit.framework.AssertionFailedError: Proxy creation was too slow
[junit] at org.springframework.aop.framework.AbstractAopProxyTests.testManyProxies(AbstractAopProxyTests.java:151)
This is an automated mail from one of the SF Compile Farm machines.
The machine name noted in the subject encountered a failure building
or running the Spring test suite. The last few lines of the output
were included for info.
NB: No further mail will be sent from this machine until a
manual reset occurs on the cf-shell machine, although builds will
continue as scheduled.
See http://springframework.sourceforge.net/test/ for further
information.
|
|
From: Dmitriy K. <dko...@ru...> - 2005-10-21 12:53:47
|
That's needed for TaskExecutor implementation based on BEA's CommonJ WorkManager. I've added the jar to the eclipse .classpath Dmitriy. Seth Ladd wrote: >Hello, > >Can someone add lib/commonj/commonj-twm.jar to the eclipse .classpath >file in CVS? This is a new jar, required by some code in the sandbox. > >Thanks! >Seth > > >------------------------------------------------------- >This SF.Net email is sponsored by: >Power Architecture Resource Center: Free content, downloads, discussions, >and more. http://solutions.newsforge.com/ibmarch.tmpl >_______________________________________________ >Springframework-developer mailing list >Spr...@li... >https://lists.sourceforge.net/lists/listinfo/springframework-developer > > |
|
From: Seth L. <set...@gm...> - 2005-10-21 00:22:30
|
Hello, Can someone add lib/commonj/commonj-twm.jar to the eclipse .classpath file in CVS? This is a new jar, required by some code in the sandbox. Thanks! Seth |
|
From: <al...@in...> - 2005-10-20 22:33:47
|
View results here -> http://opensource.jteam.nl/build/buildresults/spring?log=log20051021001559Lbuild.361 |
|
From: Darren D. <da...@sh...> - 2005-10-20 15:15:41
|
1129821332
FAILED
Buildfile: build.xml
clean:
compileattr:
[attribute-compiler] Generated attribute information for 1 classes. Ignored 0 classes.
buildmain:
[mkdir] Created dir: /home/users/d/da/davison/checkouts/spring/target/sparc-solaris1/classes
[mkdir] Created dir: /home/users/d/da/davison/checkouts/spring/target/sparc-solaris1/classes/META-INF
[javac] Compiling 1108 source files to /home/users/d/da/davison/checkouts/spring/target/sparc-solaris1/classes
[javac] /home/users/d/da/davison/checkouts/spring/src/org/springframework/beans/factory/access/BeanFactoryBootstrap.java:46: error while writing org.springframework.beans.factory.access.BeanFactoryBootstrap: /home/users/d/da/davison/checkouts/spring/target/sparc-solaris1/classes/org/springframework/beans/factory/access/BeanFactoryBootstrap.class (No such file or directory)
[javac] public class BeanFactoryBootstrap {
[javac] ^
[javac] Note: Some input files use or override a deprecated API.
[javac] Note: Recompile with -deprecation for details.
[javac] 1 error
This is an automated mail from one of the SF Compile Farm machines.
The machine name noted in the subject encountered a failure building
or running the Spring test suite. The last few lines of the output
were included for info.
NB: No further mail will be sent from this machine until a
manual reset occurs on the cf-shell machine, although builds will
continue as scheduled.
See http://springframework.sourceforge.net/test/ for further
information.
|
|
From: Keith D. <ke...@in...> - 2005-10-20 14:29:01
|
Dear Spring community, Spring Web Flow (SWF) is working towards API freeze/stabilization for the upcoming 1.0 release (starting with 1.0 RC1, targeted at November 7th). We are now in a general feature freeze for the 1.0 release. -- We need your help! SWF users, Spring developers, general Java/Spring gurus, please give the existing code base a review. Send any suspected bugs, suggested improvements, critiques, etc. to me. We want the API, particularly the webflow core, right by November 7th because once it's fixed, it's fixed. In addition, our test suite needs improvement: we are only around 50% now (though the core is well tested). We need to see 70% or higher by 11/7 - test case contributions would be greatly appreciated, and will be incorporated immediately. Just in case, here is how to access the project: Host: cvs.sourceforge.net Repository Path: /cvsroot/springframework Module: spring-projects Project: spring-webflow All spring projects are directly importable into Eclipse. Useful ANT targets: - ant 'dist" will download project dependencies and build the project - ant "clover-report" will produce a test coverage report - ant "tests" will run the test suite. - ant "doc-htmlsingle" will build the (in progress) reference documentation. Thanks! To 1.0! Keith Keith Donald Spring Web Flow Co-Lead Spring Framework Developer <http://www.springframework.com> http://www.springframework.com |
|
From: Darren D. <da...@sh...> - 2005-10-20 14:14:25
|
|
From: <al...@in...> - 2005-10-19 22:32:24
|
View results here -> http://opensource.jteam.nl/build/buildresults/spring?log=log20051020001613Lbuild.360 |
|
From: <ty...@me...> - 2005-10-19 20:26:49
|
I have being created a project using ACEGI 0.9.0 SNAPSHOT and
discovered a slight problem. Basically we have our implementation of
UserDetails, and have created a Util class to get our implementation
from the SecurityContext. However there is an issue when a user is an
Anonymous user. When a user is Anonymous the principle is stored as a
string, so when I get our user object there is ClassCastException.
Easy fix right, do a check in our Util class to see if it is a string or
an instance of UserDetails. It does seem a little fugly IMO. Another
option is to extend AnonymousProcessingFilter, which is what I am leaning
towards. However if I change that filter it may be difficult to maintain
in the future, if there are any major changes to ACEGI
It would be nice to have a way inject which implementation of UserDetails
object to use for an Anonymous user.
Are there any plans to add this or something similar to ACEGI in the future?
Regards,
Tyler
|
|
From: Peter B. <pet...@ho...> - 2005-10-19 09:37:09
|
Hello.
Would it make sense to add key-class and value-class attributes to the
<map> element, and feed the strings in the key/value elements (or
attributes) to the appropriate PropertyEditor, to allow setting key and
value of the correct class when using maps with generics?
For example, consider this example:
public Map<Locale, String> getHeadsOfState() { ... }
configured like this:
<property name="headsOfState">
<map key-class="java.util.Locale" value-class="java.lang.String">
<entry key="en_US" value="George W. Bush"/>
<entry key="en_GB" value="Tony Blair"/>
<entry key="sv_SE" value="Göran Persson"/>
</map>
</property>
I've glanced at modifying the xml parsing and subclassing or modifying
MapFactoryBean, but I thought I'd ask here first if it's possible to do
this any other way, or if it's a bad idea altogether.
What do you think?
/Peter Backlund
|
|
From: <al...@in...> - 2005-10-18 22:37:21
|
View results here -> http://opensource.jteam.nl/build/buildresults/spring?log=log20051019001738Lbuild.359 |
|
From: Yujin K. <net...@gm...> - 2005-10-18 22:25:27
|
John, Juergen or any other spring-portlet developers, Has anyone done any work in portlet-mvc to support multipart fileuploading? commons-fileuploading already has support for parsing multipart contents in PortletRequest, and I am guessing it would be pretty simple to replicate what's done in servlet-mvc to portlet world, but if some work have been done already, I would really appreciate if you could share your code with me. Yujin |
|
From: <al...@in...> - 2005-10-17 22:33:56
|
View results here -> http://opensource.jteam.nl/build/buildresults/spring?log=log20051018001641Lbuild.358 |
|
From: Torsten J. <tju...@ya...> - 2005-10-17 20:45:52
|
Hi, we got a ticket regarding bean instantiation via private constructors (http://springide.org/project/ticket/166 ). While this feature is nowhere documented it still works. Now we are wondering if this behaviour is intended or is it a "side effect" of using cglib? I'm asking because Spring IDE currently marks these beans as invalid due the missing public non-argument constructor in their bean class. What is the "official" advice regarding validation of these kind of beans? Cheers, Torsten __________________________________ Yahoo! Music Unlimited Access over 1 million songs. Try it free. http://music.yahoo.com/unlimited/ |
|
From: Eugene K. <eu...@ja...> - 2005-10-17 01:59:39
|
Hi Colin, Thanks for looking into this. Actually I've created a JIRA, which is not assigned to Jurgen. http://opensource2.atlassian.com/projects/spring/browse/SPR-1333 regards, Eugene Colin Sampaleanu wrote: > I managed to miss this when it was initially posted. We may want to > consider this for 1.3. > > > Eugene Kuleshov wrote: > >> Folks, >> >> I've implemented a sax-based parser for Spring's XML bean definition >> and wonder if you'd be interested to integrate this into Spring >> framework. this class can be used in place of the current DOM-based >> parser as well as an lightweight adapter for runtime app context >> generators such as xslt-based tools or tools like Jacn (even so I >> believe Jacn should directly generate Spring factories without >> intermediate XML representation). >> >> I run all existing tests from xml package and they all seem working >> just fine. That however required to have copies of >> XmlBeanDefinitionReaderand and XmlBeanFactory patched to work with my >> parser. >> >> In my tests this parser is little bit faster then current DOM-based >> parser and in my opinion it is structured little better then DOM-based >> parser. Basically is is sort-of stripped-down Digester (stack-based >> state machine) with declarative definitions for parsing rules. >> Interestingly the same rules could be used with StAX-based parser with >> very minimal changes or even without changes using adapter for SAX >> Attributes instance used in rule params. >> >> Also note that current XmlBeanDefinitionReader class is tight to >> DOM-based API and does not allow to hookup abstract XML parsers (e.g. >> SAX or StAX). This make impossible to substiture custom non-DOM XML >> parser to XmlBeanFactory. >> >> regards, >> Eugene |
|
From: Colin S. <col...@ex...> - 2005-10-17 01:51:45
|
I managed to miss this when it was initially posted. We may want to
consider this for 1.3.
Eugene Kuleshov wrote:
> Folks,
>
> I've implemented a sax-based parser for Spring's XML bean definition
> and wonder if you'd be interested to integrate this into Spring
> framework. this class can be used in place of the current DOM-based
> parser as well as an lightweight adapter for runtime app context
> generators such as xslt-based tools or tools like Jacn (even so I
> believe Jacn should directly generate Spring factories without
> intermediate XML representation).
>
> I run all existing tests from xml package and they all seem working
> just fine. That however required to have copies of
> XmlBeanDefinitionReaderand and XmlBeanFactory patched to work with my
> parser.
>
> In my tests this parser is little bit faster then current DOM-based
> parser and in my opinion it is structured little better then DOM-based
> parser. Basically is is sort-of stripped-down Digester (stack-based
> state machine) with declarative definitions for parsing rules.
> Interestingly the same rules could be used with StAX-based parser with
> very minimal changes or even without changes using adapter for SAX
> Attributes instance used in rule params.
>
> Also note that current XmlBeanDefinitionReader class is tight to
> DOM-based API and does not allow to hookup abstract XML parsers (e.g.
> SAX or StAX). This make impossible to substiture custom non-DOM XML
> parser to XmlBeanFactory.
>
> regards,
> Eugene
>
>
>------------------------------------------------------------------------
>
>
>package com.cibcwm.go.otis.dasl.util;
>
>import java.io.IOException;
>import java.io.InputStream;
>import java.util.ArrayList;
>import java.util.Arrays;
>import java.util.HashMap;
>import java.util.Iterator;
>import java.util.List;
>import java.util.Map;
>import java.util.Properties;
>
>import javax.xml.parsers.ParserConfigurationException;
>import javax.xml.parsers.SAXParser;
>import javax.xml.parsers.SAXParserFactory;
>
>import org.apache.commons.logging.Log;
>import org.apache.commons.logging.LogFactory;
>import org.springframework.beans.MutablePropertyValues;
>import org.springframework.beans.factory.BeanDefinitionStoreException;
>import org.springframework.beans.factory.config.BeanDefinition;
>import org.springframework.beans.factory.config.BeanDefinitionHolder;
>import org.springframework.beans.factory.config.ConstructorArgumentValues;
>import org.springframework.beans.factory.config.RuntimeBeanReference;
>import org.springframework.beans.factory.config.TypedStringValue;
>import org.springframework.beans.factory.support.AbstractBeanDefinition;
>import org.springframework.beans.factory.support.BeanDefinitionReader;
>import org.springframework.beans.factory.support.BeanDefinitionReaderUtils;
>import org.springframework.beans.factory.support.LookupOverride;
>import org.springframework.beans.factory.support.ManagedList;
>import org.springframework.beans.factory.support.ManagedMap;
>import org.springframework.beans.factory.support.ManagedSet;
>import org.springframework.beans.factory.support.ReplaceOverride;
>import org.springframework.core.io.ClassPathResource;
>import org.springframework.core.io.Resource;
>import org.springframework.core.io.support.ResourcePatternUtils;
>import org.springframework.util.ClassUtils;
>import org.springframework.util.StringUtils;
>
>import org.xml.sax.Attributes;
>import org.xml.sax.InputSource;
>import org.xml.sax.SAXException;
>import org.xml.sax.SAXParseException;
>import org.xml.sax.helpers.DefaultHandler;
>
>
>/**
> * Default implementation of the XmlBeanDefinitionParser interface.
> * Parses bean definitions according to the "spring-beans" DTD,
> * that is, Spring's default XML bean definition format.
> *
> * <p>The structure, elements and attribute names of the required XML document
> * are hard-coded in this class. (Of course a transform could be run if necessary
> * to produce this format). "beans" doesn't need to be the root element of the XML
> * document: This class will parse all bean definition elements in the XML file.
> *
> * @author Rod Johnson
> * @author Juergen Hoeller
> * @author Rob Harrop
> * @since 18.12.2003
> */
>public class SAXBeanDefinitionParser extends DefaultHandler {
>
> /**
> * Stack of the intermediate processing contexts.
> */
> List stack = new ArrayList();
> /**
> * Complete name of the current element.
> */
> private String match = "";
> private StringBuffer text = new StringBuffer();
>
>
> private final RuleSet RULES = new RuleSet();
> {
> RULES.add("*/description", null);
>
> RULES.add("beans/import", new BeansImportRule());
> RULES.add("beans/alias", new BeansAliasRule());
> RULES.add("beans", new BeansRule()); // description?, (import | alias | bean)*
>
> RULES.add("*/bean/replaced-method/arg-type", new BeanReplacedMethodArgTypeRule());
> RULES.add("*/bean/replaced-method", new BeanReplacedMethodRule()); // (arg-type)*
> RULES.add("*/bean/property", new BeanPropertyRule()); // description?, (bean | ref | idref | value | null | list | set | map | props)?
> RULES.add("*/bean/lookup-method", new BeanLookupMethodRule());
> RULES.add("*/bean/constructor-arg", new BeanConstructorArgRule()); // description?, (bean | ref | idref | value | null | list | set | map | props)?
> RULES.add("*/bean", new BeanRule()); // description?, (constructor-arg | property | lookup-method | replaced-method)*
>
> RULES.add("*/ref", new RefRule());
> RULES.add("*/idref", new IdRefRule());
> RULES.add("*/value", new ValueRule());
> RULES.add("*/null", new NullRule());
>
> RULES.add("*/list", new ListRule()); // (bean | ref | idref | value | null | list | set | map | props)*
>
> RULES.add("*/set", new SetType()); // (bean | ref | idref | value | null | list | set | map | props)*
>
> RULES.add("*/map/entry/key", new MapEntryKeyRule()); // (bean | ref | idref | value | null | list | set | map | props)
> RULES.add("*/map/entry", new MapEntryRule()); // key?, (bean | ref | idref | value | null | list | set | map | props)?
> RULES.add("*/map", new MapRule()); // (entry)*
>
> RULES.add("*/props/prop", new PropsPropRule());
> RULES.add("*/props", new PropsRule()); // (prop)*
> }
>
> static private final String BEAN_NAME_DELIMITERS = ",; ";
>
> /**
> * Value of a T/F attribute that represents true.
> * Anything else represents false. Case seNsItive.
> */
> static private final String TRUE_VALUE = "true";
> static private final String DEFAULT_VALUE = "default";
>
> static private final String AUTOWIRE_BY_NAME_VALUE = "byName";
> static private final String AUTOWIRE_BY_TYPE_VALUE = "byType";
> static private final String AUTOWIRE_CONSTRUCTOR_VALUE = "constructor";
> static private final String AUTOWIRE_AUTODETECT_VALUE = "autodetect";
>
> static private final String DEPENDENCY_CHECK_ALL_ATTRIBUTE_VALUE = "all";
> static private final String DEPENDENCY_CHECK_SIMPLE_ATTRIBUTE_VALUE = "simple";
> static private final String DEPENDENCY_CHECK_OBJECTS_ATTRIBUTE_VALUE = "objects";
>
> static private final String DEFAULT_LAZY_INIT_ATTRIBUTE = "default-lazy-init";
> static private final String DEFAULT_AUTOWIRE_ATTRIBUTE = "default-autowire";
> static private final String DEFAULT_DEPENDENCY_CHECK_ATTRIBUTE = "default-dependency-check";
>
> static private final String RESOURCE_ATTRIBUTE = "resource";
>
> static private final String NAME_ATTRIBUTE = "name";
> static private final String ALIAS_ATTRIBUTE = "alias";
>
> static private final String BEAN_ELEMENT = "bean";
> static private final String ID_ATTRIBUTE = "id";
> static private final String PARENT_ATTRIBUTE = "parent";
>
> static private final String CLASS_ATTRIBUTE = "class";
> static private final String ABSTRACT_ATTRIBUTE = "abstract";
> static private final String SINGLETON_ATTRIBUTE = "singleton";
> static private final String LAZY_INIT_ATTRIBUTE = "lazy-init";
> static private final String AUTOWIRE_ATTRIBUTE = "autowire";
> static private final String DEPENDENCY_CHECK_ATTRIBUTE = "dependency-check";
> static private final String DEPENDS_ON_ATTRIBUTE = "depends-on";
> static private final String INIT_METHOD_ATTRIBUTE = "init-method";
> static private final String DESTROY_METHOD_ATTRIBUTE = "destroy-method";
> static private final String FACTORY_METHOD_ATTRIBUTE = "factory-method";
> static private final String FACTORY_BEAN_ATTRIBUTE = "factory-bean";
>
> static private final String INDEX_ATTRIBUTE = "index";
> static private final String TYPE_ATTRIBUTE = "type";
> static private final String REF_ATTRIBUTE = "ref";
> static private final String VALUE_ATTRIBUTE = "value";
>
> static private final String REPLACER_ATTRIBUTE = "replacer";
> static private final String ARG_TYPE_MATCH_ATTRIBUTE = "match";
>
> static private final String BEAN_REF_ATTRIBUTE = "bean";
> static private final String LOCAL_REF_ATTRIBUTE = "local";
> static private final String PARENT_REF_ATTRIBUTE = "parent";
>
> static private final String KEY_ATTRIBUTE = "key";
> static private final String KEY_REF_ATTRIBUTE = "key-ref";
> static private final String VALUE_REF_ATTRIBUTE = "value-ref";
>
>
> protected final Log logger = LogFactory.getLog(getClass());
>
> BeanDefinitionReader beanDefinitionReader;
>
> Resource resource;
>
> String defaultLazyInit;
>
> String defaultAutowire;
>
> String defaultDependencyCheck;
>
> int beanDefinitionCount = 0;
> private boolean validating = true;
>
>
> public SAXBeanDefinitionParser( boolean validating) {
> this.validating = validating;
> }
>
> public int registerBeanDefinitions(BeanDefinitionReader reader, Resource resource, InputStream inputStream)
> throws BeanDefinitionStoreException {
> this.beanDefinitionReader = reader;
> this.resource = resource;
>
> SAXParserFactory factory = SAXParserFactory.newInstance();
> factory.setValidating(validating);
> SAXParser parser;
> try {
> parser = factory.newSAXParser();
> logger.debug("Loading bean definitions");
> parser.parse(inputStream, this);
>
> } catch( ParserConfigurationException ex) {
> logger.error( ex.getMessage(), ex);
> throw new BeanDefinitionStoreException( ex.getMessage(), ex);
>
> } catch( SAXException ex) {
> logger.error( ex.getMessage(), ex);
> throw new BeanDefinitionStoreException( ex.getMessage(), ex);
>
> } catch( IOException ex) {
> logger.error( ex.getMessage(), ex);
> throw new BeanDefinitionStoreException( ex.getMessage(), ex);
>
> }
>
> if (logger.isDebugEnabled()) {
> logger.debug("Found " + beanDefinitionCount + " <bean> elements in " + resource);
> }
> return beanDefinitionCount;
> }
>
> /**
> * Return the BeanDefinitionReader that this parser has been called from.
> */
> protected final BeanDefinitionReader getBeanDefinitionReader() {
> return beanDefinitionReader;
> }
>
> /**
> * Return the descriptor for the XML resource that this parser works on.
> */
> protected final Resource getResource() {
> return resource;
> }
>
> /**
> * Return the default lazy-init flag for the document that's currently parsed.
> */
> protected final String getDefaultLazyInit() {
> return defaultLazyInit;
> }
>
> /**
> * Return the default autowire setting for the document that's currently parsed.
> */
> protected final String getDefaultAutowire() {
> return defaultAutowire;
> }
>
> /**
> * Return the default dependency-check setting for the document that's currently parsed.
> */
> protected final String getDefaultDependencyCheck() {
> return defaultDependencyCheck;
> }
>
>
> /**
> * Process notification of the start of an XML element being reached.
> *
> * @param ns - The Namespace URI, or the empty string if the element has no
> * Namespace URI or if Namespace processing is not being performed.
> * @param localName - The local name (without prefix), or the empty string
> * if Namespace processing is not being performed.
> * @param qName - The qualified name (with prefix), or the empty string if
> * qualified names are not available.
> * @param list - The attributes attached to the element. If there are no
> * attributes, it shall be an empty Attributes object.
> * @exception SAXException if a parsing error is to be reported
> */
> public final void startElement( String ns, String localName, String qName, Attributes list) {
> // the actual element name is either in localName or qName, depending
> // on whether the parser is namespace aware
> String name = localName;
> if (name == null || name.length() < 1) {
> name = qName;
> }
>
> // Compute the current matching rule
> StringBuffer sb = new StringBuffer(match);
> if (match.length() > 0) {
> sb.append('/');
> }
> sb.append(name);
> match = sb.toString();
>
> // Fire "begin" event for relevant rule
> Rule r = (Rule) RULES.match(match);
> if (r != null) {
> r.begin(ns, name, list);
> }
>
> text = new StringBuffer(); // TODO optimize this
> }
>
> /**
> * Process notification of the end of an XML element being reached.
> *
> * @param ns - The Namespace URI, or the empty string if the element has no
> * Namespace URI or if Namespace processing is not being performed.
> * @param localName - The local name (without prefix), or the empty string
> * if Namespace processing is not being performed.
> * @param qName - The qualified XML 1.0 name (with prefix), or the empty
> * string if qualified names are not available.
> *
> * @exception SAXException if a parsing error is to be reported
> */
> public final void endElement(String ns, String localName, String qName) {
> // the actual element name is either in localName or qName, depending
> // on whether the parser is namespace aware
> String name = localName;
> if (name == null || name.length() < 1) {
> name = qName;
> }
>
> // Fire "end" event for relevant rule
> Rule r = (Rule) RULES.match(match);
> if (r != null) {
> r.text(ns, name, text.toString());
> r.end(ns, name);
> }
>
> // Recover the previous match expression
> int slash = match.lastIndexOf('/');
> if (slash >= 0) {
> match = match.substring(0, slash);
> } else {
> match = "";
> }
> }
>
> public void characters( char[] ch, int start, int length) {
> text.append( ch, start, length);
> }
>
>
> public InputSource resolveEntity( String publicId, String systemId) throws SAXException {
> if("-//SPRING//DTD BEAN//EN".equals(publicId) &&
> "http://www.springframework.org/dtd/spring-beans.dtd".equals(systemId)) {
> Resource resource = new ClassPathResource("/org/springframework/beans/factory/xml/spring-beans.dtd", getClass());
> try {
> InputSource source = new InputSource( resource.getInputStream());
> source.setPublicId( publicId);
> source.setSystemId( systemId);
> if (logger.isDebugEnabled()) {
> logger.debug("Found beans DTD [" + systemId + "] in classpath");
> }
> return source;
> } catch( IOException e) {
> throw new SAXException(e);
> }
> }
> return null;
> }
>
> public void error( SAXParseException e) throws SAXException {
> System.err.println( "ERROR "+e.toString());
> throw e;
> }
>
> public void warning( SAXParseException e) throws SAXException {
> System.err.println( "WARNING "+e.toString());
> throw e;
> }
>
> public void fatalError( SAXParseException e) throws SAXException {
> System.err.println( "FATAL "+e.toString());
> throw e;
> }
>
> private static final class RuleSet {
> private Map rules = new HashMap();
> private List lpatterns = new ArrayList();
> private List rpatterns = new ArrayList();
>
> public void add(String path, Rule rule) {
> String pattern = path;
> if (path.startsWith("*/")) {
> pattern = path.substring(1);
> lpatterns.add(pattern);
> } else if (path.endsWith("/*")) {
> pattern = path.substring(0, path.length() - 1);
> rpatterns.add(pattern);
> }
> rules.put(pattern, rule);
> }
>
> public Object match(String path) {
> if (rules.containsKey(path)) {
> return rules.get(path);
> }
>
> for (Iterator it = lpatterns.iterator(); it.hasNext();) {
> String pattern = (String) it.next();
> if (path.endsWith(pattern)) {
> return rules.get(pattern);
> }
> }
>
> for (Iterator it = rpatterns.iterator(); it.hasNext();) {
> String pattern = (String) it.next();
> if (path.startsWith(pattern)) {
> return rules.get(pattern);
> }
> }
>
> return null;
> }
>
> }
>
> final Object peek() {
> return stack.size() == 0 ? null : stack.get(stack.size() - 1);
> }
>
> final Object peek(int n) {
> return stack.size() < (n + 1) ? null : stack.get(n);
> }
>
> final Object pop() {
> return stack.size() == 0 ? null : stack.remove(stack.size() - 1);
> }
>
> final void push(Object object) {
> stack.add(object);
> }
>
>
> protected abstract class Rule {
>
> public void begin( String ns, String name, Attributes attrs) {
> }
>
> public void end( String ns, String name) {
> }
>
> public void text( String ns, String name, String text) {
> }
>
> protected BeanDefinitionHolder getBeanDefinitionHolder() {
> for( int n = stack.size()-1; n>=0; n--) {
> Object o = stack.get(n);
> if( o instanceof BeanDefinitionHolder) {
> return ( BeanDefinitionHolder) o;
> }
> }
> throw new BeanDefinitionStoreException( "Unable to find BeanDefinitionHolder");
> }
>
> protected AbstractBeanDefinition getBeanDefinition() {
> return ( AbstractBeanDefinition) getBeanDefinitionHolder().getBeanDefinition();
> }
>
> protected Object getValue(String elementName, Attributes atts) {
> String ref = atts.getValue(REF_ATTRIBUTE);
> String value = atts.getValue(VALUE_ATTRIBUTE);
> if(ref!=null && value!=null) {
> throw new BeanDefinitionStoreException( getResource(), getBeanDefinitionHolder().getBeanName(), elementName +
> " is only allowed to contain either a 'ref' attribute OR a 'value' attribute OR a sub-element");
> }
>
> if (ref!=null) {
> return new RuntimeBeanReference(ref);
> } else if (value!=null) {
> return value;
> }
>
> return null;
> }
>
> public void setValue( Object value) {
> Object target = peek();
>
> // introspect type and set an appropriate property
> // TODO add assertion for already set properties
> if( target instanceof ConstructorArgumentValuesHolder) { // constructor-arg/...
> ((ConstructorArgumentValuesHolder) target).setValue(value);
>
> } else if( target instanceof PropertyValueHolder) { // property/...
> ((PropertyValueHolder) target).setValue(value);
>
> } else if( target instanceof ManagedList) { // list/...
> ((ManagedList) target).add(value);
>
> } else if( target instanceof ManagedSet) { // set/...
> ((ManagedSet) target).add(value);
>
> } else if( target instanceof MapEntryHolder) { // map/entry/...
> ((MapEntryHolder) target).setValue(value);
>
> } else if( target instanceof MapEntryKeyHolder) { // map/entry/key/...
> ((MapEntryKeyHolder) target).setKey(value);
>
> }
> }
> }
>
>
> /**
> * description?, (import | alias | bean)*
> */
> private final class BeansRule extends Rule {
> public void begin( String ns, String name, Attributes atts) {
> defaultLazyInit = atts.getValue(DEFAULT_LAZY_INIT_ATTRIBUTE);
> defaultAutowire = atts.getValue(DEFAULT_AUTOWIRE_ATTRIBUTE);
> defaultDependencyCheck = atts.getValue(DEFAULT_DEPENDENCY_CHECK_ATTRIBUTE);
>
> if (logger.isDebugEnabled()) {
> logger.debug("Default lazy init '" + defaultLazyInit + "'");
> logger.debug("Default autowire '" + defaultAutowire + "'");
> logger.debug("Default dependency check '" + defaultDependencyCheck + "'");
> }
> }
> }
>
>
> public class BeansImportRule extends Rule {
> public void begin( String ns, String name, Attributes atts) {
> String location = atts.getValue(RESOURCE_ATTRIBUTE);
>
> if (ResourcePatternUtils.isUrl(location)) {
> int importCount = getBeanDefinitionReader().loadBeanDefinitions(location);
> if (logger.isDebugEnabled()) {
> logger.debug("Imported " + importCount + " bean definitions from URL location [" + location + "]");
> }
> } else {
> // No URL -> considering resource location as relative to the current file.
> try {
> Resource relativeResource = getResource().createRelative(location);
> int importCount = getBeanDefinitionReader().loadBeanDefinitions(relativeResource);
> if (logger.isDebugEnabled()) {
> logger.debug("Imported " + importCount + " bean definitions from relative location [" + location + "]");
> }
> } catch (IOException ex) {
> throw new BeanDefinitionStoreException(
> "Invalid relative resource location [" + location + "] to import bean definitions from", ex);
> }
> }
> }
> }
>
>
> public class BeansAliasRule extends Rule {
> public void begin( String ns, String name, Attributes atts) {
> String beanName = atts.getValue(NAME_ATTRIBUTE);
> String alias = atts.getValue(ALIAS_ATTRIBUTE);
> beanDefinitionReader.getBeanFactory().registerAlias(beanName, alias);
> }
> }
>
>
> /**
> * description?, (constructor-arg | property | lookup-method | replaced-method)*
> */
> public class BeanRule extends Rule {
> public void begin( String ns, String name, Attributes atts) {
> beanDefinitionCount++;
> // BeanDefinitionHolder bdHolder = parseBeanDefinitionElement(ele, false);
>
> String id = atts.getValue(ID_ATTRIBUTE);
> String nameAttr = atts.getValue(NAME_ATTRIBUTE);
>
> List aliases = new ArrayList();
> if (StringUtils.hasLength(nameAttr)) {
> String[] nameArr = StringUtils.tokenizeToStringArray(nameAttr, BEAN_NAME_DELIMITERS);
> aliases.addAll(Arrays.asList(nameArr));
> }
>
> String beanName = id;
> if (!StringUtils.hasText(beanName) && !aliases.isEmpty()) {
> beanName = (String) aliases.remove(0);
> if (logger.isDebugEnabled()) {
> logger.debug("No XML 'id' specified - using '" + beanName +
> "' as bean name and " + aliases + " as aliases");
> }
> }
>
> BeanDefinition beanDefinition = getBeanDefinition(atts, beanName);
>
> if (!StringUtils.hasText(beanName) && beanDefinition instanceof AbstractBeanDefinition) {
> boolean isInnerBean = stack.size()>0;
> beanName = BeanDefinitionReaderUtils.generateBeanName(
> (AbstractBeanDefinition) beanDefinition, beanDefinitionReader.getBeanFactory(), isInnerBean);
> if (logger.isDebugEnabled()) {
> logger.debug("Neither XML 'id' nor 'name' specified - " +
> "using generated bean name [" + beanName + "]");
> }
> }
>
> String[] aliasesArray = (String[]) aliases.toArray(new String[aliases.size()]);
>
> push( new BeanDefinitionHolder(beanDefinition, beanName, aliasesArray));
> }
>
> public void end( String ns, String name) {
> BeanDefinitionHolder bh = ( BeanDefinitionHolder) pop(); // don't inline
> if(stack.size()==0) {
> BeanDefinitionReaderUtils.registerBeanDefinition(bh, beanDefinitionReader.getBeanFactory());
> } else {
> setValue(bh);
> }
> }
>
> protected BeanDefinition getBeanDefinition(Attributes atts, String beanName)
> throws BeanDefinitionStoreException {
>
> String className = atts.getValue(CLASS_ATTRIBUTE);
> String parent = atts.getValue(PARENT_ATTRIBUTE);
>
> try {
> ConstructorArgumentValues cargs = new ConstructorArgumentValues();
> MutablePropertyValues pvs = new MutablePropertyValues();
>
> AbstractBeanDefinition bd = BeanDefinitionReaderUtils.createBeanDefinition(
> className, parent, cargs, pvs, getBeanDefinitionReader().getBeanClassLoader());
>
> String dependsOn = atts.getValue(DEPENDS_ON_ATTRIBUTE);
> if (dependsOn!=null) {
> bd.setDependsOn(StringUtils.tokenizeToStringArray(dependsOn, BEAN_NAME_DELIMITERS));
> }
>
> String factoryMethod = atts.getValue(FACTORY_METHOD_ATTRIBUTE);
> if (factoryMethod!=null) {
> bd.setFactoryMethodName(factoryMethod);
> }
> String factoryBeanName = atts.getValue(FACTORY_BEAN_ATTRIBUTE);
> if (factoryBeanName!=null) {
> bd.setFactoryBeanName(factoryBeanName);
> }
>
> String dependencyCheck = atts.getValue(DEPENDENCY_CHECK_ATTRIBUTE);
> if (DEFAULT_VALUE.equals(dependencyCheck)) {
> dependencyCheck = getDefaultDependencyCheck();
> }
> bd.setDependencyCheck(getDependencyCheck(dependencyCheck));
>
> String autowire = atts.getValue(AUTOWIRE_ATTRIBUTE);
> if (DEFAULT_VALUE.equals(autowire)) {
> autowire = getDefaultAutowire();
> }
> bd.setAutowireMode(getAutowireMode(autowire));
>
> String initMethodName = atts.getValue(INIT_METHOD_ATTRIBUTE);
> if (initMethodName!=null && !initMethodName.equals("")) {
> bd.setInitMethodName(initMethodName);
> }
> String destroyMethodName = atts.getValue(DESTROY_METHOD_ATTRIBUTE);
> if (destroyMethodName!=null && !destroyMethodName.equals("")) {
> bd.setDestroyMethodName(destroyMethodName);
> }
>
> bd.setResourceDescription(getResource().getDescription());
>
> String isAbstract = atts.getValue(ABSTRACT_ATTRIBUTE);
> if (isAbstract!=null) {
> bd.setAbstract(TRUE_VALUE.equals(isAbstract));
> }
>
> String isSingleton = atts.getValue(SINGLETON_ATTRIBUTE);
> if (isSingleton!=null) {
> bd.setSingleton(TRUE_VALUE.equals(isSingleton));
> }
>
> String lazyInit = atts.getValue(LAZY_INIT_ATTRIBUTE);
> if (DEFAULT_VALUE.equals(lazyInit) && bd.isSingleton()) {
> // Just apply default to singletons, as lazy-init has no meaning for prototypes.
> lazyInit = defaultLazyInit;
> }
> bd.setLazyInit(TRUE_VALUE.equals(lazyInit));
>
> return bd;
> }
> catch (ClassNotFoundException ex) {
> throw new BeanDefinitionStoreException(
> resource, beanName, "Bean class [" + className + "] not found", ex);
> }
> catch (NoClassDefFoundError err) {
> throw new BeanDefinitionStoreException(
> resource, beanName, "Class that bean class [" + className + "] depends on not found", err);
> }
> }
>
> protected int getDependencyCheck(String att) {
> int dependencyCheckCode = AbstractBeanDefinition.DEPENDENCY_CHECK_NONE;
> if (DEPENDENCY_CHECK_ALL_ATTRIBUTE_VALUE.equals(att)) {
> dependencyCheckCode = AbstractBeanDefinition.DEPENDENCY_CHECK_ALL;
> }
> else if (DEPENDENCY_CHECK_SIMPLE_ATTRIBUTE_VALUE.equals(att)) {
> dependencyCheckCode = AbstractBeanDefinition.DEPENDENCY_CHECK_SIMPLE;
> }
> else if (DEPENDENCY_CHECK_OBJECTS_ATTRIBUTE_VALUE.equals(att)) {
> dependencyCheckCode = AbstractBeanDefinition.DEPENDENCY_CHECK_OBJECTS;
> }
> // Else leave default value.
> return dependencyCheckCode;
> }
>
> protected int getAutowireMode(String att) {
> int autowire = AbstractBeanDefinition.AUTOWIRE_NO;
> if (AUTOWIRE_BY_NAME_VALUE.equals(att)) {
> autowire = AbstractBeanDefinition.AUTOWIRE_BY_NAME;
> }
> else if (AUTOWIRE_BY_TYPE_VALUE.equals(att)) {
> autowire = AbstractBeanDefinition.AUTOWIRE_BY_TYPE;
> }
> else if (AUTOWIRE_CONSTRUCTOR_VALUE.equals(att)) {
> autowire = AbstractBeanDefinition.AUTOWIRE_CONSTRUCTOR;
> }
> else if (AUTOWIRE_AUTODETECT_VALUE.equals(att)) {
> autowire = AbstractBeanDefinition.AUTOWIRE_AUTODETECT;
> }
> // Else leave default value.
> return autowire;
> }
>
> }
>
>
> /**
> * description?, (bean | ref | idref | value | null | list | set | map | props)?
> */
> public class BeanConstructorArgRule extends Rule {
> public void begin( String ns, String name, Attributes atts) {
> String index = atts.getValue(INDEX_ATTRIBUTE);
> String type = atts.getValue(TYPE_ATTRIBUTE);
> Object value = getValue(name, atts);
> push(new ConstructorArgumentValuesHolder( index, type, value));
> }
>
> public void end( String ns, String name) {
> ConstructorArgumentValuesHolder ch = ( ConstructorArgumentValuesHolder) pop();
>
> BeanDefinitionHolder bh = getBeanDefinitionHolder();
> String beanName = bh.getBeanName();
> ConstructorArgumentValues cargs = bh.getBeanDefinition().getConstructorArgumentValues();
>
> String type = ch.getType();
> String index = ch.getIndex();
> Object val = ch.getValue();
> if (StringUtils.hasLength(index)) {
> try {
> int i = Integer.parseInt(index);
> if (i < 0) {
> throw new BeanDefinitionStoreException(getResource(), beanName, "'index' cannot be lower than 0");
> }
> if (StringUtils.hasLength(type)) {
> cargs.addIndexedArgumentValue(i, val, type);
> } else {
> cargs.addIndexedArgumentValue(i, val);
> }
> } catch (NumberFormatException ex) {
> throw new BeanDefinitionStoreException(getResource(), beanName,
> "Attribute 'index' of tag 'constructor-arg' must be an integer");
> }
> } else {
> if (StringUtils.hasLength(type)) {
> cargs.addGenericArgumentValue(val, type);
> } else {
> cargs.addGenericArgumentValue(val);
> }
> }
> }
>
> }
>
>
> /**
> * description?, (bean | ref | idref | value | null | list | set | map | props)?
> */
> public class BeanPropertyRule extends Rule {
> public void begin( String ns, String name, Attributes atts) {
> BeanDefinitionHolder bh = getBeanDefinitionHolder();
>
> String propertyName = atts.getValue(NAME_ATTRIBUTE);
> if (!StringUtils.hasLength(propertyName)) {
> throw new BeanDefinitionStoreException(
> getResource(), bh.getBeanName(), "Tag 'property' must have a 'name' attribute");
> }
>
> MutablePropertyValues pvs = bh.getBeanDefinition().getPropertyValues();
> if (pvs.contains(propertyName)) {
> throw new BeanDefinitionStoreException(
> getResource(), bh.getBeanName(), "Multiple 'property' definitions for property '" + propertyName + "'");
> }
>
> Object value = getValue(name+" name "+propertyName, atts);
> push( new PropertyValueHolder(propertyName, value));
> }
>
> public void end( String ns, String name) {
> PropertyValueHolder pvh = ( PropertyValueHolder) pop(); // don't inline
>
> MutablePropertyValues pvs = getBeanDefinition().getPropertyValues();
> pvs.addPropertyValue(pvh.getName(), pvh.getValue());
> }
> }
>
>
> public class BeanLookupMethodRule extends Rule {
> public void begin( String ns, String name, Attributes atts) {
> String methodName = atts.getValue(NAME_ATTRIBUTE);
> String beanRef = atts.getValue(BEAN_ELEMENT);
> getBeanDefinition().getMethodOverrides().addOverride(new LookupOverride(methodName, beanRef));
> }
> }
>
>
> /**
> * (arg-type)*
> */
> public class BeanReplacedMethodRule extends Rule {
> public void begin( String ns, String name, Attributes atts) {
> String methodName = atts.getValue(NAME_ATTRIBUTE);
> String callback = atts.getValue(REPLACER_ATTRIBUTE);
> push( new ReplaceOverride(methodName, callback));
> }
>
> public void end( String ns, String name) {
> ReplaceOverride o = ( ReplaceOverride) pop(); // don't inline
> getBeanDefinition().getMethodOverrides().addOverride(o);
> }
> }
>
>
> public class BeanReplacedMethodArgTypeRule extends Rule {
> public void begin( String ns, String name, Attributes atts) {
> ReplaceOverride replaceOverride = ( ReplaceOverride) peek();
> String typeId = atts.getValue(ARG_TYPE_MATCH_ATTRIBUTE);
> replaceOverride.addTypeIdentifier(typeId==null ? "" : typeId);
> }
>
>// public void text( String arg0, String arg1, String arg2) {
>// // TODO !!!
>// ....
>// }
>//
>// public void end( String arg0, String arg1) {
>// ...
>// }
> }
>
>
> /**
> * (entry)*
> */
> public class MapRule extends Rule {
> public void begin( String ns, String name, Attributes atts) {
> push( new ManagedMap());
> }
> public void end( String ns, String name) {
> setValue(pop());
> }
> }
>
>
> /**
> * key?, (bean | ref | idref | value | null | list | set | map | props)?
> */
> public class MapEntryRule extends Rule {
> public void begin( String ns, String name, Attributes atts) {
> String keyAttribute = atts.getValue(KEY_ATTRIBUTE);
> String keyRefAttribute = atts.getValue(KEY_REF_ATTRIBUTE);
> if (keyAttribute!=null && keyRefAttribute!=null) {
> throw new BeanDefinitionStoreException(
> getResource(), getBeanDefinitionHolder().getBeanName(), "<entry> is only allowed to contain either " +
> "a 'key' attribute OR a 'key-ref' attribute OR a <key> sub-element");
> }
>
> Object key = null;
> if (keyAttribute!=null) {
> key = keyAttribute;
> } else if (keyRefAttribute!=null) {
> key = new RuntimeBeanReference(keyRefAttribute);
> }
>
> String valueAttribute = atts.getValue(VALUE_ATTRIBUTE);
> String valueRefAttribute = atts.getValue(VALUE_REF_ATTRIBUTE);
> if (valueAttribute!=null && valueRefAttribute!=null) {
> throw new BeanDefinitionStoreException(
> getResource(), getBeanDefinitionHolder().getBeanName(), "<entry> is only allowed to contain either " +
> "a 'value' attribute OR a 'value-ref' attribute OR a value sub-element");
> }
> Object value = null;
> if (valueAttribute!=null) {
> value = valueAttribute;
> } else if (valueRefAttribute!=null) {
> value = new RuntimeBeanReference(valueRefAttribute);
> }
>
> push( new MapEntryHolder( key, value));
>
> }
> public void end( String ns, String name) {
> MapEntryHolder entry = (MapEntryHolder) pop();
> ManagedMap map = ( ManagedMap) peek();
> map.put(entry.getKey(), entry.getValue());
> }
> }
>
>
> /**
> * (bean | ref | idref | value | null | list | set | map | props)
> */
> public class MapEntryKeyRule extends Rule {
> public void begin( String ns, String name, Attributes atts) {
> push( new MapEntryKeyHolder(null));
> }
> public void end( String ns, String name) {
> Object key = ((MapEntryKeyHolder)pop()).getKey();
> (( MapEntryHolder) peek()).setKey(key);
> }
> }
>
>
> /**
> * (bean | ref | idref | value | null | list | set | map | props)*
> */
> public class SetType extends Rule {
> public void begin( String ns, String name, Attributes atts) {
> push( new ManagedSet());
> }
> public void end( String ns, String name) {
> setValue(pop());
> }
> }
>
>
> /**
> * (bean | ref | idref | value | null | list | set | map | props)*
> */
> public class ListRule extends Rule {
> public void begin( String ns, String name, Attributes atts) {
> push( new ManagedList());
> }
>
> public void end( String ns, String name) {
> setValue(pop());
> }
> }
>
>
> public class NullRule extends Rule {
> public void begin( String ns, String name, Attributes atts) {
> setValue(null);
> }
> }
>
>
> public class ValueRule extends Rule {
> public void begin( String ns, String name, Attributes atts) {
> String typeClassName = atts.getValue( TYPE_ATTRIBUTE);
> push(typeClassName);
> }
> public void text( String ns, String name, String text) {
> push(text);
> }
> public void end( String ns, String name) {
> String value = ( String) pop();
> String typeClassName = ( String) pop();
> if (typeClassName!=null) {
> try {
> Class typeClass = ClassUtils.forName(typeClassName, getBeanDefinitionReader().getBeanClassLoader());
> setValue(new TypedStringValue(value, typeClass));
> } catch (ClassNotFoundException ex) {
> throw new BeanDefinitionStoreException(
> getResource(), getBeanDefinitionHolder().getBeanName(), "Value type class [" + typeClassName + "] not found", ex);
> }
> } else {
> setValue(value);
> }
> }
> }
>
>
> public class IdRefRule extends Rule {
> public void begin( String ns, String name, Attributes atts) {
> // A generic reference to any name of any bean.
> String beanRef = atts.getValue(BEAN_REF_ATTRIBUTE);
> if (!StringUtils.hasLength(beanRef)) {
> // A reference to the id of another bean in the same XML file.
> beanRef = atts.getValue(LOCAL_REF_ATTRIBUTE);
> if (!StringUtils.hasLength(beanRef)) {
> throw new BeanDefinitionStoreException(
> getResource(), getBeanDefinitionHolder().getBeanName(), "Either 'bean' or 'local' is required for an idref");
> }
> }
>
> setValue(beanRef);
> }
> }
>
>
> public class RefRule extends Rule {
> public void begin( String ns, String name, Attributes atts) {
> RuntimeBeanReference ref;
>
> String beanRef = atts.getValue(BEAN_REF_ATTRIBUTE);
> if (!StringUtils.hasLength(beanRef)) {
> // A reference to the id of another bean in the same XML file.
> beanRef = atts.getValue(LOCAL_REF_ATTRIBUTE);
> if (!StringUtils.hasLength(beanRef)) {
> // A reference to the id of another bean in a parent context.
> beanRef = atts.getValue(PARENT_REF_ATTRIBUTE);
> if (!StringUtils.hasLength(beanRef)) {
> throw new BeanDefinitionStoreException(
> getResource(), getBeanDefinitionHolder().getBeanName(), "'bean', 'local' or 'parent' is required for a reference");
> }
> ref = new RuntimeBeanReference(beanRef, true);
> } else {
> ref = new RuntimeBeanReference(beanRef);
> }
> } else {
> ref = new RuntimeBeanReference(beanRef);
> }
>
> setValue(ref);
> }
> }
>
>
> /**
> * (prop)*
> */
> public class PropsRule extends Rule {
> public void begin( String ns, String name, Attributes atts) {
> push( new Properties());
> }
> public void end( String ns, String name) {
> setValue(pop());
> }
> }
>
>
> public class PropsPropRule extends Rule {
> public void begin( String ns, String name, Attributes atts) {
> String key = atts.getValue(KEY_ATTRIBUTE);
> push(key);
> }
> public void text( String ns, String name, String text) {
> // Trim the text value to avoid unwanted whitespace
> // caused by typical XML formatting.
> push(text.trim());
> }
> public void end( String ns, String name) {
> String value = ( String) pop();
> String key = ( String) pop();
> Properties props = ( Properties) peek();
> props.setProperty(key, value);
> }
> }
>
>
> public static class ConstructorArgumentValuesHolder {
> private final String index;
> private final String type;
> private Object value;
>
> public ConstructorArgumentValuesHolder( String index, String type, Object value) {
> this.index = index;
> this.type = type;
> this.value = value;
> }
>
> public String getIndex() {
> return index;
> }
>
> public String getType() {
> return type;
> }
>
> public Object getValue() {
> return value;
> }
>
> public void setValue( Object value) {
> this.value = value;
> }
>
> }
>
>
> public static class PropertyValueHolder {
> private final String name;
> private Object value;
>
> public PropertyValueHolder( String name, Object value) {
> this.name = name;
> this.value = value;
> }
>
> public String getName() {
> return name;
> }
>
> public Object getValue() {
> return value;
> }
>
> public void setValue( Object value) {
> this.value = value;
> }
>
> }
>
>
> public static class MapEntryHolder {
> private Object key;
> private Object value;
>
> public MapEntryHolder( Object key, Object value) {
> this.key = key;
> this.value = value;
> }
>
> public Object getKey() {
> return key;
> }
>
> public Object getValue() {
> return value;
> }
>
> public void setKey( Object key) {
> this.key = key;
> }
>
> public void setValue( Object value) {
> this.value = value;
> }
>
> }
>
>
> public static class MapEntryKeyHolder {
> private Object key;
>
> public MapEntryKeyHolder( Object key) {
> this.key = key;
> }
>
> public Object getKey() {
> return key;
> }
>
> public void setKey( Object key) {
> this.key = key;
> }
>
> }
>
>}
>
>
>
|
|
From: Connolly J. <Ba...@fr...> - 2005-10-16 13:06:30
|
Tonight no time for boredom! Go on, give it a try. You'll sure enjoy it! SPUR-M: http://www.geocities.com/niuvuavi7lauv9/ Discreet, unmarked packaging. |
|
From: <al...@in...> - 2005-10-14 22:31:59
|
View results here -> http://opensource.jteam.nl/build/buildresults/spring?log=log20051015001552Lbuild.357 |
|
From: Seth L. <set...@gm...> - 2005-10-13 23:11:24
|
On 10/13/05, al...@in... <al...@in...> wrote: > View results here -> http://opensource.jteam.nl/build/buildresults/spring= ?log=3Dlog20051014001557Lbuild.356 Just a head's up, when I go to this link, I receive this error: Error transforming 'log20051014001557Lbuild.356.xml': java.io.IOException: No space left on device javax.xml.transform.TransformerException: java.io.IOException: No space left on device =09at org.apache.xalan.transformer.TransformerImpl.transformNode(Transforme= rImpl.java:1276) =09at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImp= l.java:668) =09at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImp= l.java:1129) =09at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImp= l.java:1107) =09at net.sourceforge.cruisecontrol.taglib.XSLTag.transform(XSLTag.java:112= ) =09at net.sourceforge.cruisecontrol.taglib.XSLTag.updateCacheFile(XSLTag.ja= va:248) Seth |