ace-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1197456 - /incubator/ace/trunk/ace-managementagent/src/main/java/org/apache/ace/managementagent/Activator.java
Date Fri, 04 Nov 2011 09:28:50 GMT
Author: marrs
Date: Fri Nov  4 09:28:50 2011
New Revision: 1197456

URL: http://svn.apache.org/viewvc?rev=1197456&view=rev
Log:
ACE-193 additional fix that does not even setup sync anymore when discovery is a file URL

Modified:
    incubator/ace/trunk/ace-managementagent/src/main/java/org/apache/ace/managementagent/Activator.java

Modified: incubator/ace/trunk/ace-managementagent/src/main/java/org/apache/ace/managementagent/Activator.java
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/ace-managementagent/src/main/java/org/apache/ace/managementagent/Activator.java?rev=1197456&r1=1197455&r2=1197456&view=diff
==============================================================================
--- incubator/ace/trunk/ace-managementagent/src/main/java/org/apache/ace/managementagent/Activator.java
(original)
+++ incubator/ace/trunk/ace-managementagent/src/main/java/org/apache/ace/managementagent/Activator.java
Fri Nov  4 09:28:50 2011
@@ -1,6 +1,7 @@
 package org.apache.ace.managementagent;
 
 import java.io.IOException;
+import java.net.URL;
 import java.util.ArrayList;
 import java.util.Dictionary;
 import java.util.Properties;
@@ -81,9 +82,15 @@ public class Activator extends Dependenc
                     String id = args[1];
                     String url = args[2];
                     
+                    boolean isFileUrl = "file".equals((new URL(url)).getProtocol());
+                    
                     configureFactory("org.apache.ace.identification.property.factory", "ma",
ma, "gatewayID", id);
                     configureFactory("org.apache.ace.discovery.property.factory", "ma", ma,
"serverURL", url);
-                    configureFactory("org.apache.ace.gateway.log.sync.factory", "ma", ma,
"name", "auditlog");
+                    // if discovery points to the local filesystem, it's no use trying to
sync the audit log
+                    // to a server (we are keeping the local log in case someone wants to
retrieve it)
+                    if (!isFileUrl) {
+                        configureFactory("org.apache.ace.gateway.log.sync.factory", "ma",
ma, "name", "auditlog");
+                    }
                     configureFactory("org.apache.ace.deployment.factory", "ma", ma);
                     configure("org.apache.ace.scheduler", "ma=" + ma + ";name=auditlog",
syncInterval);
                     instances.append(
@@ -102,9 +109,12 @@ public class Activator extends Dependenc
             else {
                 String server = System.getProperty("discovery", "http://localhost:8080");
                 configure("org.apache.ace.discovery.property", "serverURL", server);
+                boolean isFileUrl = "file".equals((new URL(server)).getProtocol());
                 String targetId = System.getProperty("identification", "configuredGatewayID");
                 configure("org.apache.ace.identification.property", "gatewayID", targetId);
-                configureFactory("org.apache.ace.gateway.log.sync.factory", "name", "auditlog");
+                if (!isFileUrl) {
+                    configureFactory("org.apache.ace.gateway.log.sync.factory", "name", "auditlog");
+                }
                 configure("org.apache.ace.scheduler", "auditlog", syncInterval);
                 if (!m_quiet) {
                     System.out.println("Started management agent.\n"



Mime
View raw message