[jboss-svn-commits] JBL Code SVN: r7206 - in labs/jbossesb/trunk: product/core/rosetta/src/org/jboss/internal/soa/esb/addressing/helpers product/core/rosetta/tests/src/org/jboss/soa/esb/addressing/util/tests product/core/services/src/org/jboss/internal/soa/esb product/core/services/src/org/jboss/internal/soa/esb/persistence product/core/services/src/org/jboss/internal/soa/esb/persistence/format product/core/services/src/org/jboss/internal/soa/esb/persistence/format/db product/core/services/src/org/jboss/soa/esb/services/persistence product/core/services/src/org/jboss/soa/esb/services/persistence/db product/core/services/tests/src/org/jboss/soa/esb/esb/persistence/tests qa/junit/src/org/jboss/soa/esb/messagestore

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Sun Oct 29 18:43:08 EST 2006


Author: daniel.brum at jboss.com
Date: 2006-10-29 18:42:55 -0500 (Sun, 29 Oct 2006)
New Revision: 7206

Added:
   labs/jbossesb/trunk/product/core/services/src/org/jboss/internal/soa/esb/persistence/
   labs/jbossesb/trunk/product/core/services/src/org/jboss/internal/soa/esb/persistence/format/
   labs/jbossesb/trunk/product/core/services/src/org/jboss/internal/soa/esb/persistence/format/MessageStoreFactoryImpl.java
   labs/jbossesb/trunk/product/core/services/src/org/jboss/internal/soa/esb/persistence/format/MessageStorePlugin.java
   labs/jbossesb/trunk/product/core/services/src/org/jboss/internal/soa/esb/persistence/format/db/
   labs/jbossesb/trunk/product/core/services/src/org/jboss/internal/soa/esb/persistence/format/db/DBConnectionManager.java
   labs/jbossesb/trunk/product/core/services/src/org/jboss/internal/soa/esb/persistence/format/db/DBConnectionManagerDBCP.java
   labs/jbossesb/trunk/product/core/services/src/org/jboss/internal/soa/esb/persistence/format/db/DBMessageStorePlugin.java
   labs/jbossesb/trunk/product/core/services/src/org/jboss/internal/soa/esb/persistence/format/db/MessageStoreImpl.java
Removed:
   labs/jbossesb/trunk/product/core/services/src/org/jboss/soa/esb/services/persistence/MessageStoreFactoryImpl.java
   labs/jbossesb/trunk/product/core/services/src/org/jboss/soa/esb/services/persistence/MessageStorePlugin.java
   labs/jbossesb/trunk/product/core/services/src/org/jboss/soa/esb/services/persistence/db/DBConnectionManager.java
   labs/jbossesb/trunk/product/core/services/src/org/jboss/soa/esb/services/persistence/db/DBConnectionManagerDBCP.java
   labs/jbossesb/trunk/product/core/services/src/org/jboss/soa/esb/services/persistence/db/DBMessageStorePlugin.java
   labs/jbossesb/trunk/product/core/services/src/org/jboss/soa/esb/services/persistence/db/MessageStoreImpl.java
   labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/messagestore/MessageStore_brokentest.java
Modified:
   labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/addressing/helpers/EPRHelper.java
   labs/jbossesb/trunk/product/core/rosetta/tests/src/org/jboss/soa/esb/addressing/util/tests/EPRHelperUnitTest.java
   labs/jbossesb/trunk/product/core/services/src/org/jboss/soa/esb/services/persistence/MessageStoreType.java
   labs/jbossesb/trunk/product/core/services/tests/src/org/jboss/soa/esb/esb/persistence/tests/MessageStoreUnitTest.java
   labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/messagestore/MessageStoreClient.java
   labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/messagestore/MessageStoreTest.java
Log:
fixed erroneous packages in refactoring with Eclipse

