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
|
From: Rod J. <joh...@us...> - 2006-04-21 16:59:40
|
Update of /cvsroot/springframework/spring/tiger/src/org/springframework/orm/jpa In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12689/tiger/src/org/springframework/orm/jpa Modified Files: LocalEntityManagerFactoryBean.java AbstractEntityManagerFactoryBean.java Log Message: Pulled up PersistenceProvider class Index: LocalEntityManagerFactoryBean.java =================================================================== RCS file: /cvsroot/springframework/spring/tiger/src/org/springframework/orm/jpa/LocalEntityManagerFactoryBean.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** LocalEntityManagerFactoryBean.java 21 Apr 2006 14:29:48 -0000 1.6 --- LocalEntityManagerFactoryBean.java 21 Apr 2006 16:59:37 -0000 1.7 *************** *** 55,60 **** public class LocalEntityManagerFactoryBean extends AbstractEntityManagerFactoryBean { - private Class persistenceProviderClass; - private String entityManagerName; --- 55,58 ---- *************** *** 63,84 **** /** - /** - * Set the PersistenceProvider implementation class to use for creating - * the EntityManagerFactory. If not specified (which is the default), - * the <code>Persistence</code> class will be used to create the - * EntityManagerFactory, relying on JPA's autodetection mechanism. - * @see javax.persistence.spi.PersistenceProvider - * @see javax.persistence.Persistence - */ - public void setPersistenceProviderClass(Class persistenceProviderClass) { - if (persistenceProviderClass != null && - !PersistenceProvider.class.isAssignableFrom(persistenceProviderClass)) { - throw new IllegalArgumentException( - "serviceFactoryClass must implement [javax.persistence.spi.PersistenceProvider]"); - } - this.persistenceProviderClass = persistenceProviderClass; - } - - /** * Set the name of the EntityManager configuration for the factory. * <p>Default is none, indicating the default EntityManager configuration. --- 61,64 ---- Index: AbstractEntityManagerFactoryBean.java =================================================================== RCS file: /cvsroot/springframework/spring/tiger/src/org/springframework/orm/jpa/AbstractEntityManagerFactoryBean.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** AbstractEntityManagerFactoryBean.java 21 Apr 2006 14:29:48 -0000 1.1 --- AbstractEntityManagerFactoryBean.java 21 Apr 2006 16:59:37 -0000 1.2 *************** *** 19,22 **** --- 19,23 ---- import javax.persistence.EntityManagerFactory; import javax.persistence.PersistenceException; + import javax.persistence.spi.PersistenceProvider; import org.apache.commons.logging.Log; *************** *** 46,49 **** --- 47,52 ---- private EntityManagerFactory entityManagerFactory; + protected Class persistenceProviderClass; + /** * Subclasses must implement this method to create the EntityManagerFactory that *************** *** 86,88 **** --- 89,109 ---- } + /** + /** + * Set the PersistenceProvider implementation class to use for creating + * the EntityManagerFactory. If not specified (which is the default), + * the <code>Persistence</code> class will be used to create the + * EntityManagerFactory, relying on JPA's autodetection mechanism. + * @see javax.persistence.spi.PersistenceProvider + * @see javax.persistence.Persistence + */ + public void setPersistenceProviderClass(Class persistenceProviderClass) { + if (persistenceProviderClass != null && + !PersistenceProvider.class.isAssignableFrom(persistenceProviderClass)) { + throw new IllegalArgumentException( + "serviceFactoryClass must implement [javax.persistence.spi.PersistenceProvider]"); + } + this.persistenceProviderClass = persistenceProviderClass; + } + } |
From: Rick E. <spr...@us...> - 2006-04-21 15:59:54
|
Update of /cvsroot/springframework/spring/docs/reference/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9568/docs/reference/src Modified Files: xsd-configuration.xml Log Message: [SPR-1907] Added IntelliJ IDEA setup. Index: xsd-configuration.xml =================================================================== RCS file: /cvsroot/springframework/spring/docs/reference/src/xsd-configuration.xml,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** xsd-configuration.xml 21 Apr 2006 13:56:26 -0000 1.6 --- xsd-configuration.xml 21 Apr 2006 15:59:46 -0000 1.7 *************** *** 440,452 **** <para>If your favourite Java IDE or editor is not included in the list of documented IDEs, then please do raise an issue on the Spring Framework ! <ulink linkend="http://opensource.atlassian.com/projects/spring/secure/Dashboard.jspa">JIRA</ulink> and the oversight <emphasis>may</emphasis> well be addressed in the next release.</para> <section id="xsd-config-setup-eclipse"> <title>Setting up Eclipse</title> ! <para>[TODO : document setting up Eclipse (with screenshots)]</para> </section> <section id="xsd-config-setup-idea"> ! <title>Setting up IDEA</title> ! <para>[TODO : document setting up IDEA (with screenshots)]</para> </section> </section> --- 440,576 ---- <para>If your favourite Java IDE or editor is not included in the list of documented IDEs, then please do raise an issue on the Spring Framework ! <ulink url="http://opensource.atlassian.com/projects/spring/secure/Dashboard.jspa">JIRA</ulink> and the oversight <emphasis>may</emphasis> well be addressed in the next release.</para> <section id="xsd-config-setup-eclipse"> <title>Setting up Eclipse</title> ! <para>[TODO : document setting up <ulink url="http://www.eclipse.org/">Eclipse</ulink> (with screenshots)]</para> </section> <section id="xsd-config-setup-idea"> ! <title>Setting up IntelliJ IDEA</title> ! <para>The following steps illustrate how setting up ! <ulink url="http://www.jetbrains.com/idea/">IntelliJ IDEA</ulink> to be XSD-aware is a cinch.</para> ! <para>(The assumption in the following steps is that you already have an IDEA project ! open (either a brand new project or an already existing one).</para> ! <step> ! <title>Step One</title> ! <para>Create a new XML file. You can name this file whatever you want... in the ! case of this example, the file is named <literal>'context.xml'</literal>. ! Copy and paste the following text into this file...</para> ! <para> ! <mediaobject> ! <imageobject role="fo"> ! <imagedata fileref="images/idea-setup-1.png" format="PNG" align="center" /> ! </imageobject> ! <imageobject role="html"> ! <imagedata fileref="images/idea-setup-1.png" format="PNG" align="center" /> ! </imageobject> ! </mediaobject> ! </para> ! </step> ! <step> ! <title>Step Two</title> ! <para>As can be seen in the above screenshot, the XML file has a number ! of nasty red contextual error markers. To rectify this, IDEA has to be ! made aware of the location of the referenced XSD namespace(s).</para> ! <para>To do this, simply position the cursor over the squiggly red ! area (see the screenshot below); then press the <keycombo action='open'> ! <keycap>Alt</keycap> ! <keycap>Enter</keycap> ! </keycombo> keystroke combination, and press the <keycombo action='open'> ! <keycap>Enter</keycap> ! </keycombo> key again when the popup becomes active to fetch the external ! resource.</para> ! <para> ! <mediaobject> ! <imageobject role="fo"> ! <imagedata fileref="images/idea-setup-6.png" format="PNG" align="center" /> ! </imageobject> ! <imageobject role="html"> ! <imagedata fileref="images/idea-setup-6.png" format="PNG" align="center" /> ! </imageobject> ! </mediaobject> ! </para> ! </step> ! <step> ! <title>Step Three</title> ! <para>If the external resource could not be fetched (maybe no active Internet ! connection is available), then one can manually configure the resource to ! reference a local copy of the attendant XSD file. To effect this, open up ! the <literal>'Settings'</literal> dialog ! (via the <keycombo action='open'> ! <keycap>Ctrl</keycap> ! <keycap>A</keycap> ! <keycap>S</keycap> ! </keycombo> keystroke combination or via the <literal>'File|Settings'</literal> menu), ! and click on the <literal>'Resources'</literal> button.</para> ! <para> ! <mediaobject> ! <imageobject role="fo"> ! <imagedata fileref="images/idea-setup-2.png" format="PNG" align="center" /> ! </imageobject> ! <imageobject role="html"> ! <imagedata fileref="images/idea-setup-2.png" format="PNG" align="center" /> ! </imageobject> ! </mediaobject> ! </para> ! </step> ! <step> ! <title>Step Four</title> ! <para>As can be seen in the following screenshot, this will bring up a dialog ! that allows one to add an explicit reference to a local copy of the ! <literal>util</literal> schema file. (One can find all of the various Spring ! XSD files in the <literal>'src'</literal> directory of the Spring distribution.)</para> ! <para> ! <mediaobject> ! <imageobject role="fo"> ! <imagedata fileref="images/idea-setup-3.png" format="PNG" align="center" /> ! </imageobject> ! <imageobject role="html"> ! <imagedata fileref="images/idea-setup-3.png" format="PNG" align="center" /> ! </imageobject> ! </mediaobject> ! </para> ! </step> ! <step> ! <title>Step Five</title> ! <para>Clicking the <literal>'Add'</literal> button will bring up another dialog ! that allows one explicitly to associate a namespace URI with the path to the ! relevant XSD file. As can be seen in the following screenshot, the ! <literal>'http://www.springframework.org/schema/util'</literal> namespace ! is being associated with the file resource ! <literal>'C:\bench\spring\src\org\springframework\beans\factory\xml\spring-util.xsd'</literal>.</para> ! <para> ! <mediaobject> ! <imageobject role="fo"> ! <imagedata fileref="images/idea-setup-4.png" format="PNG" align="center" /> ! </imageobject> ! <imageobject role="html"> ! <imagedata fileref="images/idea-setup-4.png" format="PNG" align="center" /> ! </imageobject> ! </mediaobject> ! </para> ! </step> ! <step> ! <title>Step Six</title> ! <para>Exiting out of the nested dialogs via the <literal>'OK'</literal> button ! will then bring back the main editing window, and as can be seen in the ! following screenshot, the contextual error markers have disppeared; typing ! the <literal>'<'</literal> character into the editing window now also ! brings up a handy dropdown box that contains all of the imported tags from ! the <literal>util</literal> namespace.</para> ! <para> ! <mediaobject> ! <imageobject role="fo"> ! <imagedata fileref="images/idea-setup-5.png" format="PNG" align="center" /> ! </imageobject> ! <imageobject role="html"> ! <imagedata fileref="images/idea-setup-5.png" format="PNG" align="center" /> ! </imageobject> ! </mediaobject> ! </para> ! </step> ! <para> ! Setting up IDEA to reference the other Spring XSD files follows a similar process. ! </para> </section> </section> |
Update of /cvsroot/springframework/spring/docs/reference/src/images In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9568/docs/reference/src/images Added Files: idea-setup-1.png idea-setup-2.png idea-setup-3.png idea-setup-4.png idea-setup-5.png idea-setup-6.png Log Message: [SPR-1907] Added IntelliJ IDEA setup. --- NEW FILE: idea-setup-1.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: idea-setup-3.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: idea-setup-2.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: idea-setup-5.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: idea-setup-4.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: idea-setup-6.png --- (This appears to be a binary file; contents omitted.) |
From: Rick E. <spr...@us...> - 2006-04-21 15:38:54
|
Update of /cvsroot/springframework/spring/docs/reference/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31083/docs/reference/src Modified Files: aspectj.xml dynamic-languages.xml Log Message: Minor - corrected invalid DocBook (ulink linkend is rubbish, must be ulink url) Index: aspectj.xml =================================================================== RCS file: /cvsroot/springframework/spring/docs/reference/src/aspectj.xml,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** aspectj.xml 19 Apr 2006 16:58:59 -0000 1.9 --- aspectj.xml 21 Apr 2006 15:38:50 -0000 1.10 *************** *** 48,52 **** simply constructed using the <literal>new</literal> operator. This is a particularly useful mechanism to avoid the ! <ulink linkend="http://www.martinfowler.com/bliki/AnemicDomainModel.html">'anemic domain model'</ulink> criticized by Martin Fowler and other OO experts. </para> --- 48,52 ---- simply constructed using the <literal>new</literal> operator. This is a particularly useful mechanism to avoid the ! <ulink url="http://www.martinfowler.com/bliki/AnemicDomainModel.html">'anemic domain model'</ulink> criticized by Martin Fowler and other OO experts. </para> *************** *** 631,635 **** <para> The AspectJ ! <ulink linkend="http://www.eclipse.org/aspectj/doc/released/progguide/index.html">Programmers Guide</ulink>, included in the AspectJ 5 distribution, is an excellent starting point. </para> --- 631,635 ---- <para> The AspectJ ! <ulink url="http://www.eclipse.org/aspectj/doc/released/progguide/index.html">Programmers Guide</ulink>, included in the AspectJ 5 distribution, is an excellent starting point. </para> Index: dynamic-languages.xml =================================================================== RCS file: /cvsroot/springframework/spring/docs/reference/src/dynamic-languages.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** dynamic-languages.xml 21 Apr 2006 13:56:26 -0000 1.5 --- dynamic-languages.xml 21 Apr 2006 15:38:50 -0000 1.6 *************** *** 21,25 **** <quote><emphasis>insert your favourite dynamic language here</emphasis></quote>, you can always raise an issue on Spring's ! <ulink linkend="http://opensource.atlassian.com/projects/spring/secure/Dashboard.jspa">JIRA</ulink> page (or implement such support yourself). </para> --- 21,25 ---- <quote><emphasis>insert your favourite dynamic language here</emphasis></quote>, you can always raise an issue on Spring's ! <ulink url="http://opensource.atlassian.com/projects/spring/secure/Dashboard.jspa">JIRA</ulink> page (or implement such support yourself). </para> |
From: Rob H. <rob...@us...> - 2006-04-21 14:45:05
|
Update of /cvsroot/springframework/spring-projects/build-spring-webflow In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31232/build-spring-webflow Modified Files: build-continuous.xml Log Message: Updated build 'from' email address Index: build-continuous.xml =================================================================== RCS file: /cvsroot/springframework/spring-projects/build-spring-webflow/build-continuous.xml,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** build-continuous.xml 12 Mar 2006 21:16:46 -0000 1.7 --- build-continuous.xml 21 Apr 2006 14:44:55 -0000 1.8 *************** *** 63,67 **** <target name="email-failure" depends="guard.smtp.host"> ! <mail mailhost="${smtp.host}" subject="Spring WebFlow ${label} FAILED" tolist="spr...@li..., al...@in..." from="al...@in..."> <message>Errors and a list of modifications can be found in the build log (http://static.springframework.org/spring-webflow/build/index.html).</message> </mail> --- 63,67 ---- <target name="email-failure" depends="guard.smtp.host"> ! <mail mailhost="${smtp.host}" subject="Spring WebFlow ${label} FAILED" tolist="spr...@li..." from="bu...@in..."> <message>Errors and a list of modifications can be found in the build log (http://static.springframework.org/spring-webflow/build/index.html).</message> </mail> *************** *** 69,73 **** <target name="email-success" depends="guard.smtp.host"> ! <mail mailhost="${smtp.host}" subject="Spring WebFlow ${label} SUCCEEDED" tolist="spr...@li..., al...@in..." from="al...@in..."> <message> Snapshot has been uploaded to http://static.springframework.org/downloads/nightly/spring-webflow --- 69,73 ---- <target name="email-success" depends="guard.smtp.host"> ! <mail mailhost="${smtp.host}" subject="Spring WebFlow ${label} SUCCEEDED" tolist="spr...@li..." from="bu...@in..."> <message> Snapshot has been uploaded to http://static.springframework.org/downloads/nightly/spring-webflow |
Update of /cvsroot/springframework/spring/tiger/test/org/springframework/orm/jpa In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21936/tiger/test/org/springframework/orm/jpa Added Files: EntityManagerFactoryBeanSupportTests.java LocalEntityManagerFactoryBeanTests.java AbstractEntityManagerFactoryBeanTests.java Log Message: Introduced AbstractEntityManagerFactoryBean. Added tests for EntityManager factory beans. --- NEW FILE: AbstractEntityManagerFactoryBeanTests.java --- /* * Copyright 2002-2006 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, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.orm.jpa; import javax.persistence.EntityManagerFactory; import javax.persistence.PersistenceException; import junit.framework.TestCase; import org.easymock.MockControl; /** * @author Rod Johnson * */ public abstract class AbstractEntityManagerFactoryBeanTests extends TestCase { protected static MockControl emfMc; protected static EntityManagerFactory mockEmf; @Override protected void setUp() throws Exception { emfMc = MockControl.createControl(EntityManagerFactory.class); mockEmf = (EntityManagerFactory) emfMc.getMock(); mockEmf.close(); emfMc.setVoidCallable(1); emfMc.replay(); } protected void checkInvariants(AbstractEntityManagerFactoryBean demf) { assertTrue(EntityManagerFactory.class.isAssignableFrom(demf.getObjectType())); assertSame(mockEmf, demf.getObject()); assertSame(mockEmf, demf.getObject()); assertSame(mockEmf, demf.getEntityManagerFactory()); } protected static class DummyEntityManagerFactoryBean extends AbstractEntityManagerFactoryBean { private final EntityManagerFactory emf; public DummyEntityManagerFactoryBean(EntityManagerFactory emf) { this.emf = emf; } @Override protected EntityManagerFactory createEntityManagerFactory() throws PersistenceException { return emf; } } } --- NEW FILE: EntityManagerFactoryBeanSupportTests.java --- /* * Copyright 2002-2006 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, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.orm.jpa; /** * @author Rod Johnson * */ public class EntityManagerFactoryBeanSupportTests extends AbstractEntityManagerFactoryBeanTests { public void testHookIsCalled() throws Exception { DummyEntityManagerFactoryBean demf = new DummyEntityManagerFactoryBean(mockEmf); demf.afterPropertiesSet(); checkInvariants(demf); // Should trigger close method expected by EntityManagerFactory mock demf.destroy(); emfMc.verify(); } } --- NEW FILE: LocalEntityManagerFactoryBeanTests.java --- /* * Copyright 2002-2006 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, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.orm.jpa; import java.util.Map; import java.util.Properties; import javax.persistence.EntityManagerFactory; import javax.persistence.PersistenceException; import javax.persistence.spi.PersistenceProvider; import javax.persistence.spi.PersistenceUnitInfo; /** * @author Rod Johnson * */ public class LocalEntityManagerFactoryBeanTests extends AbstractEntityManagerFactoryBeanTests { // Set by DummyPersistenceProvider inner class private static String actualName; private static Map actualProps; public void testThrowsPersistenceExceptionWithMissingProperties() throws Exception { LocalEntityManagerFactoryBean lemfb = new LocalEntityManagerFactoryBean(); try { lemfb.afterPropertiesSet(); fail("Should have thrown PersistenceException"); } catch (PersistenceException pe) { // Ok } } public void testValidUsageWithDefaultProperties() throws Exception { testValidUsage(null); } public void testValidUsageWithExplicitProperties() throws Exception { testValidUsage(new Properties()); } protected void testValidUsage(Properties props) throws Exception { // This will be set by DummyPersistenceProvider actualName = null; actualProps = null; LocalEntityManagerFactoryBean lemfb = new LocalEntityManagerFactoryBean(); String entityManagerName = "call me Bob"; lemfb.setEntityManagerName(entityManagerName); lemfb.setPersistenceProviderClass(DummyPersistenceProvider.class); if (props != null) { lemfb.setJpaProperties(props); } lemfb.afterPropertiesSet(); assertSame(entityManagerName, actualName); assertSame(props, actualProps); checkInvariants(lemfb); lemfb.destroy(); emfMc.verify(); } protected static class DummyPersistenceProvider implements PersistenceProvider { public EntityManagerFactory createContainerEntityManagerFactory(PersistenceUnitInfo pui, Map map) { throw new UnsupportedOperationException(); } public EntityManagerFactory createEntityManagerFactory(String emfName, Map properties) { actualName = emfName; actualProps = properties; return mockEmf; } } } |
From: Rod J. <joh...@us...> - 2006-04-21 14:29:51
|
Update of /cvsroot/springframework/spring/tiger/src/org/springframework/orm/jpa In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21936/tiger/src/org/springframework/orm/jpa Modified Files: LocalEntityManagerFactoryBean.java Added Files: AbstractEntityManagerFactoryBean.java Log Message: Introduced AbstractEntityManagerFactoryBean. Added tests for EntityManager factory beans. Index: LocalEntityManagerFactoryBean.java =================================================================== RCS file: /cvsroot/springframework/spring/tiger/src/org/springframework/orm/jpa/LocalEntityManagerFactoryBean.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** LocalEntityManagerFactoryBean.java 10 Apr 2006 13:17:52 -0000 1.5 --- LocalEntityManagerFactoryBean.java 21 Apr 2006 14:29:48 -0000 1.6 *************** *** 24,34 **** import javax.persistence.spi.PersistenceProvider; - import org.apache.commons.logging.Log; - import org.apache.commons.logging.LogFactory; - import org.springframework.beans.BeanUtils; - import org.springframework.beans.factory.DisposableBean; - import org.springframework.beans.factory.FactoryBean; - import org.springframework.beans.factory.InitializingBean; /** --- 24,28 ---- *************** *** 59,65 **** * @see org.springframework.jndi.JndiObjectFactoryBean */ ! public class LocalEntityManagerFactoryBean implements FactoryBean, InitializingBean, DisposableBean { ! ! protected final Log logger = LogFactory.getLog(getClass()); private Class persistenceProviderClass; --- 53,57 ---- * @see org.springframework.jndi.JndiObjectFactoryBean */ ! public class LocalEntityManagerFactoryBean extends AbstractEntityManagerFactoryBean { private Class persistenceProviderClass; *************** *** 67,72 **** private String entityManagerName; - private EntityManagerFactory entityManagerFactory; - private Properties jpaProperties; --- 59,62 ---- *************** *** 116,163 **** * @throws javax.persistence.PersistenceException in case of JPA initialization errors */ ! public final void afterPropertiesSet() throws PersistenceException { if (this.persistenceProviderClass != null) { // Create EntityManagerFactory directly through PersistenceProvider. PersistenceProvider pp = (PersistenceProvider) BeanUtils.instantiateClass(this.persistenceProviderClass); ! this.entityManagerFactory = pp.createEntityManagerFactory(this.entityManagerName, this.jpaProperties); ! if (this.entityManagerFactory == null) { throw new IllegalStateException( "PersistenceProvider [" + this.persistenceProviderClass.getName() + "] did not return an EntityManagerFactory for name '" + this.entityManagerName + "'"); } } else { // Let JPA perform its PersistenceProvider autodetection. ! this.entityManagerFactory = ! Persistence.createEntityManagerFactory(this.entityManagerName, this.jpaProperties); } } - - /** - * Return the singleton EntityManagerFactory. - */ - public Object getObject() { - return this.entityManagerFactory; - } - - public Class getObjectType() { - return (this.entityManagerFactory != null) ? - this.entityManagerFactory.getClass() : EntityManagerFactory.class; - } - - public boolean isSingleton() { - return true; - } - - - /** - * Close the EntityManagerFactory on bean factory shutdown. - */ - public void destroy() { - logger.info("Closing JPA EntityManagerFactory"); - this.entityManagerFactory.close(); - } - } --- 106,127 ---- * @throws javax.persistence.PersistenceException in case of JPA initialization errors */ ! protected EntityManagerFactory createEntityManagerFactory() throws PersistenceException { if (this.persistenceProviderClass != null) { // Create EntityManagerFactory directly through PersistenceProvider. PersistenceProvider pp = (PersistenceProvider) BeanUtils.instantiateClass(this.persistenceProviderClass); ! EntityManagerFactory emf = pp.createEntityManagerFactory(this.entityManagerName, this.jpaProperties); ! if (emf == null) { throw new IllegalStateException( "PersistenceProvider [" + this.persistenceProviderClass.getName() + "] did not return an EntityManagerFactory for name '" + this.entityManagerName + "'"); } + return emf; } else { // Let JPA perform its PersistenceProvider autodetection. ! return Persistence.createEntityManagerFactory(this.entityManagerName, this.jpaProperties); } } } --- NEW FILE: AbstractEntityManagerFactoryBean.java --- /* * Copyright 2002-2006 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, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.orm.jpa; import javax.persistence.EntityManagerFactory; import javax.persistence.PersistenceException; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.DisposableBean; import org.springframework.beans.factory.FactoryBean; import org.springframework.beans.factory.InitializingBean; /** * Abstract support for FactoryBeans that create a local JPA * EntityManagerFactory instance. * Behaves like a EntityManagerFactory instance when used as bean * reference, e.g. for JpaTemplate's "entityManagerFactory" property. * Note that switching to a JndiObjectFactoryBean or a bean-style * EntityManagerFactory instance is just a matter of configuration! * * @author Rod Johnson * @since 2.0 * @see JpaTemplate#setEntityManagerFactory * @see JpaTransactionManager#setEntityManagerFactory * @see org.springframework.jndi.JndiObjectFactoryBean */ public abstract class AbstractEntityManagerFactoryBean implements FactoryBean, InitializingBean, DisposableBean { protected final Log logger = LogFactory.getLog(getClass()); private EntityManagerFactory entityManagerFactory; /** * Subclasses must implement this method to create the EntityManagerFactory that * will be returned by the getObject() method * @return EntityManagerFactory instance returned by this FactoryBean * @throws PersistenceException if the EntityManager cannot be created */ protected abstract EntityManagerFactory createEntityManagerFactory() throws PersistenceException; protected EntityManagerFactory getEntityManagerFactory() { return this.entityManagerFactory; } /** * Return the singleton EntityManagerFactory. */ public final Object getObject() { return this.entityManagerFactory; } public Class getObjectType() { return (this.entityManagerFactory != null) ? this.entityManagerFactory.getClass() : EntityManagerFactory.class; } public final boolean isSingleton() { return true; } /** * Close the EntityManagerFactory on bean factory shutdown. */ public void destroy() { logger.info("Closing JPA EntityManagerFactory"); this.entityManagerFactory.close(); } public void afterPropertiesSet() throws Exception { this.entityManagerFactory = createEntityManagerFactory(); } } |
From: Rod J. <joh...@us...> - 2006-04-21 14:29:49
|
Update of /cvsroot/springframework/spring/tiger/test/org/springframework/orm/jpa In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21884/tiger/test/org/springframework/orm/jpa Log Message: Directory /cvsroot/springframework/spring/tiger/test/org/springframework/orm/jpa added to the repository |
From: Rod J. <joh...@us...> - 2006-04-21 14:29:44
|
Update of /cvsroot/springframework/spring/tiger/test/org/springframework/orm In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21884/tiger/test/org/springframework/orm Log Message: Directory /cvsroot/springframework/spring/tiger/test/org/springframework/orm added to the repository |
From: Rob H. <rob...@us...> - 2006-04-21 14:00:34
|
Update of /cvsroot/springframework/spring In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4996 Modified Files: build.xml Log Message: Modified build.xml to allow test fork mode to be configurable Index: build.xml =================================================================== RCS file: /cvsroot/springframework/spring/build.xml,v retrieving revision 1.187 retrieving revision 1.188 diff -C2 -d -r1.187 -r1.188 *** build.xml 18 Apr 2006 14:03:35 -0000 1.187 --- build.xml 21 Apr 2006 14:00:17 -0000 1.188 *************** *** 19,23 **** <property file="build.properties"/> <property file="project.properties"/> ! <!-- --- 19,23 ---- <property file="build.properties"/> <property file="project.properties"/> ! <property name="test.fork.mode" value="perBatch"/> <!-- *************** *** 896,900 **** <mkdir dir="${target.junit.summary.dir}"/> ! <junit forkmode="perBatch" printsummary="yes" haltonfailure="no" haltonerror="no"> <jvmarg line="-Djava.awt.headless=true"/> --- 896,902 ---- <mkdir dir="${target.junit.summary.dir}"/> ! <echo message="Using forkmode: ${test.fork.mode}"/> ! ! <junit forkmode="${test.fork.mode}" printsummary="yes" haltonfailure="no" haltonerror="no"> <jvmarg line="-Djava.awt.headless=true"/> |
From: Rick E. <spr...@us...> - 2006-04-21 13:56:31
|
Update of /cvsroot/springframework/spring/docs/reference/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2743/docs/reference/src Modified Files: dynamic-languages.xml xsd-configuration.xml Log Message: [SPR-1907] Added pointers to the docco for the <tx:xxx/> and <aop:xxx/> tags. Index: xsd-configuration.xml =================================================================== RCS file: /cvsroot/springframework/spring/docs/reference/src/xsd-configuration.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** xsd-configuration.xml 21 Apr 2006 12:50:36 -0000 1.5 --- xsd-configuration.xml 21 Apr 2006 13:56:26 -0000 1.6 *************** *** 122,126 **** to the value of the <literal>'java.sql.Connection.TRANSACTION_SERIALIZABLE'</literal> constant. This is all well and good, but it is a tad verbose and (unneccessarily) ! exposes a Spring's internal plumbing to the end user. </para> <para>The following XML Schema-based version is considerably more concise, --- 122,126 ---- to the value of the <literal>'java.sql.Connection.TRANSACTION_SERIALIZABLE'</literal> constant. This is all well and good, but it is a tad verbose and (unneccessarily) ! exposes Spring's internal plumbing to the end user. </para> <para>The following XML Schema-based version is considerably more concise, *************** *** 373,378 **** xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ]]><emphasis role="bold">xmlns:lang="http://www.springframework.org/schema/lang"</emphasis><![CDATA[ ! xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd ! ]]><emphasis role="bold">http://www.springframework.org/schema/jndi http://www.springframework.org/schema/jndi/spring-jndi.xsd"</emphasis><![CDATA[> ]]><lineannotation><!-- <literal><bean/></literal> definitions here --></lineannotation><![CDATA[ --- 373,430 ---- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ]]><emphasis role="bold">xmlns:lang="http://www.springframework.org/schema/lang"</emphasis><![CDATA[ ! ]]><emphasis role="bold">xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd ! http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang.xsd"</emphasis><![CDATA[> ! ! ]]><lineannotation><!-- <literal><bean/></literal> definitions here --></lineannotation><![CDATA[ ! ! </beans>]]></programlisting> ! </section> ! <section id="xsd-config-body-schemas-tx"> ! <title>The <literal>tx</literal> (transaction) schema</title> ! <para>The <literal>tx</literal> tags deal with configuring all of those ! beans in Spring's comprehensive support for transactions. These tags are ! comprehensively covered in the chapter entitled <xref linkend="transaction"/>.</para> ! <para>In the interest of completeness, to use the tags in the <literal>tx</literal> ! schema, one needs to have the following preamble at the top of one's Spring XML ! configuration file; the emboldened text in the following snippet references the ! correct schema so that the tags in the <literal>tx</literal> namespace are ! available to you.</para> ! <programlisting><![CDATA[<?xml version="1.0" encoding="UTF-8"?> ! <beans xmlns="http://www.springframework.org/schema/beans" ! xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ! xmlns:aop="http://www.springframework.org/schema/aop" ! ]]><emphasis role="bold">xmlns:tx="http://www.springframework.org/schema/tx"</emphasis><![CDATA[ ! xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd ! ]]><emphasis role="bold">http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd</emphasis><![CDATA[ ! http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd"> ! ! ]]><lineannotation><!-- <literal><bean/></literal> definitions here --></lineannotation><![CDATA[ ! ! </beans>]]></programlisting> ! <note> ! <para>Often when using the tags in the <literal>tx</literal> namespace one will also be using ! the tags from the <literal>aop</literal> namespace (since the declarative transaction support in Spring is implemented using ! AOP). The above XML snippet contains the relevant lines needed to reference the <literal>aop</literal> schema ! so that the tags in the <literal>aop</literal> namespace are available to you.</para> ! </note> ! </section> ! <section id="xsd-config-body-schemas-aop"> ! <title>The <literal>aop</literal> schema</title> ! <para>The <literal>aop</literal> tags deal with configuring all things ! AOP in Spring: this includes Spring's own proxy-based AOP framework and Spring's ! integration with the AspectJ AOP framework. These tags are ! comprehensively covered in the chapters entitled <xref linkend="aop"/> and ! <xref linkend="aspectj"/>.</para> ! <para>In the interest of completeness, to use the tags in the <literal>aop</literal> ! schema, one needs to have the following preamble at the top of one's Spring XML ! configuration file; the emboldened text in the following snippet references the ! correct schema so that the tags in the <literal>aop</literal> namespace are ! available to you.</para> ! <programlisting><![CDATA[<?xml version="1.0" encoding="UTF-8"?> ! <beans xmlns="http://www.springframework.org/schema/beans" ! xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ! ]]><emphasis role="bold">xmlns:aop="http://www.springframework.org/schema/aop"</emphasis><![CDATA[ ! xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd ! ]]><emphasis role="bold">http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd"</emphasis><![CDATA[> ]]><lineannotation><!-- <literal><bean/></literal> definitions here --></lineannotation><![CDATA[ Index: dynamic-languages.xml =================================================================== RCS file: /cvsroot/springframework/spring/docs/reference/src/dynamic-languages.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** dynamic-languages.xml 21 Apr 2006 12:50:36 -0000 1.4 --- dynamic-languages.xml 21 Apr 2006 13:56:26 -0000 1.5 *************** *** 131,135 **** <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:lang="http://www.springframework.org/schema/lang" ! xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang.xsd"> ]]><lineannotation><!-- this is the bean definition for the Groovy-backed Messenger implementation --></lineannotation><![CDATA[ --- 131,136 ---- <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:lang="http://www.springframework.org/schema/lang" ! xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd ! http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang.xsd"> ]]><lineannotation><!-- this is the bean definition for the Groovy-backed Messenger implementation --></lineannotation><![CDATA[ |
From: Rick E. <spr...@us...> - 2006-04-21 13:51:27
|
Update of /cvsroot/springframework/spring/src/org/springframework/beans/factory In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32317/src/org/springframework/beans/factory Modified Files: BeanDefinitionStoreException.java Log Message: Minor - added whitespace to make exception detail message clearer. Index: BeanDefinitionStoreException.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/beans/factory/BeanDefinitionStoreException.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** BeanDefinitionStoreException.java 3 Mar 2006 15:31:11 -0000 1.12 --- BeanDefinitionStoreException.java 21 Apr 2006 13:51:18 -0000 1.13 *************** *** 57,61 **** */ public BeanDefinitionStoreException(String resourceDescription, ParseState parseState, String msg, Throwable ex) { ! super("Error '" + msg + "' in resource'" + resourceDescription + "' at:\n" + parseState, ex); this.resourceDescription = resourceDescription; } --- 57,61 ---- */ public BeanDefinitionStoreException(String resourceDescription, ParseState parseState, String msg, Throwable ex) { ! super("Error '" + msg + "' in resource '" + resourceDescription + "' at:\n" + parseState, ex); this.resourceDescription = resourceDescription; } |
From: Rick E. <spr...@us...> - 2006-04-21 12:50:39
|
Update of /cvsroot/springframework/spring/docs/reference/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30883/docs/reference/src Modified Files: dynamic-languages.xml xsd-configuration.xml Log Message: [SPR-1907] Documented the <lang:xxx/> tags. Index: xsd-configuration.xml =================================================================== RCS file: /cvsroot/springframework/spring/docs/reference/src/xsd-configuration.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** xsd-configuration.xml 21 Apr 2006 11:31:44 -0000 1.4 --- xsd-configuration.xml 21 Apr 2006 12:50:36 -0000 1.5 *************** *** 355,358 **** --- 355,383 ---- </section> </section> + <section id="xsd-config-body-schemas-lang"> + <title>The <literal>lang</literal> schema</title> + <para>The <literal>lang</literal> tags deal with exposing objects that have been + written in a dynamic language such as JRuby or Groovy as beans in the Spring + container.</para> + <para>These tags (and the dynamic language support) are comprehensively covered + in the chapter entitled <xref linkend="dynamic-language"/>. Please do consult said + chapter for full details on this support and the <literal>lang</literal> tags + themselves.</para> + <para>In the interest of completeness, to use the tags in the <literal>lang</literal> + schema, one needs to have the following preamble at the top of one's Spring XML + configuration file; the emboldened text in the following snippet references the + correct schema so that the tags in the <literal>lang</literal> namespace are + available to you.</para> + <programlisting><![CDATA[<?xml version="1.0" encoding="UTF-8"?> + <beans xmlns="http://www.springframework.org/schema/beans" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + ]]><emphasis role="bold">xmlns:lang="http://www.springframework.org/schema/lang"</emphasis><![CDATA[ + xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd + ]]><emphasis role="bold">http://www.springframework.org/schema/jndi http://www.springframework.org/schema/jndi/spring-jndi.xsd"</emphasis><![CDATA[> + + ]]><lineannotation><!-- <literal><bean/></literal> definitions here --></lineannotation><![CDATA[ + + </beans>]]></programlisting> + </section> </section> <section id="xsd-config-setup"> Index: dynamic-languages.xml =================================================================== RCS file: /cvsroot/springframework/spring/docs/reference/src/dynamic-languages.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** dynamic-languages.xml 19 Apr 2006 14:29:38 -0000 1.3 --- dynamic-languages.xml 21 Apr 2006 12:50:36 -0000 1.4 *************** *** 52,56 **** <emphasis>only</emphasis> available in Spring versions 2.0 and above. There are currently <emphasis>no</emphasis> plans to backport the dynamic language ! support to the previous versions of Spring (most notably the 1.2.x line). </para> </section> --- 52,56 ---- <emphasis>only</emphasis> available in Spring versions 2.0 and above. There are currently <emphasis>no</emphasis> plans to backport the dynamic language ! support to previous versions of Spring (most notably the 1.2.x line). </para> </section> *************** *** 118,125 **** an instance of the <classname>DefaultBookingService</classname> class. </para> <programlisting><![CDATA[<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:lang="http://www.springframework.org/schema/lang" ! xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd http://www.springframework.org/schema/jndi http://www.springframework.org/schema/jndi/spring-jndi.xsd http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang.xsd"> ]]><lineannotation><!-- this is the bean definition for the Groovy-backed Messenger implementation --></lineannotation><![CDATA[ --- 118,135 ---- an instance of the <classname>DefaultBookingService</classname> class. </para> + <note> + <para> + To use the custom dynamic language tags to define dynamic-language-backed beans, + one needs to have the XML Schema preamble at the top of one's Spring XML + configuration file. + </para> + <para> + The chapter entitled <xref linkend="xsd-config"/> may also be of interest. + </para> + </note> <programlisting><![CDATA[<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:lang="http://www.springframework.org/schema/lang" ! xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang.xsd"> ]]><lineannotation><!-- this is the bean definition for the Groovy-backed Messenger implementation --></lineannotation><![CDATA[ |
From: Rick E. <spr...@us...> - 2006-04-21 11:31:50
|
Update of /cvsroot/springframework/spring/docs/reference/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19110/docs/reference/src Modified Files: xsd-configuration.xml Log Message: [SPR-1907] Documented the <jndi:xxx/> tags. Index: xsd-configuration.xml =================================================================== RCS file: /cvsroot/springframework/spring/docs/reference/src/xsd-configuration.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** xsd-configuration.xml 21 Apr 2006 11:10:47 -0000 1.3 --- xsd-configuration.xml 21 Apr 2006 11:31:44 -0000 1.4 *************** *** 97,101 **** the following preamble at the top of one's Spring XML configuration file; the emboldened text in the following snippet references the correct schema so that ! the tags in the <literal>util</literal> are available to you.</para> <programlisting><![CDATA[<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" --- 97,101 ---- the following preamble at the top of one's Spring XML configuration file; the emboldened text in the following snippet references the correct schema so that ! the tags in the <literal>util</literal> namespace are available to you.</para> <programlisting><![CDATA[<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" *************** *** 272,275 **** --- 272,358 ---- </section> </section> + <section id="xsd-config-body-schemas-jndi"> + <title>The <literal>jndi</literal> schema</title> + <para>The <literal>jndi</literal> tags deal with JNDI-related configuration issues, + such as looking up a JNDI object. + </para> + <para>To use the tags in the <literal>jndi</literal> schema, one needs to have + the following preamble at the top of one's Spring XML configuration file; + the emboldened text in the following snippet references the correct schema so that + the tags in the <literal>jndi</literal> namespace are available to you.</para> + <programlisting><![CDATA[<?xml version="1.0" encoding="UTF-8"?> + <beans xmlns="http://www.springframework.org/schema/beans" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + ]]><emphasis role="bold">xmlns:jndi="http://www.springframework.org/schema/jndi"</emphasis><![CDATA[ + xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd + ]]><emphasis role="bold">http://www.springframework.org/schema/jndi http://www.springframework.org/schema/jndi/spring-jndi.xsd"</emphasis><![CDATA[> + + ]]><lineannotation><!-- <literal><bean/></literal> definitions here --></lineannotation><![CDATA[ + + </beans>]]></programlisting> + <section> + <title><literal><jndi:lookup/></literal> (simple)</title> + <para>Before...</para> + <programlisting><![CDATA[<bean id="simple" class="org.springframework.jndi.JndiObjectFactoryBean"> + <property name="jndiName" value="jdbc/MyDataSource"/> + </bean>]]></programlisting> + <para>After...</para> + <programlisting><![CDATA[<jndi:lookup id="simple" jndi-name="jdbc/MyDataSource"/>]]></programlisting> + </section> + <section> + <title><literal><jndi:lookup/></literal> (with JNDI environment setting)</title> + <para>Before...</para> + <programlisting><![CDATA[<bean id="simple" class="org.springframework.jndi.JndiObjectFactoryBean"> + <property name="jndiName" value="jdbc/MyDataSource"/> + <property name="jndiEnvironment"> + <props> + <prop key="foo">bar</prop> + </props> + </property> + </bean>]]></programlisting> + <para>After...</para> + <programlisting><![CDATA[<jndi:lookup id="simple" jndi-name="jdbc/MyDataSource"> + <jndi:environment>foo=bar</jndi:environment> + </jndi:lookup>]]></programlisting> + </section> + <section> + <title><literal><jndi:lookup/></literal> (with JNDI environment settings)</title> + <para>Before...</para> + <programlisting><![CDATA[<bean id="simple" class="org.springframework.jndi.JndiObjectFactoryBean"> + <property name="jndiName" value="jdbc/MyDataSource"/> + <property name="jndiEnvironment"> + <props> + <prop key="foo">bar</prop> + <prop key="ping">pong</prop> + </props> + </property> + </bean>]]></programlisting> + <para>After...</para> + <programlisting><![CDATA[<jndi:lookup id="simple" jndi-name="jdbc/MyDataSource"> + <jndi:environment>foo=bar</jndi:environment> + <jndi:environment>ping=pong</jndi:environment> + </jndi:lookup>]]></programlisting> + </section> + <section> + <title><literal><jndi:lookup/></literal> (complex)</title> + <para>Before...</para> + <programlisting><![CDATA[<bean id="simple" class="org.springframework.jndi.JndiObjectFactoryBean"> + <property name="jndiName" value="jdbc/MyDataSource"/> + <property name="cache" value="true"/> + <property name="resourceRef" value="true"/> + <property name="lookupOnStartup" value="false"/> + <property name="expectedType" value="com.myapp.DefaultFoo"/> + <property name="proxyInterface" value="com.myapp.Foo"/> + </bean>]]></programlisting> + <para>After...</para> + <programlisting><![CDATA[<jndi:lookup id="simple" + jndi-name="jdbc/MyDataSource" + cache="true" + resource-ref="true" + lookup-on-startup="false" + expected-type="com.myapp.DefaultFoo" + proxy-interface="com.myapp.Foo"/>]]></programlisting> + </section> + </section> </section> <section id="xsd-config-setup"> |
From: Rick E. <spr...@us...> - 2006-04-21 11:10:57
|
Update of /cvsroot/springframework/spring/docs/reference/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6860/docs/reference/src Modified Files: xsd-configuration.xml Log Message: [SPR-1907] Documented the <util:xxx/> tags. Index: xsd-configuration.xml =================================================================== RCS file: /cvsroot/springframework/spring/docs/reference/src/xsd-configuration.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** xsd-configuration.xml 20 Apr 2006 16:54:36 -0000 1.2 --- xsd-configuration.xml 21 Apr 2006 11:10:47 -0000 1.3 *************** *** 1,54 **** <?xml version="1.0" encoding="UTF-8" ?> <appendix id="xsd-config"> ! <title>XML Schema-based configuration</title> ! <section> ! <title>Introduction</title> ! <para>This section of the reference documentation details the XML Schema based configuration that was introduced in Spring 2.0.</para> ! <sidebar> ! <title>DTD suppport?</title> ! <para>Authoring Spring configuration files using the older DTD style ! is still totally supported.</para> ! <para>Nothing will break if you forego the use of the new XML Schema-based ! approach to authoring Spring XML configuration files. All that you lose ! out on is more succinct and clearer configuration... in the end all of the ! XML configuration, be it DTD- or Schema-based all boils down to the same ! object model in the container.</para> ! </sidebar> ! <para>The central motivation for moving to XML Schema based configuration files was ! to enable easier Spring (unsurprisingly). The <emphasis>'classic'</emphasis> ! <literal><bean/></literal>-based approach is good (and it still continues ! to be good), but it does suffer from being a tad generic.</para> ! <para>From the Spring IoC containers point of view, <emphasis>everything</emphasis> ! is a bean. Thats great news for the Spring IoC container, because if everything is ! a bean then everything can be treated the same. The same is not true for ! developers... the objects (or classes rather) that one defines in a Spring ! XML configuration file are not all generic, vanilla beans.</para> ! <para>Spring 2.0's new XML Schema-based configuration addresses this issue. ! The <literal><bean/></literal> element is still present, and if one ! wanted to one could continue to write the <emphasis>exact same</emphasis> ! style of Spring XML configuration using only <literal><bean/></literal> ! elements. The new XML Schema-based configuration does however result in ! Spring XML configuration files that are substantially clearer to read, and ! that allow one to express the intent of what a bean definition is. ! </para> ! <para>The examples included below will hopefully convince you that the inclusion ! of XML Schema support in Spring 2.0 was a good idea. The Spting team certainly ! thinks so, and the reception in the community has been encouraging; something that ! is not covered in this section (at least not right now) is the fact that this ! new configuration mechanism is totally customisable and extensible. This means ! that one can write one's own domain specific configuration that allows one ! to more succinctly express one's domain.</para> ! </section> ! <section id="xsd-config-body"> ! <title>XML Schema-based configuration</title> ! <section id="xsd-config-body-referencing"> ! <title>Referencing the schemas</title> ! <para>To switch over from the DTD-style to the new XML Schema-style, one needs ! to effect the following change...</para> ! <programlisting><lineannotation><!-- DTDT-style --></lineannotation> <![CDATA[<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" ! "http://www.springframework.org/dtd/spring-beans.dtd"> <beans> --- 1,59 ---- <?xml version="1.0" encoding="UTF-8" ?> <appendix id="xsd-config"> ! <title>XML Schema-based configuration</title> ! <section> ! <title>Introduction</title> ! <para>This section of the reference documentation details the XML Schema based configuration that was introduced in Spring 2.0.</para> ! <sidebar> ! <title>DTD suppport?</title> ! <para>Authoring Spring configuration files using the older DTD style ! is still totally supported.</para> ! <para>Nothing will break if you forego the use of the new XML Schema-based ! approach to authoring Spring XML configuration files. All that you lose ! out on is more succinct and clearer configuration... in the end all of the ! XML configuration, be it DTD- or Schema-based all boils down to the same ! object model in the container.</para> ! </sidebar> ! <para>The central motivation for moving to XML Schema based configuration files was ! to enable easier Spring XML configuration (unsurprisingly). The <emphasis>'classic'</emphasis> ! <literal><bean/></literal>-based approach is good (and it still continues ! to be good), but it does suffer from being a tad generic.</para> ! <para>From the Spring IoC containers point of view, <emphasis>everything</emphasis> ! is a bean. That's great news for the Spring IoC container, because if everything is ! a bean then everything can be treated in the exact same fashion. The same is not true for ! developers... the objects (or classes rather) that one defines in a Spring ! XML configuration file are not all generic, vanilla beans.</para> ! <para>Spring 2.0's new XML Schema-based configuration addresses this issue. ! The <literal><bean/></literal> element is still present, and if one ! wanted to one could continue to write the <emphasis>exact same</emphasis> ! style of Spring XML configuration using only <literal><bean/></literal> ! elements. The new XML Schema-based configuration does however result in ! Spring XML configuration files that are substantially clearer to read, and ! that allow one to express the intent of what a bean definition is. ! </para> ! <para>In short, the custom tags are best for infrastructure or integration beans: ! AOP, collections, transactions, integration with 3rd party frameworks such as Mule, etc. ! The existing bean tags are best suited to application-specific beans, such as ! DAOs, service layer objects, validators, etc. ! </para> ! <para>The examples included below will hopefully convince one that the inclusion ! of XML Schema support in Spring 2.0 was a good idea. The reception in the community ! has been encouraging; something that is not covered in this section (at least ! not right now) is the fact that this new configuration mechanism is totally ! customisable and extensible. This means that one can write one's own domain ! specific configuration tags that allows one to more succinctly express one's ! domain.</para> ! </section> ! <section id="xsd-config-body"> ! <title>XML Schema-based configuration</title> ! <section id="xsd-config-body-referencing"> ! <title>Referencing the schemas</title> ! <para>To switch over from the DTD-style to the new XML Schema-style, one needs ! to effect the following change...</para> ! <programlisting><lineannotation><!-- DTD-style --></lineannotation> <![CDATA[<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" ! "http://www.springframework.org/dtd/spring-beans.dtd"> <beans> *************** *** 57,109 **** </beans>]]></programlisting> ! <para> ! The equivalent file in the XML Schema-style would be... ! </para> ! <programlisting><lineannotation><!-- DTDT-style --></lineannotation> <![CDATA[<?xml version="1.0" encoding="UTF-8"?> ! <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> - <beans> ]]><lineannotation><!-- <literal><bean/></literal> definitions here --></lineannotation><![CDATA[ </beans>]]></programlisting> ! <para> ! The above Spring XML configuration fragment is pretty much boilerplate; ! one can certainly simply use this and continue to write ! <literal><bean/></literal> definitions like one has always been doing. ! However, the entire point of switching over is to enable one to ! take advantage of the new Spring 2.0 XML tags to enable easier ! configuration. The section entitled <xref linkend="xsd-config-body-schemas-util"/> ! demonstrates how one can immediately use some of the more common utility tags. ! </para> ! </section> ! <section id="xsd-config-body-schemas-util"> ! <title>The <literal>util</literal> schema</title> ! <para> ! For this first example of the new XML tags, lets immediately jump straight to ! some before and after style configuration. ! </para> ! <para>[TODO : provide examples or links to examples (with screenshots)]</para> ! </section> ! </section> ! <section id="xsd-config-setup"> ! <title>Setting up your IDE</title> ! <para>This final section documents the steps involved in setting up a number of ! popular Java IDEs to effect the easier editing of Spring's XML Schema-based ! configuration files.</para> ! <para>If your favourite Java IDE or editor is not included in the list of ! documented IDEs, then please do raise an issue (or ticket) on the Spring ! Framework ! <ulink linkend="http://opensource.atlassian.com/projects/spring/secure/Dashboard.jspa">JIRA</ulink> ! and the oversight <emphasis>may</emphasis> well be addressed in the next release.</para> ! <section id="xsd-config-setup-eclipse"> ! <title>Setting up Eclipse</title> ! <para>[TODO : document setting up Eclipse (with screenshots)]</para> ! </section> ! <section id="xsd-config-setup-idea"> ! <title>Setting up IDEA</title> ! <para>[TODO : document setting up IDEA (with screenshots)]</para> ! </section> ! </section> </appendix> \ No newline at end of file --- 62,293 ---- </beans>]]></programlisting> ! <para>The equivalent file in the XML Schema-style would be...</para> ! <programlisting><lineannotation><!-- XML Schema-style --></lineannotation> <![CDATA[<?xml version="1.0" encoding="UTF-8"?> ! <beans xmlns="http://www.springframework.org/schema/beans" ! xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> ]]><lineannotation><!-- <literal><bean/></literal> definitions here --></lineannotation><![CDATA[ </beans>]]></programlisting> ! <para>The above Spring XML configuration fragment is pretty much boilerplate; ! one can certainly simply use this and continue to write ! <literal><bean/></literal> definitions like one has always been doing. ! However, the entire point of switching over is to enable one to ! take advantage of the new Spring 2.0 XML tags to enable easier ! configuration. The section entitled <xref linkend="xsd-config-body-schemas-util"/> ! demonstrates how one can immediately use some of the more common utility tags. ! </para> ! </section> ! <para>The rest of this chapter is devoted to showing examples of the new Spring XML Schema ! based configuration, with at least one example for every new tag. The format follows ! a before and after style, with a <literal>'before'</literal> snippet of XML showing ! the old (but still 100% legal and supported) style, followed immediately thereafter ! by an <literal>'after'</literal> example showing the new (equivalent) XML Schema-based ! style. ! </para> ! <section id="xsd-config-body-schemas-util"> ! <title>The <literal>util</literal> schema</title> ! <para>First up is coverage of the <literal>util</literal> tags. As the name ! implies, the <literal>util</literal> tags deal with common, <emphasis>utility</emphasis> ! configuration issues, such as configuring collections and suchlike. ! </para> ! <para>To use the tags in the <literal>util</literal> schema, one needs to have ! the following preamble at the top of one's Spring XML configuration file; ! the emboldened text in the following snippet references the correct schema so that ! the tags in the <literal>util</literal> are available to you.</para> ! <programlisting><![CDATA[<?xml version="1.0" encoding="UTF-8"?> ! <beans xmlns="http://www.springframework.org/schema/beans" ! xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ! ]]><emphasis role="bold">xmlns:util="http://www.springframework.org/schema/util"</emphasis><![CDATA[ ! xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd ! ]]><emphasis role="bold">http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd"</emphasis><![CDATA[> ! ! ]]><lineannotation><!-- <literal><bean/></literal> definitions here --></lineannotation><![CDATA[ ! ! </beans>]]></programlisting> ! <section> ! <title><literal><util:constant/></literal></title> ! <para>Before...</para> ! <programlisting><![CDATA[<bean id="..." class="..."> ! <property name="isolation"> ! <bean id="java.sql.Connection.TRANSACTION_SERIALIZABLE" ! class="org.springframework.beans.factory.config.FieldRetrievingFactoryBean" /> ! </property> ! </bean>]]></programlisting> ! <para>The above configuration uses a Spring <interfacename>FactoryBean</interfacename> ! implementation, the <classname>FieldRetrievingFactoryBean</classname>, to ! set the value of the <literal>'isolation'</literal> property on a bean ! to the value of the <literal>'java.sql.Connection.TRANSACTION_SERIALIZABLE'</literal> ! constant. This is all well and good, but it is a tad verbose and (unneccessarily) ! exposes a Spring's internal plumbing to the end user. ! </para> ! <para>The following XML Schema-based version is considerably more concise, ! it clearly expresses the developers intent (<emphasis>'inject this constant ! value'</emphasis>), and it just plain reads better. ! </para> ! <programlisting><![CDATA[<bean id="..." class="..."> ! <property name="isolation"> ! <util:constant static-field="java.sql.Connection.TRANSACTION_SERIALIZABLE"/> ! </property> ! </bean>]]></programlisting> ! </section> ! <section> ! <title><literal><util:property-path/></literal></title> ! <para>Before...</para> ! <programlisting><lineannotation><!-- target bean to be referenced by name --></lineannotation><![CDATA[ ! <bean id="tb" class="org.springframework.beans.TestBean" singleton="false"> ! <property name="age" value="10"/> ! <property name="spouse"> ! <bean class="org.springframework.beans.TestBean"> ! <property name="age" value="11"/> ! </bean> ! </property> ! </bean> ! ! ]]><lineannotation><!-- will result in 10, which is the value of property 'age' of bean 'tb' --></lineannotation><![CDATA[ ! <bean id="tb.age" class="org.springframework.beans.factory.config.PropertyPathFactoryBean"/>]]></programlisting> ! <para>The above configuration uses a Spring <interfacename>FactoryBean</interfacename> ! implementation, the <classname>PropertyPathFactoryBean</classname>, to ! create a bean (of type <classname>int</classname>) called ! <literal>'tb.age'</literal> that has a value equal to the <literal>'age'</literal> ! property of the <literal>'tb'</literal> bean. ! </para> ! <para>After...</para> ! <programlisting><lineannotation><!-- target bean to be referenced by name --></lineannotation><![CDATA[ ! <bean id="tb" class="org.springframework.beans.TestBean" singleton="false"> ! <property name="age" value="10"/> ! <property name="spouse"> ! <bean class="org.springframework.beans.TestBean"> ! <property name="age" value="11"/> ! </bean> ! </property> ! </bean> ! ! ]]><lineannotation><!-- will result in 10, which is the value of property 'age' of bean 'tb' --></lineannotation><![CDATA[ ! <util:property-path id="name" path="tb.age"/>]]></programlisting> ! <para>The value of the <literal>'path'</literal> attribute of the ! <literal><property-path/></literal> tag follows the form <literal>'beanName.beanProperty'</literal>.</para> ! </section> ! <section> ! <title><literal><util:properties/></literal></title> ! <para>Before...</para> ! <programlisting><lineannotation><!-- creates a <classname>java.util.Properties</classname> instance with values loaded from the supplied location --></lineannotation><![CDATA[ ! <bean id="jdbcConfiguration" class="org.springframework.beans.factory.config.PropertiesFactoryBean"> ! <property name="location" value="classpath:com/foo/jdbc-production.properties"/> ! </bean>]]></programlisting> ! <para>The above configuration uses a Spring <interfacename>FactoryBean</interfacename> ! implementation, the <classname>PropertiesFactoryBean</classname>, to ! instantiate a <classname>java.util.Properties</classname> instance with values loaded from ! the supplied <link linkend="resources"><interfacename>Resource</interfacename></link> location). ! </para> ! <para>After...</para> ! <programlisting><lineannotation><!-- creates a <classname>java.util.Properties</classname> instance with values loaded from the supplied location --></lineannotation><![CDATA[ ! <util:properties id="jdbcConfiguration" location="classpath:com/foo/jdbc-production.properties"/>]]></programlisting> ! </section> ! <section> ! <title><literal><util:list/></literal></title> ! <para>Before...</para> ! <programlisting><lineannotation><!-- creates a <classname>java.util.List</classname> instance with values loaded from the supplied <literal>'sourceList'</literal> --></lineannotation><![CDATA[ ! <bean id="emails" class="org.springframework.beans.factory.config.ListFactoryBean"> ! <property name="sourceList"> ! <list> ! <value>pec...@he...</value> ! <value>ras...@sl...</value> ! <value>sta...@go...</value> ! <value>po...@go...</value> ! </list> ! </property> ! </bean>]]></programlisting> ! <para>The above configuration uses a Spring <interfacename>FactoryBean</interfacename> ! implementation, the <classname>ListFactoryBean</classname>, to ! create a <classname>java.util.List</classname> instance initialized ! with values taken from the supplied <literal>'sourceList'</literal>. ! </para> ! <para>After...</para> ! <programlisting><lineannotation><!-- creates a <classname>java.util.List</classname> instance with values loaded from the supplied <literal>'sourceList'</literal> --></lineannotation><![CDATA[ ! <util:list id="emails"> ! <value>pec...@he...</value> ! <value>ras...@sl...</value> ! <value>sta...@go...</value> ! <value>po...@go...</value> ! </util:list>]]></programlisting> ! </section> ! <section> ! <title><literal><util:map/></literal></title> ! <para>Before...</para> ! <programlisting><lineannotation><!-- creates a <classname>java.util.Map</classname> instance with values loaded from the supplied <literal>'sourceMap'</literal> --></lineannotation><![CDATA[ ! <bean id="emails" class="org.springframework.beans.factory.config.MapFactoryBean"> ! <property name="sourceMap"> ! <map> ! <entry key="pechorin" value="pec...@he..."/> ! <entry key="raskolnikov" value="ras...@sl..."/> ! <entry key="stavrogin" value="sta...@go..."/> ! <entry key="porfiry" value="po...@go..."/> ! </list> ! </property> ! </bean>]]></programlisting> ! <para>The above configuration uses a Spring <interfacename>FactoryBean</interfacename> ! implementation, the <classname>MapFactoryBean</classname>, to ! create a <classname>java.util.Map</classname> instance initialized ! with key-value pairs taken from the supplied <literal>'sourceMap'</literal>. ! </para> ! <para>After...</para> ! <programlisting><lineannotation><!-- creates a <classname>java.util.Map</classname> instance with values loaded from the supplied <literal>'sourceMap'</literal> --></lineannotation><![CDATA[ ! <util:map id="emails"> ! <entry key="pechorin" value="pec...@he..."/> ! <entry key="raskolnikov" value="ras...@sl..."/> ! <entry key="stavrogin" value="sta...@go..."/> ! <entry key="porfiry" value="po...@go..."/> ! </util:map>]]></programlisting> ! </section> ! <section> ! <title><literal><util:set/></literal></title> ! <para>Before...</para> ! <programlisting><lineannotation><!-- creates a <classname>java.util.Set</classname> instance with values loaded from the supplied <literal>'sourceSet'</literal> --></lineannotation><![CDATA[ ! <bean id="emails" class="org.springframework.beans.factory.config.SetFactoryBean"> ! <property name="sourceSet"> ! <set> ! <value>pec...@he...</value> ! <value>ras...@sl...</value> ! <value>sta...@go...</value> ! <value>po...@go...</value> ! </set> ! </property> ! </bean>]]></programlisting> ! <para>The above configuration uses a Spring <interfacename>FactoryBean</interfacename> ! implementation, the <classname>SetFactoryBean</classname>, to ! create a <classname>java.util.Set</classname> instance initialized ! with values taken from the supplied <literal>'sourceSet'</literal>. ! </para> ! <para>After...</para> ! <programlisting><lineannotation><!-- creates a <classname>java.util.Set</classname> instance with values loaded from the supplied <literal>'sourceSet'</literal> --></lineannotation><![CDATA[ ! <util:set id="set"> ! <value>pec...@he...</value> ! <value>ras...@sl...</value> ! <value>sta...@go...</value> ! <value>po...@go...</value> ! </util:set>]]></programlisting> ! </section> ! </section> ! </section> ! <section id="xsd-config-setup"> ! <title>Setting up your IDE</title> ! <para>This final section documents the steps involved in setting up a number of ! popular Java IDEs to effect the easier editing of Spring's XML Schema-based ! configuration files.</para> ! <para>If your favourite Java IDE or editor is not included in the list of ! documented IDEs, then please do raise an issue on the Spring Framework ! <ulink linkend="http://opensource.atlassian.com/projects/spring/secure/Dashboard.jspa">JIRA</ulink> ! and the oversight <emphasis>may</emphasis> well be addressed in the next release.</para> ! <section id="xsd-config-setup-eclipse"> ! <title>Setting up Eclipse</title> ! <para>[TODO : document setting up Eclipse (with screenshots)]</para> ! </section> ! <section id="xsd-config-setup-idea"> ! <title>Setting up IDEA</title> ! <para>[TODO : document setting up IDEA (with screenshots)]</para> ! </section> ! </section> </appendix> \ No newline at end of file |
From: Rick E. <spr...@us...> - 2006-04-21 10:31:35
|
Update of /cvsroot/springframework/spring/src/org/springframework/beans/factory/config In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17171/src/org/springframework/beans/factory/config Modified Files: PropertiesFactoryBean.java Log Message: Minor - corrected Javadoc grammar. Index: PropertiesFactoryBean.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/beans/factory/config/PropertiesFactoryBean.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** PropertiesFactoryBean.java 17 Sep 2005 17:05:27 -0000 1.17 --- PropertiesFactoryBean.java 21 Apr 2006 10:31:11 -0000 1.18 *************** *** 26,30 **** /** * Allows for making a properties file from a classpath location available ! * as Properties instance in a bean factory. Can be used for to populate * any bean property of type Properties via a bean reference. * --- 26,30 ---- /** * Allows for making a properties file from a classpath location available ! * as Properties instance in a bean factory. Can be used to populate * any bean property of type Properties via a bean reference. * |
From: Rick E. <spr...@us...> - 2006-04-21 10:19:12
|
Update of /cvsroot/springframework/spring/src/org/springframework/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10291/src/org/springframework/util Modified Files: ClassUtils.java Log Message: Minor - added missing whitespace to debug message have correct grammar. Index: ClassUtils.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/util/ClassUtils.java,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** ClassUtils.java 21 Apr 2006 09:33:56 -0000 1.23 --- ClassUtils.java 21 Apr 2006 10:18:54 -0000 1.24 *************** *** 492,501 **** return true; } ! catch (Exception e) { if(logger.isDebugEnabled()) { ! logger.debug("Class '" + className + "'or one of its dependencies is not present.", e); } return false; } } } --- 492,502 ---- return true; } ! catch (Exception ex) { if(logger.isDebugEnabled()) { ! logger.debug("Class '" + className + "' or one of its dependencies is not present.", ex); } return false; } } + } |
From: Rob H. <rob...@us...> - 2006-04-21 09:34:03
|
Update of /cvsroot/springframework/spring/test/org/springframework/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15890/test/org/springframework/util Modified Files: ClassUtilsTests.java Log Message: Added ClassUtils.isPresent(). Updated LangNamespaceHandler to guard adding of BDPs Index: ClassUtilsTests.java =================================================================== RCS file: /cvsroot/springframework/spring/test/org/springframework/util/ClassUtilsTests.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** ClassUtilsTests.java 30 Jan 2006 20:50:19 -0000 1.11 --- ClassUtilsTests.java 21 Apr 2006 09:33:56 -0000 1.12 *************** *** 35,38 **** --- 35,39 ---- * @author Colin Sampaleanu * @author Juergen Hoeller + * @author Rob Harrop */ public class ClassUtilsTests extends TestCase { *************** *** 176,179 **** --- 177,184 ---- } + public void testIsPresent() throws Exception { + assertTrue(ClassUtils.isPresent("java.lang.String")); + assertFalse(ClassUtils.isPresent("java.lang.MySpecialString")); + } public static class InnerClass { |
From: Rob H. <rob...@us...> - 2006-04-21 09:34:03
|
Update of /cvsroot/springframework/spring/src/org/springframework/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15890/src/org/springframework/util Modified Files: ClassUtils.java Log Message: Added ClassUtils.isPresent(). Updated LangNamespaceHandler to guard adding of BDPs Index: ClassUtils.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/util/ClassUtils.java,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** ClassUtils.java 6 Apr 2006 13:18:31 -0000 1.22 --- ClassUtils.java 21 Apr 2006 09:33:56 -0000 1.23 *************** *** 17,20 **** --- 17,23 ---- package org.springframework.util; + import org.apache.commons.logging.Log; + import org.apache.commons.logging.LogFactory; + import java.beans.Introspector; import java.lang.reflect.Array; *************** *** 54,57 **** --- 57,65 ---- /** + * {@link Log} instance for this class. + */ + private static final Log logger = LogFactory.getLog(ClassUtils.class); + + /** * Map with primitive wrapper type as key and corresponding primitive * type as value, for example: Integer.class -> int.class *************** *** 474,476 **** --- 482,501 ---- } + /** + * Returns <code>true</code> if the {@link Class} identified by the supplied name + * is present and can be loaded. Will return <code>false</code> if either the class + * or one of its dependencies is not present or cannot be loaded. + */ + public static boolean isPresent(String className) { + try { + forName(className); + return true; + } + catch (Exception e) { + if(logger.isDebugEnabled()) { + logger.debug("Class '" + className + "'or one of its dependencies is not present.", e); + } + return false; + } + } } |
From: Rob H. <rob...@us...> - 2006-04-21 09:34:00
|
Update of /cvsroot/springframework/spring/src/org/springframework/scripting/config In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15890/src/org/springframework/scripting/config Modified Files: LangNamespaceHandler.java Log Message: Added ClassUtils.isPresent(). Updated LangNamespaceHandler to guard adding of BDPs Index: LangNamespaceHandler.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/scripting/config/LangNamespaceHandler.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** LangNamespaceHandler.java 18 Apr 2006 21:16:23 -0000 1.1 --- LangNamespaceHandler.java 21 Apr 2006 09:33:56 -0000 1.2 *************** *** 18,24 **** --- 18,26 ---- import org.springframework.beans.factory.xml.NamespaceHandlerSupport; + import org.springframework.beans.factory.xml.BeanDefinitionParser; import org.springframework.scripting.bsh.BshScriptFactory; import org.springframework.scripting.groovy.GroovyScriptFactory; import org.springframework.scripting.jruby.JRubyScriptFactory; + import org.springframework.util.ClassUtils; /** *************** *** 29,35 **** public void init() { ! registerBeanDefinitionParser("groovy", new ScriptBeanDefinitionParser(GroovyScriptFactory.class)); ! registerBeanDefinitionParser("jruby", new ScriptBeanDefinitionParser(JRubyScriptFactory.class)); ! registerBeanDefinitionParser("bsh", new ScriptBeanDefinitionParser(BshScriptFactory.class)); } --- 31,45 ---- public void init() { ! if (ClassUtils.isPresent("groovy.lang.GroovyObject")) { ! registerBeanDefinitionParser("groovy", new ScriptBeanDefinitionParser(GroovyScriptFactory.class)); ! } ! ! if (ClassUtils.isPresent("org.jruby.IRuby")) { ! registerBeanDefinitionParser("jruby", new ScriptBeanDefinitionParser(JRubyScriptFactory.class)); ! } ! ! if (ClassUtils.isPresent("bsh.Interpreter")) { ! registerBeanDefinitionParser("bsh", new ScriptBeanDefinitionParser(BshScriptFactory.class)); ! } } |
From: Rod J. <joh...@us...> - 2006-04-21 09:31:13
|
Update of /cvsroot/springframework/spring/tiger/test/org/springframework/aop/aspectj/autoproxy/benchmark In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14325/tiger/test/org/springframework/aop/aspectj/autoproxy/benchmark Modified Files: BenchmarkTests.java Log Message: Reduced number of passes to 10, and commented how to change it back to make tests meaningful Index: BenchmarkTests.java =================================================================== RCS file: /cvsroot/springframework/spring/tiger/test/org/springframework/aop/aspectj/autoproxy/benchmark/BenchmarkTests.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** BenchmarkTests.java 12 Apr 2006 18:17:39 -0000 1.3 --- BenchmarkTests.java 21 Apr 2006 09:30:50 -0000 1.4 *************** *** 28,40 **** * Tests for AspectJ auto proxying. Includes mixing with Spring AOP * Advisors to demonstrate that existing autoproxying contract is honoured. ! * * @author Rod Johnson */ public class BenchmarkTests extends TestCase { private static final String ASPECTJ_CONTEXT = "/org/springframework/aop/aspectj/autoproxy/benchmark/aspectj.xml"; protected int getCount() { ! return 1000000; } --- 28,54 ---- * Tests for AspectJ auto proxying. Includes mixing with Spring AOP * Advisors to demonstrate that existing autoproxying contract is honoured. ! * <p> ! * Change the return of the getCount() method to MEANINGFUL_NUMBER_OF_PASSES ! * to make this test actually run a meaningful benchmark. Currently it is set ! * to execute the test suite quickly, not produce meaningful results. * @author Rod Johnson */ public class BenchmarkTests extends TestCase { + /** + * Number of passes high enough to produce meaningful results. + */ + private static final int MEANINGFUL_NUMBER_OF_PASSES = 1000000; + private static final String ASPECTJ_CONTEXT = "/org/springframework/aop/aspectj/autoproxy/benchmark/aspectj.xml"; + /** + * Change the return number to MEANINGFUL_NUMBER_OF_PASSES to make this + * test useful + * @return the number of passes to runs + */ protected int getCount() { ! return 10; ! //return MEANINGFUL_NUMBER_OF_PASSES; } |
From: Juergen H. <jho...@us...> - 2006-04-21 00:18:53
|
Update of /cvsroot/springframework/spring In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22626 Modified Files: Tag: mbranch-1-2 readme.txt Log Message: prepared for release 1.2.8 Index: readme.txt =================================================================== RCS file: /cvsroot/springframework/spring/readme.txt,v retrieving revision 1.68.2.6 retrieving revision 1.68.2.7 diff -C2 -d -r1.68.2.6 -r1.68.2.7 *** readme.txt 24 Feb 2006 20:49:18 -0000 1.68.2.6 --- readme.txt 21 Apr 2006 00:18:46 -0000 1.68.2.7 *************** *** 1,4 **** ! THE SPRING FRAMEWORK, release 1.2.7 (February 2006) ! --------------------------------------------------- http://www.springframework.org --- 1,4 ---- ! THE SPRING FRAMEWORK, release 1.2.8 (April 2006) ! ------------------------------------------------ http://www.springframework.org *************** *** 93,97 **** - Dependencies: Commons Logging, (Log4J) ! * "spring-beans" (~225 KB) - Contents: JavaBeans support, bean container - Dependencies: spring-core, (CGLIB) --- 93,97 ---- - Dependencies: Commons Logging, (Log4J) ! * "spring-beans" (~230 KB) - Contents: JavaBeans support, bean container - Dependencies: spring-core, (CGLIB) *************** *** 101,105 **** - Dependencies: spring-core, (spring-beans, CGLIB, Commons Attributes) ! * "spring-context" (~105 KB) - Contents: application context, validation, JNDI, UI context support - Dependencies: spring-beans, (spring-aop, Velocity, FreeMarker, JasperReports) --- 101,105 ---- - Dependencies: spring-core, (spring-beans, CGLIB, Commons Attributes) ! * "spring-context" (~110 KB) - Contents: application context, validation, JNDI, UI context support - Dependencies: spring-beans, (spring-aop, Velocity, FreeMarker, JasperReports) *************** *** 137,141 **** - Dependencies: spring-dao, spring-beans, (spring-aop, spring-web, Hibernate2, Hibernate3) ! * "spring" (~1885 KB) - Contents: all of the above (note: mocks not included) - Dependencies: all of the above --- 137,141 ---- - Dependencies: spring-dao, spring-beans, (spring-aop, spring-web, Hibernate2, Hibernate3) ! * "spring" (~1890 KB) - Contents: all of the above (note: mocks not included) - Dependencies: all of the above |
From: Juergen H. <jho...@us...> - 2006-04-21 00:16:08
|
Update of /cvsroot/springframework/spring In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21103 Modified Files: Tag: mbranch-1-2 changelog.txt Log Message: backported fixes and enhancements from 2.0 M4 (HEAD) Index: changelog.txt =================================================================== RCS file: /cvsroot/springframework/spring/changelog.txt,v retrieving revision 1.392.2.18 retrieving revision 1.392.2.19 diff -C2 -d -r1.392.2.18 -r1.392.2.19 *** changelog.txt 27 Feb 2006 20:36:23 -0000 1.392.2.18 --- changelog.txt 21 Apr 2006 00:16:01 -0000 1.392.2.19 *************** *** 4,7 **** --- 4,85 ---- + Changes in version 1.2.8 (23.4.2006) + ------------------------------------ + + General: + * included "tiger" source tree in source build (spring-src.zip) + + Package org.springframework.aop + * fixed Cglib2AopProxy to register an explicitly given ClassLoader with the CGLIB Enhancer + * fixed CustomizableTraceInterceptor to expose the actual invocation time for exception messages + * added "trackAllInvocations" flag to JamonPerformanceMonitorInterceptor, for gathering statistics without logging + + Package org.springframework.beans + * BeanUtils throws explicit BeanInstantiationException in case of bean instantiation failure + * fixed BeanWrapperImpl to convert a null input for an array type to a null value rather than an array with null element + * changed MutablePropertyValues's "addPropertyValue" signature to void, to remain binary compatible with Spring <=1.2.6 + * fixed BeanArrayPropertyEditor to translate null value to null byte array + * added CharArrayPropertyEditor to translate String value into char array + * CharacterEditor supports unicode specification passed in as literal String, for example "\u00F6" + * FieldRetrievingFactoryBean is able to access non-public fields as well + * added "propertiesArray" bean property to PropertiesFactoryBean, for merging multiple local Properties instances + * fixed AbstractBeanFactory to avoid potential deadlock on singleton destruction with concurrent singleton creation + * fixed DefaultListableBeanFactory to not preinstantiate bean definition if explicit singleton object already registered + + Package org.springframework.context + * refined AbstractMessageSource to resolve arguments eagerly, for message defined in parent and msg arg defined in child + + Package org.springframework.core + * refined NestedXxxException to properly handle null message in root cause, through using the cause's "toString()" + * fixed FileSystemResource/UrlResource to retain leading "../" parts in paths, building correct relative paths for them + + Package org.springframework.jdbc + * refined NativeJdbcExtractorAdapter to retry with DatabaseMetaData Connection if extraction failed (for Hibernate 3.1) + * turned JdbcTemplate's "query(PreparedStatementCreator,PreparedStatementSetter,ResultSetExtractor rse)" method public + * improved JdbcTemplate's logging of ignored SQLWarnings, including SQL state and error code in the log output + + Package org.springframework.jndi + * added "defaultObject" property to JndiObjectFactoryBean, allowing to fall back to default object if JNDI lookup fails + + Package org.springframework.mail + * refined JavaMailSenderImpl to avoid "Session.getInstance(Properties)" call, for compatibility with (old) JavaMail 1.1 + + Package org.springframework.mock + * added overloaded constructors to MockFilterConfig, using a MockServletContext instead of a ServletContext argument + + Package org.springframework.orm + * fixed LocalSessionFactoryBean's "updateDatabaseSchema" to declare the correct exception (DataAccessException) + * fixed BlobStringType for Hibernate2/3 to correctly handle SQL NULL + + Package org.springframework.remoting + * RmiClientInterceptorUtils throws clearer exception message in case of proxy mismatch (for underlying RMI stubs) + * JaxRpcPortClientInterceptor synchronizes creation of JAX-RPC Calls, to make dynamic invocations with Axis thread-safe + + Package org.springframework.scheduling + * fixed TimerFactoryBean to properly initialize even without "scheduledTimerTasks" configured + + Package org.springframework.transaction + * AbstractPlatformTransactionManager logs "Should roll back transaction but cannot" message at debug level (not warn) + * TransactionInterceptor logs application exception at error level if commit throws an exception + + Package org.springframework.util + * fixed CollectionsUtils's "hasUniqueObject" to correctly handle null values + + Package org.springframework.validation + * fixed ValidationUtils's "invokeValidator" to work correctly even in case of a null reference as object to be validated + + Package org.springframework.web + * ContextLoader throws IllegalStateException if there is already a root application context present + * fixed CommonsMultipartResolver to go through the "newFileUpload" template method for any FileUpload instance + * refined FrameworkServlet to log a request handling failure at debug level rather than error level + * added "propertyEditorRegistrar" bean property to BaseCommandController, as convenience option for a single registrar + * factored out "handleNoSuchRequestHandlingMethod" method in MultiActionController, to be overridden in subclasses + * fixed SimpleMappingExceptionResolver to correctly check the depth of all exception mappings before choosing a view + * refined SimpleMappingExceptionResolver to only apply a "defaultStatusCode" to a top-level request (not to an include) + * added "clearCache()" method to AbstractCachingViewResolver, for removing all cached view objects + * optimized BeanNameViewResolver to avoid internal throwing and catching of NoSuchBeanDefinitionExceptions + * "javaScriptEscape" feature of Spring tags correctly escapes "</script>" inside a literal value + + Changes in version 1.2.7 (27.2.2006) ------------------------------------ |
From: Juergen H. <jho...@us...> - 2006-04-21 00:14:28
|
Update of /cvsroot/springframework/spring/src/org/springframework/transaction/support In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19629/src/org/springframework/transaction/support Modified Files: Tag: mbranch-1-2 AbstractPlatformTransactionManager.java Log Message: backported fixes and enhancements from 2.0 M4 (HEAD) Index: AbstractPlatformTransactionManager.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/transaction/support/AbstractPlatformTransactionManager.java,v retrieving revision 1.55.2.2 retrieving revision 1.55.2.3 diff -C2 -d -r1.55.2.2 -r1.55.2.3 *** AbstractPlatformTransactionManager.java 18 Feb 2006 19:18:45 -0000 1.55.2.2 --- AbstractPlatformTransactionManager.java 21 Apr 2006 00:13:50 -0000 1.55.2.3 *************** *** 599,603 **** } else { ! logger.warn("Should roll back transaction but cannot - no transaction available"); } } --- 599,603 ---- } else { ! logger.debug("Should roll back transaction but cannot - no transaction available"); } } |
From: Juergen H. <jho...@us...> - 2006-04-21 00:14:28
|
Update of /cvsroot/springframework/spring/src/org/springframework/orm/hibernate3 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19629/src/org/springframework/orm/hibernate3 Modified Files: Tag: mbranch-1-2 FilterDefinitionFactoryBean.java LocalSessionFactoryBean.java Log Message: backported fixes and enhancements from 2.0 M4 (HEAD) Index: LocalSessionFactoryBean.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/orm/hibernate3/LocalSessionFactoryBean.java,v retrieving revision 1.20.2.4 retrieving revision 1.20.2.5 diff -C2 -d -r1.20.2.4 -r1.20.2.5 *** LocalSessionFactoryBean.java 23 Feb 2006 22:37:06 -0000 1.20.2.4 --- LocalSessionFactoryBean.java 21 Apr 2006 00:13:49 -0000 1.20.2.5 *************** *** 782,786 **** } } ! /** --- 782,786 ---- } } ! /** *************** *** 894,898 **** public Object doInHibernate(Session session) throws HibernateException, SQLException { Connection con = session.connection(); ! final Dialect dialect = Dialect.getDialect(configuration.getProperties()); String[] sql = configuration.generateSchemaCreationScript(dialect); executeSchemaScript(con, sql); --- 894,898 ---- public Object doInHibernate(Session session) throws HibernateException, SQLException { Connection con = session.connection(); ! Dialect dialect = Dialect.getDialect(configuration.getProperties()); String[] sql = configuration.generateSchemaCreationScript(dialect); executeSchemaScript(con, sql); *************** *** 913,922 **** * <p>Uses the SessionFactory that this bean generates for accessing a JDBC * connection to perform the script. ! * @throws HibernateException in case of Hibernate initialization errors * @see #setSchemaUpdate * @see org.hibernate.cfg.Configuration#generateSchemaUpdateScript * @see org.hibernate.tool.hbm2ddl.SchemaUpdate */ ! public void updateDatabaseSchema() throws HibernateException { logger.info("Updating database schema for Hibernate SessionFactory"); HibernateTemplate hibernateTemplate = new HibernateTemplate(this.sessionFactory); --- 913,922 ---- * <p>Uses the SessionFactory that this bean generates for accessing a JDBC * connection to perform the script. ! * @throws DataAccessException in case of script execution errors * @see #setSchemaUpdate * @see org.hibernate.cfg.Configuration#generateSchemaUpdateScript * @see org.hibernate.tool.hbm2ddl.SchemaUpdate */ ! public void updateDatabaseSchema() throws DataAccessException { logger.info("Updating database schema for Hibernate SessionFactory"); HibernateTemplate hibernateTemplate = new HibernateTemplate(this.sessionFactory); *************** *** 926,930 **** public Object doInHibernate(Session session) throws HibernateException, SQLException { Connection con = session.connection(); ! final Dialect dialect = Dialect.getDialect(configuration.getProperties()); DatabaseMetadata metadata = new DatabaseMetadata(con, dialect); String[] sql = configuration.generateSchemaUpdateScript(dialect, metadata); --- 926,930 ---- public Object doInHibernate(Session session) throws HibernateException, SQLException { Connection con = session.connection(); ! Dialect dialect = Dialect.getDialect(configuration.getProperties()); DatabaseMetadata metadata = new DatabaseMetadata(con, dialect); String[] sql = configuration.generateSchemaUpdateScript(dialect, metadata); Index: FilterDefinitionFactoryBean.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/orm/hibernate3/FilterDefinitionFactoryBean.java,v retrieving revision 1.2 retrieving revision 1.2.4.1 diff -C2 -d -r1.2 -r1.2.4.1 *** FilterDefinitionFactoryBean.java 19 Apr 2005 21:07:55 -0000 1.2 --- FilterDefinitionFactoryBean.java 21 Apr 2006 00:13:49 -0000 1.2.4.1 *************** *** 1,4 **** /* ! * Copyright 2002-2005 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); --- 1,4 ---- /* ! * Copyright 2002-2006 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); *************** *** 31,36 **** * Exposes a corresponding Hibernate FilterDefinition object. * ! * <p>Typically defined as inner bean within a LocalSessionFactoryBean ! * definition, as list element for the "filterDefinitions" bean property. * For example: * --- 31,36 ---- * Exposes a corresponding Hibernate FilterDefinition object. * ! * <p>Typically defined as an inner bean within a LocalSessionFactoryBean ! * definition, as the list element for the "filterDefinitions" bean property. * For example: * *************** *** 57,60 **** --- 57,66 ---- * instead of the "filterName" property. * + * <p><b>NOTE:</b> This FactoryBean uses Hibernate 3.0 API. Unfortunately, + * Hibernate 3.1 changed its FilterDefinition class in a non-backwards-compatible + * fashion. Consider defining filters within Hibernate's own configuration file + * instead of through this FactoryBean, if you intend to run on Hibernate 3.1. + * (As of Spring 2.0, this FactoryBean will use Hibernate 3.1 API.) + * * @author Juergen Hoeller * @since 1.2 |