Skip to content

Instantly share code, notes, and snippets.

@rik0
Created February 11, 2011 18:34
Show Gist options
  • Save rik0/822792 to your computer and use it in GitHub Desktop.
Save rik0/822792 to your computer and use it in GitHub Desktop.
(defn -initialize [this params]
(dosync
(alter (.state this) assoc :starting-node false)
(alter (.state this) assoc :m-value (int *m*))
(alter (.state this) assoc :logger
(Logger/getLogger (->> this .getAddress .getName))))
(condp = (alength params)
0 true
1 (dosync
(alter (.state this) assoc :starting-node (boolean (aget params 0)))
true)
2 (dosync
(alter (.state this) assoc :starting-node (boolean (aget params 0)))
(alter (.state this) assoc :m-value (int (aget params 1)))
true)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment