You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by bo...@apache.org on 2007/05/06 16:59:31 UTC
svn commit: r535618 - in /myfaces/tobago/trunk/example/addressbook: pom.xml
src/main/java/org/apache/myfaces/tobago/example/addressbook/OpenJpaLoadTimeWeaver.java
src/main/webapp/WEB-INF/applicationContext.xml
Author: bommel
Date: Sun May 6 07:59:30 2007
New Revision: 535618
URL: http://svn.apache.org/viewvc?view=rev&rev=535618
Log:
update addressbook to openjpa 0.9.7-incubating
Added:
myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/OpenJpaLoadTimeWeaver.java
Modified:
myfaces/tobago/trunk/example/addressbook/pom.xml
myfaces/tobago/trunk/example/addressbook/src/main/webapp/WEB-INF/applicationContext.xml
Modified: myfaces/tobago/trunk/example/addressbook/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/addressbook/pom.xml?view=diff&rev=535618&r1=535617&r2=535618
==============================================================================
--- myfaces/tobago/trunk/example/addressbook/pom.xml (original)
+++ myfaces/tobago/trunk/example/addressbook/pom.xml Sun May 6 07:59:30 2007
@@ -300,7 +300,7 @@
</profile>
</profiles>
<properties>
- <openjpa.version>0.9.6-incubating</openjpa.version>
+ <openjpa.version>0.9.7-incubating</openjpa.version>
<spring.version>2.0.4</spring.version>
</properties>
</project>
Added: myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/OpenJpaLoadTimeWeaver.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/OpenJpaLoadTimeWeaver.java?view=auto&rev=535618
==============================================================================
--- myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/OpenJpaLoadTimeWeaver.java (added)
+++ myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/OpenJpaLoadTimeWeaver.java Sun May 6 07:59:30 2007
@@ -0,0 +1,66 @@
+package org.apache.myfaces.tobago.example.addressbook;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+
+import org.springframework.instrument.classloading.SimpleInstrumentableClassLoader;
+import org.springframework.instrument.classloading.SimpleLoadTimeWeaver;
+
+
+/**
+ * <a href ="https://issues.apache.org/jira/browse/OPENJPA-40">COPY FROM OPENJPA-40</a>
+ * OpenJPA-specific SimpleLoadTimeWeaver which excludes all the core
+ * <em>org.apache.openjpa</em> packages from being instrumented. This
+ * is important, since enhanced classes will wind up implementing
+ * <em>org.apache.openjpa.enhance.PersistenceCapable</em>, so it there
+ * is a mismatch between the PersistenceCapable that is loaded by the
+ * system classloader and the one that is loaded by the
+ * instrumenting ClassLoader, then OpenJPA will not function properly.
+ *
+ * <p>
+ *
+ * This loader can be specific by including the following in the
+ * spring configuration XML as follows:
+ *
+ * <p>
+ *
+ * <code>
+ * <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"&rt;
+ * ...
+ * <property name="loadTimeWeaver"&rt;
+ * <bean class="oorg.apache.myfaces.tobago.example.addressbook.OpenJpaLoadTimeWeaver"/&rt;
+ * </property&rt;
+ * </bean&rt;
+ * </code>
+ *
+ * author Marc Prud'hommeaux
+ * @since 2.0
+ */
+public class OpenJpaLoadTimeWeaver extends SimpleLoadTimeWeaver {
+
+ public OpenJpaLoadTimeWeaver() {
+ super();
+ ((SimpleInstrumentableClassLoader) getInstrumentableClassLoader()).
+ excludePackage("org.apache.openjpa");
+ }
+
+ public OpenJpaLoadTimeWeaver(SimpleInstrumentableClassLoader loader) {
+ super(loader);
+ ((SimpleInstrumentableClassLoader) getInstrumentableClassLoader()).
+ excludePackage("org.apache.openjpa");
+ }
+}
Modified: myfaces/tobago/trunk/example/addressbook/src/main/webapp/WEB-INF/applicationContext.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/addressbook/src/main/webapp/WEB-INF/applicationContext.xml?view=diff&rev=535618&r1=535617&r2=535618
==============================================================================
--- myfaces/tobago/trunk/example/addressbook/src/main/webapp/WEB-INF/applicationContext.xml (original)
+++ myfaces/tobago/trunk/example/addressbook/src/main/webapp/WEB-INF/applicationContext.xml Sun May 6 07:59:30 2007
@@ -39,7 +39,7 @@
</property>
<property name="persistenceUnitName" value="addressBook"/>
<property name="loadTimeWeaver">
- <bean class="org.springframework.instrument.classloading.SimpleLoadTimeWeaver"/>
+ <bean class="org.apache.myfaces.tobago.example.addressbook.OpenJpaLoadTimeWeaver"/>
</property>
</bean>