[jboss-svn-commits] JBL Code SVN: r8157 - in labs/jbossesb/trunk: product/core/listeners/src/org/jboss/soa/esb/actions/routing product/core/listeners/src/org/jboss/soa/esb/listeners/gateway product/core/listeners/src/org/jboss/soa/esb/listeners/message product/core/listeners/src/org/jboss/soa/esb/listeners/old product/core/rosetta/src/org/jboss/internal/soa/esb/command product/core/rosetta/src/org/jboss/internal/soa/esb/couriers product/core/rosetta/src/org/jboss/soa/esb/addressing/eprs product/core/rosetta/src/org/jboss/soa/esb/common product/core/rosetta/src/org/jboss/soa/esb/couriers product/core/rosetta/src/org/jboss/soa/esb/helpers product/core/rosetta/tests/resources/etc product/core/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/tests product/core/rosetta/tests/src/org/jboss/soa/esb/addressing/helpers/tests product/core/rosetta/tests/src/org/jboss/soa/esb/common/tests/propertymanager product/core/rosetta/tests/src/org/jboss/soa/esb/common/tests/utils product/core/rosetta! /tests/src/org/jboss/soa/esb/helpers product/etc/examples/listeners product/install product/samples/quickstarts/helloworld product/samples/quickstarts/helloworld_action product/samples/quickstarts/helloworld_embedded_reg product/samples/quickstarts/more_action product/samples/quickstarts/simple_cbr product/samples/quickstarts/simple_transformation product/samples/trailblazer2/banks/src/org/jboss/soa/esb/samples/loanbroker/banks product/samples/trailblazer2/banks/test/src/org/jboss/soa/esb/samples/loanbroker/banks product/samples/trailblazer2/esb/conf qa/junit/src/org/jboss/soa/esb/actions qa/junit/src/org/jboss/soa/esb/listeners/gateway qa/junit/src/org/jboss/soa/esb/listeners/message qa/junit/src/org/jboss/soa/esb/objpersist qa/junit/src/org/jboss/soa/esb/util

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Fri Dec 8 16:56:03 EST 2006


Author: kurt.stam at jboss.com
Date: 2006-12-08 16:55:49 -0500 (Fri, 08 Dec 2006)
New Revision: 8157

Added:
   labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/helpers/NamingContext.java
Removed:
   labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/helpers/AppServerContext.java
Modified:
   labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/routing/JMSRouter.java
   labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/gateway/JmsGatewayListener.java
   labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/message/JmsQueueListener.java
   labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/old/JmsQueueListener.java
   labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/command/JmsCommandQueue.java
   labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/couriers/JmsCourier.java
   labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/addressing/eprs/JMSEpr.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/src/org/jboss/soa/esb/couriers/CourierUtil.java
   labs/jbossesb/trunk/product/core/rosetta/tests/resources/etc/jbossesb-test-properties.xml
   labs/jbossesb/trunk/product/core/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/tests/FileCourierUnitTest.java
   labs/jbossesb/trunk/product/core/rosetta/tests/src/org/jboss/soa/esb/addressing/helpers/tests/JMSUnitTest.java
   labs/jbossesb/trunk/product/core/rosetta/tests/src/org/jboss/soa/esb/common/tests/propertymanager/PropertyManagerUnitTest.java
   labs/jbossesb/trunk/product/core/rosetta/tests/src/org/jboss/soa/esb/common/tests/utils/DrainQueuesAndTopics.java
   labs/jbossesb/trunk/product/core/rosetta/tests/src/org/jboss/soa/esb/helpers/AppServerContextUnitTest.java
   labs/jbossesb/trunk/product/etc/examples/listeners/EsbJmsListenerEasier2ReadExample.xml
   labs/jbossesb/trunk/product/etc/examples/listeners/EsbJmsListenerExample.xml
   labs/jbossesb/trunk/product/etc/examples/listeners/gatewayExample.xml
   labs/jbossesb/trunk/product/install/build.xml
   labs/jbossesb/trunk/product/samples/quickstarts/helloworld/esb-config-gateway.xml
   labs/jbossesb/trunk/product/samples/quickstarts/helloworld/esb-config.xml
   labs/jbossesb/trunk/product/samples/quickstarts/helloworld_action/esb-config-gateway.xml
   labs/jbossesb/trunk/product/samples/quickstarts/helloworld_action/esb-config.xml
   labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/esb-config-gateway.xml
   labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/esb-config.xml
   labs/jbossesb/trunk/product/samples/quickstarts/more_action/esb-config-gateway.xml
   labs/jbossesb/trunk/product/samples/quickstarts/more_action/esb-config.xml
   labs/jbossesb/trunk/product/samples/quickstarts/simple_cbr/esb-config-gateway.xml
   labs/jbossesb/trunk/product/samples/quickstarts/simple_cbr/esb-config.xml
   labs/jbossesb/trunk/product/samples/quickstarts/simple_transformation/esb-config-gateway.xml
   labs/jbossesb/trunk/product/samples/quickstarts/simple_transformation/esb-config.xml
   labs/jbossesb/trunk/product/samples/trailblazer2/banks/src/org/jboss/soa/esb/samples/loanbroker/banks/ManagerJMS.java
   labs/jbossesb/trunk/product/samples/trailblazer2/banks/test/src/org/jboss/soa/esb/samples/loanbroker/banks/JmsProcessorTest.java
   labs/jbossesb/trunk/product/samples/trailblazer2/esb/conf/jbossesb-gateway.xml
   labs/jbossesb/trunk/product/samples/trailblazer2/esb/conf/jbossesb-listener.xml
   labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/actions/CbrProxyActionUnitTest.xml
   labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/gateway/JmsGatewayListenerUnitTest.java
   labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/gateway/fileEsbListenerConfig.xml
   labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/gateway/jmsEsbListenerConfig.xml
   labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/gateway/jmsGatewayConfig.xml
   labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/gateway/secureFtpEsbListenerConfig.xml
   labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/message/CbrJmsQueueListenerTest.xml
   labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/objpersist/DrainQueuesAndTopics.java
   labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/util/JMSClientUtil.java
Log:
Adding support for (active)mq

Modified: labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/routing/JMSRouter.java
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/routing/JMSRouter.java	2006-12-08 21:42:37 UTC (rev 8156)
+++ labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/routing/JMSRouter.java	2006-12-08 21:55:49 UTC (rev 8157)
@@ -43,7 +43,7 @@
 import org.jboss.soa.esb.actions.ActionProcessor;
 import org.jboss.soa.esb.actions.ActionUtils;
 import org.jboss.soa.esb.common.Configuration;
