Author: norman
Date: Sat Jan  9 22:06:14 2010
New Revision: 897560

URL: http://svn.apache.org/viewvc?rev=897560&view=rev
Log:
Add stuff for JPA support

Added:
    james/server/trunk/spring-deployment/src/main/config/james/META-INF/
    
james/server/trunk/spring-deployment/src/main/config/james/META-INF/persistence.xml
Modified:
    james/server/trunk/pom.xml
    james/server/trunk/spring-deployment/pom.xml
    james/server/trunk/spring-deployment/src/assemble/bin.xml
    james/server/trunk/spring-deployment/src/main/config/james/spring-beans.xml

Modified: james/server/trunk/pom.xml
URL: 
http://svn.apache.org/viewvc/james/server/trunk/pom.xml?rev=897560&r1=897559&r2=897560&view=diff
==============================================================================
--- james/server/trunk/pom.xml (original)
+++ james/server/trunk/pom.xml Sat Jan  9 22:06:14 2010
@@ -454,6 +454,11 @@
     </dependency>
     <dependency>
       <groupId>org.apache.james</groupId>
+      <artifactId>apache-james-imap-jpa</artifactId>
+      <version>0.1-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.james</groupId>
       <artifactId>apache-james-imap-store</artifactId>
       <version>0.1-SNAPSHOT</version>
       <exclusions>
@@ -1056,6 +1061,44 @@
       <version>2.5.6</version>
     </dependency>
     <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-jdbc</artifactId>
+      <version>2.5.6</version>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-tx</artifactId>
+      <version>2.5.6</version>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-orm</artifactId>
+      <version>2.5.6</version>
+      <scope>runtime</scope>
+      <exclusions>
+        <exclusion>
+          <groupId>com.oracle.toplink</groupId>
+          <artifactId>toplink</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>com.oracle</groupId>
+          <artifactId>toplink-essentials</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>org.hibernate</groupId>
+          <artifactId>hibernate</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>org.hibernate</groupId>
+          <artifactId>hibernate-entitymanager</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>org.springframework</groupId>
+          <artifactId>spring-web</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency> 
+    <dependency>
       <groupId>org.slf4j</groupId>
       <artifactId>slf4j-log4j12</artifactId>
       <version>1.3.0</version>

Modified: james/server/trunk/spring-deployment/pom.xml
URL: 
http://svn.apache.org/viewvc/james/server/trunk/spring-deployment/pom.xml?rev=897560&r1=897559&r2=897560&view=diff
==============================================================================
--- james/server/trunk/spring-deployment/pom.xml (original)
+++ james/server/trunk/spring-deployment/pom.xml Sat Jan  9 22:06:14 2010
@@ -220,10 +220,25 @@
       <artifactId>spring-context</artifactId>
     </dependency>
     <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-orm</artifactId>
+      <scope>runtime</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-tx</artifactId>
+      <scope>runtime</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-jdbc</artifactId>
+      <scope>runtime</scope>
+    </dependency>
+    <dependency>
       <groupId>javax.servlet</groupId>
       <artifactId>servlet-api</artifactId>
     </dependency>
-       <dependency>
+    <dependency>
       <groupId>log4j</groupId>
       <artifactId>log4j</artifactId>
     </dependency>
@@ -390,6 +405,11 @@
       <artifactId>derby</artifactId>
       <scope>runtime</scope>
     </dependency>
+    <dependency>
+      <groupId>org.apache.james</groupId>
+      <artifactId>apache-james-imap-jpa</artifactId>
+      <scope>runtime</scope>
+    </dependency>
     
     <dependency>
       <groupId>junit</groupId>
@@ -433,4 +453,4 @@
       <scope>test</scope>
     </dependency>
   </dependencies>
-</project>
\ No newline at end of file
+</project>

Modified: james/server/trunk/spring-deployment/src/assemble/bin.xml
URL: 
http://svn.apache.org/viewvc/james/server/trunk/spring-deployment/src/assemble/bin.xml?rev=897560&r1=897559&r2=897560&view=diff
==============================================================================
--- james/server/trunk/spring-deployment/src/assemble/bin.xml (original)
+++ james/server/trunk/spring-deployment/src/assemble/bin.xml Sat Jan  9 
22:06:14 2010
@@ -40,10 +40,6 @@
     <fileSet>
       <directory>src/main/config/james</directory>
       <outputDirectory>conf</outputDirectory>
-      <includes>
-        <include>*.xml</include>
-        <include>*.properties</include>
-      </includes>
     </fileSet>
     
     <!--  create empty folders by copy a .dummy file -->