Modified: labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/addressing/helpers/EPRHelper.java
===================================================================
--- labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/addressing/helpers/EPRHelper.java	2006-10-29 23:13:48 UTC (rev 7205)
+++ labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/addressing/helpers/EPRHelper.java	2006-10-29 23:42:55 UTC (rev 7206)
@@ -38,7 +38,6 @@
 import org.jboss.soa.esb.addressing.eprs.HTTPEpr;
 import org.jboss.soa.esb.addressing.eprs.JDBCEpr;
 import org.jboss.soa.esb.addressing.eprs.JMSEpr;
-import org.w3c.dom.Attr;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.xml.sax.SAXException;

Modified: labs/jbossesb/trunk/product/core/rosetta/tests/src/org/jboss/soa/esb/addressing/util/tests/EPRHelperUnitTest.java
===================================================================
--- labs/jbossesb/trunk/product/core/rosetta/tests/src/org/jboss/soa/esb/addressing/util/tests/EPRHelperUnitTest.java	2006-10-29 23:13:48 UTC (rev 7205)
+++ labs/jbossesb/trunk/product/core/rosetta/tests/src/org/jboss/soa/esb/addressing/util/tests/EPRHelperUnitTest.java	2006-10-29 23:42:55 UTC (rev 7206)
@@ -27,7 +27,6 @@
 import org.jboss.internal.soa.esb.addressing.helpers.EPRHelper;
 import org.jboss.soa.esb.addressing.EPR;
 import org.jboss.soa.esb.addressing.eprs.EmailEpr;
-import org.jboss.soa.esb.addressing.util.EPRManager;
 
 /**
  * Unit tests for the Class class.

Copied: labs/jbossesb/trunk/product/core/services/src/org/jboss/internal/soa/esb/persistence/format/MessageStoreFactoryImpl.java (from rev 7205, labs/jbossesb/trunk/product/core/services/src/org/jboss/soa/esb/services/persistence/MessageStoreFactoryImpl.java)
===================================================================
--- labs/jbossesb/trunk/product/core/services/src/org/jboss/soa/esb/services/persistence/MessageStoreFactoryImpl.java	2006-10-29 23:13:48 UTC (rev 7205)
+++ labs/jbossesb/trunk/product/core/services/src/org/jboss/internal/soa/esb/persistence/format/MessageStoreFactoryImpl.java	2006-10-29 23:42:55 UTC (rev 7206)
@@ -0,0 +1,112 @@
+/*
+ * 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;
+
+import java.net.URI;
+import java.util.Enumeration;
+import java.util.Hashtable;
+import java.util.Properties;
+
+
+import org.jboss.internal.soa.esb.persistence.format.db.DBMessageStorePlugin;
+import org.jboss.soa.esb.services.persistence.MessageStore;
+import org.jboss.soa.esb.services.persistence.MessageStoreFactory;
+import org.jboss.soa.esb.services.persistence.MessageStoreType;
+
+public class MessageStoreFactoryImpl extends MessageStoreFactory {
+	
+	private final Hashtable<URI, MessageStorePlugin> messageStoreFormats = new Hashtable<URI, MessageStorePlugin>();
+
+	
+	public MessageStoreFactoryImpl() {
+		reset();
+	}
+	
+	public MessageStore getMessageStore() {
+		return ((MessageStorePlugin) messageStoreFormats.get(MessageStoreType.DEFAULT_TYPE)).getMessageStore();
+	}
+	
+	public MessageStore getMessageStore(URI type) {
+		if (type == null)
+			throw new IllegalArgumentException();
+
+		MessageStorePlugin plugin = messageStoreFormats.get(type);
+
+		if (plugin != null)
+			return plugin.getMessageStore();
+		else
+			return null;
+	}
+	
+	public void reset ()
+	{
+		messageStoreFormats.clear();
+		/*
+		 * Go through the properties loaded from the property file. Anything
+		 * starting with MessageStorePlugin.MESSAGE_STORE_PLUGIN is assumed to be a plugin
+		 * that we load and add to the list.
+		 */		
+		
+		Properties properties = System.getProperties();
+		
+		if (properties != null)
+		{
+			Enumeration names = properties.propertyNames();
+
+			while (names.hasMoreElements())
+			{
+				String attrName = (String) names.nextElement();
+				
+				if (attrName.startsWith(MessageStorePlugin. MESSAGE_STORE_PLUGIN))
+				{
+					try
+					{
+						String pluginName = properties.getProperty(attrName);
+						Class c = Class.forName(pluginName);
+						MessageStorePlugin thePlugin = (MessageStorePlugin) c.newInstance();
+
+						messageStoreFormats.put(thePlugin.getType(), thePlugin);
+					}
+					catch (ClassNotFoundException ex)
+					{
+						ex.printStackTrace();
+					}
+					catch (IllegalAccessException ex)
+					{
+						ex.printStackTrace();
+					}
+					catch (InstantiationException ex)
+					{
+						ex.printStackTrace();
+					}
+				}
+			}
+		}
+	         
+		/*
+		 * Now add the default(s).
+		 */		
+		messageStoreFormats.put(MessageStoreType.DATABASE, new DBMessageStorePlugin());		
+	}
+
+}

Copied: labs/jbossesb/trunk/product/core/services/src/org/jboss/internal/soa/esb/persistence/format/MessageStorePlugin.java (from rev 7205, labs/jbossesb/trunk/product/core/services/src/org/jboss/soa/esb/services/persistence/MessageStorePlugin.java)

Copied: labs/jbossesb/trunk/product/core/services/src/org/jboss/internal/soa/esb/persistence/format/db/DBConnectionManager.java (from rev 7205, labs/jbossesb/trunk/product/core/services/src/org/jboss/soa/esb/services/persistence/db/DBConnectionManager.java)

Copied: labs/jbossesb/trunk/product/core/services/src/org/jboss/internal/soa/esb/persistence/format/db/DBConnectionManagerDBCP.java (from rev 7205, labs/jbossesb/trunk/product/core/services/src/org/jboss/soa/esb/services/persistence/db/DBConnectionManagerDBCP.java)

Copied: labs/jbossesb/trunk/product/core/services/src/org/jboss/internal/soa/esb/persistence/format/db/DBMessageStorePlugin.java (from rev 7205, labs/jbossesb/trunk/product/core/services/src/org/jboss/soa/esb/services/persistence/db/DBMessageStorePlugin.java)
===================================================================
--- labs/jbossesb/trunk/product/core/services/src/org/jboss/soa/esb/services/persistence/db/DBMessageStorePlugin.java	2006-10-29 23:13:48 UTC (rev 7205)
+++ labs/jbossesb/trunk/product/core/services/src/org/jboss/internal/soa/esb/persistence/format/db/DBMessageStorePlugin.java	2006-10-29 23:42:55 UTC (rev 7206)
@@ -0,0 +1,46 @@
+/*
+ * 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.net.URI;
+
+import org.jboss.internal.soa.esb.persistence.format.MessageStorePlugin;
+import org.jboss.soa.esb.services.persistence.MessageStoreType;
+import org.jboss.soa.esb.services.persistence.MessageStore;
+
+/**
+ * @author dbrum
+ *
+ */
+public class DBMessageStorePlugin implements MessageStorePlugin {
+
+	
+	public MessageStore getMessageStore() {
+		return new MessageStoreImpl();
+	}
+
+	
+	public URI getType() {
+		return MessageStoreType.DATABASE;
+	}
+
+}

Copied: labs/jbossesb/trunk/product/core/services/src/org/jboss/internal/soa/esb/persistence/format/db/MessageStoreImpl.java (from rev 7205, labs/jbossesb/trunk/product/core/services/src/org/jboss/soa/esb/services/persistence/db/MessageStoreImpl.java)

Deleted: labs/jbossesb/trunk/product/core/services/src/org/jboss/soa/esb/services/persistence/MessageStoreFactoryImpl.java
===================================================================
--- labs/jbossesb/trunk/product/core/services/src/org/jboss/soa/esb/services/persistence/MessageStoreFactoryImpl.java	2006-10-29 23:13:48 UTC (rev 7205)
+++ labs/jbossesb/trunk/product/core/services/src/org/jboss/soa/esb/services/persistence/MessageStoreFactoryImpl.java	2006-10-29 23:42:55 UTC (rev 7206)
@@ -1,111 +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;
-
-import java.net.URI;
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.Properties;
-
-
-import org.jboss.internal.soa.esb.persistence.format.db.DBMessageStorePlugin;
-import org.jboss.soa.esb.services.persistence.MessageStore;
-import org.jboss.soa.esb.services.persistence.MessageStoreFactory;
-
-public class MessageStoreFactoryImpl extends MessageStoreFactory {
-	
-	private final Hashtable<URI, MessageStorePlugin> messageStoreFormats = new Hashtable<URI, MessageStorePlugin>();
-
-	
-	public MessageStoreFactoryImpl() {
-		reset();
-	}
-	
-	public MessageStore getMessageStore() {
-		return ((MessageStorePlugin) messageStoreFormats.get(MessageStoreType.DEFAULT_TYPE)).getMessageStore();
-	}
-	
-	public MessageStore getMessageStore(URI type) {
-		if (type == null)
-			throw new IllegalArgumentException();
-
-		MessageStorePlugin plugin = messageStoreFormats.get(type);
-
-		if (plugin != null)
-			return plugin.getMessageStore();
-		else
-			return null;
-	}
-	
-	public void reset ()
-	{
-		messageStoreFormats.clear();
-		/*
-		 * Go through the properties loaded from the property file. Anything
-		 * starting with MessageStorePlugin.MESSAGE_STORE_PLUGIN is assumed to be a plugin
-		 * that we load and add to the list.
-		 */		
-		
-		Properties properties = System.getProperties();
-		
-		if (properties != null)
-		{
-			Enumeration names = properties.propertyNames();
-
-			while (names.hasMoreElements())
-			{
-				String attrName = (String) names.nextElement();
-				
-				if (attrName.startsWith(MessageStorePlugin. MESSAGE_STORE_PLUGIN))
-				{
-					try
-					{
-						String pluginName = properties.getProperty(attrName);
-						Class c = Class.forName(pluginName);
-						MessageStorePlugin thePlugin = (MessageStorePlugin) c.newInstance();
-
-						messageStoreFormats.put(thePlugin.getType(), thePlugin);
-					}
-					catch (ClassNotFoundException ex)
-					{
-						ex.printStackTrace();
-					}
-					catch (IllegalAccessException ex)
-					{
-						ex.printStackTrace();
-					}
-					catch (InstantiationException ex)
-					{
-						ex.printStackTrace();
-					}
-				}
-			}
-		}
-	         
-		/*
-		 * Now add the default(s).
-		 */		
-		messageStoreFormats.put(MessageStoreType.DATABASE, new DBMessageStorePlugin());		
-	}
-
-}

Deleted: labs/jbossesb/trunk/product/core/services/src/org/jboss/soa/esb/services/persistence/MessageStorePlugin.java
===================================================================
--- labs/jbossesb/trunk/product/core/services/src/org/jboss/soa/esb/services/persistence/MessageStorePlugin.java	2006-10-29 23:13:48 UTC (rev 7205)
+++ labs/jbossesb/trunk/product/core/services/src/org/jboss/soa/esb/services/persistence/MessageStorePlugin.java	2006-10-29 23:42:55 UTC (rev 7206)
@@ -1,54 +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;
-
-import java.net.URI;
-
-import org.jboss.soa.esb.services.persistence.MessageStore;
-
-
-/**
-* Used to plug in new message stores dynamically. Each plugin is responsible for
-* returning a message store implementation that knows how to handle its own persistence
-* mechanism, i.e: database, file, etc.
-*  
-* @author Daniel Brum
-*
-*/
-
-public interface MessageStorePlugin {
-	
-public static final String MESSAGE_STORE_PLUGIN = "org.jboss.soa.esb.persistence.base.plugin";
-	
-	/**
-	 * @return the message instance.
-	 */
-	
-	public MessageStore getMessageStore ();
-	
-	/**
-	 * @return the unique identifier for this message store plugin.
-	 */
-	
-	public URI getType ();
-
-}

