[jboss-svn-commits] JBL Code SVN: r7159 - in labs/jbossesb/trunk/product/core/rosetta: src/org/jboss/internal/soa/esb/persistence/format/db src/org/jboss/soa/esb/common src/org/jboss/soa/esb/persistence tests/src/org/jboss/soa/esb/esb/persistence/tests
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Thu Oct 26 21:14:42 EDT 2006
Author: daniel.brum at jboss.com
Date: 2006-10-26 21:14:34 -0400 (Thu, 26 Oct 2006)
New Revision: 7159
Added:
labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/persistence/format/db/DBConnectionManagerDBCP.java
labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/persistence/MessageStore.java
labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/persistence/MessageStoreFactory.java
Removed:
labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/persistence/format/db/DBConnectionManager.java
labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/persistence/MessageStore.java
labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/persistence/MessageStoreFactory.java
Modified:
labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/persistence/format/db/MessageStoreImpl.java
labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/common/Configuration.java
labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/common/Environment.java
labs/jbossesb/trunk/product/core/rosetta/tests/src/org/jboss/soa/esb/esb/persistence/tests/MessageStoreUnitTest.java
Log:
Deleted: labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/persistence/format/db/DBConnectionManager.java
===================================================================
--- labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/persistence/format/db/DBConnectionManager.java 2006-10-27 01:12:32 UTC (rev 7158)
+++ labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/persistence/format/db/DBConnectionManager.java 2006-10-27 01:14:34 UTC (rev 7159)
@@ -1,159 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2005-2006,
- * @author daniel.brum at jboss.com
- */
-
-package org.jboss.internal.soa.esb.persistence.format.db;
-
-
-import java.sql.Connection;
-
-import org.apache.commons.pool.ObjectPool;
-import org.apache.commons.pool.impl.GenericObjectPool;
-import org.apache.commons.dbcp.ConnectionFactory;
-import org.apache.commons.dbcp.PoolingDataSource;
-import org.apache.commons.dbcp.PoolableConnectionFactory;
-import org.apache.commons.dbcp.DriverManagerConnectionFactory;
-import org.jboss.soa.esb.common.Configuration;
-
-/*
- * the DBConnectionManager class (singleton) is used by classes implenting the MessageStore interface
- * to obtain a connection to the persistence store database.
- * This class uses the Apache Commons DB Connection Pooling to handle all aspects of managing the connections
- * in a pool.
- * $author Daniel Brum
- */
-
-
-public class DBConnectionManager {
-
- /*
- * DBConnectionManager configurable properties
- */
- protected static final String MSG_STORE_DB_CONNECTION_URI = "org.jboss.soa.esb.persistence.db.connection.uri";
- protected static final String MSG_STORE_DB_CONNECTION_USER = "org.jboss.soa.esb.persistence.db.user";
- protected static final String MSG_STORE_DB_CONNECTION_PWD = "org.jboss.soa.esb.persistence.db.pwd";
-
-
- private static DBConnectionManager instance =null;
- private PoolingDataSource dataSource = null;
-// private PropertyManager propMgr = null;
-
- protected DBConnectionManager() {
- //debug
-// System.setProperty("com.arjuna.common.util.propertyservice.verbosePropertyManager", "ON");
-//
-// propMgr = PropertyManagerFactory.getPropertyManager("message.store", "dbstore");
-// try {
-// propMgr.load(XMLFilePlugin.class.getName(), "jbossesb-properties.xml");
-// } catch (IOException e) {
-// e.printStackTrace();
-// } catch (ClassNotFoundException e) {
-// e.printStackTrace();
-// } catch (LoadPropertiesException e) {
-// e.printStackTrace();
-// }
- }
-
- public static DBConnectionManager getInstance() {
- if (null == instance) {
- try {
- instance = new DBConnectionManager();
- instance.init();
- }catch(Exception e) {
- e.printStackTrace();
- return null;
- }
- }
- return instance;
- }
-
- private void init() throws Exception{
-
- String connectURL = Configuration.getStoreUrl();
- Class.forName(Configuration.getStoreDriver());
-
- ObjectPool connectionPool = new GenericObjectPool(null);
-
- ConnectionFactory connectionFactory = new DriverManagerConnectionFactory(connectURL,
- Configuration.getStoreUser(), Configuration.getStorePwd());
-
- @SuppressWarnings("unused")
- PoolableConnectionFactory poolableConnectionFactory = new PoolableConnectionFactory(connectionFactory,
- connectionPool,null,Configuration.getStoreValidateSql(),false,true);
-
- int poolSize = Integer.valueOf(Configuration.getStorePoolSize()).intValue();
-
- //add the max # of connections into the pool
- for (int i=0 ; i<poolSize ; i++) {
- try {
- //System.out.println(this.getClass().getSimpleName() + ": adding connection # " + (i+1) + " to the pool...");
- connectionPool.addObject();
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- dataSource = new PoolingDataSource(connectionPool);
- }
-
- public Connection getConnection() throws Exception{
- return dataSource.getConnection();
- }
-
-
-
-// public static void main(String args[]) {
-// try {
-// System.out.println("Creating connection.");
-// Connection conn = DBConnectionManager.getInstance().getConnection();
-// Statement stmt = null;
-// ResultSet rset = null;
-//
-//
-//
-// System.out.println("Creating statement.");
-// stmt = conn.createStatement();
-// System.out.println("Executing statement.");
-// rset = stmt.executeQuery("select * from uid_table");
-// System.out.println("Results:");
-// int numcols = rset.getMetaData().getColumnCount();
-// while(rset.next()) {
-// for(int i=1;i<=numcols;i++) {
-// System.out.print("\t" + rset.getString(i));
-// }
-// System.out.println("");
-// }
-//
-// } catch (Exception e) {
-// // TODO Auto-generated catch block
-// e.printStackTrace();
-// }
-//
-// //uuid test
-// for (int x=0;x<10;x++) {
-// System.out.println("esb://" + UUID.randomUUID());
-// }
-
-
-
-// }
-
-
-
-}
Copied: labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/persistence/format/db/DBConnectionManagerDBCP.java (from rev 7145, labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/persistence/format/db/DBConnectionManager.java)
===================================================================
--- labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/persistence/format/db/DBConnectionManager.java 2006-10-26 14:55:42 UTC (rev 7145)
+++ labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/persistence/format/db/DBConnectionManagerDBCP.java 2006-10-27 01:14:34 UTC (rev 7159)
@@ -0,0 +1,102 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author daniel.brum at jboss.com
+ */
+
+package org.jboss.internal.soa.esb.persistence.format.db;
+
+
+import java.sql.Connection;
+
+import org.apache.commons.pool.ObjectPool;
+import org.apache.commons.pool.impl.GenericObjectPool;
+import org.apache.commons.dbcp.ConnectionFactory;
+import org.apache.commons.dbcp.PoolingDataSource;
+import org.apache.commons.dbcp.PoolableConnectionFactory;
+import org.apache.commons.dbcp.DriverManagerConnectionFactory;
+import org.jboss.soa.esb.common.Configuration;
+
+/*
+ * the DBConnectionManager class (singleton) is used by classes implenting the MessageStore interface
+ * to obtain a connection to the persistence store database.
+ * This class uses the Apache Commons DB Connection Pooling to handle all aspects of managing the connections
+ * in a pool.
+ * $author Daniel Brum
+ */
+
+
+public class DBConnectionManagerDBCP {
+
+
+
+ private static DBConnectionManagerDBCP instance =null;
+ private PoolingDataSource dataSource = null;
+
+ protected DBConnectionManagerDBCP() {}
+
+ public static DBConnectionManagerDBCP getInstance() {
+ if (null == instance) {
+ try {
+ instance = new DBConnectionManagerDBCP();
+ instance.init();
+ }catch(Exception e) {
+ e.printStackTrace();
+ return null;
+ }
+ }
+ return instance;
+ }
+
+ private void init() throws Exception{
+
+ String connectURL = Configuration.getStoreUrl();
+ Class.forName(Configuration.getStoreDriver());
+
+ ObjectPool connectionPool = new GenericObjectPool(null);
+
+ ConnectionFactory connectionFactory = new DriverManagerConnectionFactory(connectURL,
+ Configuration.getStoreUser(), Configuration.getStorePwd());
+
+ @SuppressWarnings("unused")
+
+ PoolableConnectionFactory poolableConnectionFactory = new PoolableConnectionFactory(connectionFactory,
+ connectionPool,null,null,false,false);
+
+// int poolSize = Integer.valueOf(Configuration.getStorePoolSize()).intValue();
+ int poolSize = 10; //TODO: Remove once we standardize on C3PO for pool management
+
+ //add the max # of connections into the pool
+ for (int i=0 ; i<poolSize ; i++) {
+ try {
+ connectionPool.addObject();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ dataSource = new PoolingDataSource(connectionPool);
+ }
+
+ public Connection getConnection() throws Exception{
+ return dataSource.getConnection();
+ }
+
+
+
+
+}
Modified: labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/persistence/format/db/MessageStoreImpl.java
===================================================================
--- labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/persistence/format/db/MessageStoreImpl.java 2006-10-27 01:12:32 UTC (rev 7158)
+++ labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/persistence/format/db/MessageStoreImpl.java 2006-10-27 01:14:34 UTC (rev 7159)
@@ -52,28 +52,26 @@
public class MessageStoreImpl implements MessageStore {
-// private Connection conn = null;
-// private PreparedStatement ps = null;
-// private ResultSet rs = null;
+ protected DBConnectionManager mgr = null;
+ protected Connection conn = null;
+ protected ResultSet rs = null;
+ protected PreparedStatement ps = null;
- private DBConnectionManager mgr = null;
-
public MessageStoreImpl() {
mgr = DBConnectionManager.getInstance();
}
- public URI addMessage(Message message){
-
- Connection conn = null;
- PreparedStatement ps = null;
+ public synchronized URI addMessage(Message message){
+
String messageString = null;
URI uid = null;
+
try {
conn = mgr.getConnection();
- uid = new URI("urn:jboss:esb:message:UID:" + UUID.randomUUID().toString());
+ uid = new URI("urn:jboss:esb:message:UID:" + UUID.randomUUID().toString());
if (message.getType().equals(MessageType.JBOSS_XML) ) {
Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
@@ -97,36 +95,20 @@
ps.setString(1, uid.toString());
ps.setString(2, message.getType().toString());
ps.setString(3, messageString);
- ps.execute();
+ ps.execute();
-
- } catch (Exception e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } //finally { release(); }
- finally {
- if (conn != null) {
- try{
- ps.close();
- }catch (Exception e1){}
- try{
- conn.close();
- }catch(Exception e2){}
- }
- }
+ } catch (Exception e) { e.printStackTrace(); }
+ finally { release(); }
return uid;
}
- public Message getMessage(URI uid) throws Exception{
+ public synchronized Message getMessage(URI uid) throws Exception{
- Connection conn = null;
- PreparedStatement ps = null;
- ResultSet rs = null;
-
- String sql = "select uid,type,message from message where uid=?";
+ String sql = "select uid,type,message from message where uid=?";
+ Message message = null;
- try {
+ try {
conn = mgr.getConnection();
ps = conn.prepareStatement(sql);
ps.setString(1, uid.toString());
@@ -143,17 +125,16 @@
DocumentBuilder builder = factory.newDocumentBuilder();
Document doc = builder.parse(inStream);
- org.jboss.internal.soa.esb.message.format.xml.MessageImpl message =
+ org.jboss.internal.soa.esb.message.format.xml.MessageImpl xmlMessage =
new org.jboss.internal.soa.esb.message.format.xml.MessageImpl();
- message.fromXML(doc);
- return message;
+ xmlMessage.fromXML(doc);
+ message=xmlMessage;
}
if (type.equals(MessageType.JAVA_SERIALIZED)) {
- Object message = Base64.decodeToObject(msg);
- return (org.jboss.internal.soa.esb.message.format.serialized.MessageImpl)message;
-
+ Object byteMessage = Base64.decodeToObject(msg);
+ message = (org.jboss.internal.soa.esb.message.format.serialized.MessageImpl)byteMessage;
}
} catch (SQLException e) {
@@ -162,42 +143,28 @@
} catch (Exception e) {
e.printStackTrace();
return null;
- }//finally { release(); }
- finally {
- if (conn != null) {
- if (rs != null) {
- try{
- rs.close();
- }catch (Exception e) {}
- }
+ }finally { release(); }
+
+ return message;
+
+ }
+
+ private void release() {
+
+ if (conn != null) {
+ if (rs != null) {
try{
- ps.close();
- }catch (Exception e1){}
- try{
- conn.close();
- }catch(Exception e2){}
+ rs.close();
+ }catch (Exception e) {}
}
+ try{
+ ps.close();
+ }catch (Exception e1){}
+ try{
+ conn.close();
+ }catch(Exception e2){}
}
-
- return null;
}
-
-// private void release() {
-//
-// if (conn != null) {
-// if (rs != null) {
-// try{
-// rs.close();
-// }catch (Exception e) {}
-// }
-// try{
-// ps.close();
-// }catch (Exception e1){}
-// try{
-// conn.close();
-// }catch(Exception e2){}
-// }
-// }
Modified: labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/common/Configuration.java
===================================================================
--- labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/common/Configuration.java 2006-10-27 01:12:32 UTC (rev 7158)
+++ labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/common/Configuration.java 2006-10-27 01:14:34 UTC (rev 7159)
@@ -52,10 +52,14 @@
new KeyValuePair(Environment.DB_PASSWORD, getDbPassword()),
new KeyValuePair(Environment.MSG_STORE_DB_CONNECTION_URL, getStoreUrl()),
new KeyValuePair(Environment.MSG_STORE_DB_JDBC_DRIVER, getStoreDriver()),
- new KeyValuePair(Environment.MSG_STORE_DB_POOL_SIZE, getStorePoolSize()),
new KeyValuePair(Environment.MSG_STORE_DB_CONNECTION_USER, getStoreUser()),
new KeyValuePair(Environment.MSG_STORE_DB_CONNECTION_PWD, getStorePwd()),
- new KeyValuePair(Environment.MSG_STORE_DB_VALIDATE_SQL, getStoreValidateSql()),
+ new KeyValuePair(Environment.MSG_STORE_DB_POOL_MIN_SIZE, getStorePoolMinSize()),
+ new KeyValuePair(Environment.MSG_STORE_DB_POOL_MAX_SIZE, getStorePoolMaxSize()),
+ new KeyValuePair(Environment.MSG_STORE_DB_POOL_INITIAL_SIZE,getStorePoolInitialSize()),
+ new KeyValuePair(Environment.MSG_STORE_DB_POOL_TEST_TABLE, getStorePoolTestTable()),
+ new KeyValuePair(Environment.MSG_STORE_DB_POOL_TIMEOUT_MILLIS,getStorePoolTimeoutMillis()),
+
};
@@ -223,29 +227,47 @@
{
String property = ModulePropertyManager.getPropertyManager(ModulePropertyManager.DBSTORE_MODULE).getProperty(Environment.MSG_STORE_DB_JDBC_DRIVER);
return property;
+ }
+
+ public static String getStorePwd()
+ {
+ String property = ModulePropertyManager.getPropertyManager(ModulePropertyManager.DBSTORE_MODULE).getProperty(Environment.MSG_STORE_DB_CONNECTION_PWD);
+ return property;
}
- public static String getStorePoolSize()
+ public static String getStoreUser()
{
- String property = ModulePropertyManager.getPropertyManager(ModulePropertyManager.DBSTORE_MODULE).getProperty(Environment.MSG_STORE_DB_POOL_SIZE);
+ String property = ModulePropertyManager.getPropertyManager(ModulePropertyManager.DBSTORE_MODULE).getProperty(Environment.MSG_STORE_DB_CONNECTION_USER);
return property;
}
- public static String getStorePwd()
+ public static String getStorePoolInitialSize()
{
- String property = ModulePropertyManager.getPropertyManager(ModulePropertyManager.DBSTORE_MODULE).getProperty(Environment.MSG_STORE_DB_CONNECTION_PWD);
+ String property = ModulePropertyManager.getPropertyManager(ModulePropertyManager.DBSTORE_MODULE).getProperty(Environment.MSG_STORE_DB_POOL_INITIAL_SIZE);
return property;
}
- public static String getStoreUser()
+ public static String getStorePoolMinSize()
{
- String property = ModulePropertyManager.getPropertyManager(ModulePropertyManager.DBSTORE_MODULE).getProperty(Environment.MSG_STORE_DB_CONNECTION_USER);
+ String property = ModulePropertyManager.getPropertyManager(ModulePropertyManager.DBSTORE_MODULE).getProperty(Environment.MSG_STORE_DB_POOL_MIN_SIZE);
return property;
}
- public static String getStoreValidateSql()
+ public static String getStorePoolMaxSize()
{
- String property = ModulePropertyManager.getPropertyManager(ModulePropertyManager.DBSTORE_MODULE).getProperty(Environment.MSG_STORE_DB_VALIDATE_SQL);
+ String property = ModulePropertyManager.getPropertyManager(ModulePropertyManager.DBSTORE_MODULE).getProperty(Environment.MSG_STORE_DB_POOL_MAX_SIZE);
return property;
}
+
+ public static String getStorePoolTestTable()
+ {
+ String property = ModulePropertyManager.getPropertyManager(ModulePropertyManager.DBSTORE_MODULE).getProperty(Environment.MSG_STORE_DB_POOL_TEST_TABLE);
+ return property;
+ }
+
+ public static String getStorePoolTimeoutMillis()
+ {
+ String property = ModulePropertyManager.getPropertyManager(ModulePropertyManager.DBSTORE_MODULE).getProperty(Environment.MSG_STORE_DB_POOL_TIMEOUT_MILLIS);
+ return property;
+ }
}
\ No newline at end of file
Modified: labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/common/Environment.java
===================================================================
--- labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/common/Environment.java 2006-10-27 01:12:32 UTC (rev 7158)
+++ labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/common/Environment.java 2006-10-27 01:14:34 UTC (rev 7159)
@@ -100,12 +100,15 @@
/*
* DatabaseMessageStore Persistence Store properties.
*/
- public static final String MSG_STORE_DB_CONNECTION_URL = "org.jboss.soa.esb.persistence.db.connection.url";
- public static final String MSG_STORE_DB_CONNECTION_USER = "org.jboss.soa.esb.persistence.db.user";
- public static final String MSG_STORE_DB_CONNECTION_PWD = "org.jboss.soa.esb.persistence.db.pwd";
- public static final String MSG_STORE_DB_TABLE_NAME = "org.jboss.soa.esb.persistence.db.table";
- public static final String MSG_STORE_DB_JDBC_DRIVER = "org.jboss.soa.esb.persistence.db.jdbc.driver";
- public static final String MSG_STORE_DB_POOL_SIZE = "org.jboss.soa.esb.persistence.db.pool.size";
- public static final String MSG_STORE_DB_VALIDATE_SQL = "org.jboss.soa.esb.persistence.db.pool.validate.sql";
+ public static final String MSG_STORE_DB_CONNECTION_URL = "org.jboss.soa.esb.persistence.db.connection.url";
+ public static final String MSG_STORE_DB_CONNECTION_USER = "org.jboss.soa.esb.persistence.db.user";
+ public static final String MSG_STORE_DB_CONNECTION_PWD = "org.jboss.soa.esb.persistence.db.pwd";
+ public static final String MSG_STORE_DB_TABLE_NAME = "org.jboss.soa.esb.persistence.db.table";
+ public static final String MSG_STORE_DB_JDBC_DRIVER = "org.jboss.soa.esb.persistence.db.jdbc.driver";
+ public static final String MSG_STORE_DB_POOL_INITIAL_SIZE = "org.jboss.soa.esb.persistence.db.pool.initial.size";
+ public static final String MSG_STORE_DB_POOL_MIN_SIZE = "org.jboss.soa.esb.persistence.db.pool.min.size";
+ public static final String MSG_STORE_DB_POOL_MAX_SIZE = "org.jboss.soa.esb.persistence.db.pool.max.size";
+ public static final String MSG_STORE_DB_POOL_TEST_TABLE = "org.jboss.soa.esb.persistence.db.pool.test.table";
+ public static final String MSG_STORE_DB_POOL_TIMEOUT_MILLIS = "org.jboss.soa.esb.persistence.db.pool.timeout.millis";
}
\ No newline at end of file
Deleted: labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/persistence/MessageStore.java
===================================================================
--- labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/persistence/MessageStore.java 2006-10-27 01:12:32 UTC (rev 7158)
+++ labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/persistence/MessageStore.java 2006-10-27 01:14:34 UTC (rev 7159)
@@ -1,37 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2005-2006,
- * @author daniel.brum at jboss.com
- */
-
-package org.jboss.soa.esb.persistence;
-
-import java.net.URI;
-
-import org.jboss.soa.esb.message.Message;
-
-
-
-public interface MessageStore {
-
- public URI addMessage(Message message);
- public Message getMessage(URI uid) throws Exception;
-// public void replaceMessage(Message message);
-// public void removeMessage(long uid);
-
-}
Added: labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/persistence/MessageStore.java
===================================================================
--- labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/persistence/MessageStore.java 2006-10-27 01:12:32 UTC (rev 7158)
+++ labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/persistence/MessageStore.java 2006-10-27 01:14:34 UTC (rev 7159)
@@ -0,0 +1,37 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author daniel.brum at jboss.com
+ */
+
+package org.jboss.soa.esb.persistence;
+
+import java.net.URI;
+
+import org.jboss.soa.esb.message.Message;
+
+
+
+public interface MessageStore {
+
+ public URI addMessage(Message message);
+ public Message getMessage(URI uid) throws Exception;
+// public void replaceMessage(Message message);
+// public void removeMessage(long uid);
+
+}
Deleted: labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/persistence/MessageStoreFactory.java
===================================================================
--- labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/persistence/MessageStoreFactory.java 2006-10-27 01:12:32 UTC (rev 7158)
+++ labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/persistence/MessageStoreFactory.java 2006-10-27 01:14:34 UTC (rev 7159)
@@ -1,67 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2005-2006,
- * @author daniel.brum at jboss.com
- */
-
-
-/**
- * You get a MessageStore of a specific type when you need it.
- */
-
-
-package org.jboss.soa.esb.persistence;
-
-import java.net.URI;
-
-import org.jboss.internal.soa.esb.persistence.format.MessageStoreFactoryImpl;
-
-
-public abstract class MessageStoreFactory {
-
- private static final MessageStoreFactory theFactory = new MessageStoreFactoryImpl();
-
- /**
- * @return a default implementation.
- */
-
- public abstract MessageStore getMessageStore ();
-
- /**
- * @param type the unique identifier representing the type of this MessageStore.
- * @return the MessageStore, or <code>null</code> if no suitable store is available.
- */
-
- public abstract MessageStore getMessageStore (URI type);
-
-
- public static MessageStoreFactory getInstance ()
- {
- return theFactory;
- }
-
- /**
- * Reload the plugins.
- */
-
- public abstract void reset ();
-
-
-
-
-}
Added: labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/persistence/MessageStoreFactory.java
===================================================================
--- labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/persistence/MessageStoreFactory.java 2006-10-27 01:12:32 UTC (rev 7158)
+++ labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/persistence/MessageStoreFactory.java 2006-10-27 01:14:34 UTC (rev 7159)
@@ -0,0 +1,67 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author daniel.brum at jboss.com
+ */
+
+
+/**
+ * You get a MessageStore of a specific type when you need it.
+ */
+
+
+package org.jboss.soa.esb.persistence;
+
+import java.net.URI;
+
+import org.jboss.internal.soa.esb.persistence.format.MessageStoreFactoryImpl;
+
+
+public abstract class MessageStoreFactory {
+
+ private static final MessageStoreFactory theFactory = new MessageStoreFactoryImpl();
+
+ /**
+ * @return a default implementation.
+ */
+
+ public abstract MessageStore getMessageStore ();
+
+ /**
+ * @param type the unique identifier representing the type of this MessageStore.
+ * @return the MessageStore, or <code>null</code> if no suitable store is available.
+ */
+
+ public abstract MessageStore getMessageStore (URI type);
+
+
+ public static MessageStoreFactory getInstance ()
+ {
+ return theFactory;
+ }
+
+ /**
+ * Reload the plugins.
+ */
+
+ public abstract void reset ();
+
+
+
+
+}
Modified: labs/jbossesb/trunk/product/core/rosetta/tests/src/org/jboss/soa/esb/esb/persistence/tests/MessageStoreUnitTest.java
===================================================================
--- labs/jbossesb/trunk/product/core/rosetta/tests/src/org/jboss/soa/esb/esb/persistence/tests/MessageStoreUnitTest.java 2006-10-27 01:12:32 UTC (rev 7158)
+++ labs/jbossesb/trunk/product/core/rosetta/tests/src/org/jboss/soa/esb/esb/persistence/tests/MessageStoreUnitTest.java 2006-10-27 01:14:34 UTC (rev 7159)
@@ -31,7 +31,7 @@
import junit.framework.TestCase;
-import org.jboss.internal.soa.esb.persistence.format.db.DBConnectionManager;
+import org.jboss.internal.soa.esb.persistence.format.db.DBConnectionManagerDBCP;
import org.jboss.soa.esb.common.Configuration;
import org.jboss.soa.esb.common.tests.HsqldbUtil;
import org.jboss.soa.esb.common.tests.TestUtil;
@@ -129,7 +129,7 @@
MessageStoreUnitTest.runBeforeAllTests();
MessageStore store = MessageStoreFactory.getInstance().getMessageStore(MessageStoreType.DATABASE);
assertEquals((store != null), true);
- DBConnectionManager mgr = DBConnectionManager.getInstance();
+ DBConnectionManagerDBCP mgr = DBConnectionManagerDBCP.getInstance();
assertEquals((mgr != null), true);
MessageStoreUnitTest.runAfterAllTests();
}
More information about the jboss-svn-commits
mailing list