Author: ivol37 at gmail.com
Date: Fri Jan  7 12:43:48 2011
New Revision: 577

Log:
[AMDATU-243] Moved cluster configuration to settings in root pom.xml such that 
they can be overruled in own settings.xml. Also added javadoc to template 
config callback handler.

Modified:
   
trunk/amdatu-core/config-filebased/src/main/resources/conf/org.amdatu.core.cassandra.application.cfg
   
trunk/amdatu-core/config-templates/src/main/java/org/amdatu/core/config/templates/ConfigTemplateCallbackHandler.java
   trunk/pom.xml

Modified: 
trunk/amdatu-core/config-filebased/src/main/resources/conf/org.amdatu.core.cassandra.application.cfg
==============================================================================
--- 
trunk/amdatu-core/config-filebased/src/main/resources/conf/org.amdatu.core.cassandra.application.cfg
        (original)
+++ 
trunk/amdatu-core/config-filebased/src/main/resources/conf/org.amdatu.core.cassandra.application.cfg
        Fri Jan  7 12:43:48 2011
@@ -19,19 +19,17 @@
 # Name of the Cassandra cluster to join. If a seed is defined in the 'seeds' 
property
 # that defines a different clustername, a clustername mismatch error will be 
displayed
 # and that seed will not become part of this cluster.
-clustername='Amdatu Cluster'
+clustername=${cassandra.clustername}
 
 # Comma separated list of IP addresses of nodes in the cluster to connect to.
 # Note that does not need to be a full listing of all IP addresses of all nodes
 # in the cluster, it may be a subset of it. This property determines with what
 # other nodes in the cluster this node will synchronize its data.
 # When cassandra is executed in stand-alone mode, this value should be 
127.0.0.1
-seeds=127.0.0.1
-#seeds=172.16.10.109,172.16.10.203
+seeds=${cassandra.seeds}
 
 # The IP address of this node that other cassandra nodes will use to connect 
to.
 # This IP address must thus be accessible from the other nodes in the cluster 
(to
 # be precise; those that provided this node as one of its seeds).
 # When cassandra is executed in stand-alone mode, this value should be 
localhost
-listen_address=localhost
-#listen_address=172.16.11.108
\ No newline at end of file
+listen_address=${cassandra.listen_address}
\ No newline at end of file

Modified: 
trunk/amdatu-core/config-templates/src/main/java/org/amdatu/core/config/templates/ConfigTemplateCallbackHandler.java
==============================================================================
--- 
trunk/amdatu-core/config-templates/src/main/java/org/amdatu/core/config/templates/ConfigTemplateCallbackHandler.java
        (original)
+++ 
trunk/amdatu-core/config-templates/src/main/java/org/amdatu/core/config/templates/ConfigTemplateCallbackHandler.java
        Fri Jan  7 12:43:48 2011
@@ -16,6 +16,21 @@
  */
 package org.amdatu.core.config.templates;
 
+/**
+ * A ConfigTemplateCallbackHandler can be passed to the ConfigTemplateManager 
when more specific
+ * placeholder replacement is needed. The ConfigTemplateManager will buy 
default replace placeholders
+ * ${[pid]/[property]} by their corresponding value in ConfigugrationAdmin. 
Sometimes, more logic is
+ * needed to perform this replacement, for example in case the value is 
actually a multi-value property
+ * which need te be replaced with a different syntax (for example, stored in 
ConfigurationAdmin comma
+ * separated but when replaced should be line feed separated).
+ * This callback handler facilitates this. Whenever a placeholder is about to 
be replaced, the getValue on
+ * this callback handler is invoked with the pid and property name of the 
palceholder and the configuration
+ * value retrieved from ConfigurationAdmin. The callback handler returns the 
String value that the placeholder
+ * should be replaced with.
+ * 
+ * @author ivol
+ *
+ */
 public interface ConfigTemplateCallbackHandler {
     /**
      * 

Modified: trunk/pom.xml
==============================================================================
--- trunk/pom.xml       (original)
+++ trunk/pom.xml       Fri Jan  7 12:43:48 2011
@@ -40,6 +40,17 @@
     <compiler.optimize>false</compiler.optimize>
     <default.loglevel>WARNING</default.loglevel>
 
+    <!-- Name of the Cassandra cluster this node is part of -->
+    <cassandra.clustername>'Amdatu Cluster'</cassandra.clustername>
+
+    <!-- Comma-separated list of IP addresses of nodes in the cassandra 
cluster, i.e. "172.16.10.109,172.16.10.203" -->
+    <cassandra.seeds>127.0.0.1</cassandra.seeds>
+
+    <!-- Address for incoming cassandra connections. In case this is a 
stand-alone node, define "localhost".
+         Otherwise, specify the IP address other nodes in the cluster will use 
to connect to this node (they
+         define this IP address in their list of seeds). For example: 
"172.16.11.108" -->
+    <cassandra.listen_address>localhost</cassandra.listen_address>
+
     <!--
       Version numbers of dependent libraries
     -->

Reply via email to