Modified: labs/jbossesb/trunk/product/core/services/src/org/jboss/soa/esb/services/persistence/MessageStoreType.java
===================================================================
--- labs/jbossesb/trunk/product/core/services/src/org/jboss/soa/esb/services/persistence/MessageStoreType.java	2006-10-29 23:13:48 UTC (rev 7205)
+++ labs/jbossesb/trunk/product/core/services/src/org/jboss/soa/esb/services/persistence/MessageStoreType.java	2006-10-29 23:42:55 UTC (rev 7206)
@@ -26,7 +26,7 @@
  *
  */
 
-package org.jboss.internal.soa.esb.persistence.format;
+package org.jboss.soa.esb.services.persistence;
 
 import java.net.URI;
 

Deleted: labs/jbossesb/trunk/product/core/services/src/org/jboss/soa/esb/services/persistence/db/DBConnectionManager.java
===================================================================
--- labs/jbossesb/trunk/product/core/services/src/org/jboss/soa/esb/services/persistence/db/DBConnectionManager.java	2006-10-29 23:13:48 UTC (rev 7205)
+++ labs/jbossesb/trunk/product/core/services/src/org/jboss/soa/esb/services/persistence/db/DBConnectionManager.java	2006-10-29 23:42:55 UTC (rev 7206)
@@ -1,99 +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.jboss.soa.esb.common.Configuration;
-
-import com.mchange.v2.c3p0.ComboPooledDataSource;
-
-
-public class DBConnectionManager {
-	
-	private static DBConnectionManager instance =null;
-	
-	protected ComboPooledDataSource pooledDS = null;
-	
-	private static final Object foo = new Integer(0);
-	
-	
-	protected DBConnectionManager() {}
-	
-	public static DBConnectionManager getInstance() {		
-			if (null != instance) {				
-				return instance;
-			} synchronized(foo) {
-				if (null != instance)
-					return instance;
-				try {
-					instance = new DBConnectionManager();
-					instance.init();
-				}catch(Exception e) {
-					e.printStackTrace();
-					return null;
-				}
-				
-				return instance;
-			}				
-				
-	}
-	
-	private void init() throws Exception{
-		System.out.println("Initializing DBConnectionManager2...");		
-		pooledDS = new ComboPooledDataSource();
-		
-		pooledDS.setDriverClass(Configuration.getStoreDriver());
-		pooledDS.setJdbcUrl(Configuration.getStoreUrl());
-		pooledDS.setUser(Configuration.getStoreUser());
-		pooledDS.setPassword(Configuration.getStorePwd());
-		pooledDS.setMinPoolSize(Integer.valueOf(Configuration.getStorePoolMinSize()));
-		pooledDS.setInitialPoolSize(Integer.valueOf(Configuration.getStorePoolInitialSize()));
-		pooledDS.setMaxPoolSize(Integer.valueOf(Configuration.getStorePoolMaxSize()));		
-		pooledDS.setAutomaticTestTable(Configuration.getStorePoolTestTable());
-		pooledDS.setCheckoutTimeout(Integer.valueOf(Configuration.getStorePoolTimeoutMillis()));
-	}
-		
-		
-	
-	public Connection getConnection() throws Exception{		
-		
-		Connection conn = null;
-		
-		//TODO: figure out why this is neccessary - pool should never return null if DB is up and can connect
-		//testing showed null was being returned from pool in QA test MessageStoreTest
-		while (true)
-		{
-			if (null!=pooledDS)
-				if (null != (conn=pooledDS.getConnection()))
-						break;
-			else
-				System.out.println("Null pooledDS");
-			try { Thread.sleep(1000); }
-			catch(Exception e) {}
-		}
-		
-		return conn;
-		
-	}
-
-}