-import org.jboss.soa.esb.helpers.AppServerContext;
+import org.jboss.soa.esb.helpers.NamingContext;
 import org.jboss.soa.esb.helpers.KeyValuePair;
 
 /**
@@ -176,9 +176,10 @@
         // TODO: Modify to support topic destinations too
 
         private JMSSendQueueSetup(String queueName) throws NamingException, JMSException  {
-            Context m_oCtx = AppServerContext.getServerContext(
-                    Configuration.getJndiServerType(), 
-                    Configuration.getJndiServerURL());           
+            Context m_oCtx = NamingContext.getServerContext(
+                    Configuration.getJndiServerURL(),
+                    Configuration.getJndiServerConnectionFactory(), 
+                    Configuration.getJndiServerPkgPrefix());           
             QueueConnectionFactory qcf = (QueueConnectionFactory) m_oCtx.lookup("ConnectionFactory");
             QueueConnection oQconn = qcf.createQueueConnection();
 

Modified: labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/gateway/JmsGatewayListener.java
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/gateway/JmsGatewayListener.java	2006-12-08 21:42:37 UTC (rev 8156)
+++ labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/gateway/JmsGatewayListener.java	2006-12-08 21:55:49 UTC (rev 8157)
@@ -46,7 +46,7 @@
 import org.jboss.soa.esb.couriers.Courier;
 import org.jboss.soa.esb.couriers.CourierException;
 import org.jboss.soa.esb.couriers.CourierFactory;
-import org.jboss.soa.esb.helpers.AppServerContext;
+import org.jboss.soa.esb.helpers.NamingContext;
 import org.jboss.soa.esb.helpers.ConfigTree;
 import org.jboss.soa.esb.listeners.ListenerTagNames;
 import org.jboss.soa.esb.message.Message;
@@ -216,15 +216,19 @@
         _queueSession = null;
         _queue = null;
 
-        String sJndiType = _controller.obtainAtt(_config, JMSEpr.JNDI_TYPE_TAG,"jboss");
-        if (null==_config.getAttribute(JMSEpr.JNDI_TYPE_TAG))
-    	_logger.debug("No value specified for "+JMSEpr.JNDI_TYPE_TAG+" attribute"
-    			+" -  Using default of: '"+sJndiType+"'");
-        String sJndiURL = _controller.obtainAtt(_config, JMSEpr.JNDI_URL_TAG,"localhost");
+        String sJndiURL = _controller.obtainAtt(_config, JMSEpr.JNDI_URL_TAG, NamingContext.JBOSS_PROVIDER_URL);
         if (null==_config.getAttribute(JMSEpr.JNDI_URL_TAG))
         	_logger.debug("No value specified for "+JMSEpr.JNDI_URL_TAG+" attribute"
         			+" -  Using default of: '"+sJndiURL+"'");
-        Context oJndiCtx = AppServerContext.getServerContext(sJndiType,sJndiURL);
+        String sJndiContextFactory = _controller.obtainAtt(_config, JMSEpr.JNDI_CONTEXT_FACTORY,NamingContext.JBOSS_INITIAL_CONTEXT_FACTORY);
+        if (null==_config.getAttribute(JMSEpr.JNDI_CONTEXT_FACTORY))
+    	_logger.debug("No value specified for "+JMSEpr.JNDI_CONTEXT_FACTORY+" attribute"
+    			+" -  Using default of: '"+sJndiContextFactory+"'");
+        String sJndiPkgPrefix = _controller.obtainAtt(_config, JMSEpr.JNDI_PKG_PREFIX_TAG,NamingContext.JBOSS_PROVIDER_URL);
+        if (null==_config.getAttribute(JMSEpr.JNDI_PKG_PREFIX_TAG))
+    	_logger.debug("No value specified for "+JMSEpr.JNDI_PKG_PREFIX_TAG+" attribute"
+    			+" -  Using default of: '"+sJndiPkgPrefix+"'");
+        Context oJndiCtx = NamingContext.getServerContext(sJndiURL,sJndiContextFactory,sJndiPkgPrefix);
 
         String sFactClass = _controller.obtainAtt(_config,JMSEpr.CONNECTION_FACTORY_TAG, "ConnectionFactory");
         if (null==_config.getAttribute(JMSEpr.CONNECTION_FACTORY_TAG))
@@ -232,14 +236,14 @@
         			+" -  Using default of: '"+sFactClass+"'");
     	_serviceName	= _config.getAttribute(ListenerTagNames.SERVICE_NAME_TAG);
         _myEpr = (null==_serviceName) ? null
-        		: new JMSEpr(JMSEpr.QUEUE_TYPE,_queueName,sFactClass,sJndiType,sJndiURL,_messageSelector);
+        		: new JMSEpr(JMSEpr.QUEUE_TYPE,_queueName,sFactClass,sJndiURL,sJndiContextFactory,sJndiPkgPrefix,_messageSelector);
         
         Object tmp = oJndiCtx.lookup(sFactClass);
         QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;
 
         _queueConnection = qcf.createQueueConnection();
-        _queue = (Queue) oJndiCtx.lookup(_queueName);
         _queueSession = _queueConnection.createQueueSession(false,QueueSession.AUTO_ACKNOWLEDGE);
+        _queue = _queueSession.createQueue(_queueName);
         _queueConnection.start();
 
         _messageReceiver = _queueSession.createReceiver(_queue, _messageSelector);

Modified: labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/message/JmsQueueListener.java
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/message/JmsQueueListener.java	2006-12-08 21:42:37 UTC (rev 8156)
+++ labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/message/JmsQueueListener.java	2006-12-08 21:55:49 UTC (rev 8157)
@@ -39,7 +39,7 @@
 import org.apache.log4j.Logger;
 import org.jboss.soa.esb.ConfigurationException;
 import org.jboss.soa.esb.addressing.eprs.JMSEpr;
-import org.jboss.soa.esb.helpers.AppServerContext;
+import org.jboss.soa.esb.helpers.NamingContext;
 import org.jboss.soa.esb.helpers.ConfigTree;
 import org.jboss.soa.esb.listeners.ListenerTagNames;
 import org.jboss.soa.esb.listeners.State;
@@ -150,22 +150,26 @@
         _oQsess = null;
         _oQueue = null;
 
-        _jndiType = obtainAttribute	(JMSEpr.JNDI_TYPE_TAG	,"jboss");
-        if (null==_config.getAttribute(JMSEpr.JNDI_TYPE_TAG))
-        	_logger.debug("No value specified for "+JMSEpr.JNDI_TYPE_TAG+" attribute"
-        			+" -  Using default of: '"+_jndiType+"'");
         _jndiURL = obtainAttribute	(JMSEpr.JNDI_URL_TAG	,"localhost");
         if (null==_config.getAttribute(JMSEpr.JNDI_URL_TAG))
         	_logger.debug("No value specified for "+JMSEpr.JNDI_URL_TAG+" attribute"
         			+" -  Using default of: '"+_jndiURL+"'");
-        _jndiCtx = AppServerContext.getServerContext(_jndiType,_jndiURL);
+        _jndiContextFactory = obtainAttribute	(JMSEpr.JNDI_CONTEXT_FACTORY	,NamingContext.JBOSS_INITIAL_CONTEXT_FACTORY);
+        if (null==_config.getAttribute(JMSEpr.JNDI_CONTEXT_FACTORY))
+        	_logger.debug("No value specified for "+JMSEpr.JNDI_CONTEXT_FACTORY+" attribute"
+        			+" -  Using default of: '"+_jndiContextFactory+"'");
+        if (null==_config.getAttribute(JMSEpr.JNDI_PKG_PREFIX_TAG))
+        	_logger.debug("No value specified for "+JMSEpr.JNDI_PKG_PREFIX_TAG+" attribute"
+        			+" -  Using default of: '"+_jndiPkgPrefix+"'");
+        
+        _jndiCtx = NamingContext.getServerContext(_jndiURL,_jndiContextFactory,_jndiPkgPrefix);
 
         _jmsFactoryClass = obtainAttribute(JMSEpr.CONNECTION_FACTORY_TAG, "ConnectionFactory");
         if (null==_config.getAttribute(JMSEpr.CONNECTION_FACTORY_TAG))
         	_logger.debug("No value specified for "+JMSEpr.CONNECTION_FACTORY_TAG+" attribute"
         			+" -  Using default of: '"+_jmsFactoryClass+"'");
         _epr = new JMSEpr(JMSEpr.QUEUE_TYPE,_queueName,_jmsFactoryClass
-        				,_jndiType,_jndiURL,_sSelector);
+        				,_jndiURL,_jndiContextFactory,_jndiPkgPrefix,_sSelector);
 
 		Exception thrown = null;
         try
@@ -174,8 +178,8 @@
         	QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;
 
         	_oQconn = qcf.createQueueConnection();
-        	_oQueue = (Queue) _jndiCtx.lookup(_queueName);
         	_oQsess = _oQconn.createQueueSession(false,TopicSession.AUTO_ACKNOWLEDGE);
+        	_oQueue = _oQsess.createQueue(_queueName);
         	_oQconn.start();
         	_receiver = _oQsess.createReceiver(_oQueue, _sSelector);
         	return;
@@ -277,8 +281,9 @@
     protected Queue 			_oQueue;
     protected String	_queueName
     					,_sSelector
-    					,_jndiType
     					,_jndiURL
+    					,_jndiContextFactory
+    					,_jndiPkgPrefix
     					,_jmsFactoryClass
     ;
     protected Context			_jndiCtx;

Modified: labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/old/JmsQueueListener.java
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/old/JmsQueueListener.java	2006-12-08 21:42:37 UTC (rev 8156)
+++ labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/old/JmsQueueListener.java	2006-12-08 21:55:49 UTC (rev 8157)
@@ -36,13 +36,14 @@
 
 import org.jboss.soa.esb.actions.ActionDefinitionFactory;
 import org.jboss.soa.esb.actions.ActionProcessor;
-import org.jboss.soa.esb.helpers.AppServerContext;
+import org.jboss.soa.esb.helpers.NamingContext;
 import org.jboss.soa.esb.helpers.ConfigTree;
 
 public class JmsQueueListener extends AbstractListener {
 
     public static final String LISTEN_QUEUE_CONN_FACT = "queueConnFactoryClass";
-    public static final String LISTEN_JNDI_TYPE = "listenJndiType";
+    public static final String LISTEN_JNDI_CONTEXT_FACTORY = "listenJndiContextFactory";
+    public static final String LISTEN_JNDI_PKG_PREFIX = "listenJndiPkgPrefix";
     public static final String LISTEN_JNDI_URL = "listenJndiURL";
     public static final String LISTEN_QUEUE = "listenQueue";
     public static final String LISTEN_MSG_SELECTOR = "listenMsgSelector";
@@ -80,12 +81,14 @@
         m_oQsess = null;
         m_oQueue = null;
 
-        String sJndiType = GpListener.obtainAtt(listenerConfig, LISTEN_JNDI_TYPE,
-                "jboss");
         String sJndiURL = GpListener.obtainAtt(listenerConfig, LISTEN_JNDI_URL,
-                "localhost");
-        Context oJndiCtx = AppServerContext.getServerContext(sJndiType,
-                sJndiURL);
+                NamingContext.JBOSS_PROVIDER_URL);
+        String sJndiContextFactory = GpListener.obtainAtt(listenerConfig, LISTEN_JNDI_CONTEXT_FACTORY,
+                NamingContext.JBOSS_INITIAL_CONTEXT_FACTORY);
+        String sJndiPkgPrefix = GpListener.obtainAtt(listenerConfig, LISTEN_JNDI_PKG_PREFIX,
+                NamingContext.JBOSS_INITIAL_CONTEXT_FACTORY);
+        Context oJndiCtx = NamingContext.getServerContext(
+                sJndiURL, sJndiContextFactory, sJndiPkgPrefix);
 
         String sFactClass = GpListener.obtainAtt(listenerConfig,
                 LISTEN_QUEUE_CONN_FACT, "ConnectionFactory");

Modified: labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/command/JmsCommandQueue.java
===================================================================
--- labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/command/JmsCommandQueue.java	2006-12-08 21:42:37 UTC (rev 8156)
+++ labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/command/JmsCommandQueue.java	2006-12-08 21:55:49 UTC (rev 8157)
@@ -20,7 +20,7 @@
 
 import org.apache.log4j.Logger;
 import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.helpers.AppServerContext;
+import org.jboss.soa.esb.helpers.NamingContext;
 import org.jboss.soa.esb.helpers.ConfigTree;
 import org.jboss.soa.esb.util.Util;
 
@@ -37,9 +37,11 @@
 
 	public static final String COMMAND_CONN_FACTORY = "commandConnFactoryClass";
 
-	public static final String COMMAND_JNDI_TYPE = "commandJndiType";
-
 	public static final String COMMAND_JNDI_URL = "commandJndiURL";
+	
+	public static final String COMMAND_JNDI_CONTEXT_FACTORY = "commandJndiContextFactory";
+	
+	public static final String COMMAND_JNDI_PKG_PREFIX = "commandJndiUrlPkgPrefix";
 
 	public static final String COMMAND_IS_TOPIC = "commandIsTopic";
 
@@ -102,12 +104,14 @@
 
 			oNewAtts.put(COMMAND_JNDI_NAME, sJndiName);
 
-			String sJndiType = obtainAtt(p_oP, COMMAND_JNDI_TYPE, "jboss");
-			oNewAtts.put(COMMAND_JNDI_TYPE, sJndiType);
-			String sJndiURL = obtainAtt(p_oP, COMMAND_JNDI_URL, "localhost");
+			String sJndiURL = obtainAtt(p_oP, COMMAND_JNDI_URL, NamingContext.JBOSS_PROVIDER_URL);
 			oNewAtts.put(COMMAND_JNDI_URL, sJndiURL);
-			Context oJndiCtx = AppServerContext.getServerContext(sJndiType,
-					sJndiURL);
+			String sJndiContextFactory = obtainAtt(p_oP, COMMAND_JNDI_CONTEXT_FACTORY, NamingContext.JBOSS_INITIAL_CONTEXT_FACTORY);
+			oNewAtts.put(COMMAND_JNDI_CONTEXT_FACTORY, sJndiContextFactory);
+			String sJndiPkgPrefix = obtainAtt(p_oP, COMMAND_JNDI_PKG_PREFIX, NamingContext.JBOSS_URL_PKG_PREFIX);
+			oNewAtts.put(COMMAND_JNDI_PKG_PREFIX, sJndiPkgPrefix);
+			Context oJndiCtx = NamingContext.getServerContext(sJndiURL,
+					sJndiContextFactory, sJndiPkgPrefix);
 
 			String sFactClass = obtainAtt(p_oP, COMMAND_CONN_FACTORY,
 					"ConnectionFactory");
@@ -125,9 +129,9 @@
 			if (bIsTopic) {
 				TopicConnectionFactory tcf = (TopicConnectionFactory) oFactCls;
 				TopicConnection oTC = tcf.createTopicConnection();
-				Topic oTopic = (Topic) oJndiCtx.lookup(sJndiName);
 				TopicSession oSess = oTC.createTopicSession(false,
 						TopicSession.AUTO_ACKNOWLEDGE);
+				Topic oTopic = oSess.createTopic(sJndiName);
 				m_oJmsConn = oTC;
 				m_oJmsSess = oSess;
 				oTC.start();
@@ -135,10 +139,9 @@
 			} else {
 				QueueConnectionFactory qcf = (QueueConnectionFactory) oFactCls;
 				QueueConnection oQC = qcf.createQueueConnection();
-				javax.jms.Queue oQ = (javax.jms.Queue) oJndiCtx
-						.lookup(sJndiName);
 				QueueSession oSess = oQC.createQueueSession(false,
 						TopicSession.AUTO_ACKNOWLEDGE);
+				javax.jms.Queue oQ = oSess.createQueue(sJndiName);
 				oQC.start();
 				m_oJmsConn = oQC;
 				m_oJmsSess = oSess;

Modified: labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/couriers/JmsCourier.java
===================================================================
--- labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/couriers/JmsCourier.java	2006-12-08 21:42:37 UTC (rev 8156)
+++ labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/couriers/JmsCourier.java	2006-12-08 21:55:49 UTC (rev 8157)
@@ -46,7 +46,7 @@
 import org.apache.log4j.Logger;
 import org.jboss.soa.esb.addressing.eprs.JMSEpr;
 import org.jboss.soa.esb.couriers.CourierException;
-import org.jboss.soa.esb.helpers.AppServerContext;
+import org.jboss.soa.esb.helpers.NamingContext;
 import org.jboss.soa.esb.helpers.KeyValuePair;
 import org.jboss.soa.esb.message.Message;
 import org.jboss.soa.esb.util.Util;
@@ -184,13 +184,16 @@
     
     private void createMessageProducer() throws Exception
     {
-        String sJndiType = _epr.getJndiType();
-        if (Util.isNullString(sJndiType))
-        	sJndiType = "jboss";
+        String sJndiConnectionFactory = _epr.getJndiContextFactory();
+        if (Util.isNullString(sJndiConnectionFactory))
+        	sJndiConnectionFactory = NamingContext.JBOSS_INITIAL_CONTEXT_FACTORY;
         String sJndiURL = _epr.getJndiURL();
         if (Util.isNullString(sJndiURL))
-        	sJndiURL = "localhost";
-        Context oJndiCtx = AppServerContext.getServerContext(sJndiType,sJndiURL);
+        	sJndiURL = NamingContext.JBOSS_PROVIDER_URL;
+        String sJndiPkgPrefix = _epr.getJndiPkgPrefix();
+        if (Util.isNullString(sJndiPkgPrefix))
+        	sJndiPkgPrefix = NamingContext.JBOSS_URL_PKG_PREFIX;
+        Context oJndiCtx = NamingContext.getServerContext(sJndiURL, sJndiConnectionFactory, sJndiPkgPrefix);
 
         String sFactoryClass = _epr.getConnectionFactory();
         if (Util.isNullString(sFactoryClass))
@@ -201,20 +204,20 @@
         String sType = _epr.getDestinationType();
         if (JMSEpr.QUEUE_TYPE.equals(sType))
         {
-            javax.jms.Queue queue = (javax.jms.Queue) oJndiCtx.lookup(_epr.getDestinationName());
             QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;
             QueueConnection qConn = qcf.createQueueConnection();
             QueueSession qSess = qConn.createQueueSession(false,QueueSession.AUTO_ACKNOWLEDGE);
+            javax.jms.Queue queue = qSess.createQueue(_epr.getDestinationName());
             _jmsConnection	 = qConn;
             _jmsSession		 = qSess;
             _messageProducer = qSess.createSender(queue);
         }
         else if(JMSEpr.TOPIC_TYPE.equals(sType))
         {
-            Topic topic = (Topic) oJndiCtx.lookup(_epr.getDestinationName());
             TopicConnectionFactory tcf = (TopicConnectionFactory) tmp;
             TopicConnection tConn = tcf.createTopicConnection();
             TopicSession tSess = tConn.createTopicSession(false,TopicSession.AUTO_ACKNOWLEDGE);
+            Topic topic = tSess.createTopic(_epr.getDestinationName());
             _jmsConnection	 = tConn;
             _jmsSession		 = tSess;
             _messageProducer = tSess.createPublisher(topic);
@@ -279,13 +282,16 @@
 
     private void createMessageConsumer() throws Exception
     {
-        String sJndiType = _epr.getJndiType();
-        if (Util.isNullString(sJndiType))
-        	sJndiType = "jboss";
+    	String sJndiConnectionFactory = _epr.getJndiContextFactory();
+        if (Util.isNullString(sJndiConnectionFactory))
+        	sJndiConnectionFactory = NamingContext.JBOSS_INITIAL_CONTEXT_FACTORY;
         String sJndiURL = _epr.getJndiURL();
         if (Util.isNullString(sJndiURL))
-        	sJndiURL = "localhost";
-        Context oJndiCtx = AppServerContext.getServerContext(sJndiType,sJndiURL);
+        	sJndiURL = NamingContext.JBOSS_PROVIDER_URL;
+        String sJndiPkgPrefix = _epr.getJndiPkgPrefix();
+        if (Util.isNullString(sJndiPkgPrefix))
+        	sJndiPkgPrefix = NamingContext.JBOSS_URL_PKG_PREFIX;
+        Context oJndiCtx = NamingContext.getServerContext(sJndiURL, sJndiConnectionFactory, sJndiPkgPrefix);
 
         String sFactoryClass = _epr.getConnectionFactory();
         if (Util.isNullString(sFactoryClass))
@@ -296,10 +302,10 @@
         String sType = _epr.getDestinationType();
         if (JMSEpr.QUEUE_TYPE.equals(sType))
         {
-            javax.jms.Queue queue = (javax.jms.Queue) oJndiCtx.lookup(_epr.getDestinationName());
             QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;
             QueueConnection qConn = qcf.createQueueConnection();
             QueueSession qSess = qConn.createQueueSession(false,QueueSession.AUTO_ACKNOWLEDGE);
+            javax.jms.Queue queue = qSess.createQueue(_epr.getDestinationName());
             _jmsConnection	 = qConn;
             _jmsSession		 = qSess;
             _messageConsumer = qSess.createReceiver(queue,_epr.getMessageSelector());
@@ -307,10 +313,10 @@
         }
         else if(JMSEpr.TOPIC_TYPE.equals(sType))
         {
-            Topic topic = (Topic) oJndiCtx.lookup(_epr.getDestinationName());
             TopicConnectionFactory tcf = (TopicConnectionFactory) tmp;
             TopicConnection tConn = tcf.createTopicConnection();
             TopicSession tSess = tConn.createTopicSession(false,TopicSession.AUTO_ACKNOWLEDGE);
+            Topic topic = tSess.createTopic(_epr.getDestinationName());
             _jmsConnection	 = tConn;
             _jmsSession		 = tSess;
             _messageConsumer = tSess.createConsumer(topic,_epr.getMessageSelector());

Modified: labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/addressing/eprs/JMSEpr.java
===================================================================
--- labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/addressing/eprs/JMSEpr.java	2006-12-08 21:42:37 UTC (rev 8156)
+++ labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/addressing/eprs/JMSEpr.java	2006-12-08 21:55:49 UTC (rev 8157)
@@ -30,6 +30,7 @@
 
 import org.jboss.soa.esb.addressing.EPR;
 import org.jboss.soa.esb.addressing.PortReference;
+import org.jboss.soa.esb.helpers.NamingContext;
 
 /**
  * A helper class for using JMS style EPRs. Simply create and use instances of
@@ -49,8 +50,9 @@
     public static final String DESTINATION_TYPE_TAG = "destination-type";
     public static final String DESTINATION_NAME_TAG = "destination-name";
     public static final String CONNECTION_FACTORY_TAG = "connection-factory";
-    public static final String JNDI_TYPE_TAG = "jndi-type";
+    public static final String JNDI_PKG_PREFIX_TAG = "jndi-pkg-prefix";
     public static final String JNDI_URL_TAG = "jndi-URL";
+    public static final String JNDI_CONTEXT_FACTORY = "jndi-context-factory";
     public static final String MESSAGE_SELECTOR_TAG = "message-selector";
     public static final String QUEUE_TYPE = "queue";
     public static final String TOPIC_TYPE = "topic";
@@ -76,7 +78,7 @@
 	    String connection)
     {
 	this(ONE_ONE_PROTOCOL, destinationType, destinationName, connection,
-		"jboss", "localhost", null);
+		NamingContext.JBOSS_PROVIDER_URL, NamingContext.JBOSS_INITIAL_CONTEXT_FACTORY,null, null);
     }
 
     /**
@@ -99,11 +101,11 @@
          */
 
     public JMSEpr(String destinationType, String destinationName,
-	    String connection, String jndiType, String jndiUrl,
+	    String connection, String jndiUrl, String jndiContextFactory, String jndiPkgPrefix,
 	    String messageSelector)
     {
 	this(ONE_ONE_PROTOCOL, destinationType, destinationName, connection,
-		jndiType, jndiUrl, messageSelector);
+		jndiUrl, jndiContextFactory, jndiPkgPrefix, messageSelector);
     }
 
     /**
@@ -128,8 +130,8 @@
          */
 
     public JMSEpr(String protocol, String destinationType,
-	    String destinationName, String connection, String jndiType,
-	    String jndiUrl, String messageSelector)
+	    String destinationName, String connection,
+	    String jndiUrl, String jndiContextFactory, String jndiPkgPrefix, String messageSelector)
     {
 	// how many of these do we really need? modify accordingly.
 
@@ -154,8 +156,11 @@
 		if (connection != null)
 		    addr.addExtension(CONNECTION_FACTORY_TAG, connection);
 
-		if (jndiType != null)
-		    addr.addExtension(JNDI_TYPE_TAG, jndiType);
+		if (jndiContextFactory != null)
+		    addr.addExtension(JNDI_CONTEXT_FACTORY, jndiContextFactory);
+		
+		if (jndiPkgPrefix != null)
+		    addr.addExtension(JNDI_PKG_PREFIX_TAG, jndiPkgPrefix);
 
 		if (jndiUrl != null)
 		    addr.addExtension(JNDI_URL_TAG, jndiUrl);
@@ -225,17 +230,29 @@
     }
 
     /**
-         * @return the jndi type for this EPR, or <code>null</code> if none is
+         * @return the jndi context factory for this EPR, or <code>null</code> if none is
          *         set.
          * @throws URISyntaxException
          *                 thrown if the address is malformed.
          */
 