Added: 
james/server/trunk/spring-deployment/src/main/config/james/META-INF/persistence.xml
URL: 
http://svn.apache.org/viewvc/james/server/trunk/spring-deployment/src/main/config/james/META-INF/persistence.xml?rev=897560&view=auto
==============================================================================
--- 
james/server/trunk/spring-deployment/src/main/config/james/META-INF/persistence.xml
 (added)
+++ 
james/server/trunk/spring-deployment/src/main/config/james/META-INF/persistence.xml
 Sat Jan  9 22:06:14 2010
@@ -0,0 +1,16 @@
+<persistence xmlns="http://java.sun.com/xml/ns/persistence";
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+    version="1.0">
+    <persistence-unit name="James" transaction-type="RESOURCE_LOCAL">
+       <class>org.apache.james.imap.jpa.mail.model.JPAHeader</class>
+       <class>org.apache.james.imap.jpa.mail.model.JPAMailbox</class>
+       <class>org.apache.james.imap.jpa.mail.model.JPAMailboxMembership</class>
+       <class>org.apache.james.imap.jpa.mail.model.JPAMessage</class>
+       <class>org.apache.james.imap.jpa.mail.model.JPAProperty</class>
+       <class>org.apache.james.imap.jpa.user.model.JPASubscription</class>
+    <properties>
+        <!--  create tables on startup -->
+               <property name="openjpa.jdbc.SynchronizeMappings" 
value="buildSchema(ForeignKeys=true)"/>
+    </properties>
+    </persistence-unit>
+</persistence>

Modified: 
james/server/trunk/spring-deployment/src/main/config/james/spring-beans.xml
URL: 
http://svn.apache.org/viewvc/james/server/trunk/spring-deployment/src/main/config/james/spring-beans.xml?rev=897560&r1=897559&r2=897560&view=diff
==============================================================================
--- james/server/trunk/spring-deployment/src/main/config/james/spring-beans.xml 
(original)
+++ james/server/trunk/spring-deployment/src/main/config/james/spring-beans.xml 
Sat Jan  9 22:06:14 2010
@@ -330,10 +330,6 @@
     <bean id="imapEncoderFactory" 
class="org.apache.james.imap.encode.main.DefaultImapEncoderFactory"/>
     <bean id="imapEncoder" factory-bean="imapEncoderFactory"  
factory-method="buildImapEncoder"/>
        
-       <bean id="mailboxmanager" 
class="org.apache.james.mailboxmanager.torque.DefaultMailboxManager">
-                       <constructor-arg index="0" ref="authenticator"/>
-                       <constructor-arg index="1" ref="subscriper"/>
-       </bean>
        
        <bean id="subscriper" 
class="org.apache.james.imapserver.UserMetaDataRepositorySubscripter"/>
                
@@ -342,6 +338,42 @@
        <bean id="userMetaDataRepository" 
class="org.apache.james.user.impl.file.FileUserMetaDataRepository">
                <constructor-arg index="0" value="var/users"/>
         </bean>
+        
+        <bean id="mailboxmanager" 
class="org.apache.james.mailboxmanager.torque.DefaultMailboxManager">
+                       <constructor-arg index="0" ref="authenticator"/>
+                       <constructor-arg index="1" ref="subscriper"/>
+       </bean>
+       
+       <!--  Enable this for JPA implementation -->
+       <!--  
+       <bean id="mailboxmanager" 
class="org.apache.james.imap.jpa.JPAMailboxManager">
+        <constructor-arg index="0" ref="authenticator"/>
+        <constructor-arg index="1" ref="subscriper"/>
+        <constructor-arg index="2" ref="entityManagerFactory"/>
+    </bean>
+
+    <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" 
destroy-method="close">
+        <property name="driverClassName" 
value="org.apache.derby.jdbc.EmbeddedDriver" />
+        <property name="url" 
value="jdbc:derby:../var/mailboxmanager-derbydb;create=true" />
+        <property name="username" value="app" />
+        <property name="password" value="app" />
+    </bean>
+    
+    <bean id="entityManagerFactory" 
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
+        <property name="dataSource" ref="dataSource"/>
+        <property name="jpaVendorAdapter" ref="vendorAdapter"/>
+    </bean>
+
+    <bean id="vendorAdapter" 
class="org.springframework.orm.jpa.vendor.OpenJpaVendorAdapter">
+        <property name="database" value="DERBY"/>
+        <property name="showSql" value="true"/>
+    </bean>
+
+    <bean id="transactionManager" 
class="org.springframework.orm.jpa.JpaTransactionManager">
+       <property name="entityManagerFactory" ref="entityManagerFactory"/>
+       <property name="dataSource" ref="dataSource"/>
+    </bean>
+       -->
        <!--
                
####################################################################
        -->



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to