You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by gn...@apache.org on 2006/02/14 01:40:34 UTC
svn commit: r377552 - in /incubator/servicemix/trunk/servicemix-core:
project.xml
src/main/java/org/apache/servicemix/jbi/audit/jdbc/JdbcAuditor.java
Author: gnodet
Date: Mon Feb 13 16:40:32 2006
New Revision: 377552
URL: http://svn.apache.org/viewcvs?rev=377552&view=rev
Log:
SM-308: remove commons-digester and commons-betwixt dependencies
Modified:
incubator/servicemix/trunk/servicemix-core/project.xml
incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/audit/jdbc/JdbcAuditor.java
Modified: incubator/servicemix/trunk/servicemix-core/project.xml
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-core/project.xml?rev=377552&r1=377551&r2=377552&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-core/project.xml (original)
+++ incubator/servicemix/trunk/servicemix-core/project.xml Mon Feb 13 16:40:32 2006
@@ -327,15 +327,6 @@
<id>hsqldb</id>
<version>${hsqldb_version}</version>
</dependency>
- <dependency>
- <id>axion</id>
- <version>${axion_version}</version>
- </dependency>
- <dependency>
- <groupId>commons-primitives</groupId>
- <artifactId>commons-primitives</artifactId>
- <version>${commons_primitives_version}</version>
- </dependency>
<dependency>
<groupId>servicemix</groupId>
@@ -347,16 +338,7 @@
<artifactId>commons-lang</artifactId>
<version>${commons_lang_version}</version>
</dependency>
- <dependency>
- <groupId>commons-betwixt</groupId>
- <artifactId>commons-betwixt</artifactId>
- <version>${commons_betwixt_version}</version>
- </dependency>
- <dependency>
- <groupId>commons-digester</groupId>
- <artifactId>commons-digester</artifactId>
- <version>${commons_digester_version}</version>
- </dependency>
+
<dependency>
<groupId>easymock</groupId>
<artifactId>easymock</artifactId>
Modified: incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/audit/jdbc/JdbcAuditor.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/audit/jdbc/JdbcAuditor.java?rev=377552&r1=377551&r2=377552&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/audit/jdbc/JdbcAuditor.java (original)
+++ incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/audit/jdbc/JdbcAuditor.java Mon Feb 13 16:40:32 2006
@@ -17,8 +17,9 @@
import org.apache.ddlutils.Platform;
import org.apache.ddlutils.PlatformFactory;
-import org.apache.ddlutils.io.DatabaseIO;
+import org.apache.ddlutils.model.Column;
import org.apache.ddlutils.model.Database;
+import org.apache.ddlutils.model.Table;
import org.apache.servicemix.jbi.audit.AbstractAuditor;
import org.apache.servicemix.jbi.audit.AuditorException;
import org.apache.servicemix.jbi.messaging.ExchangePacket;
@@ -34,8 +35,6 @@
import javax.jbi.messaging.MessagingException;
import javax.sql.DataSource;
-import java.io.InputStream;
-import java.io.InputStreamReader;
import java.net.URI;
import java.sql.Connection;
import java.sql.PreparedStatement;
@@ -80,20 +79,29 @@
throw new IllegalArgumentException("dataSource should not be null");
}
platform = PlatformFactory.createNewPlatformInstance(dataSource);
- InputStream is = getClass().getResourceAsStream(DATABASE_MODEL);
- if (is == null) {
- throw new IllegalArgumentException("Could not find database model on classpath: " + DATABASE_MODEL);
- }
- try {
- DatabaseIO dataReader = new DatabaseIO();
- dataReader.setValidateXml(false);
- database = dataReader.read(new InputStreamReader(is));
- } finally {
- is.close();
- }
+ database = createDatabase();
platform.createTables(database, false, true);
init(getContainer());
start();
+ }
+
+ protected Database createDatabase() {
+ Database db = new Database();
+ db.setName("JDBCAudit");
+ Table table = new Table();
+ table.setName("SM_AUDIT");
+ Column id = new Column();
+ id.setName("ID");
+ id.setType("VARCHAR");
+ id.setPrimaryKey(true);
+ id.setRequired(true);
+ table.addColumn(id);
+ Column exchange = new Column();
+ exchange.setName("EXCHANGE");
+ exchange.setType("BLOB");
+ table.addColumn(exchange);
+ db.addTable(table);
+ return db;
}
public void onMessageExchange(MessageExchange exchange) throws MessagingException {