-    public final String getJndiType () throws URISyntaxException
+    public final String getJndiContextFactory () throws URISyntaxException
     {
-	return getAddr().getExtensionValue(JNDI_TYPE_TAG);
+	return getAddr().getExtensionValue(JNDI_CONTEXT_FACTORY);
     }
+    
+    /**
+     * @return the jndi pkg prefix for this EPR, or <code>null</code> if none is
+     *         set.
+     * @throws URISyntaxException
+     *                 thrown if the address is malformed.
+     */
 
+	 public final String getJndiPkgPrefix () throws URISyntaxException
+	 {
+	 return getAddr().getExtensionValue(JNDI_PKG_PREFIX_TAG);
+     }
+
     /**
          * @return the jndi URL for this EPR, or <code>null</code> if none is
          *         set.

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-12-08 21:42:37 UTC (rev 8156)
+++ labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/common/Configuration.java	2006-12-08 21:55:49 UTC (rev 8157)
@@ -34,8 +34,9 @@
 			new KeyValuePair(Environment.SMTP_PORT, 					getSmtpPort()),
 			new KeyValuePair(Environment.SMTP_FROM, 					getSmtpFrom()),
 			new KeyValuePair(Environment.SMTP_AUTH, 					getSmtpAuth()),
-			new KeyValuePair(Environment.JNDI_SERVER_TYPE, 				getJndiServerType()),
 			new KeyValuePair(Environment.JNDI_SERVER_URL, 				getJndiServerURL()),
+			new KeyValuePair(Environment.JNDI_SERVER_CONNECTION_FACTORY,getJndiServerConnectionFactory()),
+			new KeyValuePair(Environment.JNDI_SERVER_PKG_PREFIX, 	    getJndiServerPkgPrefix()),
 			new KeyValuePair(Environment.REGISTRY_QUERY_MANAGER_URI, 	getRegistryQueryManageURI()),
 			new KeyValuePair(Environment.REGISTRY_LIFECYCLE_MANAGER_URI,getRegistryLifecycleManagerURI()),
 			new KeyValuePair(Environment.REGISTRY_IMPEMENTATION_CLASS,  getRegistryImplementationClass()),
@@ -106,17 +107,23 @@
 		return ModulePropertyManager.getPropertyManager(ModulePropertyManager.TRANSPORTS_MODULE).getProperty(Environment.SMTP_AUTH);
 	}
 
-	public static String getJndiServerType()
-	{
-		return ModulePropertyManager.getPropertyManager(ModulePropertyManager.CORE_MODULE).getProperty(Environment.JNDI_SERVER_TYPE,
-				Environment.DEFAULT_SERVER_TYPE);
-	}
-
 	public static String getJndiServerURL()
 	{
 		return ModulePropertyManager.getPropertyManager(ModulePropertyManager.CORE_MODULE).getProperty(Environment.JNDI_SERVER_URL,
 				Environment.DEFAULT_HOST);
 	}
+	
+	public static String getJndiServerConnectionFactory()
+	{
+		return ModulePropertyManager.getPropertyManager(ModulePropertyManager.CORE_MODULE).getProperty(Environment.JNDI_SERVER_CONNECTION_FACTORY,
+				Environment.DEFAULT_JNDI_CONTEXT_FACTORY);
+	}
+	
+	public static String getJndiServerPkgPrefix()
+	{
+		return ModulePropertyManager.getPropertyManager(ModulePropertyManager.CORE_MODULE).getProperty(Environment.JNDI_SERVER_PKG_PREFIX,
+				Environment.DEFAULT_JNDI_PKG_PREFIX);
+	}
 	/**
 	 * The Registry Query Manager URI can be used to obtain information about services and their endPoints.
 	 * @return Registry Query Manager URI String

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-12-08 21:42:37 UTC (rev 8156)
+++ labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/common/Environment.java	2006-12-08 21:55:49 UTC (rev 8157)
@@ -40,8 +40,9 @@
 	/*
 	 * Code properties
 	 */
