You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by dj...@apache.org on 2008/06/17 02:06:04 UTC
svn commit: r668352 - in /geronimo/plugins/james/trunk: ./
geronimo-james/src/main/java/org/apache/geronimo/plugins/james/
james-derby-database/ james-derby-database/src/
james-derby-database/src/main/ james-derby-database/src/main/plan/
james-derby-da...
Author: djencks
Date: Mon Jun 16 17:06:04 2008
New Revision: 668352
URL: http://svn.apache.org/viewvc?rev=668352&view=rev
Log:
a bit of pom cleanup, and add a james db. Attempt to use it: the server starts but I don't know if it works
Added:
geronimo/plugins/james/trunk/geronimo-james/src/main/java/org/apache/geronimo/plugins/james/DataSourceBridge.java (with props)
geronimo/plugins/james/trunk/james-derby-database/
geronimo/plugins/james/trunk/james-derby-database/pom.xml (with props)
geronimo/plugins/james/trunk/james-derby-database/src/
geronimo/plugins/james/trunk/james-derby-database/src/main/
geronimo/plugins/james/trunk/james-derby-database/src/main/plan/
geronimo/plugins/james/trunk/james-derby-database/src/main/plan/plan.xml (with props)
geronimo/plugins/james/trunk/james-derby-database/src/main/resources/
Modified:
geronimo/plugins/james/trunk/james/pom.xml
geronimo/plugins/james/trunk/james/src/main/resources/var/james/config/james-config.xml
geronimo/plugins/james/trunk/pom.xml
Added: geronimo/plugins/james/trunk/geronimo-james/src/main/java/org/apache/geronimo/plugins/james/DataSourceBridge.java
URL: http://svn.apache.org/viewvc/geronimo/plugins/james/trunk/geronimo-james/src/main/java/org/apache/geronimo/plugins/james/DataSourceBridge.java?rev=668352&view=auto
==============================================================================
--- geronimo/plugins/james/trunk/geronimo-james/src/main/java/org/apache/geronimo/plugins/james/DataSourceBridge.java (added)
+++ geronimo/plugins/james/trunk/geronimo-james/src/main/java/org/apache/geronimo/plugins/james/DataSourceBridge.java Mon Jun 16 17:06:04 2008
@@ -0,0 +1,55 @@
+/*
+ * 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.
+ */
+
+
+package org.apache.geronimo.plugins.james;
+
+import java.sql.Connection;
+import java.sql.SQLException;
+
+import javax.sql.DataSource;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+import org.apache.avalon.excalibur.datasource.DataSourceComponent;
+import org.apache.avalon.framework.configuration.Configuration;
+import org.apache.avalon.framework.configuration.ConfigurationException;
+
+/**
+ * Avalon component that delegates to a datasource from global jndi
+ * @version $Rev:$ $Date:$
+ */
+public class DataSourceBridge implements DataSourceComponent {
+
+ private DataSource ds;
+
+ public Connection getConnection() throws SQLException {
+ return ds.getConnection();
+ }
+
+ public void configure(Configuration configuration) throws ConfigurationException {
+ String jndiName = configuration.getChild("jndi-name").getValue();
+ try {
+ InitialContext ctx = new InitialContext();
+ ds = (DataSource) ctx.lookup(jndiName);
+ } catch (NamingException e) {
+ throw new ConfigurationException("Could not locate datasource at: " + jndiName, e);
+ }
+ }
+}
Propchange: geronimo/plugins/james/trunk/geronimo-james/src/main/java/org/apache/geronimo/plugins/james/DataSourceBridge.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/plugins/james/trunk/geronimo-james/src/main/java/org/apache/geronimo/plugins/james/DataSourceBridge.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: geronimo/plugins/james/trunk/geronimo-james/src/main/java/org/apache/geronimo/plugins/james/DataSourceBridge.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/plugins/james/trunk/james-derby-database/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/plugins/james/trunk/james-derby-database/pom.xml?rev=668352&view=auto
==============================================================================
--- geronimo/plugins/james/trunk/james-derby-database/pom.xml (added)
+++ geronimo/plugins/james/trunk/james-derby-database/pom.xml Mon Jun 16 17:06:04 2008
@@ -0,0 +1,110 @@
+<?xml version="1.0"?>
+<!--
+ 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.
+-->
+<!-- $Rev$ $Date$ -->
+
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <parent>
+ <artifactId>james-parent</artifactId>
+ <groupId>org.apache.geronimo.plugins</groupId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>james-derby-database</artifactId>
+ <packaging>car</packaging>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.geronimo.configs</groupId>
+ <artifactId>system-database</artifactId>
+ <type>car</type>
+ </dependency>
+
+ <dependency>
+ <groupId>org.tranql</groupId>
+ <artifactId>tranql-connector-derby-embed-xa</artifactId>
+ <type>rar</type>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.geronimo.framework</groupId>
+ <artifactId>geronimo-gbean-deployer</artifactId>
+ <type>car</type>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.geronimo.configs</groupId>
+ <artifactId>j2ee-deployer</artifactId>
+ <type>car</type>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.geronimo.configs</groupId>
+ <artifactId>connector-deployer</artifactId>
+ <type>car</type>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.geronimo.buildsupport</groupId>
+ <artifactId>car-maven-plugin</artifactId>
+ <version>${geronimoVersion}</version>
+ <extensions>true</extensions>
+ <configuration>
+ <category>Mail</category>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.geronimo.buildsupport</groupId>
+ <artifactId>car-maven-plugin</artifactId>
+ <configuration>
+ <deploymentConfigs>
+ <deploymentConfig>${gbeanDeployer}</deploymentConfig>
+ <deploymentConfig>${j2eeDeployer}</deploymentConfig>
+ <deploymentConfig>${connectorDeployer}</deploymentConfig>
+ </deploymentConfigs>
+ <module>
+ <groupId>org.tranql</groupId>
+ <artifactId>tranql-connector-derby-embed-xa</artifactId>
+ <type>rar</type>
+ </module>
+ <useMavenDependencies>
+ <value>true</value>
+ <includeVersion>true</includeVersion>
+ </useMavenDependencies>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <properties>
+ <gbeanDeployer>org.apache.geronimo.framework/geronimo-gbean-deployer/${geronimoVersion}/car</gbeanDeployer>
+ <j2eeDeployer>org.apache.geronimo.configs/j2ee-deployer/${geronimoVersion}/car</j2eeDeployer>
+ <connectorDeployer>org.apache.geronimo.configs/connector-deployer/${geronimoVersion}/car</connectorDeployer>
+ </properties>
+</project>
\ No newline at end of file
Propchange: geronimo/plugins/james/trunk/james-derby-database/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/plugins/james/trunk/james-derby-database/pom.xml
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: geronimo/plugins/james/trunk/james-derby-database/pom.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: geronimo/plugins/james/trunk/james-derby-database/src/main/plan/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/plugins/james/trunk/james-derby-database/src/main/plan/plan.xml?rev=668352&view=auto
==============================================================================
--- geronimo/plugins/james/trunk/james-derby-database/src/main/plan/plan.xml (added)
+++ geronimo/plugins/james/trunk/james-derby-database/src/main/plan/plan.xml Mon Jun 16 17:06:04 2008
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+
+<!-- $Rev$ $Date$ -->
+
+<connector xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector-1.2">
+ <resourceadapter>
+ <outbound-resourceadapter>
+ <connection-definition>
+ <connectionfactory-interface>javax.sql.DataSource</connectionfactory-interface>
+ <connectiondefinition-instance>
+ <name>jdbc/jamesdb</name>
+ <config-property-setting name="Password">james</config-property-setting>
+ <config-property-setting name="UserName">james</config-property-setting>
+ <config-property-setting name="DatabaseName">james</config-property-setting>
+ <connectionmanager>
+ <local-transaction/>
+ <single-pool>
+ <max-size>10</max-size>
+ <min-size>0</min-size>
+ <match-one/>
+ </single-pool>
+ </connectionmanager>
+ </connectiondefinition-instance>
+ <connectiondefinition-instance>
+ <name>jdbc/NoTxjamesdb</name>
+ <config-property-setting name="Password">james</config-property-setting>
+ <config-property-setting name="UserName">james</config-property-setting>
+ <config-property-setting name="DatabaseName">james</config-property-setting>
+ <connectionmanager>
+ <no-transaction/>
+ <single-pool>
+ <max-size>10</max-size>
+ <min-size>0</min-size>
+ <match-one/>
+ </single-pool>
+ </connectionmanager>
+ </connectiondefinition-instance>
+ </connection-definition>
+ </outbound-resourceadapter>
+ </resourceadapter>
+
+</connector>
Propchange: geronimo/plugins/james/trunk/james-derby-database/src/main/plan/plan.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/plugins/james/trunk/james-derby-database/src/main/plan/plan.xml
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: geronimo/plugins/james/trunk/james-derby-database/src/main/plan/plan.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Modified: geronimo/plugins/james/trunk/james/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/plugins/james/trunk/james/pom.xml?rev=668352&r1=668351&r2=668352&view=diff
==============================================================================
--- geronimo/plugins/james/trunk/james/pom.xml (original)
+++ geronimo/plugins/james/trunk/james/pom.xml Mon Jun 16 17:06:04 2008
@@ -19,17 +19,22 @@
<version>${pom.version}</version>
</dependency>
<dependency>
- <groupId>org.apache.geronimo.framework</groupId>
- <artifactId>j2ee-system</artifactId>
- <version>${geronimoVersion}</version>
+ <groupId>org.apache.geronimo.plugins</groupId>
+ <artifactId>james-derby-database</artifactId>
+ <version>${pom.version}</version>
<type>car</type>
</dependency>
<dependency>
- <groupId>org.apache.geronimo.configs</groupId>
- <artifactId>system-database</artifactId>
- <version>${geronimoVersion}</version>
+ <groupId>org.apache.geronimo.framework</groupId>
+ <artifactId>j2ee-system</artifactId>
<type>car</type>
</dependency>
+ <!--<dependency>-->
+ <!--<groupId>org.apache.geronimo.configs</groupId>-->
+ <!--<artifactId>system-database</artifactId>-->
+ <!--<version>${geronimoVersion}</version>-->
+ <!--<type>car</type>-->
+ <!--</dependency>-->
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
@@ -37,7 +42,6 @@
<dependency>
<groupId>org.apache.geronimo.framework</groupId>
<artifactId>geronimo-gbean-deployer</artifactId>
- <version>${geronimoVersion}</version>
<type>car</type>
<scope>provided</scope>
</dependency>
Modified: geronimo/plugins/james/trunk/james/src/main/resources/var/james/config/james-config.xml
URL: http://svn.apache.org/viewvc/geronimo/plugins/james/trunk/james/src/main/resources/var/james/config/james-config.xml?rev=668352&r1=668351&r2=668352&view=diff
==============================================================================
--- geronimo/plugins/james/trunk/james/src/main/resources/var/james/config/james-config.xml (original)
+++ geronimo/plugins/james/trunk/james/src/main/resources/var/james/config/james-config.xml Mon Jun 16 17:06:04 2008
@@ -158,22 +158,10 @@
value="derby"/>
<property
name="torque.dsfactory.mailboxmanager.factory"
- value="org.apache.torque.dsfactory.SharedPoolDataSourceFactory"/>
+ value="org.apache.torque.dsfactory.JndiDataSourceFactory"/>
<property
- name="torque.dsfactory.mailboxmanager.connection.driver"
- value="org.apache.derby.jdbc.EmbeddedDriver"/>
- <property
- name="torque.dsfactory.mailboxmanager.connection.url"
- value="jdbc:derby:mailboxmanager-derbydb;create=true"/>
- <property
- name="torque.dsfactory.mailboxmanager.connection.user"
- value="app"/>
- <property
- name="torque.dsfactory.mailboxmanager.connection.password"
- value="app"/>
- <property
- name="torque.dsfactory.mailboxmanager.pool.maxActive"
- value="100"/>
+ name="torque.dsfactory.mailboxmanager.jndi.path"
+ value="jca:org.apache.geronimo.plugins/james-derby-database/JCAManagedConnectionFactory/jdbc/jamesdb"/>
</torque-properties>
</factory>
</mailboxmanager>
@@ -199,7 +187,7 @@
<handler>
<!-- RFC 3501 requires a minimum timeout of 30 minutes -->
<connectiontimeout>1800000</connectiontimeout>
- <streamdump enabled="true" directory="../apps/james/streamdump" />
+ <streamdump enabled="true" directory="streamdump" />
</handler>
</imapserver>
@@ -1424,13 +1412,8 @@
<!-- database, which is easy to embed - but we support all the major SQL -->
<!-- databases - just reconfigure your JDBC configuration -->
<!-- -->
- <data-source name="maildb" class="org.apache.james.util.dbcp.JdbcDataSource">
- <driver>org.apache.derby.jdbc.EmbeddedDriver</driver>
- <dburl>jdbc:derby:derbydb;create=true</dburl>
- <user></user>
- <password></password>
- <poolPreparedStatements>true</poolPreparedStatements>
- <max>20</max>
+ <data-source name="maildb" class="org.apache.geronimo.james.DataSourceBridge">
+ <jndi-name>jca:org.apache.geronimo.plugins/james-derby-database/JCAManagedConnectionFactory/jdbc/jamesdb</jndi-name>
</data-source>
<!-- -->
Modified: geronimo/plugins/james/trunk/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/plugins/james/trunk/pom.xml?rev=668352&r1=668351&r2=668352&view=diff
==============================================================================
--- geronimo/plugins/james/trunk/pom.xml (original)
+++ geronimo/plugins/james/trunk/pom.xml Mon Jun 16 17:06:04 2008
@@ -80,12 +80,46 @@
</dependency>
<dependency>
+ <groupId>org.apache.geronimo.framework</groupId>
+ <artifactId>j2ee-system</artifactId>
+ <version>${geronimoVersion}</version>
+ <type>car</type>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.geronimo.configs</groupId>
+ <artifactId>system-database</artifactId>
+ <version>${geronimoVersion}</version>
+ <type>car</type>
+ </dependency>
+ <dependency>
+ <groupId>org.tranql</groupId>
+ <artifactId>tranql-connector-derby-embed-xa</artifactId>
+ <version>1.4</version>
+ <type>rar</type>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.geronimo.framework</groupId>
+ <artifactId>geronimo-gbean-deployer</artifactId>
+ <version>${geronimoVersion}</version>
+ <type>car</type>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.geronimo.configs</groupId>
+ <artifactId>j2ee-deployer</artifactId>
+ <version>${geronimoVersion}</version>
+ <type>car</type>
+ </dependency>
+ <dependency>
<groupId>org.apache.geronimo.configs</groupId>
- <artifactId>j2ee-server</artifactId>
+ <artifactId>connector-deployer</artifactId>
<version>${geronimoVersion}</version>
<type>car</type>
</dependency>
+
+
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
@@ -333,6 +367,7 @@
<modules>
<module>geronimo-james</module>
+ <module>james-derby-database</module>
<module>james</module>
</modules>