activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject svn commit: r405737 - /incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/jndi/ActiveMQInitialContextFactory.java
Date Wed, 10 May 2006 12:38:10 GMT
Author: jstrachan
Date: Wed May 10 05:38:06 2006
New Revision: 405737

URL: http://svn.apache.org/viewcvs?rev=405737&view=rev
Log:
made it a little easier to extend the ActiveMQ JNDI provider

Modified:
    incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/jndi/ActiveMQInitialContextFactory.java

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/jndi/ActiveMQInitialContextFactory.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/jndi/ActiveMQInitialContextFactory.java?rev=405737&r1=405736&r2=405737&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/jndi/ActiveMQInitialContextFactory.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/jndi/ActiveMQInitialContextFactory.java
Wed May 10 05:38:06 2006
@@ -105,23 +105,7 @@
             }
         });
 
-        return new ReadOnlyContext(environment, data);
-    }
-
-    private ActiveMQConnectionFactory createConnectionFactory(String name, Hashtable environment)
  throws URISyntaxException {
-        Hashtable temp = new Hashtable(environment);
-        String prefix = connectionPrefix+name+".";
-        for (Iterator iter = environment.entrySet().iterator(); iter.hasNext();) {
-            Map.Entry entry = (Map.Entry) iter.next();
-            String key = (String) entry.getKey();
-            if( key.startsWith(prefix) ) {
-                // Rename the key...
-                temp.remove(key);
-                key = key.substring(prefix.length());
-                temp.put(key, entry.getValue());
-            }
-        }
-        return createConnectionFactory(temp);
+        return createContext(environment, data);
     }
 
     // Properties
@@ -144,6 +128,27 @@
 
     // Implementation methods
     //-------------------------------------------------------------------------
+
+    protected ReadOnlyContext createContext(Hashtable environment, Map data) {
+        return new ReadOnlyContext(environment, data);
+    }
+
+    protected ActiveMQConnectionFactory createConnectionFactory(String name, Hashtable environment)
  throws URISyntaxException {
+        Hashtable temp = new Hashtable(environment);
+        String prefix = connectionPrefix+name+".";
+        for (Iterator iter = environment.entrySet().iterator(); iter.hasNext();) {
+            Map.Entry entry = (Map.Entry) iter.next();
+            String key = (String) entry.getKey();
+            if( key.startsWith(prefix) ) {
+                // Rename the key...
+                temp.remove(key);
+                key = key.substring(prefix.length());
+                temp.put(key, entry.getValue());
+            }
+        }
+        return createConnectionFactory(temp);
+    }
+
     protected String[] getConnectionFactoryNames(Map environment) {
         String factoryNames = (String) environment.get("connectionFactoryNames");
         if (factoryNames != null) {



Mime
View raw message