-	public static final String JNDI_SERVER_TYPE               = "org.jboss.soa.esb.jndi.server.type";
 	public static final String JNDI_SERVER_URL                = "org.jboss.soa.esb.jndi.server.url";
+	public static final String JNDI_SERVER_CONNECTION_FACTORY = "org.jboss.soa.esb.jndi.server.connection.factory";
+	public static final String JNDI_SERVER_PKG_PREFIX         = "org.jboss.soa.esb.jndi.server.pkg.prefix";
 	public static final String PARAMS_REPOS_IMPL_CLASS        = "org.jboss.soa.esb.paramsRepository.class";
 	public static final String OBJECT_STORE_CONFIG_FILE       = "org.jboss.soa.esb.objStore.configFile";
 	public static final String ENCRYPT_FACTORY_CLASS          = "org.jboss.soa.esb.encryption.factory.class";
@@ -98,7 +99,8 @@
 	public static final String DEFAULT_USERNAME                       = "";
 	public static final String DEFAULT_PASSWORD                       = "";
 	public static final String DEFAULT_PORT                           = "25";
-	public static final String DEFAULT_SERVER_TYPE                    = "jboss";
+	public static final String DEFAULT_JNDI_CONTEXT_FACTORY           = "org.jnp.interfaces.NamingContextFactory";
+	public static final String DEFAULT_JNDI_PKG_PREFIX                = "org.jboss.naming:org.jnp.interfaces";
 	
 	/*
 	 * DatabaseMessageStore Persistence Store properties.

Modified: labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/couriers/CourierUtil.java
===================================================================
--- labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/couriers/CourierUtil.java	2006-12-08 21:42:37 UTC (rev 8156)
+++ labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/couriers/CourierUtil.java	2006-12-08 21:55:49 UTC (rev 8157)
@@ -103,9 +103,9 @@
 	    	JMSEpr jpr = (JMSEpr) toEpr;
             //Setting the replyTo to the queue we specific in the epr we are going to call
 			//The selectors will do the job.
-			replyToEpr =  new JMSEpr(jpr.getDestinationType()  ,jpr.getDestinationName()
-	            ,jpr.getConnectionFactory(),jpr.getJndiType()
-	            ,jpr.getJndiURL()          ,getReplySelector());
+			replyToEpr =  new JMSEpr(jpr.getDestinationType(), jpr.getDestinationName()
+	            ,jpr.getConnectionFactory() ,jpr.getJndiURL(), jpr.getJndiContextFactory()
+	            ,jpr.getJndiPkgPrefix(), getReplySelector());
     	} else {
     		throw new CourierException("Found a non-JMS based EPR, JMS-EPRs is all we support right now");
     	}

Deleted: labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/helpers/AppServerContext.java
===================================================================
--- labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/helpers/AppServerContext.java	2006-12-08 21:42:37 UTC (rev 8156)
+++ labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/helpers/AppServerContext.java	2006-12-08 21:55:49 UTC (rev 8157)
@@ -1,108 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY 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 along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.soa.esb.helpers;
-
-import java.util.Properties;
-
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-
-import org.apache.log4j.Logger;
-
-
-/**
- * Obtains JNDI naming context for a predefined list of 'well known' server
- * types
- * 
- */
-public abstract class AppServerContext {
-	/**
-	 * Logger for this class
-	 */
-	private static final Logger m_oLogger = Logger
-			.getLogger(AppServerContext.class);
-
-	/**
-	 * Indicates that a jboss context is requested
-	 */
-	public static final String CTX_JBOSS = "jboss";
-
-	public static final int MAX_RETRIES = 10;
-
-	public static final int WAIT_FOR_RETRY = 30;
-
-	public enum SERVER_TYPE {
-		jboss, weblogic, websphere, oracle
-	};
-
-	public static Context getServerContext(String pType, String p_sJndiServer) {
-		return getServerContext(SERVER_TYPE.valueOf(pType), p_sJndiServer);
-	}
-	
-	// REVIEW: What is all this about... this class doesn't support anything other than a JBoss Server!!
-
-	/**
-	 * Searches a predefined table of 'well known' app server types, and returns
-	 * the corresponding naming context
-	 * 
-	 * @param p_sServer:
-	 *            name or IP of server, and optionally port #
-	 */
-	private static Context getServerContext(SERVER_TYPE pType,
-			String p_sJndiServer) {
-		switch (pType) {
-		case jboss:
-			return jbossContext(p_sJndiServer);
-		}
-
-		return null;
-	} // __________________________________
-
-	private static Context jbossContext(String p_sJndiServer) {
-		Properties oPr = new Properties();
-		oPr.setProperty(Context.PROVIDER_URL, p_sJndiServer);
-		oPr.setProperty(Context.INITIAL_CONTEXT_FACTORY,
-				"org.jnp.interfaces.NamingContextFactory");
-		oPr.setProperty(Context.URL_PKG_PREFIXES,
-				"org.jboss.naming:org.jnp.interfaces");
-
-		boolean bCtxOK = false;
-		Context oCtx = null;
-		for (int i1 = 0; (!bCtxOK) && i1 < MAX_RETRIES; i1++) {
-			// check if context is valid
-			try {
-				oCtx = new InitialContext(oPr);
-				oCtx.list("__dummy2@#$%");
-				bCtxOK = true;
-			} catch (NamingException nex) {
-				bCtxOK = true;
-			}
-		}
-		if (bCtxOK)
-			return oCtx;
-		m_oLogger.error("Can't connect to jndiServer <" + p_sJndiServer + ">");
-		return null;
-
-	} // ________________________
-
-} // ____________________________________________________________________________

