Screenshot instructions:
Windows
Mac
Red Hat Linux
Ubuntu
Click URL instructions:
Right-click on ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)
You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
(387) |
May
(1066) |
Jun
(689) |
Jul
(504) |
Aug
(697) |
Sep
(660) |
Oct
(591) |
Nov
(393) |
Dec
(324) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(567) |
Feb
(448) |
Mar
(461) |
Apr
(368) |
May
(887) |
Jun
(243) |
Jul
(429) |
Aug
(670) |
Sep
(648) |
Oct
(684) |
Nov
(599) |
Dec
(317) |
2008 |
Jan
(388) |
Feb
(400) |
Mar
(323) |
Apr
(214) |
May
(228) |
Jun
(120) |
Jul
(168) |
Aug
(64) |
Sep
(78) |
Oct
(127) |
Nov
(28) |
Dec
|
2009 |
Jan
|
Feb
(1) |
Mar
(22) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
|
|
|
|
1
(37) |
2
(9) |
3
(8) |
4
(34) |
5
(5) |
6
(28) |
7
(34) |
8
(9) |
9
(4) |
10
|
11
(6) |
12
(78) |
13
|
14
(29) |
15
(11) |
16
(33) |
17
|
18
(10) |
19
(19) |
20
|
21
(7) |
22
(10) |
23
(5) |
24
|
25
(1) |
26
(9) |
27
(14) |
28
(23) |
29
(20) |
30
(5) |
31
(13) |
From: Rick Evans <springboy@us...> - 2007-03-31 15:52:21
|
Update of /cvsroot/springframework/spring/docs/reference/src In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv5391/docs/reference/src Modified Files: beans.xml Log Message: CSS file is now referenced inline. Stops the CSS file not being resolved when the release docco is put on the main Spring website. Index: beans.xml =================================================================== RCS file: /cvsroot/springframework/spring/docs/reference/src/beans.xml,v retrieving revision 1.162 retrieving revision 1.163 diff -C2 -d -r1.162 -r1.163 *** beans.xml 27 Mar 2007 21:35:57 -0000 1.162 --- beans.xml 31 Mar 2007 15:51:59 -0000 1.163 *************** *** 112,117 **** configuration metadata that is allowed. The Spring IoC container itself is <emphasis>totally</emphasis> decoupled from the format in which this ! configuration metadata is actually written.</para> ! <para>At the time of writing, you can supply this configuration metadata using either XML, the Java properties format, or programmatically (using Spring's public API). The XML-based configuration metadata format really is --- 112,117 ---- configuration metadata that is allowed. The Spring IoC container itself is <emphasis>totally</emphasis> decoupled from the format in which this ! configuration metadata is actually written. ! At the time of writing, you can supply this configuration metadata using either XML, the Java properties format, or programmatically (using Spring's public API). The XML-based configuration metadata format really is *************** *** 143,160 **** (see <xref linkend="context-create" />).</para> </section> ! <para>At its most basic level, a Spring IoC container configuration consists of the ! definition of at least one bean that the container must manage, but typically there ! will be more than one bean definition. When using XML-based configuration metadata, ! these beans are configured as one or more <literal><bean/></literal> elements ! inside a top-level <literal><beans/></literal> element.</para> <para>These bean definitions correspond to the actual objects that make up your ! application(s). Typically you will have bean definitions for your service layer objects, your data access objects (DAOs), presentation objects such as Struts <interfacename>Action</interfacename> instances, infrastructure objects such as Hibernate <interfacename>SessionFactory</interfacename> instances, JMS <interfacename>Queue</interfacename> references, etc. (the possibilities are of ! course endless and are limited only by the scope and complexity of your application).</para> ! <para>Find below an example of the basic structure of XML-based configuration ! metadata.</para> <programlisting><![CDATA[<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans"; --- 143,160 ---- (see <xref linkend="context-create" />).</para> </section> ! <para>Spring configuration consists of at least one bean definition that the ! container must manage, but typically there will be more than one bean definition. ! When using XML-based configuration metadata, these beans are configured as ! <literal><bean/></literal> elements inside a top-level <literal><beans/></literal> ! element.</para> <para>These bean definitions correspond to the actual objects that make up your ! application. Typically you will have bean definitions for your service layer objects, your data access objects (DAOs), presentation objects such as Struts <interfacename>Action</interfacename> instances, infrastructure objects such as Hibernate <interfacename>SessionFactory</interfacename> instances, JMS <interfacename>Queue</interfacename> references, etc. (the possibilities are of ! course endless, and are limited only by the scope and complexity of your application). ! (Typically one does not configure fine-grained domain objects in the container.)</para> ! <para>Find below an example of the basic structure of XML-based configuration metadata.</para> <programlisting><![CDATA[<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans"; *************** *** 185,188 **** --- 185,189 ---- <programlisting><![CDATA[ApplicationContext context = new ClassPathXmlApplicationContext( new String[] {"applicationContext.xml", "applicationContext-part2.xml"}); + ]]><lineannotation>// of course, an <interfacename>ApplicationContext</interfacename> is just a <interfacename>BeanFactory</interfacename></lineannotation><![CDATA[ BeanFactory factory = (BeanFactory) context;]]></programlisting> *************** *** 250,256 **** <listitem> <para>bean behavioral configuration elements, which state how the ! bean should behave in the container (i.e. prototype or singleton, ! autowiring mode, dependency checking mode, initialization and ! destruction methods)</para> </listitem> <listitem> --- 251,256 ---- <listitem> <para>bean behavioral configuration elements, which state how the ! bean should behave in the container (prototype or singleton, ! autowiring mode, initialization and destruction callbacks, and so forth).</para> </listitem> <listitem> *************** *** 262,266 **** </listitem> <listitem> ! <para>other beans which are needed for the bean to do its work, i.e. <emphasis>collaborators</emphasis> (also called dependencies).</para> </listitem> --- 262,266 ---- </listitem> <listitem> ! <para>other beans which are needed for the bean to do its work, that is <emphasis>collaborators</emphasis> (also called dependencies).</para> </listitem> *************** *** 624,636 **** <para> The basic principle behind <emphasis>Dependency Injection</emphasis> (DI) ! is that objects define their dependencies (i.e. the other objects they work ! with) only through constructor arguments, arguments to a factory method, or ! properties which are set on the object instance after it has been ! constructed or returned from a factory method. Then, it is the job of ! the container to actually <emphasis>inject</emphasis> those dependencies ! when it creates the bean. This is fundamentally the inverse, hence the ! name <emphasis>Inversion of Control</emphasis> (IoC), of the bean itself ! being in control of instantiating or locating its dependencies on its ! own using direct construction of classes, or something like the <emphasis>Service Locator</emphasis> pattern. </para> --- 624,636 ---- <para> The basic principle behind <emphasis>Dependency Injection</emphasis> (DI) ! is that objects define their dependencies (that is to say the other ! objects they work with) only through constructor arguments, arguments ! to a factory method, or properties which are set on the object instance ! after it has been constructed or returned from a factory method. Then, it ! is the job of the container to actually <emphasis>inject</emphasis> those ! dependencies when it creates the bean. This is fundamentally the inverse, ! hence the name <emphasis>Inversion of Control</emphasis> (IoC), of the bean ! itself being in control of instantiating or locating its dependencies on its ! own using direct construction of classes, or something like the <emphasis>Service Locator</emphasis> pattern. </para> *************** *** 693,697 **** private MovieFinder movieFinder; ! ]]><lineannotation>// a constructor so that the Spring container can 'inject' a <interfacename>MovieFinder</interfacename></lineannotation><![CDATA[ public SimpleMovieLister(MovieFinder movieFinder) { this.movieFinder = movieFinder; --- 693,697 ---- private MovieFinder movieFinder; ! ]]><lineannotation>// a constructor so that the Spring container can 'inject' a <interfacename>MovieFinder</interfacename></lineannotation><![CDATA[ public SimpleMovieLister(MovieFinder movieFinder) { this.movieFinder = movieFinder; *************** *** 738,742 **** convert properties from one format to another. However, most users of Spring will not be dealing with these classes directly ! (i.e. programmatically), but rather with an XML definition file which will be converted internally into instances of these classes, and used to load an entire Spring IoC container instance. --- 738,742 ---- convert properties from one format to another. However, most users of Spring will not be dealing with these classes directly ! (that is programmatically), but rather with an XML definition file which will be converted internally into instances of these classes, and used to load an entire Spring IoC container instance. *************** *** 786,802 **** </orderedlist> <para> ! It is important to realize that Spring validates the ! configuration of each bean in a container as the container ! is created, including the validation that properties which are ! bean references are actually referring to valid beans (i.e. the ! beans being referred to are also defined in the container. ! However, the bean properties themselves are not set until the ! bean <emphasis>is actually created</emphasis>. For that which ! are singleton-scoped and set to be pre-instantiated (such as singleton beans in an <interfacename>ApplicationContext</interfacename>), ! creation happens at the time that the container is created, but ! otherwise this is only when the bean is requested. When a bean ! actually has to be created, this will potentially cause a graph ! of other beans to be created, as its dependencies and its dependencies' dependencies (and so on) are created and assigned. </para> --- 786,798 ---- </orderedlist> <para> ! The Spring container validates the configuration of each bean as the container ! is created, including the validation that properties which are bean references ! are actually referring to valid beans. However, the bean properties themselves ! are not set until the bean <emphasis>is actually created</emphasis>. For those ! beans that are singleton-scoped and set to be pre-instantiated (such as singleton beans in an <interfacename>ApplicationContext</interfacename>), ! creation happens at the time that the container is created, but otherwise this is ! only when the bean is requested. When a bean actually has to be created, this will ! potentially cause a graph of other beans to be created, as its dependencies and its dependencies' dependencies (and so on) are created and assigned. </para> *************** *** 819,828 **** </sidebar> <para> ! You can generally trust Spring to do the right thing. It ! will detect mis-configuration issues, such as references to ! non-existent beans and circular dependencies, at container ! load-time. It will actually set properties and resolve ! dependencies (i.e. create those dependencies if needed) as late as ! possible, which is when the bean is actually created. This means that a Spring container which has loaded correctly can later generate an exception when you request a bean if there is a problem creating that --- 815,823 ---- </sidebar> <para> ! You can generally trust Spring to do the right thing. It will detect ! mis-configuration issues, such as references to non-existent beans and ! circular dependencies, at container load-time. It will actually set ! properties and resolve dependencies as late as possible, which is when ! the bean is actually created. This means that a Spring container which has loaded correctly can later generate an exception when you request a bean if there is a problem creating that *************** *** 836,840 **** <interfacename>ApplicationContext</interfacename> is created, not later. If you wish, you can still override this default behavior and set any of these ! singleton beans to lazy-initialize (i.e. not be pre-instantiated). </para> <para> --- 831,835 ---- <interfacename>ApplicationContext</interfacename> is created, not later. If you wish, you can still override this default behavior and set any of these ! singleton beans to lazy-initialize (that is not be pre-instantiated). </para> <para> *************** *** 943,955 **** ... } ! // a static factory method; the arguments to this method can be // considered the dependencies of the bean that is returned, ! // regardless of how those arguments are actually used. public static ExampleBean createInstance ( AnotherBean anotherBean, YetAnotherBean yetAnotherBean, int i) { ExampleBean eb = new ExampleBean (...); ! // some other operations ! ... return eb; } --- 938,950 ---- ... } ! ]]><lineannotation> // a static factory method; the arguments to this method can be // considered the dependencies of the bean that is returned, ! // regardless of how those arguments are actually used.</lineannotation><![CDATA[ public static ExampleBean createInstance ( AnotherBean anotherBean, YetAnotherBean yetAnotherBean, int i) { + ExampleBean eb = new ExampleBean (...); ! ]]><lineannotation>// some other operations...</lineannotation><![CDATA[ return eb; } *************** *** 978,982 **** is the order in which those arguments will be supplied to the appropriate constructor when it is being instantiated. Consider the ! following class... </para> <programlisting><![CDATA[package x.y; --- 973,977 ---- is the order in which those arguments will be supplied to the appropriate constructor when it is being instantiated. Consider the ! following class: </para> <programlisting><![CDATA[package x.y; *************** *** 985,989 **** public Foo(Bar bar, Baz baz) { ! // ... } }]]></programlisting> --- 980,984 ---- public Foo(Bar bar, Baz baz) { ! ]]><lineannotation>// ...</lineannotation><![CDATA[ } }]]></programlisting> *************** *** 992,997 **** and <classname>Baz</classname> classes are not related in an inheritance hierarchy). Thus the following configuration will work just fine, and you do not need to ! specify the constructor argument indexes and / or types explicitly... it just plain ! works as you would expect it to. </para> <programlisting><![CDATA[<beans> --- 987,991 ---- and <classname>Baz</classname> classes are not related in an inheritance hierarchy). Thus the following configuration will work just fine, and you do not need to ! specify the constructor argument indexes and / or types explicitly. </para> <programlisting><![CDATA[<beans> *************** *** 1011,1016 **** <literal><value>true<value></literal>, Spring cannot determine the type of the value, and so cannot match by type without ! help. Consider the following class, which is used for the following two ! sections: </para> <programlisting><![CDATA[package examples; --- 1005,1009 ---- <literal><value>true<value></literal>, Spring cannot determine the type of the value, and so cannot match by type without ! help. Consider the following class: </para> <programlisting><![CDATA[package examples; *************** *** 1050,1057 **** an index also solves the problem of ambiguity where a constructor may have two arguments of the same type. Note that the <emphasis>index is 0 based</emphasis>.</para> - <tip> - <para>Specifying a constructor argument index is the preferred way of performing - constructor IoC.</para> - </tip> </section> </section> --- 1043,1046 ---- *************** *** 1103,1108 **** <literal><value/></literal> elements. If you are reading this reference manual straight through from top to bottom (wow!) then we are getting slightly ahead of ourselves here, ! but did you know that you can specify a <classname>java.util.Properties</classname> ! instance like this?</para> <programlisting><![CDATA[<bean id="mappings" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> --- 1092,1096 ---- <literal><value/></literal> elements. If you are reading this reference manual straight through from top to bottom (wow!) then we are getting slightly ahead of ourselves here, ! but you can also configure a <classname>java.util.Properties</classname> instance like so:</para> <programlisting><![CDATA[<bean id="mappings" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> *************** *** 1213,1219 **** The main use of this bean reference variant is when you have a hierarchy of containers and you want to wrap an existing bean in a parent container ! with some sort of proxy which will have the same name as the parent bean ! (i.e. the bean definition in the child context is overriding the parent ! bean).</para> <programlisting><lineannotation><!-- in the parent context --></lineannotation><![CDATA[ <bean id="accountService" class="com.foo.SimpleAccountService"> --- 1201,1205 ---- The main use of this bean reference variant is when you have a hierarchy of containers and you want to wrap an existing bean in a parent container ! with some sort of proxy which will have the same name as the parent bean.</para> <programlisting><lineannotation><!-- in the parent context --></lineannotation><![CDATA[ <bean id="accountService" class="com.foo.SimpleAccountService"> *************** *** 1318,1322 **** have child-style <literal><list/></literal>, <literal><map/></literal>, <literal><set/></literal> or <literal><props/></literal> elements ! inherit and override values from the parent collection; i.e. the child collection's values will be the result obtained from the merging of the elements of the parent and child collections, with the child's collection elements overriding values --- 1304,1308 ---- have child-style <literal><list/></literal>, <literal><map/></literal>, <literal><set/></literal> or <literal><props/></literal> elements ! inherit and override values from the parent collection; that is to say the child collection's values will be the result obtained from the merging of the elements of the parent and child collections, with the child's collection elements overriding values *************** *** 1325,1331 **** parent-child bean mechanism. This concept has not yet been introduced, so readers unfamiliar with the concept of parent and child bean definitions ! may wish to read the corresponding section before continuing (see the ! section entitled <xref linkend="beans-child-bean-definitions" />).</emphasis></para> ! <para>An example would perhaps serve best to illustrate this feature:</para> <programlisting><![CDATA[<beans> <bean id="parent" abstract="true" class="example.ComplexObject"> --- 1311,1317 ---- parent-child bean mechanism. This concept has not yet been introduced, so readers unfamiliar with the concept of parent and child bean definitions ! may wish to read the <link linkend="beans-child-bean-definitions">relevant section</link> ! before continuing.</emphasis></para> ! <para>Find below an example of the collection merging feature:</para> <programlisting><![CDATA[<beans> <bean id="parent" abstract="true" class="example.ComplexObject"> *************** *** 1366,1370 **** <literal><map/></literal>, and <literal><set/></literal> collection types. In the specific case of the <literal><list/></literal> element, the ! semantics associated with the <classname>List</classname> collection type, i.e. the notion of an <literal>ordered</literal> collection of values, is maintained; the parent's values will precede all of the child list's values. In the --- 1352,1356 ---- <literal><map/></literal>, and <literal><set/></literal> collection types. In the specific case of the <literal><list/></literal> element, the ! semantics associated with the <classname>List</classname> collection type, that is the notion of an <literal>ordered</literal> collection of values, is maintained; the parent's values will precede all of the child list's values. In the *************** *** 1888,1893 **** <entry> <para>Dependency checking is performed for primitive types ! and collections (everything except collaborators, i.e. other ! beans)</para> </entry> </row> --- 1874,1878 ---- <entry> <para>Dependency checking is performed for primitive types ! and collections (everything except collaborators).</para> </entry> </row> *************** *** 1895,1899 **** <entry>object</entry> <entry> ! <para>Dependency checking is performed for collaborators only</para> </entry> </row> --- 1880,1884 ---- <entry>object</entry> <entry> ! <para>Dependency checking is performed for collaborators only.</para> </entry> </row> *************** *** 1902,1906 **** <entry> <para>Dependency checking is done for collaborators, primitive types ! and collections</para> </entry> </row> --- 1887,1891 ---- <entry> <para>Dependency checking is done for collaborators, primitive types ! and collections.</para> </entry> </row> *************** *** 2176,2180 **** <entry> <para>Scopes a single bean definition to the lifecycle of ! a single HTTP request; i.e. each and every HTTP request will have its own instance of a bean created off the back of a single bean definition. Only valid in the context of a --- 2161,2165 ---- <entry> <para>Scopes a single bean definition to the lifecycle of ! a single HTTP request; that is each and every HTTP request will have its own instance of a bean created off the back of a single bean definition. Only valid in the context of a *************** *** 2351,2358 **** <para>In order to effect the scoping of beans at the <literal>request</literal>, <literal>session</literal>, and <literal>global session</literal> levels ! (i.e. web-scoped beans), some minor initial configuration is required before you can set about defining your bean definitions. Please note that this extra setup is <emphasis>not</emphasis> required if you just want to use the ! 'standard' scopes; i.e. singleton and prototype.</para> <para>Now as things stand, there are a couple of ways to effect this initial setup depending on your particular servlet environment. If you are --- 2336,2343 ---- <para>In order to effect the scoping of beans at the <literal>request</literal>, <literal>session</literal>, and <literal>global session</literal> levels ! (web-scoped beans), some minor initial configuration is required before you can set about defining your bean definitions. Please note that this extra setup is <emphasis>not</emphasis> required if you just want to use the ! 'standard' scopes (namely singleton and prototype).</para> <para>Now as things stand, there are a couple of ways to effect this initial setup depending on your particular servlet environment. If you are *************** *** 3059,3066 **** <title>Bean definition inheritance</title> <para>A bean definition potentially contains a large amount of ! configuration information, including container specific information (i.e. ! initialization method, static factory method name, etc.) and constructor arguments and property values. A child bean definition is a bean ! definition which inherits configuration data from a parent definition. It is then able to override some values, or add others, as needed. Using parent and child bean definitions can potentially save a lot of typing. --- 3044,3051 ---- <title>Bean definition inheritance</title> <para>A bean definition potentially contains a large amount of ! configuration information, including container specific information (for example ! initialization method, static factory method name, and so forth) and constructor arguments and property values. A child bean definition is a bean ! definition that inherits configuration data from a parent definition. It is then able to override some values, or add others, as needed. Using parent and child bean definitions can potentially save a lot of typing. *************** *** 3091,3095 **** <para>A child bean definition will use the bean class from the parent definition if none is specified, but can also override it. In the latter ! case, the child bean class must be compatible with the parent, i.e. it must accept the parent's property values.</para> <para>A child bean definition will inherit constructor argument values, --- 3076,3080 ---- <para>A child bean definition will use the bean class from the parent definition if none is specified, but can also override it. In the latter ! case, the child bean class must be compatible with the parent, that is it must accept the parent's property values.</para> <para>A child bean definition will inherit constructor argument values, *************** *** 3176,3180 **** have instantiated a bean instance for you, and <emphasis>then</emphasis> <literal>BeanPostProcessors</literal> get a chance to do their stuff.</para> ! <para>If you want to change the actual bean definition (i.e. the recipe that defines the bean), then you rather need to use a <interfacename>BeanFactoryPostProcessor</interfacename> (described below in the --- 3161,3165 ---- have instantiated a bean instance for you, and <emphasis>then</emphasis> <literal>BeanPostProcessors</literal> get a chance to do their stuff.</para> ! <para>If you want to change the actual bean definition (that is the recipe that defines the bean), then you rather need to use a <interfacename>BeanFactoryPostProcessor</interfacename> (described below in the *************** *** 3314,3319 **** <interfacename>org.springframework.beans.factory.config.BeanFactoryPostProcessor</interfacename>. The semantics of this interface are similar to the <interfacename>BeanPostProcessor</interfacename>, ! with one major difference. <literal>BeanFactoryPostProcessors</literal> operate on ! bean definitions (i.e. the configuration metadata that is supplied to a container); that is to say, the Spring IoC container will allow <literal>BeanFactoryPostProcessors</literal> to read the configuration metadata and potentially change it <emphasis>before</emphasis> the --- 3299,3303 ---- <interfacename>org.springframework.beans.factory.config.BeanFactoryPostProcessor</interfacename>. The semantics of this interface are similar to the <interfacename>BeanPostProcessor</interfacename>, ! with one major difference. <literal>BeanFactoryPostProcessors</literal> operate on; that is to say, the Spring IoC container will allow <literal>BeanFactoryPostProcessors</literal> to read the configuration metadata and potentially change it <emphasis>before</emphasis> the *************** *** 3330,3334 **** <note> <para>If you want to change the actual bean <emphasis>instances</emphasis> ! (i.e. the objects that are created from the configuration metadata), then you rather need to use a <interfacename>BeanPostProcessor</interfacename> (described above in the section entitled --- 3314,3318 ---- <note> <para>If you want to change the actual bean <emphasis>instances</emphasis> ! (the objects that are created from the configuration metadata), then you rather need to use a <interfacename>BeanPostProcessor</interfacename> (described above in the section entitled *************** *** 3741,3750 **** </entry> <entry> ! <para>Event published when the <interfacename>ApplicationContext</interfacename> is initialized or refreshed. Initialized here means that all beans are loaded, singletons are pre-instantiated and the <interfacename>ApplicationContext</interfacename> is ready ! for use</para> </entry> </row> --- 3725,3734 ---- </entry> <entry> ! <para>Published when the <interfacename>ApplicationContext</interfacename> is initialized or refreshed. Initialized here means that all beans are loaded, singletons are pre-instantiated and the <interfacename>ApplicationContext</interfacename> is ready ! for use.</para> </entry> </row> *************** *** 3754,3761 **** </entry> <entry> ! <para>Event published when the <interfacename>ApplicationContext</interfacename> is closed, using the <methodname>close()</methodname> method on the <interfacename>ApplicationContext</interfacename>. Closed here means ! that singleton beans are destroyed</para> </entry> </row> --- 3738,3745 ---- </entry> <entry> ! <para>Published when the <interfacename>ApplicationContext</interfacename> is closed, using the <methodname>close()</methodname> method on the <interfacename>ApplicationContext</interfacename>. Closed here means ! that singleton beans (only!) are destroyed.</para> </entry> </row> *************** *** 3766,3773 **** <entry> <para>A web-specific event telling all beans that a HTTP ! request has been serviced (i.e. this will be published <emphasis>after</emphasis> the request has been finished). Note that this event is only applicable for web applications ! using Spring's <classname>DispatcherServlet</classname></para> </entry> </row> --- 3750,3757 ---- <entry> <para>A web-specific event telling all beans that a HTTP ! request has been serviced (this will be published <emphasis>after</emphasis> the request has been finished). Note that this event is only applicable for web applications ! using Spring's <classname>DispatcherServlet</classname>.</para> </entry> </row> *************** *** 3876,3880 **** <para>The location path or paths supplied to an <interfacename>ApplicationContext</interfacename> constructor are actually resource strings, and in simple form are ! treated appropriately to the specific context implementation (i.e. <classname>ClassPathXmlApplicationContext</classname> treats a simple location path as a classpath location), but may also be used with special prefixes to force --- 3860,3864 ---- <para>The location path or paths supplied to an <interfacename>ApplicationContext</interfacename> constructor are actually resource strings, and in simple form are ! treated appropriately to the specific context implementation ( <classname>ClassPathXmlApplicationContext</classname> treats a simple location path as a classpath location), but may also be used with special prefixes to force *************** *** 3959,3963 **** Spring IoC container.</para> <para>As another example, in a complex J2EE apps with multiple layers ! (i.e. various JAR files, EJBs, and WAR files packaged as an EAR), with each layer having its own Spring IoC container definition (effectively forming a hierarchy), the preferred approach when --- 3943,3947 ---- Spring IoC container.</para> <para>As another example, in a complex J2EE apps with multiple layers ! (various JAR files, EJBs, and WAR files packaged as an EAR), with each layer having its own Spring IoC container definition (effectively forming a hierarchy), the preferred approach when *************** *** 3977,3982 **** or <literal><ulink url="http://www.springframework.org/docs/api/org/springframework/beans/factory/access/SingletonBeanFactoryLocator.html">SingletonBeanFactoryLocator</ulink></literal> ! may be used to demand-load multiple hierarchical (i.e. one is a parent of ! another) Spring IoC container instances in an effectively singleton fashion, which may then be used as the parents of the web-application Spring IoC container instances. The result is that bean definitions for lower layers are --- 3961,3966 ---- or <literal><ulink url="http://www.springframework.org/docs/api/org/springframework/beans/factory/access/SingletonBeanFactoryLocator.html">SingletonBeanFactoryLocator</ulink></literal> ! may be used to demand-load multiple hierarchical (that is one container is the parent of ! another) Spring IoC container instances in a singleton fashion, which may then be used as the parents of the web-application Spring IoC container instances. The result is that bean definitions for lower layers are |
From: Rick Evans <springboy@us...> - 2007-03-31 15:52:21
|
Update of /cvsroot/springframework/spring/docs/reference/styles In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv5391/docs/reference/styles Modified Files: html.xsl html_chunk.xsl Log Message: CSS file is now referenced inline. Stops the CSS file not being resolved when the release docco is put on the main Spring website. Index: html_chunk.xsl =================================================================== RCS file: /cvsroot/springframework/spring/docs/reference/styles/html_chunk.xsl,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** html_chunk.xsl 5 Aug 2006 13:55:24 -0000 1.9 --- html_chunk.xsl 31 Mar 2007 15:52:00 -0000 1.10 *************** *** 16,20 **** <xsl:param name="chunk.section.depth">'5'</xsl:param> <xsl:param name="use.id.as.filename">'1'</xsl:param> ! <xsl:param name="html.stylesheet">../styles/html.css</xsl:param> <!-- These extensions are required for table printing and other stuff --> <xsl:param name="use.extensions">1</xsl:param> --- 16,20 ---- <xsl:param name="chunk.section.depth">'5'</xsl:param> <xsl:param name="use.id.as.filename">'1'</xsl:param> ! <xsl:param name="html.stylesheet">html.css</xsl:param> <!-- These extensions are required for table printing and other stuff --> <xsl:param name="use.extensions">1</xsl:param> Index: html.xsl =================================================================== RCS file: /cvsroot/springframework/spring/docs/reference/styles/html.xsl,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** html.xsl 9 Apr 2006 19:54:24 -0000 1.2 --- html.xsl 31 Mar 2007 15:52:00 -0000 1.3 *************** *** 21,25 **** ################################################### --> ! <xsl:param name="html.stylesheet">../styles/html.css</xsl:param> <!-- These extensions are required for table printing and other stuff --> --- 21,25 ---- ################################################### --> ! <xsl:param name="html.stylesheet">html.css</xsl:param> <!-- These extensions are required for table printing and other stuff --> |
From: Rick Evans <springboy@us...> - 2007-03-31 15:51:18
|
Update of /cvsroot/springframework/spring/docs/reference/styles In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv4939/docs/reference/styles Modified Files: html.css Log Message: Softer color for embedded code fragments (reads easier on the eye now). Index: html.css =================================================================== RCS file: /cvsroot/springframework/spring/docs/reference/styles/html.css,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** html.css 4 Nov 2006 09:54:57 -0000 1.29 --- html.css 31 Mar 2007 15:50:52 -0000 1.30 *************** *** 205,209 **** border-width: 1px; border-color: #CCCCCC; ! background-color: #F4F4F4; } --- 205,209 ---- border-width: 1px; border-color: #CCCCCC; ! background-color: #f3f5e9; } |
From: Juergen Hoeller <jhoeller@us...> - 2007-03-31 15:13:47
|
Update of /cvsroot/springframework/spring/src/org/springframework/web/servlet/view In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv22494/src/org/springframework/web/servlet/view Modified Files: AbstractTemplateView.java AbstractTemplateViewResolver.java Log Message: rearranged properties Index: AbstractTemplateViewResolver.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/web/servlet/view/AbstractTemplateViewResolver.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** AbstractTemplateViewResolver.java 7 Oct 2005 12:40:11 -0000 1.8 --- AbstractTemplateViewResolver.java 31 Mar 2007 15:13:42 -0000 1.9 *************** *** 1,4 **** /* ! * Copyright 2002-2005 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); --- 1,4 ---- /* ! * Copyright 2002-2007 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); *************** *** 18,25 **** /** ! * Abstract base class for template view resolvers like ! * VelocityViewResolver and FreeMarkerViewResolver. * ! * <p>Provides a convenient way to specify AbstractTemplateView's * exposure flags for request attributes, session attributes, * and Spring's macro helpers. --- 18,25 ---- /** ! * Abstract base class for template view resolvers, ! * in particular for Velocity and FreeMarker views. * ! * <p>Provides a convenient way to specify {@link AbstractTemplateView}'s * exposure flags for request attributes, session attributes, * and Spring's macro helpers. *************** *** 35,46 **** private boolean exposeRequestAttributes = false; - private boolean exposeSessionAttributes = false; - - private boolean exposeSpringMacroHelpers = false; - private boolean allowRequestOverride = false; private boolean allowSessionOverride = false; protected Class requiredViewClass() { --- 35,46 ---- private boolean exposeRequestAttributes = false; private boolean allowRequestOverride = false; + private boolean exposeSessionAttributes = false; + private boolean allowSessionOverride = false; + private boolean exposeSpringMacroHelpers = false; + protected Class requiredViewClass() { *************** *** 58,79 **** /** - * Set whether all HttpSession attributes should be added to the - * model prior to merging with the template. Default is "false". - * @see AbstractTemplateView#setExposeSessionAttributes - */ - public void setExposeSessionAttributes(boolean exposeSessionAttributes) { - this.exposeSessionAttributes = exposeSessionAttributes; - } - - /** - * Set whether to expose a RequestContext for use by Spring's macro library, - * under the name "springBindRequestContext". Default is "false". - * @see AbstractTemplateView#setExposeSpringMacroHelpers - */ - public void setExposeSpringMacroHelpers(boolean exposeSpringMacroHelpers) { - this.exposeSpringMacroHelpers = exposeSpringMacroHelpers; - } - - /** * Set whether HttpServletRequest attributes are allowed to override (hide) * controller generated model attributes of the same name. Default is "false", --- 58,61 ---- *************** *** 87,90 **** --- 69,81 ---- /** + * Set whether all HttpSession attributes should be added to the + * model prior to merging with the template. Default is "false". + * @see AbstractTemplateView#setExposeSessionAttributes + */ + public void setExposeSessionAttributes(boolean exposeSessionAttributes) { + this.exposeSessionAttributes = exposeSessionAttributes; + } + + /** * Set whether HttpSession attributes are allowed to override (hide) * controller generated model attributes of the same name. Default is "false", *************** *** 97,108 **** } protected AbstractUrlBasedView buildView(String viewName) throws Exception { AbstractTemplateView view = (AbstractTemplateView) super.buildView(viewName); view.setExposeRequestAttributes(this.exposeRequestAttributes); - view.setExposeSessionAttributes(this.exposeSessionAttributes); - view.setExposeSpringMacroHelpers(this.exposeSpringMacroHelpers); view.setAllowRequestOverride(this.allowRequestOverride); view.setAllowSessionOverride(this.allowSessionOverride); return view; } --- 88,108 ---- } + /** + * Set whether to expose a RequestContext for use by Spring's macro library, + * under the name "springMacroRequestContext". Default is "false". + * @see AbstractTemplateView#setExposeSpringMacroHelpers + */ + public void setExposeSpringMacroHelpers(boolean exposeSpringMacroHelpers) { + this.exposeSpringMacroHelpers = exposeSpringMacroHelpers; + } + protected AbstractUrlBasedView buildView(String viewName) throws Exception { AbstractTemplateView view = (AbstractTemplateView) super.buildView(viewName); view.setExposeRequestAttributes(this.exposeRequestAttributes); view.setAllowRequestOverride(this.allowRequestOverride); + view.setExposeSessionAttributes(this.exposeSessionAttributes); view.setAllowSessionOverride(this.allowSessionOverride); + view.setExposeSpringMacroHelpers(this.exposeSpringMacroHelpers); return view; } Index: AbstractTemplateView.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/web/servlet/view/AbstractTemplateView.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** AbstractTemplateView.java 20 Jun 2006 14:39:30 -0000 1.13 --- AbstractTemplateView.java 31 Mar 2007 15:13:42 -0000 1.14 *************** *** 1,4 **** /* ! * Copyright 2002-2006 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); --- 1,4 ---- /* ! * Copyright 2002-2007 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); *************** *** 58,62 **** // is available. try { ! ServletResponse.class.getMethod("getContentType", new Class[] {}); responseGetContentTypeAvailable = true; } --- 58,62 ---- // is available. try { ! ServletResponse.class.getMethod("getContentType", new Class[0]); responseGetContentTypeAvailable = true; } *************** *** 66,79 **** } private boolean exposeRequestAttributes = false; private boolean exposeSessionAttributes = false; - private boolean exposeSpringMacroHelpers = false; - - private boolean allowRequestOverride = false; - private boolean allowSessionOverride = false; /** --- 66,80 ---- } + private boolean exposeRequestAttributes = false; + private boolean allowRequestOverride = false; + private boolean exposeSessionAttributes = false; private boolean allowSessionOverride = false; + private boolean exposeSpringMacroHelpers = false; + /** *************** *** 86,97 **** /** - * Set whether all HttpSession attributes should be added to the - * model prior to merging with the template. Default is "false". - */ - public void setExposeSessionAttributes(boolean exposeSessionAttributes) { - this.exposeSessionAttributes = exposeSessionAttributes; - } - - /** * Set whether HttpServletRequest attributes are allowed to override (hide) * controller generated model attributes of the same name. Default is "false", --- 87,90 ---- *************** *** 102,106 **** this.allowRequestOverride = allowRequestOverride; } ! /** * Set whether HttpSession attributes are allowed to override (hide) --- 95,107 ---- this.allowRequestOverride = allowRequestOverride; } ! ! /** ! * Set whether all HttpSession attributes should be added to the ! * model prior to merging with the template. Default is "false". ! */ ! public void setExposeSessionAttributes(boolean exposeSessionAttributes) { ! this.exposeSessionAttributes = exposeSessionAttributes; ! } ! /** * Set whether HttpSession attributes are allowed to override (hide) *************** *** 117,122 **** * under the name "springMacroRequestContext". Default is "false". * <p>Currently needed for Spring's Velocity and FreeMarker default macros. ! * Note that this is <b>not</b> required for templates that use HTML ! * forms <b>unless</b> you wish to take advantage of the Spring helper macros. * @see #SPRING_MACRO_REQUEST_CONTEXT_ATTRIBUTE */ --- 118,123 ---- * under the name "springMacroRequestContext". Default is "false". * <p>Currently needed for Spring's Velocity and FreeMarker default macros. ! * Note that this is <i>not</i> required for templates that use HTML ! * forms <i>unless</i> you wish to take advantage of the Spring helper macros. * @see #SPRING_MACRO_REQUEST_CONTEXT_ATTRIBUTE */ *************** *** 170,174 **** "' because of an existing model object of the same name"); } ! // expose RequestContext instance for Spring macros model.put(SPRING_MACRO_REQUEST_CONTEXT_ATTRIBUTE, new RequestContext(request, model)); } --- 171,175 ---- "' because of an existing model object of the same name"); } ! // Expose RequestContext instance for Spring macros. model.put(SPRING_MACRO_REQUEST_CONTEXT_ATTRIBUTE, new RequestContext(request, model)); } |
From: Rick Evans <springboy@us...> - 2007-03-31 15:09:43
|
Update of /cvsroot/springframework/spring/docs/reference/src/images In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv21147/docs/reference/src/images Modified Files: container-magic.png Log Message: Removed use of word 'magic' (has negative connotations). Index: container-magic.png =================================================================== RCS file: /cvsroot/springframework/spring/docs/reference/src/images/container-magic.png,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsA05Al4 and /tmp/cvsy2Wnc4 differ |
From: Juergen Hoeller <jhoeller@us...> - 2007-03-31 14:53:50
|
Update of /cvsroot/springframework/spring/src/org/springframework/beans/factory/support In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv14550/src/org/springframework/beans/factory/support Modified Files: ConstructorResolver.java AbstractAutowireCapableBeanFactory.java BeanDefinitionValueResolver.java AbstractBeanFactory.java Log Message: support registration of shared editors, to allow for specific synchronization on individual editor instances Index: ConstructorResolver.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/beans/factory/support/ConstructorResolver.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** ConstructorResolver.java 29 Mar 2007 10:33:07 -0000 1.20 --- ConstructorResolver.java 31 Mar 2007 14:53:46 -0000 1.21 *************** *** 420,426 **** try { Object originalValue = valueHolder.getValue(); ! Object convertedValue = ! this.beanFactory.doTypeConversionIfNecessary(bw, originalValue, ! paramTypes[index], MethodParameter.forMethodOrConstructor(methodOrCtor, index)); args.arguments[index] = convertedValue; ConstructorArgumentValues.ValueHolder sourceHolder = --- 420,425 ---- try { Object originalValue = valueHolder.getValue(); ! Object convertedValue = bw.convertIfNecessary(originalValue, paramTypes[index], ! MethodParameter.forMethodOrConstructor(methodOrCtor, index)); args.arguments[index] = convertedValue; ConstructorArgumentValues.ValueHolder sourceHolder = Index: AbstractBeanFactory.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/beans/factory/support/AbstractBeanFactory.java,v retrieving revision 1.166 retrieving revision 1.167 diff -C2 -d -r1.166 -r1.167 *** AbstractBeanFactory.java 28 Mar 2007 21:19:05 -0000 1.166 --- AbstractBeanFactory.java 31 Mar 2007 14:53:46 -0000 1.167 *************** *** 33,40 **** import org.springframework.beans.PropertyEditorRegistry; import org.springframework.beans.PropertyEditorRegistrySupport; - import org.springframework.beans.PropertyValues; import org.springframework.beans.SimpleTypeConverter; import org.springframework.beans.TypeConverter; - import org.springframework.beans.TypeMismatchException; import org.springframework.beans.factory.BeanCreationException; import org.springframework.beans.factory.BeanCurrentlyInCreationException; --- 33,38 ---- *************** *** 59,63 **** import org.springframework.beans.factory.config.Scope; import org.springframework.core.CollectionFactory; - import org.springframework.core.MethodParameter; import org.springframework.util.Assert; import org.springframework.util.ClassUtils; --- 57,60 ---- *************** *** 836,841 **** */ protected void registerCustomEditors(PropertyEditorRegistry registry) { ! if (registry instanceof PropertyEditorRegistrySupport) { ! ((PropertyEditorRegistrySupport) registry).useConfigValueEditors(); } for (Iterator it = this.propertyEditorRegistrars.iterator(); it.hasNext();) { --- 833,840 ---- */ protected void registerCustomEditors(PropertyEditorRegistry registry) { ! PropertyEditorRegistrySupport registrySupport = ! (registry instanceof PropertyEditorRegistrySupport ? (PropertyEditorRegistrySupport) registry : null); ! if (registrySupport != null) { ! registrySupport.useConfigValueEditors(); } for (Iterator it = this.propertyEditorRegistrars.iterator(); it.hasNext();) { *************** *** 847,899 **** Class clazz = (Class) entry.getKey(); PropertyEditor editor = (PropertyEditor) entry.getValue(); ! registry.registerCustomEditor(clazz, editor); ! } ! } ! ! /** ! * Apply the given property values to the given bean. ! * @param bw the BeanWrapper that wraps the bean ! * @param pv the PropertyValues to apply ! */ ! protected void applyPropertyValues(BeanWrapper bw, PropertyValues pv) { ! // Synchronize if custom editors are registered. ! // Necessary because PropertyEditors are not thread-safe. ! if (!this.customEditors.isEmpty()) { ! synchronized (this.customEditors) { ! bw.setPropertyValues(pv); } ! } ! else { ! bw.setPropertyValues(pv); ! } ! } ! ! /** ! * Convert the given value into the specified target type, ! * using the specified BeanWrapper. ! * @param converter the TypeConverter to work on ! * @param value the original value ! * @param targetType the target type to convert to ! * (or <code>null</code> if not known, for example in case of a collection element) ! * @param methodParam the method parameter that is the target of the conversion ! * (for analysis of generic types; may be <code>null</code>) ! * @return the converted value, matching the target type ! * @throws org.springframework.beans.TypeMismatchException if type conversion failed ! * @see org.springframework.beans.BeanWrapperImpl#convertIfNecessary(Object, Class) ! */ ! protected Object doTypeConversionIfNecessary( ! TypeConverter converter, Object value, Class targetType, MethodParameter methodParam) ! throws TypeMismatchException { ! ! // Synchronize if custom editors are registered. ! // Necessary because PropertyEditors are not thread-safe. ! if (!this.customEditors.isEmpty()) { ! synchronized (this.customEditors) { ! return converter.convertIfNecessary(value, targetType, methodParam); } } - else { - return converter.convertIfNecessary(value, targetType, methodParam); - } } --- 846,858 ---- Class clazz = (Class) entry.getKey(); PropertyEditor editor = (PropertyEditor) entry.getValue(); ! // Register the editor as shared instance, if possible, ! // to make it clear that it might be used concurrently. ! if (registrySupport != null) { ! registrySupport.registerSharedEditor(clazz, editor); } ! else { ! registry.registerCustomEditor(clazz, editor); } } } Index: BeanDefinitionValueResolver.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/beans/factory/support/BeanDefinitionValueResolver.java,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** BeanDefinitionValueResolver.java 28 Mar 2007 20:28:13 -0000 1.25 --- BeanDefinitionValueResolver.java 31 Mar 2007 14:53:46 -0000 1.26 *************** *** 162,167 **** Class resolvedTargetType = resolveTargetType(typedStringValue); if (resolvedTargetType != null) { ! return this.beanFactory.doTypeConversionIfNecessary( ! this.typeConverter, typedStringValue.getValue(), resolvedTargetType, null); } else { --- 162,166 ---- Class resolvedTargetType = resolveTargetType(typedStringValue); if (resolvedTargetType != null) { ! return this.typeConverter.convertIfNecessary(typedStringValue.getValue(), resolvedTargetType, null); } else { Index: AbstractAutowireCapableBeanFactory.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/beans/factory/support/AbstractAutowireCapableBeanFactory.java,v retrieving revision 1.135 retrieving revision 1.136 diff -C2 -d -r1.135 -r1.136 *** AbstractAutowireCapableBeanFactory.java 29 Mar 2007 21:10:02 -0000 1.135 --- AbstractAutowireCapableBeanFactory.java 31 Mar 2007 14:53:46 -0000 1.136 *************** *** 1101,1105 **** // Set our (possibly massaged) deep copy. try { ! applyPropertyValues(bw, new MutablePropertyValues(deepCopy)); } catch (BeansException ex) { --- 1101,1105 ---- // Set our (possibly massaged) deep copy. try { ! bw.setPropertyValues(new MutablePropertyValues(deepCopy)); } catch (BeansException ex) { |
From: Juergen Hoeller <jhoeller@us...> - 2007-03-31 14:53:50
|
Update of /cvsroot/springframework/spring/src/org/springframework/beans In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv14550/src/org/springframework/beans Modified Files: TypeConverterDelegate.java PropertyEditorRegistrySupport.java Log Message: support registration of shared editors, to allow for specific synchronization on individual editor instances Index: PropertyEditorRegistrySupport.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/beans/PropertyEditorRegistrySupport.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** PropertyEditorRegistrySupport.java 28 Mar 2007 20:14:15 -0000 1.17 --- PropertyEditorRegistrySupport.java 31 Mar 2007 14:53:46 -0000 1.18 *************** *** 26,29 **** --- 26,30 ---- import java.util.Collection; import java.util.HashMap; + import java.util.HashSet; import java.util.Iterator; import java.util.LinkedList; *************** *** 84,87 **** --- 85,90 ---- private Map customEditors; + private Set sharedEditors; + private Map customEditorCache; *************** *** 245,248 **** --- 248,276 ---- } + /** + * Register the given custom property editor for all properties + * of the given type, indicating that the given instance is a + * shared editor that might be used concurrently. + * @param requiredType the type of the property + * @param propertyEditor the shared editor to register + */ + public void registerSharedEditor(Class requiredType, PropertyEditor propertyEditor) { + registerCustomEditor(requiredType, null, propertyEditor); + if (this.sharedEditors == null) { + this.sharedEditors = new HashSet(); + } + this.sharedEditors.add(propertyEditor); + } + + /** + * Check whether the given editor instance is a shared editor, that is, + * whether the given editor instance might be used concurrently. + * @param propertyEditor the editor instance to check + * @return whether the editor is a shared instance + */ + public boolean isSharedEditor(PropertyEditor propertyEditor) { + return (this.sharedEditors != null && this.sharedEditors.contains(propertyEditor)); + } + public PropertyEditor findCustomEditor(Class requiredType, String propertyPath) { if (this.customEditors == null) { *************** *** 329,332 **** --- 357,361 ---- * try custom editor for superclass (which will in any case be able * to render a value as String via <code>getAsText</code>). + * @param requiredType the type to look for * @return the custom editor, or <code>null</code> if none found for this type * @see java.beans.PropertyEditor#getAsText() Index: TypeConverterDelegate.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/beans/TypeConverterDelegate.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** TypeConverterDelegate.java 29 Mar 2007 11:35:53 -0000 1.14 --- TypeConverterDelegate.java 31 Mar 2007 14:53:46 -0000 1.15 *************** *** 82,86 **** /** * Convert the value to the specified required type. ! * @param newValue proposed change value * @param requiredType the type we must convert to * (or <code>null</code> if not known, for example in case of a collection element) --- 82,86 ---- /** * Convert the value to the specified required type. ! * @param newValue the proposed new value * @param requiredType the type we must convert to * (or <code>null</code> if not known, for example in case of a collection element) *************** *** 94,98 **** /** * Convert the value to the specified required type. ! * @param newValue proposed change value * @param requiredType the type we must convert to * (or <code>null</code> if not known, for example in case of a collection element) --- 94,98 ---- /** * Convert the value to the specified required type. ! * @param newValue the proposed new value * @param requiredType the type we must convert to * (or <code>null</code> if not known, for example in case of a collection element) *************** *** 111,116 **** * Convert the value to the required type for the specified property. * @param propertyName name of the property ! * @param oldValue previous value, if available (may be <code>null</code>) ! * @param newValue proposed change value * @param requiredType the type we must convert to * (or <code>null</code> if not known, for example in case of a collection element) --- 111,116 ---- * Convert the value to the required type for the specified property. * @param propertyName name of the property ! * @param oldValue the previous value, if available (may be <code>null</code>) ! * @param newValue the proposed new value * @param requiredType the type we must convert to * (or <code>null</code> if not known, for example in case of a collection element) *************** *** 127,132 **** /** * Convert the value to the required type for the specified property. ! * @param oldValue previous value, if available (may be <code>null</code>) ! * @param newValue proposed change value * @param descriptor the JavaBeans descriptor for the property * @return the new value, possibly the result of type conversion --- 127,132 ---- /** * Convert the value to the required type for the specified property. ! * @param oldValue the previous value, if available (may be <code>null</code>) ! * @param newValue the proposed new value * @param descriptor the JavaBeans descriptor for the property * @return the new value, possibly the result of type conversion *************** *** 146,151 **** * for the specified property. * @param propertyName name of the property ! * @param oldValue previous value, if available (may be <code>null</code>) ! * @param newValue proposed change value * @param requiredType the type we must convert to * (or <code>null</code> if not known, for example in case of a collection element) --- 146,151 ---- * for the specified property. * @param propertyName name of the property ! * @param oldValue the previous value, if available (may be <code>null</code>) ! * @param newValue the proposed new value * @param requiredType the type we must convert to * (or <code>null</code> if not known, for example in case of a collection element) *************** *** 164,194 **** // Custom editor for this type? ! PropertyEditor pe = this.propertyEditorRegistry.findCustomEditor(requiredType, propertyName); // Value not of required type? ! if (pe != null || (requiredType != null && !ClassUtils.isAssignableValue(requiredType, convertedValue))) { ! if (pe == null && descriptor != null) { if (JdkVersion.isAtLeastJava15()) { ! pe = descriptor.createPropertyEditor(this.targetObject); } else { Class editorClass = descriptor.getPropertyEditorClass(); if (editorClass != null) { ! pe = (PropertyEditor) BeanUtils.instantiateClass(editorClass); } } } ! if (pe == null && requiredType != null) { // No custom editor -> check BeanWrapperImpl's default editors. ! pe = (PropertyEditor) this.propertyEditorRegistry.getDefaultEditor(requiredType); ! if (pe == null && !unknownEditorTypes.containsKey(requiredType)) { // No BeanWrapper default editor -> check standard JavaBean editors. ! pe = PropertyEditorManager.findEditor(requiredType); ! if (pe == null) { unknownEditorTypes.put(requiredType, Boolean.TRUE); } } } ! convertedValue = convertValue(convertedValue, requiredType, pe, oldValue); } --- 164,194 ---- // Custom editor for this type? ! PropertyEditor editor = this.propertyEditorRegistry.findCustomEditor(requiredType, propertyName); // Value not of required type? ! if (editor != null || (requiredType != null && !ClassUtils.isAssignableValue(requiredType, convertedValue))) { ! if (editor == null && descriptor != null) { if (JdkVersion.isAtLeastJava15()) { ! editor = descriptor.createPropertyEditor(this.targetObject); } else { Class editorClass = descriptor.getPropertyEditorClass(); if (editorClass != null) { ! editor = (PropertyEditor) BeanUtils.instantiateClass(editorClass); } } } ! if (editor == null && requiredType != null) { // No custom editor -> check BeanWrapperImpl's default editors. ! editor = (PropertyEditor) this.propertyEditorRegistry.getDefaultEditor(requiredType); ! if (editor == null && !unknownEditorTypes.containsKey(requiredType)) { // No BeanWrapper default editor -> check standard JavaBean editors. ! editor = PropertyEditorManager.findEditor(requiredType); ! if (editor == null) { unknownEditorTypes.put(requiredType, Boolean.TRUE); } } } ! convertedValue = doConvertValue(oldValue, convertedValue, requiredType, editor); } *************** *** 235,253 **** } ! protected Object convertValue(Object newValue, Class requiredType, PropertyEditor pe, Object oldValue) { Object convertedValue = newValue; ! if (pe != null && !(convertedValue instanceof String)) { // Not a String -> use PropertyEditor's setValue. // With standard PropertyEditors, this will return the very same object; // we just want to allow special PropertyEditors to override setValue // for type conversion from non-String values to the required type. ! pe.setValue(convertedValue); ! Object newConvertedValue = pe.getValue(); if (newConvertedValue != convertedValue) { convertedValue = newConvertedValue; // Reset PropertyEditor: It already did a proper conversion. // Don't use it again for a setAsText call. ! pe = null; } } --- 235,278 ---- } ! /** ! * Convert the value to the required type (if necessary from a String), ! * using the given property editor. ! * @param oldValue the previous value, if available (may be <code>null</code>) ! * @param newValue the proposed new value ! * @param requiredType the type we must convert to ! * (or <code>null</code> if not known, for example in case of a collection element) ! * @param editor the PropertyEditor to use ! * @return the new value, possibly the result of type conversion ! * @throws IllegalArgumentException if type conversion failed ! */ ! protected Object doConvertValue(Object oldValue, Object newValue, Class requiredType, PropertyEditor editor) { Object convertedValue = newValue; + boolean sharedEditor = false; ! if (editor != null) { ! sharedEditor = this.propertyEditorRegistry.isSharedEditor(editor); ! } ! ! if (editor != null && !(convertedValue instanceof String)) { // Not a String -> use PropertyEditor's setValue. // With standard PropertyEditors, this will return the very same object; // we just want to allow special PropertyEditors to override setValue // for type conversion from non-String values to the required type. ! Object newConvertedValue = null; ! if (sharedEditor) { ! synchronized (editor) { ! editor.setValue(convertedValue); ! newConvertedValue = editor.getValue(); ! } ! } ! else { ! editor.setValue(convertedValue); ! newConvertedValue = editor.getValue(); ! } if (newConvertedValue != convertedValue) { convertedValue = newConvertedValue; // Reset PropertyEditor: It already did a proper conversion. // Don't use it again for a setAsText call. ! editor = null; } } *************** *** 263,274 **** } ! if (pe != null && convertedValue instanceof String) { // Use PropertyEditor's setAsText in case of a String value. if (logger.isTraceEnabled()) { ! logger.trace("Converting String to [" + requiredType + "] using property editor [" + pe + "]"); } - pe.setValue(oldValue); - pe.setAsText((String) convertedValue); - convertedValue = pe.getValue(); } --- 288,307 ---- } ! if (editor != null && convertedValue instanceof String) { // Use PropertyEditor's setAsText in case of a String value. if (logger.isTraceEnabled()) { ! logger.trace("Converting String to [" + requiredType + "] using property editor [" + editor + "]"); ! } ! String newTextValue = (String) convertedValue; ! if (sharedEditor) { ! // Synchronized access to shared editor instance. ! synchronized (editor) { ! return doConvertTextValue(oldValue, newTextValue, editor); ! } ! } ! else { ! // Unsynchronized access to shared editor instance. ! return doConvertTextValue(oldValue, newTextValue, editor); } } *************** *** 276,279 **** --- 309,325 ---- } + /** + * Convert the given text value using the given property editor. + * @param oldValue the previous value, if available (may be <code>null</code>) + * @param newTextValue the proposed text value + * @param editor the PropertyEditor to use + * @return the converted value + */ + protected Object doConvertTextValue(Object oldValue, String newTextValue, PropertyEditor editor) { + editor.setValue(oldValue); + editor.setAsText(newTextValue); + return editor.getValue(); + } + protected Object convertToTypedArray(Object input, String propertyName, Class componentType) { if (input instanceof Collection) { |
From: Juergen Hoeller <jhoeller@us...> - 2007-03-31 14:53:28
|
Update of /cvsroot/springframework/spring/src/org/springframework/beans In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv14527/src/org/springframework/beans Modified Files: PropertyEditorRegistry.java Log Message: polishing Index: PropertyEditorRegistry.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/beans/PropertyEditorRegistry.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PropertyEditorRegistry.java 24 Dec 2006 12:20:58 -0000 1.4 --- PropertyEditorRegistry.java 31 Mar 2007 14:53:24 -0000 1.5 *************** *** 1,4 **** /* ! * Copyright 2002-2006 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); --- 1,4 ---- /* ! * Copyright 2002-2007 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); *************** *** 24,34 **** * * <p>Extended by {@link BeanWrapper}; implemented by {@link BeanWrapperImpl} ! * and {@link org.springframework.validation.DataBinder}. * * @author Juergen Hoeller * @since 1.2.6 * @see PropertyEditorRegistrar * @see BeanWrapper - * @see BeanWrapperImpl * @see org.springframework.validation.DataBinder */ --- 24,34 ---- * * <p>Extended by {@link BeanWrapper}; implemented by {@link BeanWrapperImpl} ! * and {@link org.springframework.validation.DataBinder}. * * @author Juergen Hoeller * @since 1.2.6 + * @see java.beans.PropertyEditor * @see PropertyEditorRegistrar * @see BeanWrapper * @see org.springframework.validation.DataBinder */ *************** *** 38,43 **** * Register the given custom property editor for all properties * of the given type. ! * @param requiredType type of the property ! * @param propertyEditor editor to register */ void registerCustomEditor(Class requiredType, PropertyEditor propertyEditor); --- 38,43 ---- * Register the given custom property editor for all properties * of the given type. ! * @param requiredType the type of the property ! * @param propertyEditor the editor to register */ void registerCustomEditor(Class requiredType, PropertyEditor propertyEditor); *************** *** 57,63 **** * (for all values n), you would use "items.quality" as the value of the * 'propertyPath' argument to this method. ! * @param requiredType type of the property (can be <code>null</code> if a property * is given but should be specified in any case for consistency checking) ! * @param propertyPath path of the property (name or nested path), or * <code>null</code> if registering an editor for all properties of the given type * @param propertyEditor editor to register --- 57,63 ---- * (for all values n), you would use "items.quality" as the value of the * 'propertyPath' argument to this method. ! * @param requiredType the type of the property (can be <code>null</code> if a property * is given but should be specified in any case for consistency checking) ! * @param propertyPath the path of the property (name or nested path), or * <code>null</code> if registering an editor for all properties of the given type * @param propertyEditor editor to register *************** *** 67,73 **** /** * Find a custom property editor for the given type and property. ! * @param requiredType type of the property (can be <code>null</code> if a property * is given but should be specified in any case for consistency checking) ! * @param propertyPath path of the property (name or nested path), or * <code>null</code> if looking for an editor for all properties of the given type * @return the registered editor, or <code>null</code> if none --- 67,73 ---- /** * Find a custom property editor for the given type and property. ! * @param requiredType the type of the property (can be <code>null</code> if a property * is given but should be specified in any case for consistency checking) ! * @param propertyPath the path of the property (name or nested path), or * <code>null</code> if looking for an editor for all properties of the given type * @return the registered editor, or <code>null</code> if none |
From: Rick Evans <springboy@us...> - 2007-03-31 14:14:43
|
Update of /cvsroot/springframework/spring-projects/spring-ws-core/docs/reference/src/images In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv27550/spring-ws-core/docs/reference/src/images Added Files: .cvsignore banner4.jpg i21-banner-rhs.jpg logo.gif logo.jpg logo.psd logo.xcf xdev-spring_logo.jpg Log Message: Added Spring and I21 logos to the SWS reference docco. --- NEW FILE: logo.xcf --- (This appears to be a binary file; contents omitted.) --- NEW FILE: .cvsignore --- Thumbs.db --- NEW FILE: banner4.jpg --- (This appears to be a binary file; contents omitted.) --- NEW FILE: logo.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: logo.psd --- (This appears to be a binary file; contents omitted.) --- NEW FILE: xdev-spring_logo.jpg --- (This appears to be a binary file; contents omitted.) --- NEW FILE: logo.jpg --- (This appears to be a binary file; contents omitted.) --- NEW FILE: i21-banner-rhs.jpg --- (This appears to be a binary file; contents omitted.) |
From: Rick Evans <springboy@us...> - 2007-03-31 14:11:47
|
Update of /cvsroot/springframework/spring-projects/spring-ws-core/docs/reference/styles In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv22548/spring-ws-core/docs/reference/styles Modified Files: html.css html.xsl html_chunk.xsl Log Message: Branded the SWS reference docco to look like the main (core) Spring reference docco. Index: html_chunk.xsl =================================================================== RCS file: /cvsroot/springframework/spring-projects/spring-ws-core/docs/reference/styles/html_chunk.xsl,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** html_chunk.xsl 14 Feb 2006 16:21:12 -0000 1.1 --- html_chunk.xsl 31 Mar 2007 14:08:38 -0000 1.2 *************** *** 1,38 **** ! <?xml version="1.0"?> ! <!-- ! ! This is the XSL HTML configuration file for the Hibernate ! Reference Documentation. ! ! It took me days to figure out this stuff and fix most of ! the obvious bugs in the DocBook XSL distribution, so if you ! use this stylesheet, give some credit back to the Hibernate ! project. ! ! christian.bauer@... --> - <!DOCTYPE xsl:stylesheet [ <!ENTITY db_xsl_path "../lib/docbook-xsl/"> ! <!ENTITY callout_gfx_path "../images/callouts/"> ! <!ENTITY admon_gfx_path "../html/images/admons/"> ]> ! ! <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; ! version="1.0" ! xmlns="http://www.w3.org/TR/xhtml1/transitional"; ! exclude-result-prefixes="#default"> ! ! <xsl:import href="&db_xsl_path;/html/chunk.xsl"/> ! ! <!--################################################### HTML Settings ! ################################################### --> ! <xsl:param name="chunk.section.depth">'5'</xsl:param> <xsl:param name="use.id.as.filename">'1'</xsl:param> ! <xsl:param name="html.stylesheet">../styles/html.css</xsl:param> ! <!-- These extensions are required for table printing and other stuff --> <xsl:param name="use.extensions">1</xsl:param> --- 1,20 ---- ! <?xml version="1.0" ?> <!-- ! This is the XSL HTML configuration file for the Spring Web Services Reference Documentation. --> <!DOCTYPE xsl:stylesheet [ <!ENTITY db_xsl_path "../lib/docbook-xsl/"> ! <!ENTITY callout_gfx_path "images/callouts/"> ! <!ENTITY admon_gfx_path "images/admons/"> ]> ! <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; version="1.0" ! xmlns="http://www.w3.org/TR/xhtml1/transitional"; exclude-result-prefixes="#default"> ! <xsl:import href="&db_xsl_path;/html/chunk.xsl" /> ! <!--################################################### HTML Settings ! ################################################### --> <xsl:param name="chunk.section.depth">'5'</xsl:param> <xsl:param name="use.id.as.filename">'1'</xsl:param> ! <xsl:param name="html.stylesheet">html.css</xsl:param> <!-- These extensions are required for table printing and other stuff --> <xsl:param name="use.extensions">1</xsl:param> *************** *** 40,88 **** <xsl:param name="callout.extensions">1</xsl:param> <xsl:param name="graphicsize.extension">0</xsl:param> ! ! <!--################################################### Table Of Contents ! ################################################### --> ! <!-- Generate the TOCs for named components only --> <xsl:param name="generate.toc"> book toc </xsl:param> - <!-- Show only Sections up to level 3 in the TOCs --> <xsl:param name="toc.section.depth">3</xsl:param> ! ! <!--################################################### Labels ! ################################################### --> ! <!-- Label Chapters and Sections (numbering) --> <xsl:param name="chapter.autolabel">1</xsl:param> ! <xsl:param name="section.autolabel" select="1"/> ! <xsl:param name="section.label.includes.component.label" select="1"/> ! ! <!--################################################### Callouts ! ################################################### --> ! <!-- Use images for callouts instead of (1) (2) (3) --> <xsl:param name="callout.graphics">1</xsl:param> <xsl:param name="callout.graphics.path">&callout_gfx_path;</xsl:param> - <!-- Place callout marks at this column in annotated areas --> <xsl:param name="callout.defaultcolumn">90</xsl:param> ! ! <!--################################################### Admonitions ! ################################################### --> ! <!-- Use nice graphics for admonitions --> <xsl:param name="admon.graphics">'1'</xsl:param> <xsl:param name="admon.graphics.path">&admon_gfx_path;</xsl:param> ! ! <!--################################################### Misc ! ################################################### --> ! <!-- Placement of titles --> <xsl:param name="formal.title.placement"> --- 22,58 ---- <xsl:param name="callout.extensions">1</xsl:param> <xsl:param name="graphicsize.extension">0</xsl:param> ! <!--################################################### Table Of Contents ! ################################################### --> <!-- Generate the TOCs for named components only --> <xsl:param name="generate.toc"> book toc </xsl:param> <!-- Show only Sections up to level 3 in the TOCs --> <xsl:param name="toc.section.depth">3</xsl:param> ! <!--################################################### Labels ! ################################################### --> <!-- Label Chapters and Sections (numbering) --> <xsl:param name="chapter.autolabel">1</xsl:param> ! <xsl:param name="section.autolabel" select="1" /> ! <xsl:param name="section.label.includes.component.label" select="1" /> ! <!--################################################### Callouts ! ################################################### --> <!-- Use images for callouts instead of (1) (2) (3) --> <xsl:param name="callout.graphics">1</xsl:param> <xsl:param name="callout.graphics.path">&callout_gfx_path;</xsl:param> <!-- Place callout marks at this column in annotated areas --> <xsl:param name="callout.defaultcolumn">90</xsl:param> ! <!--################################################### Admonitions ! ################################################### --> <!-- Use nice graphics for admonitions --> <xsl:param name="admon.graphics">'1'</xsl:param> <xsl:param name="admon.graphics.path">&admon_gfx_path;</xsl:param> ! <!--################################################### Misc ! ################################################### --> <!-- Placement of titles --> <xsl:param name="formal.title.placement"> *************** *** 92,96 **** table before procedure before ! </xsl:param> ! </xsl:stylesheet> --- 62,217 ---- table before procedure before ! </xsl:param> ! <xsl:template match="author" mode="titlepage.mode"> ! <xsl:if test="name(preceding-sibling::*[1]) = 'author'"> ! <xsl:text>, </xsl:text> ! </xsl:if> ! <span class="{name(.)}"> ! <xsl:call-template name="person.name" /> ! <xsl:apply-templates mode="titlepage.mode" select="./contrib" /> ! <xsl:apply-templates mode="titlepage.mode" select="./affiliation" /> ! </span> ! </xsl:template> ! <xsl:template match="authorgroup" mode="titlepage.mode"> ! <div class="{name(.)}"> ! <h2>Authors</h2> ! <p /> ! <xsl:apply-templates mode="titlepage.mode" /> ! </div> ! </xsl:template> ! <!--################################################### ! Headers and Footers ! ################################################### --> ! <!-- let's have a Spring and I21 banner across the top of each page --> ! <xsl:template name="user.header.navigation"> ! <div style="background-color:white;border:none;height:73px;border:1px solid black;"> ! <a style="border:none;" href="http://www.springframework.org/"; title="The Spring Framework"> ! <img style="border:none;" src="images/xdev-spring_logo.jpg" /> ! </a> ! <a style="border:none;" href="http://www.interface21.com/"; title="Interface21 - Spring from the Source"> ! <img style="border:none;position:absolute;padding-top:5px;right:42px;" src="images/i21-banner-rhs.jpg" /> ! </a> ! </div> ! </xsl:template> ! <!-- no other header navigation (prev, next, etc.) --> ! <xsl:template name="header.navigation" /> ! <xsl:param name="navig.showtitles">1</xsl:param> ! <!-- let's have a 'Sponsored by Interface21' strapline (or somesuch) across the bottom of each page --> ! <xsl:template name="footer.navigation"> ! <xsl:param name="prev" select="/foo" /> ! <xsl:param name="next" select="/foo" /> ! <xsl:param name="nav.context" /> ! <xsl:variable name="home" select="/*[1]" /> ! <xsl:variable name="up" select="parent::*" /> ! <xsl:variable name="row1" select="count($prev) > 0 ! or count($up) > 0 ! or count($next) > 0" /> ! <xsl:variable name="row2" select="($prev and $navig.showtitles != 0) ! or (generate-id($home) != generate-id(.) ! or $nav.context = 'toc') ! or ($chunk.tocs.and.lots != 0 ! and $nav.context != 'toc') ! or ($next and $navig.showtitles != 0)" /> ! <xsl:if test="$suppress.navigation = '0' and $suppress.footer.navigation = '0'"> ! <div class="navfooter"> ! <xsl:if test="$footer.rule != 0"> ! <hr /> ! </xsl:if> ! <xsl:if test="$row1 or $row2"> ! <table width="100%" summary="Navigation footer"> ! <xsl:if test="$row1"> ! <tr> ! <td width="40%" align="left"> ! <xsl:if test="count($prev)>0"> ! <a accesskey="p"> ! <xsl:attribute name="href"> ! <xsl:call-template name="href.target"> ! <xsl:with-param name="object" select="$prev" /> ! </xsl:call-template> ! </xsl:attribute> ! <xsl:call-template name="navig.content"> ! <xsl:with-param name="direction" select="'prev'" /> ! </xsl:call-template> ! </a> ! </xsl:if> ! <xsl:text> </xsl:text> ! </td> ! ! <td width="20%" align="center"> ! <xsl:choose> ! <xsl:when test="$home != . or $nav.context = 'toc'"> ! <a accesskey="h"> ! <xsl:attribute name="href"> ! <xsl:call-template name="href.target"> ! <xsl:with-param name="object" select="$home" /> ! </xsl:call-template> ! </xsl:attribute> ! <xsl:call-template name="navig.content"> ! <xsl:with-param name="direction" select="'home'" /> ! </xsl:call-template> ! </a> ! <xsl:if test="$chunk.tocs.and.lots != 0 and $nav.context != 'toc'"> ! <xsl:text> | </xsl:text> ! </xsl:if> ! </xsl:when> ! <xsl:otherwise> </xsl:otherwise> ! </xsl:choose> ! <xsl:if test="$chunk.tocs.and.lots != 0 and $nav.context != 'toc'"> ! <a accesskey="t"> ! <xsl:attribute name="href"> ! <xsl:apply-templates select="/*[1]" mode="recursive-chunk-filename"> ! <xsl:with-param name="recursive" select="true()" /> ! </xsl:apply-templates> ! <xsl:text>-toc</xsl:text> ! <xsl:value-of select="$html.ext" /> ! </xsl:attribute> ! <xsl:call-template name="gentext"> ! <xsl:with-param name="key" select="'nav-toc'" /> ! </xsl:call-template> ! </a> ! </xsl:if> ! </td> ! <td width="40%" align="right"> ! <xsl:text> </xsl:text> ! <xsl:if test="count($next)>0"> ! <a accesskey="n"> ! <xsl:attribute name="href"> ! <xsl:call-template name="href.target"> ! <xsl:with-param name="object" select="$next" /> ! </xsl:call-template> ! </xsl:attribute> ! <xsl:call-template name="navig.content"> ! <xsl:with-param name="direction" select="'next'" /> ! </xsl:call-template> ! </a> ! </xsl:if> ! </td> ! </tr> ! </xsl:if> ! <xsl:if test="$row2"> ! <tr> ! <td width="40%" align="left" valign="top"> ! <xsl:if test="$navig.showtitles != 0"> ! <xsl:apply-templates select="$prev" mode="object.title.markup" /> ! </xsl:if> ! <xsl:text> </xsl:text> ! </td> ! <td width="20%" align="center"> ! <span style="color:white;font-size:90%;"> ! <a href="http://www.interface21.com/"; title="Interface21 - Spring from the Source">Sponsored by Interface21</a> ! </span> ! </td> ! <td width="40%" align="right" valign="top"> ! <xsl:text> </xsl:text> ! <xsl:if test="$navig.showtitles != 0"> ! <xsl:apply-templates select="$next" mode="object.title.markup" /> ! </xsl:if> ! </td> ! </tr> ! </xsl:if> ! </table> ! </xsl:if> ! </div> ! </xsl:if> ! </xsl:template> </xsl:stylesheet> Index: html.css =================================================================== RCS file: /cvsroot/springframework/spring-projects/spring-ws-core/docs/reference/styles/html.css,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** html.css 21 Oct 2006 06:14:19 -0000 1.2 --- html.css 31 Mar 2007 14:08:37 -0000 1.3 *************** *** 278,281 **** --- 278,287 ---- } + .title .interfacename, + .title .literal, + .title .classname { + font-size: 130%; + } + /* everything in a <lineannotation/> is displayed in a coloured, comment-like font */ .programlisting * .lineannotation, Index: html.xsl =================================================================== RCS file: /cvsroot/springframework/spring-projects/spring-ws-core/docs/reference/styles/html.xsl,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** html.xsl 14 Feb 2006 16:21:12 -0000 1.1 --- html.xsl 31 Mar 2007 14:08:38 -0000 1.2 *************** *** 1,21 **** <?xml version="1.0"?> - <!-- ! ! This is the XSL HTML configuration file for the Hibernate ! Reference Documentation. ! ! It took me days to figure out this stuff and fix most of ! the obvious bugs in the DocBook XSL distribution, so if you ! use this stylesheet, give some credit back to the Hibernate ! project. ! ! christian.bauer@... --> - <!DOCTYPE xsl:stylesheet [ <!ENTITY db_xsl_path "../lib/docbook-xsl/"> ! <!ENTITY callout_gfx_path "../images/callouts/"> ! <!ENTITY admon_gfx_path "../html_single/images/admons/"> ]> --- 1,11 ---- <?xml version="1.0"?> <!-- ! This is the XSL HTML configuration file for the Spring ! Web Services Reference Documentation. --> <!DOCTYPE xsl:stylesheet [ <!ENTITY db_xsl_path "../lib/docbook-xsl/"> ! <!ENTITY callout_gfx_path "images/callouts/"> ! <!ENTITY admon_gfx_path "images/admons/"> ]> *************** *** 31,35 **** ################################################### --> ! <xsl:param name="html.stylesheet">../styles/html.css</xsl:param> <!-- These extensions are required for table printing and other stuff --> --- 21,25 ---- ################################################### --> ! <xsl:param name="html.stylesheet">html.css</xsl:param> <!-- These extensions are required for table printing and other stuff --> *************** *** 79,88 **** <xsl:param name="admon.graphics.path">&admon_gfx_path;</xsl:param> ! <!--################################################### Misc ! ################################################### --> ! ! <!-- Placement of titles --> ! <xsl:param name="formal.title.placement"> figure after example before --- 69,77 ---- <xsl:param name="admon.graphics.path">&admon_gfx_path;</xsl:param> ! <!--################################################### Misc ! ################################################### --> ! <!-- Placement of titles --> ! <xsl:param name="formal.title.placement"> figure after example before *************** *** 90,94 **** table before procedure before ! </xsl:param> ! </xsl:stylesheet> --- 79,100 ---- table before procedure before ! </xsl:param> ! <xsl:template match="author" mode="titlepage.mode"> ! <xsl:if test="name(preceding-sibling::*[1]) = 'author'"> ! <xsl:text>, </xsl:text> ! </xsl:if> ! <span class="{name(.)}"> ! <xsl:call-template name="person.name" /> ! <xsl:apply-templates mode="titlepage.mode" select="./contrib" /> ! <xsl:apply-templates mode="titlepage.mode" select="./affiliation" /> ! </span> ! </xsl:template> ! <xsl:template match="authorgroup" mode="titlepage.mode"> ! <div class="{name(.)}"> ! <h2>Authors</h2> ! <p/> ! <xsl:apply-templates mode="titlepage.mode" /> ! </div> ! </xsl:template> ! </xsl:stylesheet> |
From: Rick Evans <springboy@us...> - 2007-03-31 14:11:45
|
Update of /cvsroot/springframework/spring-projects/spring-ws-core/docs/reference/src In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv22548/spring-ws-core/docs/reference/src Modified Files: index.xml Log Message: Branded the SWS reference docco to look like the main (core) Spring reference docco. Index: index.xml =================================================================== RCS file: /cvsroot/springframework/spring-projects/spring-ws-core/docs/reference/src/index.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** index.xml 21 Oct 2006 06:13:19 -0000 1.4 --- index.xml 31 Mar 2007 14:08:37 -0000 1.5 *************** *** 2,30 **** <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "../lib/docbook-dtd/docbookx.dtd" [ ! <!ENTITY overview SYSTEM "overview.xml"> ! <!ENTITY oxm SYSTEM "oxm.xml"> ! <!ENTITY ws SYSTEM "ws.xml"> ]> <book> ! <bookinfo> ! <title>Spring Web Services - Reference Documentation</title> ! <releaseinfo>Version 0.9.1</releaseinfo> ! <authorgroup> ! <author> ! <firstname>Arjen</firstname> ! <surname>Poutsma</surname> ! </author> ! </authorgroup> ! <legalnotice> ! Copies of this document may be made for your own use and for ! distribution to others, provided that you do not charge any ! fee for such copies and further provided that each copy ! contains this Copyright Notice, whether distributed in print ! or electronically. ! </legalnotice> ! </bookinfo> ! <toc/> ! &overview; ! &ws; ! &oxm; </book> --- 2,36 ---- <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "../lib/docbook-dtd/docbookx.dtd" [ ! <!ENTITY overview SYSTEM "overview.xml"> ! <!ENTITY oxm SYSTEM "oxm.xml"> ! <!ENTITY ws SYSTEM "ws.xml"> ]> <book> ! <bookinfo> ! <title>Spring Web Services - Reference Documentation</title> ! <releaseinfo>Version 0.9.1</releaseinfo> ! <authorgroup> ! <author> ! <firstname>Arjen</firstname> ! <surname>Poutsma</surname> ! </author> ! <author> ! <firstname>Rick</firstname> ! <surname>Evans</surname> ! </author> ! </authorgroup> ! <legalnotice> ! <para> ! Copies of this document may be made for your own use and for ! distribution to others, provided that you do not charge any ! fee for such copies and further provided that each copy ! contains this Copyright Notice, whether distributed in print ! or electronically. ! </para> ! </legalnotice> ! </bookinfo> ! <toc/> ! &overview; ! &ws; ! &oxm; </book> |
From: Rick Evans <springboy@us...> - 2007-03-31 14:08:42
|
Update of /cvsroot/springframework/spring-projects/common-build In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv22548/common-build Modified Files: doc-targets.xml Log Message: Branded the SWS reference docco to look like the main (core) Spring reference docco. Index: doc-targets.xml =================================================================== RCS file: /cvsroot/springframework/spring-projects/common-build/doc-targets.xml,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** doc-targets.xml 13 Feb 2006 14:18:28 -0000 1.9 --- doc-targets.xml 31 Mar 2007 14:08:37 -0000 1.10 *************** *** 98,101 **** --- 98,102 ---- </fileset> </copy> + <copy todir="${docs.ref.target.dir}/html/" file="${docs.ref.dir}/styles/html.css" failonerror="false"/> <java classname="com.icl.saxon.StyleSheet" fork="true" dir="${docs.ref.target.dir}/html"> *************** *** 127,130 **** --- 128,132 ---- </fileset> </copy> + <copy todir="${docs.ref.target.dir}/html_single/" file="${docs.ref.dir}/styles/html.css" failonerror="false"/> <java classname="com.icl.saxon.StyleSheet" fork="true" dir="${docs.ref.target.dir}/html_single"> |
From: Juergen Hoeller <jhoeller@us...> - 2007-03-31 10:11:49
|
Update of /cvsroot/springframework/spring/src/org/springframework/beans In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv4914/src/org/springframework/beans Modified Files: PropertyValuesEditor.java Log Message: use a shared PropertiesEditor instance Index: PropertyValuesEditor.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/beans/PropertyValuesEditor.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PropertyValuesEditor.java 27 May 2005 19:49:57 -0000 1.4 --- PropertyValuesEditor.java 31 Mar 2007 10:11:43 -0000 1.5 *************** *** 1,11 **** /* ! * Copyright 2002-2005 the original author or authors. ! * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at ! * * http://www.apache.org/licenses/LICENSE-2.0 ! * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, --- 1,11 ---- /* ! * Copyright 2002-2007 the original author or authors. ! * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at ! * * http://www.apache.org/licenses/LICENSE-2.0 ! * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, *************** *** 20,49 **** import java.util.Properties; - import org.springframework.beans.MutablePropertyValues; import org.springframework.beans.propertyeditors.PropertiesEditor; /** ! * Editor for PropertyValues objects. Not ! * a GUI editor. ! * <br>NB: this editor must be registered with the JavaBeans API before it ! * will be available. Editors in this package are ! * registered by BeanWrapperImpl. ! * <br>The required format is defined in java.util.Properties documentation. ! * Each property must be on a new line. ! * <br> ! * The present implementation relies on a PropertiesEditor. * * @author Rod Johnson */ public class PropertyValuesEditor extends PropertyEditorSupport { ! ! ! /** ! * @see java.beans.PropertyEditor#setAsText(java.lang.String) ! */ ! public void setAsText(String s) throws IllegalArgumentException { ! PropertiesEditor pe = new PropertiesEditor(); ! pe.setAsText(s); ! Properties props = (Properties) pe.getValue(); setValue(new MutablePropertyValues(props)); } --- 20,45 ---- import java.util.Properties; import org.springframework.beans.propertyeditors.PropertiesEditor; /** ! * {@link java.beans.PropertyEditor Editor} for a {@link PropertyValues} object. ! * ! * <p>The required format is defined in the {@link java.util.Properties} ! * documentation. Each property must be on a new line. ! * ! * <p>The present implementation relies on a ! * {@link org.springframework.beans.propertyeditors.PropertiesEditor} ! * underneath. * * @author Rod Johnson + * @author Juergen Hoeller */ public class PropertyValuesEditor extends PropertyEditorSupport { ! ! private final PropertiesEditor propertiesEditor = new PropertiesEditor(); ! ! public void setAsText(String text) throws IllegalArgumentException { ! this.propertiesEditor.setAsText(text); ! Properties props = (Properties) this.propertiesEditor.getValue(); setValue(new MutablePropertyValues(props)); } |
From: Adrian Colyer <adrian-colyer@us...> - 2007-03-30 13:45:46
|
Update of /cvsroot/springframework/spring/src/org/springframework/aop/aspectj In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv6314/src/org/springframework/aop/aspectj Modified Files: TypePatternClassFilter.java Log Message: support literal "and", "or" and "not" in type pattern expressions passed to AspectJ Index: TypePatternClassFilter.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/aop/aspectj/TypePatternClassFilter.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TypePatternClassFilter.java 12 Sep 2006 21:41:19 -0000 1.2 --- TypePatternClassFilter.java 30 Mar 2007 13:45:42 -0000 1.3 *************** *** 22,25 **** --- 22,26 ---- import org.springframework.aop.ClassFilter; import org.springframework.util.Assert; + import org.springframework.util.StringUtils; /** *************** *** 80,84 **** this.aspectJTypePatternMatcher = PointcutParser.getPointcutParserSupportingAllPrimitivesAndUsingContextClassloaderForResolution(). ! parseTypePattern(typePattern); } --- 81,85 ---- this.aspectJTypePatternMatcher = PointcutParser.getPointcutParserSupportingAllPrimitivesAndUsingContextClassloaderForResolution(). ! parseTypePattern(replaceBooleanOperators(typePattern)); } *************** *** 100,102 **** --- 101,115 ---- } + /** + * If a type pattern has been specified in XML, the user cannot + * write <code>and</code> as "&&" (though && will work). + * We also allow <code>and</code> between two sub-expressions. + * <p>This method converts back to <code>&&</code> for the AspectJ pointcut parser. + */ + private String replaceBooleanOperators(String pcExpr) { + pcExpr = StringUtils.replace(pcExpr," and "," && "); + pcExpr = StringUtils.replace(pcExpr, " or ", " || "); + pcExpr = StringUtils.replace(pcExpr, " not ", " ! "); + return pcExpr; + } } |
From: Adrian Colyer <adrian-colyer@us...> - 2007-03-30 13:45:34
|
Update of /cvsroot/springframework/spring/test/org/springframework/aop/aspectj In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv6295/test/org/springframework/aop/aspectj Modified Files: TypePatternClassFilterTests.java Log Message: support literal "and", "or" and "not" in type pattern expressions passed to AspectJ Index: TypePatternClassFilterTests.java =================================================================== RCS file: /cvsroot/springframework/spring/test/org/springframework/aop/aspectj/TypePatternClassFilterTests.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TypePatternClassFilterTests.java 12 Sep 2006 21:41:19 -0000 1.2 --- TypePatternClassFilterTests.java 30 Mar 2007 13:45:23 -0000 1.3 *************** *** 61,64 **** --- 61,77 ---- assertFalse("Must be excluded: not subclass", tpcf.matches(DefaultListableBeanFactory.class)); } + + public void testAndOrNotReplacement() { + TypePatternClassFilter tpcf = new TypePatternClassFilter("java.lang.Object or java.lang.String"); + assertFalse("matches Number",tpcf.matches(Number.class)); + assertTrue("matches Object",tpcf.matches(Object.class)); + assertTrue("matchesString",tpcf.matches(String.class)); + tpcf = new TypePatternClassFilter("java.lang.Number+ and java.lang.Float"); + assertTrue("matches Float",tpcf.matches(Float.class)); + assertFalse("matches Double",tpcf.matches(Double.class)); + tpcf = new TypePatternClassFilter("java.lang.Number+ and not java.lang.Float"); + assertFalse("matches Float",tpcf.matches(Float.class)); + assertTrue("matches Double",tpcf.matches(Double.class)); + } public void testSetTypePatternWithNullArgument() throws Exception { |
From: Juergen Hoeller <jhoeller@us...> - 2007-03-30 12:20:02
|
Update of /cvsroot/springframework/spring/docs/reference/src In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv4043/docs/reference/src Modified Files: transaction.xml Log Message: fixed typo Index: transaction.xml =================================================================== RCS file: /cvsroot/springframework/spring/docs/reference/src/transaction.xml,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** transaction.xml 20 Feb 2007 14:09:12 -0000 1.64 --- transaction.xml 30 Mar 2007 12:19:37 -0000 1.65 *************** *** 1103,1108 **** <para> ! <table id="tx-annotation-drive-settings"> ! <title><literal><tx:annotation-drive/></literal> settings</title> <tgroup cols="4"> <thead> --- 1103,1108 ---- <para> ! <table id="tx-annotation-driven-settings"> ! <title><literal><tx:annotation-driven/></literal> settings</title> <tgroup cols="4"> <thead> |
From: Juergen Hoeller <jhoeller@us...> - 2007-03-30 12:17:37
|
Update of /cvsroot/springframework/spring/src/org/springframework/jndi In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv2542/src/org/springframework/jndi Modified Files: JndiObjectFactoryBean.java Log Message: added "proxyInterfaces" property, for specifying multiple interfaces; autodetect proxy interfaces from a specified "expectedType", if necessary Index: JndiObjectFactoryBean.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/jndi/JndiObjectFactoryBean.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** JndiObjectFactoryBean.java 7 Mar 2007 00:08:10 -0000 1.18 --- JndiObjectFactoryBean.java 30 Mar 2007 12:17:26 -0000 1.19 *************** *** 58,62 **** public class JndiObjectFactoryBean extends JndiObjectLocator implements FactoryBean, BeanClassLoaderAware { ! private Class proxyInterface; private boolean lookupOnStartup = true; --- 58,62 ---- public class JndiObjectFactoryBean extends JndiObjectLocator implements FactoryBean, BeanClassLoaderAware { ! private Class[] proxyInterfaces; private boolean lookupOnStartup = true; *************** *** 73,87 **** /** * Specify the proxy interface to use for the JNDI object. * Needs to be specified because the actual JNDI object type is not known * in advance in case of a lazy lookup. ! * <p>Typically used in conjunction with "lookupOnStartup"=false and/or "cache"=false. * @see #setLookupOnStartup * @see #setCache */ public void setProxyInterface(Class proxyInterface) { ! if (!proxyInterface.isInterface()) { ! throw new IllegalArgumentException("[" + proxyInterface.getName() + "] is not an interface"); ! } ! this.proxyInterface = proxyInterface; } --- 73,98 ---- /** * Specify the proxy interface to use for the JNDI object. + * <p>Typically used in conjunction with "lookupOnStartup"=false and/or "cache"=false. * Needs to be specified because the actual JNDI object type is not known * in advance in case of a lazy lookup. ! * @see #setProxyInterfaces * @see #setLookupOnStartup * @see #setCache */ public void setProxyInterface(Class proxyInterface) { ! this.proxyInterfaces = new Class[] {proxyInterface}; ! } ! ! /** ! * Specify multiple proxy interfaces to use for the JNDI object. ! * <p>Typically used in conjunction with "lookupOnStartup"=false and/or "cache"=false. ! * Note that proxy interfaces will be autodetected from a specified "expectedType", ! * if necessary. ! * @see #setExpectedType ! * @see #setLookupOnStartup ! * @see #setCache ! */ ! public void setProxyInterfaces(Class[] proxyInterfaces) { ! this.proxyInterfaces = proxyInterfaces; } *************** *** 135,139 **** super.afterPropertiesSet(); ! if (this.proxyInterface != null) { if (this.defaultObject != null) { throw new IllegalArgumentException( --- 146,169 ---- super.afterPropertiesSet(); ! if (!this.lookupOnStartup || !this.cache) { ! // We need to create a proxy for this... ! if (this.proxyInterfaces == null) { ! Class expectedType = getExpectedType(); ! if (expectedType != null) { ! if (expectedType.isInterface()) { ! this.proxyInterfaces = new Class[] {expectedType}; ! } ! else { ! this.proxyInterfaces = ClassUtils.getAllInterfacesForClass(expectedType); ! } ! } ! } ! if (this.proxyInterfaces == null) { ! throw new IllegalArgumentException( ! "Cannot deactivate 'lookupOnStartup' or 'cache' without specifying a 'proxyInterface'"); ! } ! } ! ! if (this.proxyInterfaces != null) { if (this.defaultObject != null) { throw new IllegalArgumentException( *************** *** 145,152 **** else { - if (!this.lookupOnStartup || !this.cache) { - throw new IllegalArgumentException( - "Cannot deactivate 'lookupOnStartup' or 'cache' without specifying a 'proxyInterface'"); - } if (this.defaultObject != null && getExpectedType() != null && !getExpectedType().isInstance(this.defaultObject)) { --- 175,178 ---- *************** *** 199,206 **** public Class getObjectType() { ! if (this.proxyInterface != null) { ! return this.proxyInterface; } ! else if (this.jndiObject != null) { return this.jndiObject.getClass(); } --- 225,237 ---- public Class getObjectType() { ! if (this.proxyInterfaces != null) { ! if (this.proxyInterfaces.length == 1) { ! return this.proxyInterfaces[0]; ! } ! else if (this.proxyInterfaces.length > 1) { ! return createCompositeInterface(this.proxyInterfaces); ! } } ! if (this.jndiObject != null) { return this.jndiObject.getClass(); } *************** *** 216,219 **** --- 247,264 ---- /** + * Create a composite interface Class for the given interfaces, + * implementing the given interfaces in one single Class. + * <p>The default implementation builds a JDK proxy class for the + * given interfaces. + * @param interfaces the interfaces to merge + * @return the merged interface as Class + * @see java.lang.reflect.Proxy#getProxyClass + */ + protected Class createCompositeInterface(Class[] interfaces) { + return ClassUtils.createCompositeInterface(interfaces, this.beanClassLoader); + } + + + /** * Inner class to just introduce an AOP dependency when actually creating a proxy. */ *************** *** 233,237 **** // Create a proxy with JndiObjectFactoryBean's proxy interface and the JndiObjectTargetSource. ProxyFactory proxyFactory = new ProxyFactory(); ! proxyFactory.addInterface(jof.proxyInterface); proxyFactory.setTargetSource(targetSource); return proxyFactory.getProxy(jof.beanClassLoader); --- 278,282 ---- // Create a proxy with JndiObjectFactoryBean's proxy interface and the JndiObjectTargetSource. ProxyFactory proxyFactory = new ProxyFactory(); ! proxyFactory.setInterfaces(jof.proxyInterfaces); proxyFactory.setTargetSource(targetSource); return proxyFactory.getProxy(jof.beanClassLoader); |
From: Juergen Hoeller <jhoeller@us...> - 2007-03-30 11:57:10
|
Update of /cvsroot/springframework/spring/src/org/springframework/jndi In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv24821/src/org/springframework/jndi Modified Files: JndiObjectTargetSource.java Log Message: return the specified "expectedType" as target class if no JNDI object has been obtained yet Index: JndiObjectTargetSource.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/jndi/JndiObjectTargetSource.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** JndiObjectTargetSource.java 7 Mar 2007 00:03:38 -0000 1.5 --- JndiObjectTargetSource.java 30 Mar 2007 11:57:00 -0000 1.6 *************** *** 106,110 **** public Class getTargetClass() { ! return (this.cachedObject != null ? this.cachedObject.getClass() : this.targetClass); } --- 106,118 ---- public Class getTargetClass() { ! if (this.cachedObject != null) { ! return this.cachedObject.getClass(); ! } ! else if (this.targetClass != null) { ! return this.targetClass; ! } ! else { ! return getExpectedType(); ! } } |
From: Juergen Hoeller <jhoeller@us...> - 2007-03-29 22:27:32
|
Update of /cvsroot/springframework/spring/test/org/springframework/beans/factory In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv24735/test/org/springframework/beans/factory Modified Files: DefaultListableBeanFactoryTests.java Log Message: increased accepted performance test limits Index: DefaultListableBeanFactoryTests.java =================================================================== RCS file: /cvsroot/springframework/spring/test/org/springframework/beans/factory/DefaultListableBeanFactoryTests.java,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** DefaultListableBeanFactoryTests.java 28 Mar 2007 21:43:51 -0000 1.44 --- DefaultListableBeanFactoryTests.java 29 Mar 2007 22:27:28 -0000 1.45 *************** *** 940,944 **** sw.stop(); System.out.println(sw.getTotalTimeMillis()); ! assertTrue("Prototype creation took too long: " + sw.getTotalTimeMillis(), sw.getTotalTimeMillis() < 1000); } --- 940,944 ---- sw.stop(); System.out.println(sw.getTotalTimeMillis()); ! assertTrue("Prototype creation took too long: " + sw.getTotalTimeMillis(), sw.getTotalTimeMillis() < 1500); } *************** *** 1053,1057 **** sw.stop(); System.out.println(sw.getTotalTimeMillis()); ! assertTrue("Prototype creation took too long: " + sw.getTotalTimeMillis(), sw.getTotalTimeMillis() < 1500); } --- 1053,1057 ---- sw.stop(); System.out.println(sw.getTotalTimeMillis()); ! assertTrue("Prototype creation took too long: " + sw.getTotalTimeMillis(), sw.getTotalTimeMillis() < 2000); } *************** *** 1101,1105 **** sw.stop(); System.out.println(sw.getTotalTimeMillis()); ! assertTrue("Prototype creation took too long: " + sw.getTotalTimeMillis(), sw.getTotalTimeMillis() < 2000); } --- 1101,1105 ---- sw.stop(); System.out.println(sw.getTotalTimeMillis()); ! assertTrue("Prototype creation took too long: " + sw.getTotalTimeMillis(), sw.getTotalTimeMillis() < 3000); } *************** *** 1121,1125 **** sw.stop(); System.out.println(sw.getTotalTimeMillis()); ! assertTrue("Prototype creation took too long: " + sw.getTotalTimeMillis(), sw.getTotalTimeMillis() < 1000); } --- 1121,1125 ---- sw.stop(); System.out.println(sw.getTotalTimeMillis()); ! assertTrue("Prototype creation took too long: " + sw.getTotalTimeMillis(), sw.getTotalTimeMillis() < 1500); } |
From: Juergen Hoeller <jhoeller@us...> - 2007-03-29 22:23:34
|
Update of /cvsroot/springframework/spring/tiger/test/org/springframework/aop/aspectj/autoproxy In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv23144/tiger/test/org/springframework/aop/aspectj/autoproxy Modified Files: aspectsPlusAdvisor.xml AspectJAutoProxyCreatorTests.java Log Message: added performance tests Index: AspectJAutoProxyCreatorTests.java =================================================================== RCS file: /cvsroot/springframework/spring/tiger/test/org/springframework/aop/aspectj/autoproxy/AspectJAutoProxyCreatorTests.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** AspectJAutoProxyCreatorTests.java 27 Jan 2007 00:17:00 -0000 1.16 --- AspectJAutoProxyCreatorTests.java 29 Mar 2007 22:23:31 -0000 1.17 *************** *** 18,21 **** --- 18,23 ---- import junit.framework.TestCase; + import org.apache.commons.logging.Log; + import org.apache.commons.logging.LogFactory; import org.springframework.aop.aspectj.annotation.AbstractAspectJAdvisorFactoryTests; *************** *** 25,39 **** import org.springframework.aop.framework.ProxyConfig; import org.springframework.aop.support.AopUtils; import org.springframework.beans.ITestBean; import org.springframework.beans.PropertyValue; import org.springframework.beans.TestBean; import org.springframework.beans.factory.config.MethodInvokingFactoryBean; import org.springframework.beans.factory.support.RootBeanDefinition; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; import org.springframework.context.support.GenericApplicationContext; /** ! * Tests for AspectJ auto proxying. Includes mixing with Spring AOP Advisors * to demonstrate that existing autoproxying contract is honoured. * --- 27,46 ---- import org.springframework.aop.framework.ProxyConfig; import org.springframework.aop.support.AopUtils; + import org.springframework.beans.INestedTestBean; import org.springframework.beans.ITestBean; + import org.springframework.beans.NestedTestBean; import org.springframework.beans.PropertyValue; import org.springframework.beans.TestBean; import org.springframework.beans.factory.config.MethodInvokingFactoryBean; + import org.springframework.beans.factory.support.DefaultListableBeanFactory; import org.springframework.beans.factory.support.RootBeanDefinition; + import org.springframework.beans.factory.xml.XmlBeanDefinitionReader; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; import org.springframework.context.support.GenericApplicationContext; + import org.springframework.util.StopWatch; /** ! * Tests for AspectJ auto-proxying. Includes mixing with Spring AOP Advisors * to demonstrate that existing autoproxying contract is honoured. * *************** *** 43,46 **** --- 50,55 ---- public class AspectJAutoProxyCreatorTests extends TestCase { + private static final Log factoryLog = LogFactory.getLog(DefaultListableBeanFactory.class); + public void testAspectsAreApplied() { ClassPathXmlApplicationContext bf = new ClassPathXmlApplicationContext( *************** *** 67,70 **** --- 76,138 ---- } + public void testAspectsAndAdvisorAppliedToPrototypeIsFastEnough() { + if (factoryLog.isTraceEnabled() || factoryLog.isDebugEnabled()) { + // Skip this test: Trace logging blows the time limit. + return; + } + ClassPathXmlApplicationContext ac = new ClassPathXmlApplicationContext( + "/org/springframework/aop/aspectj/autoproxy/aspectsPlusAdvisor.xml"); + StopWatch sw = new StopWatch(); + sw.start("prototype"); + for (int i = 0; i < 10000; i++) { + ITestBean shouldBeWeaved = (ITestBean) ac.getBean("adrian2"); + if (i < 10) { + testAspectsAndAdvisorAreApplied(ac, shouldBeWeaved); + } + } + sw.stop(); + System.out.println(sw.getTotalTimeMillis()); + assertTrue("Prototype creation took too long: " + sw.getTotalTimeMillis(), sw.getTotalTimeMillis() < 3000); + } + + public void testAspectsAndAdvisorNotAppliedToPrototypeIsFastEnough() { + if (factoryLog.isTraceEnabled() || factoryLog.isDebugEnabled()) { + // Skip this test: Trace logging blows the time limit. + return; + } + ClassPathXmlApplicationContext ac = new ClassPathXmlApplicationContext( + "/org/springframework/aop/aspectj/autoproxy/aspectsPlusAdvisor.xml"); + StopWatch sw = new StopWatch(); + sw.start("prototype"); + for (int i = 0; i < 100000; i++) { + INestedTestBean shouldNotBeWeaved = (INestedTestBean) ac.getBean("i21"); + if (i < 10) { + assertFalse(AopUtils.isAopProxy(shouldNotBeWeaved)); + } + } + sw.stop(); + System.out.println(sw.getTotalTimeMillis()); + assertTrue("Prototype creation took too long: " + sw.getTotalTimeMillis(), sw.getTotalTimeMillis() < 2500); + } + + public void testAspectsAndAdvisorNotAppliedToManySingletonsIsFastEnough() { + if (factoryLog.isTraceEnabled() || factoryLog.isDebugEnabled()) { + // Skip this test: Trace logging blows the time limit. + return; + } + GenericApplicationContext ac = new GenericApplicationContext(); + new XmlBeanDefinitionReader(ac).loadBeanDefinitions( + "/org/springframework/aop/aspectj/autoproxy/aspectsPlusAdvisor.xml"); + for (int i = 0; i < 10000; i++) { + ac.registerBeanDefinition("singleton" + i, new RootBeanDefinition(NestedTestBean.class)); + } + StopWatch sw = new StopWatch(); + sw.start("singleton"); + ac.refresh(); + sw.stop(); + System.out.println(sw.getTotalTimeMillis()); + assertTrue("Singleton creation took too long: " + sw.getTotalTimeMillis(), sw.getTotalTimeMillis() < 3000); + } + public void testAspectsAndAdvisorAreAppliedEvenIfComingFromParentFactory() { ClassPathXmlApplicationContext ac = new ClassPathXmlApplicationContext( *************** *** 77,81 **** childAc.registerBeanDefinition("adrian2", bd); // Register the advisor auto proxy creator with subclass ! childAc.registerBeanDefinition(AnnotationAwareAspectJAutoProxyCreator.class.getName(), new RootBeanDefinition(AnnotationAwareAspectJAutoProxyCreator.class)); childAc.refresh(); --- 145,150 ---- childAc.registerBeanDefinition("adrian2", bd); // Register the advisor auto proxy creator with subclass ! childAc.registerBeanDefinition(AnnotationAwareAspectJAutoProxyCreator.class.getName(), ! new RootBeanDefinition(AnnotationAwareAspectJAutoProxyCreator.class)); childAc.refresh(); *************** *** 159,170 **** public void testTwoAdviceAspectSingleton() { ! testTwoAdviceAspectWith("twoAdviceAspect.xml"); } public void testTwoAdviceAspectPrototype() { ! testTwoAdviceAspectWith("twoAdviceAspectPrototype.xml"); } ! private void testTwoAdviceAspectWith(String location) { ClassPathXmlApplicationContext bf = new ClassPathXmlApplicationContext( "/org/springframework/aop/aspectj/autoproxy/" + location); --- 228,239 ---- public void testTwoAdviceAspectSingleton() { ! doTestTwoAdviceAspectWith("twoAdviceAspect.xml"); } public void testTwoAdviceAspectPrototype() { ! doTestTwoAdviceAspectWith("twoAdviceAspectPrototype.xml"); } ! private void doTestTwoAdviceAspectWith(String location) { ClassPathXmlApplicationContext bf = new ClassPathXmlApplicationContext( "/org/springframework/aop/aspectj/autoproxy/" + location); Index: aspectsPlusAdvisor.xml =================================================================== RCS file: /cvsroot/springframework/spring/tiger/test/org/springframework/aop/aspectj/autoproxy/aspectsPlusAdvisor.xml,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** aspectsPlusAdvisor.xml 20 Aug 2006 19:08:43 -0000 1.6 --- aspectsPlusAdvisor.xml 29 Mar 2007 22:23:31 -0000 1.7 *************** *** 4,19 **** <beans> ! <bean class="org.springframework.aop.aspectj.annotation.AnnotationAwareAspectJAutoProxyCreator" /> ! <bean class="org.springframework.aop.aspectj.autoproxy.MultiplyReturnValue" > ! <property name="multiple" value="3" /> </bean> ! <bean id="adrian" class="org.springframework.beans.TestBean"> ! <property name="name" value="Adrian" /> ! <property name="age" value="34" /> </bean> ! ! <bean class="org.springframework.aop.aspectj.autoproxy.TestBeanAdvisor" /> ! </beans> --- 4,28 ---- <beans> ! <bean class="org.springframework.aop.aspectj.annotation.AnnotationAwareAspectJAutoProxyCreator"/> ! <bean class="org.springframework.aop.aspectj.autoproxy.MultiplyReturnValue"> ! <property name="multiple" value="3"/> </bean> ! <bean id="adrian" class="org.springframework.beans.TestBean"> ! <property name="name" value="Adrian"/> ! <property name="age" value="34"/> </bean> ! ! <bean id="adrian2" class="org.springframework.beans.TestBean" scope="prototype"> ! <property name="name" value="Adrian"/> ! <property name="age" value="34"/> ! </bean> ! ! <bean id="i21" class="org.springframework.beans.NestedTestBean" scope="prototype"> ! <property name="company" value="i21"/> ! </bean> ! ! <bean class="org.springframework.aop.aspectj.autoproxy.TestBeanAdvisor"/> ! </beans> |
From: Juergen Hoeller <jhoeller@us...> - 2007-03-29 22:22:51
|
Update of /cvsroot/springframework/spring/src/org/springframework/aop/framework/autoproxy In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv23054/src/org/springframework/aop/framework/autoproxy Modified Files: AbstractAutoProxyCreator.java Log Message: cache advice information per bean, for efficient prototype creation with auto-proxying (and efficient skipping of non-advised beans) Index: AbstractAutoProxyCreator.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/aop/framework/autoproxy/AbstractAutoProxyCreator.java,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** AbstractAutoProxyCreator.java 28 Feb 2007 20:03:07 -0000 1.47 --- AbstractAutoProxyCreator.java 29 Mar 2007 22:22:44 -0000 1.48 *************** *** 137,141 **** * "postProcessBeforeInstantiation") in the "postProcessAfterInitialization" method. */ ! private final Set targetSourcedBeanNames = Collections.synchronizedSet(new HashSet()); --- 137,145 ---- * "postProcessBeforeInstantiation") in the "postProcessAfterInitialization" method. */ ! private final Set targetSourcedBeans = Collections.synchronizedSet(new HashSet()); ! ! private final Set advisedBeans = Collections.synchronizedSet(new HashSet()); ! ! private final Set nonAdvisedBeans = Collections.synchronizedSet(new HashSet()); *************** *** 232,237 **** public Object postProcessBeforeInstantiation(Class beanClass, String beanName) throws BeansException { ! if (isInfrastructureClass(beanClass, beanName) || shouldSkip(beanClass, beanName)) { ! return null; } --- 236,249 ---- public Object postProcessBeforeInstantiation(Class beanClass, String beanName) throws BeansException { ! Object cacheKey = getCacheKey(beanClass, beanName); ! ! if (!this.targetSourcedBeans.contains(cacheKey)) { ! if (this.advisedBeans.contains(cacheKey) || this.nonAdvisedBeans.contains(cacheKey)) { ! return null; ! } ! if (isInfrastructureClass(beanClass, beanName) || shouldSkip(beanClass, beanName)) { ! this.nonAdvisedBeans.add(cacheKey); ! return null; ! } } *************** *** 241,245 **** TargetSource targetSource = getCustomTargetSource(beanClass, beanName); if (targetSource != null) { ! this.targetSourcedBeanNames.add(beanName); Object[] specificInterceptors = getAdvicesAndAdvisorsForBean(beanClass, beanName, targetSource); return createProxy(beanClass, beanName, specificInterceptors, targetSource); --- 253,257 ---- TargetSource targetSource = getCustomTargetSource(beanClass, beanName); if (targetSource != null) { ! this.targetSourcedBeans.add(beanName); Object[] specificInterceptors = getAdvicesAndAdvisorsForBean(beanClass, beanName, targetSource); return createProxy(beanClass, beanName, specificInterceptors, targetSource); *************** *** 269,274 **** */ public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { ! if (this.targetSourcedBeanNames.contains(beanName) || ! isInfrastructureClass(bean.getClass(), beanName) || shouldSkip(bean.getClass(), beanName)) { return bean; } --- 281,293 ---- */ public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { ! if (this.targetSourcedBeans.contains(beanName)) { ! return bean; ! } ! Object cacheKey = getCacheKey(bean.getClass(), beanName); ! if (this.nonAdvisedBeans.contains(cacheKey)) { ! return bean; ! } ! if (isInfrastructureClass(bean.getClass(), beanName) || shouldSkip(bean.getClass(), beanName)) { ! this.nonAdvisedBeans.add(cacheKey); return bean; } *************** *** 277,283 **** --- 296,304 ---- Object[] specificInterceptors = getAdvicesAndAdvisorsForBean(bean.getClass(), beanName, null); if (specificInterceptors != DO_NOT_PROXY) { + this.advisedBeans.add(cacheKey); return createProxy(bean.getClass(), beanName, specificInterceptors, new SingletonTargetSource(bean)); } + this.nonAdvisedBeans.add(cacheKey); return bean; } *************** *** 285,288 **** --- 306,319 ---- /** + * Build a cache key for the given bean class and bean name. + * @param beanClass the bean class + * @param beanName the bean name + * @return the cache key for the given class and name + */ + protected Object getCacheKey(Class beanClass, String beanName) { + return beanClass.getName() + "_" + beanName; + } + + /** * Return whether the given bean class and bean name represents an * infrastructure class that should never be proxied. *************** *** 339,358 **** protected TargetSource getCustomTargetSource(Class beanClass, String beanName) { // We can't create fancy target sources for directly registered singletons. ! if (this.beanFactory != null && this.beanFactory.containsBean(beanName)) { ! if (logger.isTraceEnabled()) { ! logger.trace("Checking for custom TargetSource for bean with name '" + beanName + "'"); ! } ! if (this.customTargetSourceCreators != null) { ! for (int i = 0; i < this.customTargetSourceCreators.length; i++) { ! TargetSourceCreator tsc = this.customTargetSourceCreators[i]; ! TargetSource ts = tsc.getTargetSource(beanClass, beanName); ! if (ts != null) { ! // Found a matching TargetSource. ! if (logger.isDebugEnabled()) { ! logger.debug("TargetSourceCreator [" + tsc + ! " found custom TargetSource for bean with name '" + beanName + "'"); ! } ! return ts; } } } --- 370,385 ---- protected TargetSource getCustomTargetSource(Class beanClass, String beanName) { // We can't create fancy target sources for directly registered singletons. ! if (this.customTargetSourceCreators != null && ! this.beanFactory != null && this.beanFactory.containsBean(beanName)) { ! for (int i = 0; i < this.customTargetSourceCreators.length; i++) { ! TargetSourceCreator tsc = this.customTargetSourceCreators[i]; ! TargetSource ts = tsc.getTargetSource(beanClass, beanName); ! if (ts != null) { ! // Found a matching TargetSource. ! if (logger.isDebugEnabled()) { ! logger.debug("TargetSourceCreator [" + tsc + ! " found custom TargetSource for bean with name '" + beanName + "'"); } + return ts; } } |
From: Juergen Hoeller <jhoeller@us...> - 2007-03-29 22:11:18
|
Update of /cvsroot/springframework/spring/tiger/test/org/springframework/orm/jpa In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv18980/tiger/test/org/springframework/orm/jpa Modified Files: AbstractEntityManagerFactoryBeanTests.java Log Message: DummyEntityManagerFactoryBean returns proper persistenceUnitName (to make tests pass on INFO/DEBUG log level as well) Index: AbstractEntityManagerFactoryBeanTests.java =================================================================== RCS file: /cvsroot/springframework/spring/tiger/test/org/springframework/orm/jpa/AbstractEntityManagerFactoryBeanTests.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** AbstractEntityManagerFactoryBeanTests.java 26 Mar 2007 21:38:52 -0000 1.6 --- AbstractEntityManagerFactoryBeanTests.java 29 Mar 2007 22:11:14 -0000 1.7 *************** *** 74,78 **** public String getPersistenceUnitName() { ! throw new UnsupportedOperationException(); } } --- 74,78 ---- public String getPersistenceUnitName() { ! return "test"; } } |
From: Juergen Hoeller <jhoeller@us...> - 2007-03-29 22:07:47
|
Update of /cvsroot/springframework/spring/tiger/src/org/springframework/aop/aspectj/annotation In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv17300/tiger/src/org/springframework/aop/aspectj/annotation Modified Files: BeanFactoryAspectJAdvisorsBuilder.java Log Message: cache Advisors for singleton aspects; cache AspectInstanceFactory for non-singleton aspects Index: BeanFactoryAspectJAdvisorsBuilder.java =================================================================== RCS file: /cvsroot/springframework/spring/tiger/src/org/springframework/aop/aspectj/annotation/BeanFactoryAspectJAdvisorsBuilder.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** BeanFactoryAspectJAdvisorsBuilder.java 3 Jan 2007 12:46:47 -0000 1.1 --- BeanFactoryAspectJAdvisorsBuilder.java 29 Mar 2007 22:07:43 -0000 1.2 *************** *** 17,25 **** package org.springframework.aop.aspectj.annotation; import java.util.LinkedList; import java.util.List; - import org.apache.commons.logging.Log; - import org.apache.commons.logging.LogFactory; import org.aspectj.lang.reflect.PerClauseKind; --- 17,27 ---- package org.springframework.aop.aspectj.annotation; + import java.util.Collections; + import java.util.HashMap; + import java.util.Iterator; import java.util.LinkedList; import java.util.List; + import java.util.Map; import org.aspectj.lang.reflect.PerClauseKind; *************** *** 40,49 **** public class BeanFactoryAspectJAdvisorsBuilder { - private static final Log logger = LogFactory.getLog(BeanFactoryAspectJAdvisorsBuilder.class); - private final ListableBeanFactory beanFactory; private final AspectJAdvisorFactory advisorFactory; /** --- 42,56 ---- public class BeanFactoryAspectJAdvisorsBuilder { private final ListableBeanFactory beanFactory; private final AspectJAdvisorFactory advisorFactory; + private List<String> aspectBeanNames; + + private final Map<String, List<Advisor>> advisorsCache = new HashMap<String, List<Advisor>>(); + + private final Map<String, MetadataAwareAspectInstanceFactory> aspectFactoryCache = + new HashMap<String, MetadataAwareAspectInstanceFactory>(); + /** *************** *** 76,116 **** */ public List<Advisor> buildAspectJAdvisors() { ! List<Advisor> advisors = new LinkedList<Advisor>(); ! String[] beanNames = ! BeanFactoryUtils.beanNamesForTypeIncludingAncestors(this.beanFactory, Object.class, true, false); ! for (String beanName : beanNames) { ! if (!isEligibleBean(beanName)) { ! continue; } ! // We must be careful not to instantiate beans eagerly as in this ! // case they would be cached by the Spring container but would not ! // have been weaved ! Class beanType = this.beanFactory.getType(beanName); ! if (beanType == null) { ! continue; } ! ! if (this.advisorFactory.isAspect(beanType)) { ! AspectMetadata amd = new AspectMetadata(beanType, beanName); ! MetadataAwareAspectInstanceFactory factory = null; ! if (amd.getAjType().getPerClause().getKind() == PerClauseKind.SINGLETON) { ! factory = new BeanFactoryAspectInstanceFactory(this.beanFactory, beanName); ! } ! else { ! // Per target or per this ! if (this.beanFactory.isSingleton(beanName)) { ! throw new IllegalArgumentException( ! "Bean with name '" + beanName + "' is a singleton, but aspect instantiation model is not singleton"); ! } ! factory = new PrototypeAspectInstanceFactory(this.beanFactory, beanName); ! } ! List<Advisor> classAdvisors = this.advisorFactory.getAdvisors(factory); ! if (logger.isDebugEnabled()) { ! logger.debug("Found " + classAdvisors.size() + ! " AspectJ advice methods in bean with name '" + beanName + "'"); ! } ! advisors.addAll(classAdvisors); } } --- 83,152 ---- */ public List<Advisor> buildAspectJAdvisors() { ! List<String> aspectNames = null; ! synchronized (this) { ! aspectNames = this.aspectBeanNames; ! if (aspectNames == null) { ! List<Advisor> advisors = new LinkedList<Advisor>(); ! aspectNames = new LinkedList<String>(); ! String[] beanNames = ! BeanFactoryUtils.beanNamesForTypeIncludingAncestors(this.beanFactory, Object.class, true, false); ! for (String beanName : beanNames) { ! if (!isEligibleBean(beanName)) { ! continue; ! } ! // We must be careful not to instantiate beans eagerly as in this ! // case they would be cached by the Spring container but would not ! // have been weaved ! Class beanType = this.beanFactory.getType(beanName); ! if (beanType == null) { ! continue; ! } ! if (this.advisorFactory.isAspect(beanType)) { ! aspectNames.add(beanName); ! AspectMetadata amd = new AspectMetadata(beanType, beanName); ! if (amd.getAjType().getPerClause().getKind() == PerClauseKind.SINGLETON) { ! MetadataAwareAspectInstanceFactory factory = ! new BeanFactoryAspectInstanceFactory(this.beanFactory, beanName); ! List<Advisor> classAdvisors = this.advisorFactory.getAdvisors(factory); ! if (this.beanFactory.isSingleton(beanName)) { ! this.advisorsCache.put(beanName, classAdvisors); ! } ! else { ! this.aspectFactoryCache.put(beanName, factory); ! } ! advisors.addAll(classAdvisors); ! } ! else { ! // Per target or per this. ! if (this.beanFactory.isSingleton(beanName)) { ! throw new IllegalArgumentException("Bean with name '" + beanName + ! "' is a singleton, but aspect instantiation model is not singleton"); ! } ! MetadataAwareAspectInstanceFactory factory = ! new PrototypeAspectInstanceFactory(this.beanFactory, beanName); ! this.aspectFactoryCache.put(beanName, factory); ! advisors.addAll(this.advisorFactory.getAdvisors(factory)); ! } ! } ! } ! this.aspectBeanNames = aspectNames; ! return advisors; } + } ! if (aspectNames.isEmpty()) { ! return Collections.EMPTY_LIST; ! } ! List<Advisor> advisors = new LinkedList<Advisor>(); ! for (Iterator it = aspectNames.iterator(); it.hasNext();) { ! String aspectName = (String) it.next(); ! List<Advisor> cachedAdvisors = this.advisorsCache.get(aspectName); ! if (cachedAdvisors != null) { ! advisors.addAll(cachedAdvisors); } ! else { ! MetadataAwareAspectInstanceFactory factory = this.aspectFactoryCache.get(aspectName); ! advisors.addAll(this.advisorFactory.getAdvisors(factory)); } } *************** *** 121,124 **** --- 157,161 ---- * Return whether the aspect bean with the given name is eligible. * @param beanName the name of the aspect bean + * @return whether the bean is eligible */ protected boolean isEligibleBean(String beanName) { |
From: Juergen Hoeller <jhoeller@us...> - 2007-03-29 21:47:35
|
Update of /cvsroot/springframework/spring/tiger/src/org/springframework/aop/aspectj/annotation In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv9029/tiger/src/org/springframework/aop/aspectj/annotation Modified Files: AnnotationAwareAspectJAutoProxyCreator.java Log Message: polishing Index: AnnotationAwareAspectJAutoProxyCreator.java =================================================================== RCS file: /cvsroot/springframework/spring/tiger/src/org/springframework/aop/aspectj/annotation/AnnotationAwareAspectJAutoProxyCreator.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** AnnotationAwareAspectJAutoProxyCreator.java 3 Jan 2007 12:46:47 -0000 1.9 --- AnnotationAwareAspectJAutoProxyCreator.java 29 Mar 2007 21:47:30 -0000 1.10 *************** *** 27,31 **** /** ! * AspectJAwareAdvisorAutoProxyCreator subclass that processes all AspectJ * annotation aspects in the current application context, as well as Spring Advisors. * --- 27,31 ---- /** ! * {@link AspectJAwareAdvisorAutoProxyCreator} subclass that processes all AspectJ * annotation aspects in the current application context, as well as Spring Advisors. * *************** *** 43,47 **** * @author Juergen Hoeller * @since 2.0 - * @see org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator * @see org.springframework.aop.aspectj.annotation.AspectJAdvisorFactory */ --- 43,46 ---- *************** *** 74,78 **** protected void initBeanFactory(ConfigurableListableBeanFactory beanFactory) { super.initBeanFactory(beanFactory); ! this.aspectJAdvisorsBuilder = new BeanFactoryAspectJAdvisorsBuilderAdapter(beanFactory, this.aspectJAdvisorFactory); } --- 73,78 ---- protected void initBeanFactory(ConfigurableListableBeanFactory beanFactory) { super.initBeanFactory(beanFactory); ! this.aspectJAdvisorsBuilder = ! new BeanFactoryAspectJAdvisorsBuilderAdapter(beanFactory, this.aspectJAdvisorFactory); } |
From: Juergen Hoeller <jhoeller@us...> - 2007-03-29 21:36:39
|
Update of /cvsroot/springframework/spring/src/org/springframework/aop/framework/autoproxy In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv5098/src/org/springframework/aop/framework/autoproxy Modified Files: BeanFactoryAdvisorRetrievalHelper.java Log Message: cache Advisor bean names Index: BeanFactoryAdvisorRetrievalHelper.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/aop/framework/autoproxy/BeanFactoryAdvisorRetrievalHelper.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** BeanFactoryAdvisorRetrievalHelper.java 6 Mar 2007 15:08:16 -0000 1.2 --- BeanFactoryAdvisorRetrievalHelper.java 29 Mar 2007 21:36:35 -0000 1.3 *************** *** 44,47 **** --- 44,49 ---- private final ConfigurableListableBeanFactory beanFactory; + private String[] cachedAdvisorBeanNames; + /** *************** *** 62,70 **** */ public List findAdvisorBeans() { List advisors = new LinkedList(); - // Do not initialize FactoryBeans here: We need to leave all regular beans - // uninitialized to let the auto-proxy creator apply to them! - String[] advisorNames = - BeanFactoryUtils.beanNamesForTypeIncludingAncestors(this.beanFactory, Advisor.class, true, false); for (int i = 0; i < advisorNames.length; i++) { String name = advisorNames[i]; --- 64,84 ---- */ public List findAdvisorBeans() { + // Determine list of advisor bean names, if not cached already. + String[] advisorNames = null; + synchronized (this) { + advisorNames = this.cachedAdvisorBeanNames; + if (advisorNames == null) { + // Do not initialize FactoryBeans here: We need to leave all regular beans + // uninitialized to let the auto-proxy creator apply to them! + advisorNames = BeanFactoryUtils.beanNamesForTypeIncludingAncestors( + this.beanFactory, Advisor.class, true, false); + this.cachedAdvisorBeanNames = advisorNames; + } + } + if (advisorNames.length == 0) { + return new LinkedList(); + } + List advisors = new LinkedList(); for (int i = 0; i < advisorNames.length; i++) { String name = advisorNames[i]; |