Deleted: labs/jbossesb/trunk/product/core/services/src/org/jboss/soa/esb/services/persistence/db/DBConnectionManagerDBCP.java
===================================================================
--- labs/jbossesb/trunk/product/core/services/src/org/jboss/soa/esb/services/persistence/db/DBConnectionManagerDBCP.java	2006-10-29 23:13:48 UTC (rev 7205)
+++ labs/jbossesb/trunk/product/core/services/src/org/jboss/soa/esb/services/persistence/db/DBConnectionManagerDBCP.java	2006-10-29 23:42:55 UTC (rev 7206)
@@ -1,101 +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 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.getStorePoolInitialSize());
-		
-		//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();
-	}
-
-
-
-
-}

Deleted: labs/jbossesb/trunk/product/core/services/src/org/jboss/soa/esb/services/persistence/db/DBMessageStorePlugin.java
===================================================================
--- labs/jbossesb/trunk/product/core/services/src/org/jboss/soa/esb/services/persistence/db/DBMessageStorePlugin.java	2006-10-29 23:13:48 UTC (rev 7205)
+++ labs/jbossesb/trunk/product/core/services/src/org/jboss/soa/esb/services/persistence/db/DBMessageStorePlugin.java	2006-10-29 23:42:55 UTC (rev 7206)
@@ -1,46 +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.net.URI;
-
-import org.jboss.internal.soa.esb.persistence.format.MessageStorePlugin;
-import org.jboss.internal.soa.esb.persistence.format.MessageStoreType;
-import org.jboss.soa.esb.services.persistence.MessageStore;
-
-/**
- * @author dbrum
- *
- */
-public class DBMessageStorePlugin implements MessageStorePlugin {
-
-	
-	public MessageStore getMessageStore() {
-		return new MessageStoreImpl();
-	}
-
-	
-	public URI getType() {
-		return MessageStoreType.DATABASE;
-	}
-
-}