Copied: labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/helpers/NamingContext.java (from rev 8131, labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/helpers/AppServerContext.java)
===================================================================
--- labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/helpers/AppServerContext.java	2006-12-07 22:39:46 UTC (rev 8131)
+++ labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/helpers/NamingContext.java	2006-12-08 21:55:49 UTC (rev 8157)
@@ -0,0 +1,86 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY 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 along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.soa.esb.helpers;
+
+import java.util.Properties;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+import org.apache.log4j.Logger;
+
+/**
+ * Obtains JNDI naming context.
+ * 
+ */
+public abstract class NamingContext 
+{
+	/**
+	 * Logger for this class
+	 */
+	private static final Logger _logger = Logger
+			.getLogger(NamingContext.class);
+
+	public static final int MAX_RETRIES = 10;
+	public static final String JBOSS_PROVIDER_URL = "localhost";
+	public static final String JBOSS_INITIAL_CONTEXT_FACTORY = "org.jnp.interfaces.NamingContextFactory";
+	public static final String JBOSS_URL_PKG_PREFIX = ""; //"org.jboss.naming:org.jnp.interfaces"
+	/**
+	 * Tries to connect to the server to obtain the server Context.
+	 * 
+	 * @param providerUrl
+	 * @param initialContextFactory
+	 * @param urlPkgPrefixes
+	 * @return the InitialContext.
+	 */
+	public static Context getServerContext(String providerUrl, 
+			String initialContextFactory, String urlPkgPrefixes) 
+	{
+		Properties properties = new Properties();
+		properties.setProperty(Context.PROVIDER_URL, providerUrl);
+		properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, initialContextFactory);
+		if (urlPkgPrefixes!=null && !"".equals(urlPkgPrefixes)) {
+			properties.setProperty(Context.URL_PKG_PREFIXES, urlPkgPrefixes);
+		}
+
+		boolean bCtxOK = false;
+		Context oCtx = null;
+		for (int i1 = 0; (!bCtxOK) && i1 < MAX_RETRIES; i1++) {
+			// check if context is valid
+			try {
+				oCtx = new InitialContext(properties);
+				oCtx.list("__dummy2@#$%");
+				bCtxOK = true;
+			} catch (NamingException nex) {
+				bCtxOK = true;
+			}
+		}
+		if (bCtxOK) {
+			return oCtx;
+		} else {
+			_logger.error("Can't connect to JNDI Server <" + providerUrl + ">");
+			return null;
+		}
+	}
+
+}

Modified: labs/jbossesb/trunk/product/core/rosetta/tests/resources/etc/jbossesb-test-properties.xml
===================================================================
--- labs/jbossesb/trunk/product/core/rosetta/tests/resources/etc/jbossesb-test-properties.xml	2006-12-08 21:42:37 UTC (rev 8156)
+++ labs/jbossesb/trunk/product/core/rosetta/tests/resources/etc/jbossesb-test-properties.xml	2006-12-08 21:55:49 UTC (rev 8157)
@@ -31,7 +31,7 @@
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:noNamespaceSchemaLocation="jbossesb-1_0.xsd">
     <properties name="core">
-		<property name="org.jboss.soa.esb.jndi.server.type" value="foobar"/>
+		<property name="org.jboss.soa.esb.jndi.server.connection.factory" value="foobar"/>
 		<property name="org.jboss.soa.esb.objStore.configFile" value="file:config.xml"/>
     </properties>
     <properties name="transports" depends="core">

Modified: labs/jbossesb/trunk/product/core/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/tests/FileCourierUnitTest.java
===================================================================
--- labs/jbossesb/trunk/product/core/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/tests/FileCourierUnitTest.java	2006-12-08 21:42:37 UTC (rev 8156)
+++ labs/jbossesb/trunk/product/core/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/tests/FileCourierUnitTest.java	2006-12-08 21:55:49 UTC (rev 8157)
@@ -203,7 +203,7 @@
 		Assert.assertTrue(theFile.exists());
 		_logger.info("Invalid Message file "+theFile.toString()+" successfully created");
 				
-		FileEpr fromEpr = new FileEpr("file://"+TMP_DIR);
+		FileEpr fromEpr = new FileEpr("file:"+TMP_DIR);
 		fromEpr.setInputSuffix(TEST_SUFFIX);
 		fromEpr.setPostSuffix(DONE_SUFFIX);
 		fromEpr.setErrorSuffix(ERROR_SUFFIX);

