activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajdav...@apache.org
Subject svn commit: r646803 - in /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network: DiscoveryNetworkConnector.java LdapNetworkConnector.java MulticastNetworkConnector.java NetworkBridgeConfiguration.java NetworkConnector.java
Date Thu, 10 Apr 2008 13:43:51 GMT
Author: rajdavies
Date: Thu Apr 10 06:43:46 2008
New Revision: 646803

URL: http://svn.apache.org/viewvc?rev=646803&view=rev
Log:
Applied patch for https://issues.apache.org/activemq/browse/AMQ-1465

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/DiscoveryNetworkConnector.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/LdapNetworkConnector.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/MulticastNetworkConnector.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/NetworkBridgeConfiguration.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/NetworkConnector.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/DiscoveryNetworkConnector.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/DiscoveryNetworkConnector.java?rev=646803&r1=646802&r2=646803&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/DiscoveryNetworkConnector.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/DiscoveryNetworkConnector.java
Thu Apr 10 06:43:46 2008
@@ -202,7 +202,13 @@
     }
 
     public String getName() {
-        return discoveryAgent.toString();
+        String name = super.getName();
+        if (name == null) {
+            name = discoveryAgent.toString();
+            ;
+            super.setName(name);
+        }
+        return name;
     }
 
 }

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/LdapNetworkConnector.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/LdapNetworkConnector.java?rev=646803&r1=646802&r2=646803&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/LdapNetworkConnector.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/LdapNetworkConnector.java
Thu Apr 10 06:43:46 2008
@@ -88,6 +88,8 @@
 
    // local context
    private DirContext context = null;
+   //currently in use URI
+   private URI ldapURI = null;
 
    /**
     * returns the next URI from the configured list
@@ -195,9 +197,9 @@
       LOG.info("connecting...");
       Hashtable<String, String> env = new Hashtable();
       env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
-      URI uri = getUri();
-      LOG.debug("    URI [" + uri + "]");
-      env.put(Context.PROVIDER_URL, uri.toString());
+      this.ldapURI = getUri();
+      LOG.debug("    URI [" + this.ldapURI + "]");
+      env.put(Context.PROVIDER_URL, this.ldapURI.toString());
       if(anonymousAuthentication)
       {
          LOG.debug("    login credentials [anonymous]");
@@ -221,9 +223,9 @@
          {
             if(failover)
             {
-               uri = getUri();
-               LOG.error("connection error [" + env.get(Context.PROVIDER_URL) + "], failover
connection to [" + uri.toString() + "]");
-               env.put(Context.PROVIDER_URL, uri.toString());
+                this.ldapURI = getUri();
+               LOG.error("connection error [" + env.get(Context.PROVIDER_URL) + "], failover
connection to [" + this.ldapURI.toString() + "]");
+               env.put(Context.PROVIDER_URL, this.ldapURI.toString());
                Thread.sleep(curReconnectDelay);
                curReconnectDelay = Math.min(curReconnectDelay * 2, maxReconnectDelay);
             }
@@ -272,14 +274,22 @@
     *
     * @return connector name
     */
-   public String getName()
-      { return toString(); }
+   public String getName() {
 
-   /**
-    * add connector of the given URI
-    *
-    * @param result search result of connector to add
-    */
+        String name = super.getName();
+        if (name == null) {
+            name = this.getClass().getName() + " [" + ldapURI.toString() + "]";
+            super.setName(name);
+        }
+        return name;
+    }
+
+   /**
+     * add connector of the given URI
+     * 
+     * @param result
+     *            search result of connector to add
+     */
    protected synchronized void addConnector(SearchResult result)
       throws Exception
    {

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/MulticastNetworkConnector.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/MulticastNetworkConnector.java?rev=646803&r1=646802&r2=646803&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/MulticastNetworkConnector.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/MulticastNetworkConnector.java
Thu Apr 10 06:43:46 2008
@@ -142,7 +142,12 @@
     }
 
     public String getName() {
-        return remoteTransport.toString();
+        String name = super.getName();
+        if(name == null) {
+            name = remoteTransport.toString();
+            super.setName(name);
+        }
+        return name;
     }
 
     protected DemandForwardingBridgeSupport createBridge(Transport local, Transport remote)
{

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/NetworkBridgeConfiguration.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/NetworkBridgeConfiguration.java?rev=646803&r1=646802&r2=646803&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/NetworkBridgeConfiguration.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/NetworkBridgeConfiguration.java
Thu Apr 10 06:43:46 2008
@@ -35,7 +35,7 @@
     private String userName;
     private String password;
     private String destinationFilter = ">";
-    private String name = "localhost";
+    private String name = null;
 
     /**
      * @return the conduitSubscriptions
@@ -210,6 +210,9 @@
      * @return the name
      */
     public String getName() {
+        if(this.name == null) {
+            this.name = "localhost";
+        }
         return this.name;
     }
 

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/NetworkConnector.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/NetworkConnector.java?rev=646803&r1=646802&r2=646803&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/NetworkConnector.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/NetworkConnector.java
Thu Apr 10 06:43:46 2008
@@ -201,8 +201,6 @@
         serviceSupport.stop();
     }
 
-    public abstract String getName();
-
     protected void handleStart() throws Exception {
         if (localURI == null) {
             throw new IllegalStateException("You must configure the 'localURI' property");
@@ -262,6 +260,7 @@
             }
         }
     }
+    
 
     @SuppressWarnings("unchecked")
     protected ObjectName createNetworkBridgeObjectName(NetworkBridge bridge) throws MalformedObjectNameException
{



Mime
View raw message