Deleted: labs/jbossesb/trunk/product/core/services/src/org/jboss/soa/esb/services/persistence/db/MessageStoreImpl.java
===================================================================
--- labs/jbossesb/trunk/product/core/services/src/org/jboss/soa/esb/services/persistence/db/MessageStoreImpl.java	2006-10-29 23:13:48 UTC (rev 7205)
+++ labs/jbossesb/trunk/product/core/services/src/org/jboss/soa/esb/services/persistence/db/MessageStoreImpl.java	2006-10-29 23:42:55 UTC (rev 7206)
@@ -1,162 +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.io.Serializable;
-import java.net.URI;
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.util.UUID;
-
-import org.jboss.internal.soa.esb.thirdparty.Base64;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.services.persistence.MessageStore;
-import org.jboss.soa.esb.util.Util;
-
-
-public class MessageStoreImpl implements MessageStore {
-	
-	
-	protected DBConnectionManager mgr = null;
-	protected Connection conn = null;
-	protected ResultSet rs = null;
-	protected PreparedStatement ps = null;
-	
-	public MessageStoreImpl() {		
-		mgr = DBConnectionManager.getInstance();
-	}
-	
-	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());			
-			
-			String messageString = Base64.encodeObject(Util.serialize(message));	
-			
-//			if (message.getType().equals(MessageType.JBOSS_XML) ) {
-//				Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
-//				((org.jboss.internal.soa.esb.message.format.xml.MessageImpl)message).toXML(doc);					
-//				StringWriter sWriter = new StringWriter();
-//				OutputFormat format = new OutputFormat();
-//				format.setIndenting(true);
-//				XMLSerializer xmlS = new XMLSerializer(sWriter, format);
-//				xmlS.asDOMSerializer();
-//				xmlS.serialize(doc);
-//				messageString = sWriter.toString();
-//			}
-//			
-//			if (message.getType().equals(MessageType.JAVA_SERIALIZED) ) {
-//				messageString = Base64.encodeObject((Serializable)message);				
-//			}			
-			
-			//insert into the database
-			String sql = "insert into message(uid, type, message) values(?,?,?)";
-			ps = conn.prepareStatement(sql);
-			ps.setString(1, uid.toString());
-			ps.setString(2, message.getType().toString());
-			ps.setString(3, messageString);
-			ps.execute();			
-			
-		} catch (Exception e) {	e.printStackTrace(); }		
-		finally { release(); }
-		
-		return uid;
-	}
-
-	public synchronized Message getMessage(URI uid) throws Exception{		
-		
-		String sql = "select uid,type,message from message where uid=?";
-		Message message = null;
-			
-		try {			
-			conn = mgr.getConnection();
-			ps = conn.prepareStatement(sql);
-			ps.setString(1, uid.toString());
-			
-			rs = ps.executeQuery();
-			if (! rs.next()) throw new Exception("Non existing Message for UID: " + uid);			 
-//			URI type= URI.create(rs.getString(2));			
-			message = Util.deserialize((Serializable)Base64.decodeToObject(rs.getString(3)));
-			
-			
-//			if (type.equals(MessageType.JBOSS_XML)) {		
-//
-//				InputStream inStream = new ByteArrayInputStream(msg.getBytes());
-//				DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
-//				DocumentBuilder builder = factory.newDocumentBuilder();				
-//				Document doc = builder.parse(inStream);				
-//				
-//				org.jboss.internal.soa.esb.message.format.xml.MessageImpl xmlMessage = 
-//					new org.jboss.internal.soa.esb.message.format.xml.MessageImpl();
-//				xmlMessage.fromXML(doc);
-//				message=xmlMessage;
-//				
-//			}
-//			if (type.equals(MessageType.JAVA_SERIALIZED)) {		
-//				
-//				Object byteMessage = Base64.decodeToObject(msg);								
-//				message = (org.jboss.internal.soa.esb.message.format.serialized.MessageImpl)byteMessage;
-//			}			
-			
-		} catch (SQLException e) {
-			e.printStackTrace();
-			return null;
-		} catch (Exception e) {
-			e.printStackTrace();
-			return null;
-		}finally { release(); }		
-		
-		return message;
-		
-	}
-	
-	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/services/tests/src/org/jboss/soa/esb/esb/persistence/tests/MessageStoreUnitTest.java
===================================================================
--- labs/jbossesb/trunk/product/core/services/tests/src/org/jboss/soa/esb/esb/persistence/tests/MessageStoreUnitTest.java	2006-10-29 23:13:48 UTC (rev 7205)
+++ labs/jbossesb/trunk/product/core/services/tests/src/org/jboss/soa/esb/esb/persistence/tests/MessageStoreUnitTest.java	2006-10-29 23:42:55 UTC (rev 7206)
@@ -37,7 +37,7 @@
 
 import junit.framework.TestCase;
 
-import org.jboss.internal.soa.esb.persistence.format.MessageStoreType;
+import org.jboss.soa.esb.services.persistence.MessageStoreType;
 import org.jboss.internal.soa.esb.persistence.format.db.DBConnectionManager;
 import org.jboss.soa.esb.common.Configuration;
 import org.jboss.soa.esb.common.tests.HsqldbUtil;

Modified: labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/messagestore/MessageStoreClient.java
===================================================================
--- labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/messagestore/MessageStoreClient.java	2006-10-29 23:13:48 UTC (rev 7205)
+++ labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/messagestore/MessageStoreClient.java	2006-10-29 23:42:55 UTC (rev 7206)
@@ -26,7 +26,7 @@
 import java.util.Vector;
 
 import org.apache.log4j.Logger;
-import org.jboss.internal.soa.esb.persistence.format.MessageStoreType;
+import org.jboss.soa.esb.services.persistence.MessageStoreType;
 import org.jboss.soa.esb.message.Message;
 import org.jboss.soa.esb.message.format.MessageFactory;
 import org.jboss.soa.esb.message.format.MessageType;

Modified: labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/messagestore/MessageStoreTest.java
===================================================================
--- labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/messagestore/MessageStoreTest.java	2006-10-29 23:13:48 UTC (rev 7205)
+++ labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/messagestore/MessageStoreTest.java	2006-10-29 23:42:55 UTC (rev 7206)
@@ -32,7 +32,7 @@
 import junit.framework.TestCase;
 
 import org.apache.log4j.Logger;