Modified: labs/jbossesb/trunk/product/core/rosetta/tests/src/org/jboss/soa/esb/addressing/helpers/tests/JMSUnitTest.java
===================================================================
--- labs/jbossesb/trunk/product/core/rosetta/tests/src/org/jboss/soa/esb/addressing/helpers/tests/JMSUnitTest.java	2006-12-08 21:42:37 UTC (rev 8156)
+++ labs/jbossesb/trunk/product/core/rosetta/tests/src/org/jboss/soa/esb/addressing/helpers/tests/JMSUnitTest.java	2006-12-08 21:55:49 UTC (rev 8157)
@@ -39,7 +39,7 @@
 	{
 		try
 		{
-			new JMSEpr(JMSEpr.ONE_ONE_PROTOCOL, JMSEpr.QUEUE_TYPE, "bar", "foobar",null,null,null);
+			new JMSEpr(JMSEpr.ONE_ONE_PROTOCOL, JMSEpr.QUEUE_TYPE, "bar", "foobar",null,null,null,null);
 		}
 		catch (Exception ex)
 		{
@@ -51,7 +51,7 @@
 	{
 		try
 		{
-			JMSEpr jms = new JMSEpr(JMSEpr.ONE_ONE_PROTOCOL, JMSEpr.QUEUE_TYPE, "bar", "foobar",null,null,null);
+			JMSEpr jms = new JMSEpr(JMSEpr.ONE_ONE_PROTOCOL, JMSEpr.QUEUE_TYPE, "bar", "foobar", null,null,null,null);
 			
 			assertEquals(jms.getVersion(), JMSEpr.ONE_ONE_PROTOCOL);
 			assertEquals(jms.getConnectionFactory(), "foobar");

Modified: labs/jbossesb/trunk/product/core/rosetta/tests/src/org/jboss/soa/esb/common/tests/propertymanager/PropertyManagerUnitTest.java
===================================================================
--- labs/jbossesb/trunk/product/core/rosetta/tests/src/org/jboss/soa/esb/common/tests/propertymanager/PropertyManagerUnitTest.java	2006-12-08 21:42:37 UTC (rev 8156)
+++ labs/jbossesb/trunk/product/core/rosetta/tests/src/org/jboss/soa/esb/common/tests/propertymanager/PropertyManagerUnitTest.java	2006-12-08 21:55:49 UTC (rev 8157)
@@ -50,7 +50,7 @@
             fail(e.toString());
         }
         
-		assertEquals(corepm.getProperty(Environment.JNDI_SERVER_TYPE), "foobar");		
+		assertEquals(corepm.getProperty(Environment.JNDI_SERVER_CONNECTION_FACTORY), "foobar");		
 		assertEquals(corepm.getProperty(Environment.OBJECT_STORE_CONFIG_FILE), "file:config.xml");
 		
 		try
@@ -80,7 +80,7 @@
             fail(e.toString());
         }
         
-        assertEquals(transportpm.getProperty(Environment.JNDI_SERVER_TYPE), "foobar");
+        assertEquals(transportpm.getProperty(Environment.JNDI_SERVER_CONNECTION_FACTORY), "foobar");
         assertEquals(transportpm.getProperty(Environment.SMTP_HOST), "thishost");
 	}
 

Modified: labs/jbossesb/trunk/product/core/rosetta/tests/src/org/jboss/soa/esb/common/tests/utils/DrainQueuesAndTopics.java
===================================================================
--- labs/jbossesb/trunk/product/core/rosetta/tests/src/org/jboss/soa/esb/common/tests/utils/DrainQueuesAndTopics.java	2006-12-08 21:42:37 UTC (rev 8156)
+++ labs/jbossesb/trunk/product/core/rosetta/tests/src/org/jboss/soa/esb/common/tests/utils/DrainQueuesAndTopics.java	2006-12-08 21:55:49 UTC (rev 8157)
@@ -35,14 +35,11 @@
 import javax.jms.TopicSubscriber;
 import javax.naming.Context;
 
-import org.jboss.soa.esb.helpers.AppServerContext;
+import org.jboss.soa.esb.helpers.NamingContext;
 
 public class DrainQueuesAndTopics
 {
   private static final int	  MAX_TIMES_NOMSG = 10;
-  private static final String JNDI_URL	= "localhost";
-  private static final String JNDI_TYPE 
-  						= AppServerContext.SERVER_TYPE.jboss.toString();
  
   private Context m_oCtx;
   
@@ -56,7 +53,10 @@
   public int purgeQueueTopic(String p_sName) throws Exception
   { 
 	int iRet = 0;
-	m_oCtx = AppServerContext.getServerContext(JNDI_TYPE,JNDI_URL);
+	m_oCtx = NamingContext.getServerContext(
+			NamingContext.JBOSS_PROVIDER_URL, 
+			NamingContext.JBOSS_INITIAL_CONTEXT_FACTORY,
+			NamingContext.JBOSS_URL_PKG_PREFIX);
 	
 	System.out.println(p_sName);
 	MessageConsumer oCns = null;

Modified: labs/jbossesb/trunk/product/core/rosetta/tests/src/org/jboss/soa/esb/helpers/AppServerContextUnitTest.java
===================================================================
--- labs/jbossesb/trunk/product/core/rosetta/tests/src/org/jboss/soa/esb/helpers/AppServerContextUnitTest.java	2006-12-08 21:42:37 UTC (rev 8156)
+++ labs/jbossesb/trunk/product/core/rosetta/tests/src/org/jboss/soa/esb/helpers/AppServerContextUnitTest.java	2006-12-08 21:55:49 UTC (rev 8157)
@@ -35,12 +35,14 @@
 public class AppServerContextUnitTest extends TestCase {
 
 	public void test_AppServerContext() throws NamingException {
-		Context ctx = AppServerContext.getServerContext("jboss", "http://localhost:1234");
+		Context ctx = NamingContext.getServerContext("http://localhost:1234", 
+				NamingContext.JBOSS_INITIAL_CONTEXT_FACTORY,
+				NamingContext.JBOSS_URL_PKG_PREFIX);
 		
 		Hashtable props = ctx.getEnvironment();
 		System.out.println(props);
 		assertEquals("org.jnp.interfaces.NamingContextFactory", props.get(Context.INITIAL_CONTEXT_FACTORY));
 		assertEquals("http://localhost:1234", props.get(Context.PROVIDER_URL));
-		assertEquals("org.jboss.naming:org.jnp.interfaces", props.get("java.naming.factory.url.pkgs"));
+		assertEquals("", props.get("java.naming.factory.url.pkgs"));
 	}
 }

Modified: labs/jbossesb/trunk/product/etc/examples/listeners/EsbJmsListenerEasier2ReadExample.xml
===================================================================
--- labs/jbossesb/trunk/product/etc/examples/listeners/EsbJmsListenerEasier2ReadExample.xml	2006-12-08 21:42:37 UTC (rev 8156)
+++ labs/jbossesb/trunk/product/etc/examples/listeners/EsbJmsListenerEasier2ReadExample.xml	2006-12-08 21:55:49 UTC (rev 8157)
@@ -7,7 +7,7 @@
 	connection-factory="ConnectionFactory"
 	destination-type="queue"
    	destination-name="queue/A"
-	jndi-type="jboss"
+	jndi-context-factory="org.jnp.interfaces.NamingContextFactory"
     jndi-URL="localhost"
     message-selector="service='handOfGod'"
    >

Modified: labs/jbossesb/trunk/product/etc/examples/listeners/EsbJmsListenerExample.xml
===================================================================
--- labs/jbossesb/trunk/product/etc/examples/listeners/EsbJmsListenerExample.xml	2006-12-08 21:42:37 UTC (rev 8156)
+++ labs/jbossesb/trunk/product/etc/examples/listeners/EsbJmsListenerExample.xml	2006-12-08 21:55:49 UTC (rev 8157)
@@ -7,7 +7,7 @@
 	connection-factory="ConnectionFactory"
 	destination-type="queue"
    	destination-name="queue/A"
-	jndi-type="jboss"
+	jndi-context-factory="org.jnp.interfaces.NamingContextFactory"
     jndi-URL="localhost"
     message-selector="service='maradona'"
    >

Modified: labs/jbossesb/trunk/product/etc/examples/listeners/gatewayExample.xml
===================================================================
--- labs/jbossesb/trunk/product/etc/examples/listeners/gatewayExample.xml	2006-12-08 21:42:37 UTC (rev 8156)
+++ labs/jbossesb/trunk/product/etc/examples/listeners/gatewayExample.xml	2006-12-08 21:55:49 UTC (rev 8157)
@@ -12,7 +12,7 @@
 	connection-factory="ConnectionFactory"
 	destination-type="queue"
    	destination-name="queue/A"
-	jndi-type="jboss"
+	jndi-context-factory="org.jnp.interfaces.NamingContextFactory"
     jndi-URL="localhost"
     message-selector="service='composeExampleService'"
    >

Modified: labs/jbossesb/trunk/product/install/build.xml
===================================================================
--- labs/jbossesb/trunk/product/install/build.xml	2006-12-08 21:42:37 UTC (rev 8156)
+++ labs/jbossesb/trunk/product/install/build.xml	2006-12-08 21:55:49 UTC (rev 8157)
@@ -12,11 +12,11 @@
 	<target name="configure" depends="configure.jboss" />
 	<target name="configure.jboss">
 		<!-- conf -->
-		<copy  file="${org.jboss.esb.deployment.conf}/jbossesb-gateway.xml"
+		<copy  file="${org.jboss.esb.deployment.conf}/jbossesb-gateway.xml" overwrite="true"
 		       todir="${org.jboss.esb.appserver.home}/server/${org.jboss.esb.appserver.config}/conf" />
-		<copy  file="${org.jboss.esb.deployment.conf}/jbossesb-listener.xml"
+		<copy  file="${org.jboss.esb.deployment.conf}/jbossesb-listener.xml" overwrite="true"
 			   todir="${org.jboss.esb.appserver.home}/server/${org.jboss.esb.appserver.config}/conf" />
-		<copy  file="${org.jboss.esb.deployment.conf}/juddi.properties"
+		<copy  file="${org.jboss.esb.deployment.conf}/juddi.properties" overwrite="true"
 			   todir="${org.jboss.esb.appserver.home}/server/${org.jboss.esb.appserver.config}/conf" />
 		<!-- data -->
 		<copy  file="${org.jboss.esb.deployment.data}/hypersonic/default.data" overwrite="true"
@@ -26,7 +26,7 @@
 		<copy  file="${org.jboss.esb.deployment.data}/hypersonic/default.script" overwrite="true"
 			   todir="${org.jboss.esb.appserver.home}/server/${org.jboss.esb.appserver.config}/data/hypersonic" />
 		<!-- deploy -->
-		<copy  file="${org.jboss.esb.deployment.deploy}/hsqldb-ds.xml"
+		<copy  file="${org.jboss.esb.deployment.deploy}/hsqldb-ds.xml" overwrite="true"
 			   todir="${org.jboss.esb.appserver.home}/server/${org.jboss.esb.appserver.config}/deploy" />
 		<copy  todir="${org.jboss.esb.appserver.home}/server/${org.jboss.esb.appserver.config}/deploy">
 			<fileset dir="${org.jboss.esb.dist.lib}" includes="jbossesb.sar/**"/></copy>

Modified: labs/jbossesb/trunk/product/samples/quickstarts/helloworld/esb-config-gateway.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld/esb-config-gateway.xml	2006-12-08 21:42:37 UTC (rev 8156)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld/esb-config-gateway.xml	2006-12-08 21:55:49 UTC (rev 8157)
@@ -6,7 +6,7 @@
 	connection-factory="ConnectionFactory"
    	destination-type="queue"
    	destination-name="queue/quickstart_helloworld_Request"
-	jndi-type="jboss"
+	jndi-context-factory="org.jnp.interfaces.NamingContextFactory"
     jndi-URL="localhost"
    >
    <!-- no action needed as the inbound message is automatically converted

Modified: labs/jbossesb/trunk/product/samples/quickstarts/helloworld/esb-config.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld/esb-config.xml	2006-12-08 21:42:37 UTC (rev 8156)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld/esb-config.xml	2006-12-08 21:55:49 UTC (rev 8157)
@@ -8,7 +8,7 @@
 	connection-factory="ConnectionFactory"
 	destination-type="queue"
    	destination-name="queue/B"
-    jndi-type="jboss"
+    jndi-context-factory="org.jnp.interfaces.NamingContextFactory"
     jndi-URL="localhost"   
    >
 	   <action class="quickstart.MyJMSListenerAction" process="displayMessage" />	  

Modified: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_action/esb-config-gateway.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_action/esb-config-gateway.xml	2006-12-08 21:42:37 UTC (rev 8156)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_action/esb-config-gateway.xml	2006-12-08 21:55:49 UTC (rev 8157)
@@ -6,7 +6,7 @@
 	connection-factory="ConnectionFactory"
    	destination-type="queue"
    	destination-name="queue/quickstart_helloworld_action_Request"
-	jndi-type="jboss"
+	jndi-context-factory="org.jnp.interfaces.NamingContextFactory"
     jndi-URL="localhost"
    >
    <!-- no action needed as the inbound message is automatically converted

Modified: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_action/esb-config.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_action/esb-config.xml	2006-12-08 21:42:37 UTC (rev 8156)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_action/esb-config.xml	2006-12-08 21:55:49 UTC (rev 8157)
@@ -8,7 +8,7 @@
 	connection-factory="ConnectionFactory"
 	destination-type="queue"
    	destination-name="queue/B"
-    jndi-type="jboss"
+    jndi-context-factory="org.jnp.interfaces.NamingContextFactory"
     jndi-URL="localhost"   
    >
 	   <action class="quickstart.MyJMSListenerAction" process="displayMessage" exceptionMethod="exceptionHandler" />	  

Modified: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/esb-config-gateway.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/esb-config-gateway.xml	2006-12-08 21:42:37 UTC (rev 8156)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/esb-config-gateway.xml	2006-12-08 21:55:49 UTC (rev 8157)
@@ -6,7 +6,7 @@
 	connection-factory="ConnectionFactory"
    	destination-type="queue"
    	destination-name="queue/quickstart_helloworld_Request"
-	jndi-type="jboss"
+	jndi-context-factory="org.jnp.interfaces.NamingContextFactory"
     jndi-URL="localhost"
    >
    <!-- no action needed as the inbound message is automatically converted

Modified: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/esb-config.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/esb-config.xml	2006-12-08 21:42:37 UTC (rev 8156)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/esb-config.xml	2006-12-08 21:55:49 UTC (rev 8157)
@@ -8,7 +8,7 @@
 	connection-factory="ConnectionFactory"
 	destination-type="queue"
    	destination-name="queue/B"
-    jndi-type="jboss"
+    jndi-context-factory="org.jnp.interfaces.NamingContextFactory"
     jndi-URL="localhost"   
    >
 	   <action class="quickstart.MyJMSListenerAction" process="displayMessage" />	  

Modified: labs/jbossesb/trunk/product/samples/quickstarts/more_action/esb-config-gateway.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/more_action/esb-config-gateway.xml	2006-12-08 21:42:37 UTC (rev 8156)
+++ labs/jbossesb/trunk/product/samples/quickstarts/more_action/esb-config-gateway.xml	2006-12-08 21:55:49 UTC (rev 8157)
@@ -6,7 +6,7 @@
 	connection-factory="ConnectionFactory"
    	destination-type="queue"
    	destination-name="queue/quickstart_more_action_Request"
-	jndi-type="jboss"
+	jndi-context-factory="org.jnp.interfaces.NamingContextFactory"
     jndi-URL="localhost"
    >
    </esb-jms-gateway>   

Modified: labs/jbossesb/trunk/product/samples/quickstarts/more_action/esb-config.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/more_action/esb-config.xml	2006-12-08 21:42:37 UTC (rev 8156)
+++ labs/jbossesb/trunk/product/samples/quickstarts/more_action/esb-config.xml	2006-12-08 21:55:49 UTC (rev 8157)
@@ -8,7 +8,7 @@
 	connection-factory="ConnectionFactory"
 	destination-type="queue"
    	destination-name="queue/B"
-    jndi-type="jboss"
+    jndi-context-factory="org.jnp.interfaces.NamingContextFactory"
     jndi-URL="localhost">
 	   <action class="quickstart.MyJMSListenerAction" process="displayMessage" exceptionMethod="exceptionHandler" />	  
    	   <action class="quickstart.MyJMSListenerAction" exceptionMethod="exceptionHandler" />

Modified: labs/jbossesb/trunk/product/samples/quickstarts/simple_cbr/esb-config-gateway.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/simple_cbr/esb-config-gateway.xml	2006-12-08 21:42:37 UTC (rev 8156)
+++ labs/jbossesb/trunk/product/samples/quickstarts/simple_cbr/esb-config-gateway.xml	2006-12-08 21:55:49 UTC (rev 8157)
@@ -6,7 +6,7 @@
 	connection-factory="ConnectionFactory"
    	destination-type="queue"
    	destination-name="queue/quickstart_simple_cbr_Request"
-	jndi-type="jboss"
+	jndi-context-factory="org.jnp.interfaces.NamingContextFactory"
     jndi-URL="localhost"
    >
    <!-- no action needed as the inbound message is automatically converted

Modified: labs/jbossesb/trunk/product/samples/quickstarts/simple_cbr/esb-config.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/simple_cbr/esb-config.xml	2006-12-08 21:42:37 UTC (rev 8156)
+++ labs/jbossesb/trunk/product/samples/quickstarts/simple_cbr/esb-config.xml	2006-12-08 21:55:49 UTC (rev 8157)
@@ -7,7 +7,7 @@
 	connection-factory="ConnectionFactory"
 	destination-type="queue"
    	destination-name="queue/B"
-	jndi-type="jboss"
+	jndi-context-factory="org.jnp.interfaces.NamingContextFactory"
     jndi-URL="localhost">
 	   <cbr ruleSet="MyESBRules-XPath.drl" ruleLanguage="XPathLanguage.dsl" />
 	   <!--  XPathLanguage.dsl lives in core\services\rules\XPathLanguage.dsl jbossesb-rules.jar -->
@@ -20,7 +20,7 @@
 		connection-factory="ConnectionFactory"
 		destination-type="queue"
    		destination-name="queue/CBRExpressFreeShipping"
-	    jndi-type="jboss"
+	    jndi-context-factory="org.jnp.interfaces.NamingContextFactory"
     	jndi-URL="localhost">    
 	   <action class="quickstart.MyJMSListenerAction" process="displayMessage" exceptionMethod="exceptionHandler" />
 	   <action class="quickstart.RouteExpressShipping" process="noOperation" okMethod="sendResponse"/>

Modified: labs/jbossesb/trunk/product/samples/quickstarts/simple_transformation/esb-config-gateway.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/simple_transformation/esb-config-gateway.xml	2006-12-08 21:42:37 UTC (rev 8156)
+++ labs/jbossesb/trunk/product/samples/quickstarts/simple_transformation/esb-config-gateway.xml	2006-12-08 21:55:49 UTC (rev 8157)
@@ -6,7 +6,7 @@
 	connection-factory="ConnectionFactory"
    	destination-type="queue"
    	destination-name="queue/quickstart_simple_transformation_Request" 
-	jndi-type="jboss"
+	jndi-context-factory="org.jnp.interfaces.NamingContextFactory"
     jndi-URL="localhost"
    >
 	<!--  Listen for DVDStore_Orders or quickstart_simple_transformation_Request -->

Modified: labs/jbossesb/trunk/product/samples/quickstarts/simple_transformation/esb-config.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/simple_transformation/esb-config.xml	2006-12-08 21:42:37 UTC (rev 8156)
+++ labs/jbossesb/trunk/product/samples/quickstarts/simple_transformation/esb-config.xml	2006-12-08 21:55:49 UTC (rev 8157)
@@ -8,7 +8,7 @@
 	connection-factory="ConnectionFactory"
 	destination-type="queue"
    	destination-name="queue/B"
-    jndi-type="jboss"
+    jndi-context-factory="org.jnp.interfaces.NamingContextFactory"
     jndi-URL="localhost"   
    >
     <action class="quickstart.MyJMSListenerAction" process="displayMessage" />

Modified: labs/jbossesb/trunk/product/samples/trailblazer2/banks/src/org/jboss/soa/esb/samples/loanbroker/banks/ManagerJMS.java
===================================================================
--- labs/jbossesb/trunk/product/samples/trailblazer2/banks/src/org/jboss/soa/esb/samples/loanbroker/banks/ManagerJMS.java	2006-12-08 21:42:37 UTC (rev 8156)
+++ labs/jbossesb/trunk/product/samples/trailblazer2/banks/src/org/jboss/soa/esb/samples/loanbroker/banks/ManagerJMS.java	2006-12-08 21:55:49 UTC (rev 8157)
@@ -64,8 +64,6 @@
 	private static String QUEUE_IN = "queue/C";
 	/** Default outgoing queue */
 	private static String QUEUE_OUT = "queue/D";
-	/** Default jms provider url */
-	private static String PROVIDER_URL = "localhost";
 	/** Context used to lookup the Queues */
 	private static InitialContext ctx;
 	/** Properties used when constructing the InitialContext */
@@ -78,13 +76,14 @@
 	 */
 	public void listen() {
 		try {
-			properties.put(Context.INITIAL_CONTEXT_FACTORY,
-					"org.jnp.interfaces.NamingContextFactory");
-			//properties.put(Context.URL_PKG_PREFIXES, "org.jnp.interfaces");
-			properties.put(Context.PROVIDER_URL, PROVIDER_URL);
+			//ActiveMQ
+			//properties.put(Context.INITIAL_CONTEXT_FACTORY,"org.apache.activemq.jndi.ActiveMQInitialContextFactory");
+			//properties.put(Context.PROVIDER_URL           , "tcp://localhost:61616");
+			//JBossMQ
+		    properties.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
+		    properties.put(Context.PROVIDER_URL           , "localhost");
 			ctx = new InitialContext(properties);
-			logger.info("Looking up queue=" + QUEUE_IN);
-			Queue inQueue = (Queue) ctx.lookup(QUEUE_IN);
+			
 			logger.info("Looking up connection factory");
 			QueueConnectionFactory qcf = (QueueConnectionFactory) ctx
 					.lookup("ConnectionFactory");
@@ -93,6 +92,9 @@
 			logger.info("Creating session");
 			QueueSession qs = inQueueConnection.createQueueSession(false,
 					Session.DUPS_OK_ACKNOWLEDGE);
+			logger.info("Looking up queue=" + QUEUE_IN);
+			Queue inQueue = qs.createQueue(QUEUE_IN);
+			//Queue inQueue = (Queue) ctx.lookup(QUEUE_IN);
 			QueueReceiver qr = qs.createReceiver(inQueue);
 			qr.setMessageListener(this);
 			inQueueConnection.start();
@@ -127,7 +129,6 @@
 					.processMessage(bankQuoteRequest);
 			bankQuoteReply.setCustomerEmail(bankQuoteRequest.customerEmail);
 			String bankQuoteReplyXML = xstream.toXML(bankQuoteReply);
-			Queue outQueue = (Queue) ctx.lookup(QUEUE_OUT);
 			logger.log(Priority.INFO, "Looking up connection factory");
 			QueueConnectionFactory qcf = (QueueConnectionFactory) ctx
 					.lookup("ConnectionFactory");
@@ -137,6 +138,7 @@
 				logger.log(Priority.INFO, "Creating session");
 				QueueSession qs = outQueueConnection.createQueueSession(false,
 						Session.DUPS_OK_ACKNOWLEDGE);
+				Queue outQueue = qs.createQueue(QUEUE_OUT);
 				TextMessage responseTextMessage = qs
 						.createTextMessage(bankQuoteReplyXML);
 				QueueSender queueSender = qs.createSender(outQueue);
@@ -163,11 +165,10 @@
 	 */
 	public static void main(String[] args) {
 		if (args != null && args.length > 0) {
-			PROVIDER_URL = args[0];
-			if (args.length > 1) {
-				QUEUE_IN = args[1];
-				if (args.length > 2) {
-					QUEUE_OUT = args[2];
+			if (args.length > 0) {
+				QUEUE_IN = args[0];
+				if (args.length > 1) {
+					QUEUE_OUT = args[1];
 				}
 			}
 		} else {
@@ -175,7 +176,6 @@
 					"Usage: ManagerJMS providerURL, queueIn, queueOut");
 		}
 		System.out.println("Starting JMS Bank Listener...");
-		System.out.println("Provider URL='" + PROVIDER_URL + "'.");
 		System.out.println("Listening  to Queue '" + QUEUE_IN + "'.");
 		System.out.println("Responding to Queue '" + QUEUE_OUT + "'.");
 		DOMConfigurator.configure("log4j.xml");

Modified: labs/jbossesb/trunk/product/samples/trailblazer2/banks/test/src/org/jboss/soa/esb/samples/loanbroker/banks/JmsProcessorTest.java
===================================================================
--- labs/jbossesb/trunk/product/samples/trailblazer2/banks/test/src/org/jboss/soa/esb/samples/loanbroker/banks/JmsProcessorTest.java	2006-12-08 21:42:37 UTC (rev 8156)
+++ labs/jbossesb/trunk/product/samples/trailblazer2/banks/test/src/org/jboss/soa/esb/samples/loanbroker/banks/JmsProcessorTest.java	2006-12-08 21:55:49 UTC (rev 8157)
@@ -56,15 +56,21 @@
 		Queue queue;
 		try {
 			Properties properties = new Properties();
+			
+			//ActiveMQ
+			//properties.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.activemq.jndi.ActiveMQInitialContextFactory");
+		    //properties.put(Context.PROVIDER_URL           , "tcp://localhost:61616");
+			//JBossMQ
 		    properties.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
-		    properties.put(Context.URL_PKG_PREFIXES       , "org.jnp.interfaces");
 		    properties.put(Context.PROVIDER_URL           , "localhost");
 			InitialContext ctx = new InitialContext(properties);
-			queue = (Queue) ctx.lookup("queue/C");
+		
 			QueueConnectionFactory factory = (QueueConnectionFactory) ctx
 					.lookup("ConnectionFactory");
 			QueueConnection cnn = factory.createQueueConnection();
 			sess = cnn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
+			queue = sess.createQueue("queue/C");
+			//queue = sess.createQueue("queue/C");
 			String str="23456890,3,4,20000,5,unique,kurt.stam at jboss.com";
 			TextMessage msg = sess.createTextMessage(str);
 			QueueSender sender = sess.createSender(queue);

Modified: labs/jbossesb/trunk/product/samples/trailblazer2/esb/conf/jbossesb-gateway.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/trailblazer2/esb/conf/jbossesb-gateway.xml	2006-12-08 21:42:37 UTC (rev 8156)
+++ labs/jbossesb/trunk/product/samples/trailblazer2/esb/conf/jbossesb-gateway.xml	2006-12-08 21:55:49 UTC (rev 8157)
@@ -6,7 +6,7 @@
 		connection-factory="ConnectionFactory" 
 		destination-type="queue" 
 		destination-name="queue/D" 
-		jndi-type="jboss" 
+		jndi-context-factory="org.jnp.interfaces.NamingContextFactory"
 		jndi-URL="localhost">
 	<!--  no action needed as the inbound message is automatically converted
      and sent to the queue for the target service

Modified: labs/jbossesb/trunk/product/samples/trailblazer2/esb/conf/jbossesb-listener.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/trailblazer2/esb/conf/jbossesb-listener.xml	2006-12-08 21:42:37 UTC (rev 8156)
+++ labs/jbossesb/trunk/product/samples/trailblazer2/esb/conf/jbossesb-listener.xml	2006-12-08 21:55:49 UTC (rev 8157)
@@ -7,7 +7,7 @@
 		connection-factory="ConnectionFactory"
 		destination-type="queue"
 	   	destination-name="queue/A"
-		jndi-type="jboss"
+		jndi-context-factory="org.jnp.interfaces.NamingContextFactory"
 		jndi-URL="localhost"	
 		message-selector="service='creditAgency'"
 		maxThreads="1"
@@ -24,7 +24,7 @@
 		connection-factory="ConnectionFactory"
 		destination-type="queue"
 	   	destination-name="queue/E"
-		jndi-type="jboss"
+		jndi-context-factory="org.jnp.interfaces.NamingContextFactory"
 		jndi-URL="localhost"	
 		maxThreads="1">
 		

Modified: labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/actions/CbrProxyActionUnitTest.xml
===================================================================
--- labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/actions/CbrProxyActionUnitTest.xml	2006-12-08 21:42:37 UTC (rev 8156)
+++ labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/actions/CbrProxyActionUnitTest.xml	2006-12-08 21:55:49 UTC (rev 8157)
@@ -21,6 +21,10 @@
  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
  */ 
  -->
+ 
+ <!-- for activemq use:
+  jndi-context-factory="org.apache.activemq.jndi.ActiveMQInitialContextFactory"
+    jndi-URL="tcp://localhost:61616" -->
 
 <ContentBasedRouterTest parameterReloadSecs="180">
    <ContentBasedRouter
@@ -31,7 +35,7 @@
 	connection-factory="ConnectionFactory"
 	destination-type="queue"
    	destination-name="queue/A"
-	jndi-type="jboss"
+	jndi-context-factory="org.jnp.interfaces.NamingContextFactory"
     jndi-URL="localhost"
     message-selector="service='ContentBasedRouting-SerializableOrXml'"
    >

Modified: labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/gateway/JmsGatewayListenerUnitTest.java
===================================================================
--- labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/gateway/JmsGatewayListenerUnitTest.java	2006-12-08 21:42:37 UTC (rev 8156)
+++ labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/gateway/JmsGatewayListenerUnitTest.java	2006-12-08 21:55:49 UTC (rev 8157)
@@ -47,7 +47,7 @@
 import org.apache.log4j.Logger;
 import org.apache.log4j.xml.DOMConfigurator;
 import org.jboss.soa.esb.addressing.eprs.JMSEpr;
-import org.jboss.soa.esb.helpers.AppServerContext;
+import org.jboss.soa.esb.helpers.NamingContext;
 import org.jboss.soa.esb.helpers.ConfigTree;
 import org.jboss.soa.esb.listeners.message.EsbListenerController;
 import org.jboss.soa.esb.listeners.message.EsbListenerControllerFactory;
@@ -74,7 +74,6 @@
 	static String SERVICE_NAME	= "testJmsGateway";
 	static String THE_TEXT 		= "This is the JMS text that will travel around";
 
-	static String _appServer		= System.getProperty("unit.test.appserver","localhost");
 	EsbListenerController	_esbListController;
 	GatewayListenerController _gatewayController;
 
@@ -167,9 +166,11 @@
 		InputStream inStream = JmsGatewayListenerUnitTest.class.getResourceAsStream(_gatewayConfig);
 		ConfigTree tree = ConfigTree.fromInputStream(inStream)
 				.getAllChildren()[0];
-        String sJndiType = tree.getAttribute(JMSEpr.JNDI_TYPE_TAG);
-        String sJndiURL = _appServer;
-        Context oJndiCtx = AppServerContext.getServerContext(sJndiType,sJndiURL);
+        String sJndiContextFactory = tree.getAttribute(JMSEpr.JNDI_CONTEXT_FACTORY);
+        String sJndiURL = tree.getAttribute(JMSEpr.JNDI_URL_TAG);
+        String sJndiPkgPrefix = tree.getAttribute(JMSEpr.JNDI_PKG_PREFIX_TAG);
+        
+        Context oJndiCtx = NamingContext.getServerContext(sJndiURL,sJndiContextFactory,sJndiPkgPrefix);
         String sFactoryClass = tree.getAttribute(JMSEpr.CONNECTION_FACTORY_TAG);
         if (Util.isNullString(sFactoryClass))
         	sFactoryClass = "ConnectionFactory";        

Modified: labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/gateway/fileEsbListenerConfig.xml
===================================================================
--- labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/gateway/fileEsbListenerConfig.xml	2006-12-08 21:42:37 UTC (rev 8156)
+++ labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/gateway/fileEsbListenerConfig.xml	2006-12-08 21:55:49 UTC (rev 8157)
@@ -8,7 +8,7 @@
 	connection-factory="ConnectionFactory"
 	destination-type="queue"
 	destination-name="queue/A"
-	jndi-type="jboss"
+	jndi-context-factory="org.jnp.interfaces.NamingContextFactory"
 	jndi-URL="localhost"
 	message-selector="service='testFileGateway'"
 	>

Modified: labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/gateway/jmsEsbListenerConfig.xml
===================================================================
--- labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/gateway/jmsEsbListenerConfig.xml	2006-12-08 21:42:37 UTC (rev 8156)
+++ labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/gateway/jmsEsbListenerConfig.xml	2006-12-08 21:55:49 UTC (rev 8157)
@@ -8,7 +8,7 @@
 	connection-factory="ConnectionFactory"
 	destination-type="queue"
 	destination-name="queue/A"
-	jndi-type="jboss"
+	jndi-context-factory="org.jnp.interfaces.NamingContextFactory"
 	jndi-URL="localhost"
 	message-selector="service='testJmsGateway'"
 	>

Modified: labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/gateway/jmsGatewayConfig.xml
===================================================================
--- labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/gateway/jmsGatewayConfig.xml	2006-12-08 21:42:37 UTC (rev 8156)
+++ labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/gateway/jmsGatewayConfig.xml	2006-12-08 21:55:49 UTC (rev 8157)
@@ -6,7 +6,7 @@
      connection-factory="ConnectionFactory"
      destination-type="queue"
      destination-name="queue/A"
-     jndi-type="jboss"
+     jndi-jndi-context-factory="org.jnp.interfaces.NamingContextFactory"
      jndi-URL="localhost"
      message-selector="messSelector='testJmsGateway'"
    >

Modified: labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/gateway/secureFtpEsbListenerConfig.xml
===================================================================
--- labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/gateway/secureFtpEsbListenerConfig.xml	2006-12-08 21:42:37 UTC (rev 8156)
+++ labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/gateway/secureFtpEsbListenerConfig.xml	2006-12-08 21:55:49 UTC (rev 8157)
@@ -10,7 +10,7 @@
 			connection-factory="ConnectionFactory"
 			destination-type="queue"
 			destination-name="queue/A"
-			jndi-type="jboss"
+			jndi-context-factory="org.jnp.interfaces.NamingContextFactory"
 			jndi-URL="localhost"
 			message-selector="service='coalMarketRights'"
 		/>

Modified: labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/message/CbrJmsQueueListenerTest.xml
===================================================================
--- labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/message/CbrJmsQueueListenerTest.xml	2006-12-08 21:42:37 UTC (rev 8156)
+++ labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/message/CbrJmsQueueListenerTest.xml	2006-12-08 21:55:49 UTC (rev 8157)
@@ -31,8 +31,8 @@
 	connection-factory="ConnectionFactory"
 	destination-type="queue"
    	destination-name="queue/A"
-	jndi-type="jboss"
-    jndi-URL="localhost"
+	jndi-context-factory="org.apache.activemq.jndi.ActiveMQInitialContextFactory"
+    jndi-URL="tcp://localhost:61616"
     message-selector="service='ContentBasedRouting-SerializableOrXml'"
    >
 	   <cbr ruleSet="JBossESBRules.drl" />

Modified: labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/objpersist/DrainQueuesAndTopics.java
===================================================================
--- labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/objpersist/DrainQueuesAndTopics.java	2006-12-08 21:42:37 UTC (rev 8156)
+++ labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/objpersist/DrainQueuesAndTopics.java	2006-12-08 21:55:49 UTC (rev 8157)
@@ -13,14 +13,14 @@
 import javax.jms.TopicSubscriber;
 import javax.naming.Context;
 
-import org.jboss.soa.esb.helpers.AppServerContext;
+import org.jboss.soa.esb.helpers.NamingContext;
 
 public class DrainQueuesAndTopics
 {
   private static final int	  MAX_TIMES_NOMSG = 10;
   private static final String JNDI_URL	= "localhost";
-  private static final String JNDI_TYPE 
-  						= AppServerContext.SERVER_TYPE.jboss.toString();
+  private static final String JNDI_CONNECTION_FACTORY  
+  						= NamingContext.JBOSS_INITIAL_CONTEXT_FACTORY;
  
   private Context m_oCtx;
   
@@ -34,7 +34,7 @@
   public int purgeQueueTopic(String p_sName) throws Exception
   { 
 	int iRet = 0;
-	m_oCtx = AppServerContext.getServerContext(JNDI_TYPE,JNDI_URL);
+	m_oCtx = NamingContext.getServerContext(JNDI_URL, JNDI_CONNECTION_FACTORY, null);
 	
 	System.out.println(p_sName);
 	MessageConsumer oCns = null;

Modified: labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/util/JMSClientUtil.java
===================================================================
--- labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/util/JMSClientUtil.java	2006-12-08 21:42:37 UTC (rev 8156)
+++ labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/util/JMSClientUtil.java	2006-12-08 21:55:49 UTC (rev 8157)
@@ -17,7 +17,7 @@
 
 import org.apache.log4j.Logger;
 import org.jboss.soa.esb.common.Configuration;
-import org.jboss.soa.esb.helpers.AppServerContext;
+import org.jboss.soa.esb.helpers.NamingContext;
 import org.jboss.soa.esb.helpers.KeyValuePair;
 
 /**
@@ -100,9 +100,10 @@
 		String queueName;
 
 		private JMSSendQueueSetup(QUEUE queue) throws Exception {
-			Context m_oCtx = AppServerContext.getServerContext(
-					Configuration.getJndiServerType(), 
-					Configuration.getJndiServerURL());			
+			Context m_oCtx = NamingContext.getServerContext(
+					Configuration.getJndiServerURL(),
+					Configuration.getJndiServerConnectionFactory(), 
+					Configuration.getJndiServerPkgPrefix());
 			QueueConnectionFactory qcf = (QueueConnectionFactory) m_oCtx.lookup("ConnectionFactory");
 			QueueConnection oQconn = qcf.createQueueConnection();
 




More information about the jboss-svn-commits mailing list