-import org.jboss.internal.soa.esb.persistence.format.MessageStoreType;
+import org.jboss.soa.esb.services.persistence.MessageStoreType;
 import org.jboss.internal.soa.esb.persistence.format.db.DBConnectionManager;
 import org.jboss.soa.esb.common.Configuration;
 import org.jboss.soa.esb.message.Message;

Deleted: labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/messagestore/MessageStore_brokentest.java
===================================================================
--- labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/messagestore/MessageStore_brokentest.java	2006-10-29 23:13:48 UTC (rev 7205)
+++ labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/messagestore/MessageStore_brokentest.java	2006-10-29 23:42:55 UTC (rev 7206)
@@ -1,118 +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.messagestore;
-
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Random;
-
-import org.apache.log4j.Logger;
-import org.jboss.internal.soa.esb.persistence.format.MessageStoreType;
-import org.jboss.soa.esb.common.Configuration;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.format.MessageFactory;
-import org.jboss.soa.esb.message.format.MessageType;
-import org.jboss.soa.esb.services.persistence.MessageStore;
-import org.jboss.soa.esb.services.persistence.MessageStoreFactory;
-
-import junit.framework.TestCase;
-
-/**
- * @author dbrum
- *
- */
-public class MessageStore_brokentest extends TestCase {
-	private static Logger logger = Logger.getLogger(MessageStore_brokentest.class);
-	
-	public void test() throws Exception {
-		int requestors = 1000;	//number of persist calls to make
-		List<URI> uriList = new ArrayList<URI>();
-		
-		TestUtil.setESBPropertiesFileToUse();
-		MessageStore_brokentest.runBeforeAllTests();
-		
-		//get the database store
-		MessageStore store = MessageStoreFactory.getInstance().getMessageStore(MessageStoreType.DATABASE);
-		
-		//messages to persist
-		Message msg[] = { MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML), 
-						 MessageFactory.getInstance().getMessage(MessageType.JAVA_SERIALIZED)};		
-		
-		//set some content inside the Messages
-		for (int x=0; x<msg.length; x++) {
-			msg[x].getBody().setContents("TEST BODY".getBytes());
-			msg[x].getProperties().setProperty("prop"+x, "val"+x);
-			msg[x].getAttachment().addItem(new String("TEST ATTACHMENT"));						
-		}
-		
-		//loop through adding the messages
-		
-		Random rndMsg = new Random();
-		for (int x=0; x<=requestors; x++) {
-			URI uid = store.addMessage(msg[rndMsg.nextInt(2)]);			
-			uriList.add(uid);			
-		}
-		
-		logger.info("total messages persisted to db: " + (uriList.size()-1));
-		
-		//loop back reading the messages from the db
-		List<Message> messages = new ArrayList<Message>();
-		for (int x=0; x<uriList.size(); x++) {
-			messages.add(store.getMessage(uriList.get(x)));
-		}
-		logger.info("total messages read from db: " + (messages.size()-1));
-		
-		MessageStore_brokentest.runAfterAllTests();
-		
-	}
-	
-	protected static void runBeforeAllTests() throws Exception{
-		
-		TestUtil.setESBPropertiesFileToUse();				
-					
-		if (Configuration.getStoreDriver().equals("org.hsqldb.jdbcDriver")) {
-			HsqldbUtil.startHsqldb("home/dbrum/dev/jbossesb/trunk/product/install/message-store/sql/hsqldb/create_database.sql", "jbossesb");
-		}
-		
-	}
-	
-	private static void runAfterAllTests() throws Exception{
-		
-		if (Configuration.getStoreDriver().equals("org.hsqldb.jdbcDriver")) {
-			HsqldbUtil.stopHsqldb(Configuration.getStoreUrl(),
-					Configuration.getStoreUser(),Configuration.getStorePwd() );
-		}
-	}
-	
-	public static void main(String args[]) {
-		MessageStore_brokentest test = new MessageStore_brokentest();
-		try {
-			test.test();
-		} catch (Exception e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-		}
-	}
-	
-	
-}




More information about the jboss-svn-commits mailing list