title: Generate class with static method from Clojure
body: <p>I have a Clojure library that I would like to use in Java, but I'm having trouble getting the correct class generated. I would like to generate a class that is effectively:</p>
  
  <pre><code>public class TokenStore {
      public static TokenStore Sns(Map&lt;String, String&gt; services) { /* ... */ }
  
      public String addToken(String token, String username, String service) { /* ... */ }
      public String findToken(String username, String service) { /* ... */ }
      public String sendNotification(String username, String service, String message) { /* ... */ }
  }
  </code></pre>
  
  <p>Here's what I'm trying to do in Clojure:</p>
  
  <pre><code>(ns my.lib.token-java
    (:require [my.lib.token :refer :all])
    (:gen-class
     :name my.lib.TokenStore
     :methods [#^{:static true} [Sns [java.util.Map] TokenStore]]))
  
  (defprotocol TokenStore
    (addToken [this token username service])
    (findToken [this username service])
    (sendNotification [this username service message]))
  
  (defn -Sns [services]
    (let [ts (token-store (apply concat (for [[k v] (into {} coll)] [(keyword k) v]))]
      (reify TokenStore
        (addToken [this token username service]
          (add-token this token username service))
        (findToken [this username service]
          (find-token this username service))
        (sendNotification [this username service message]
          (send-notification this username service message)))))
  </code></pre>
  
  <p>But when I try to compile it, I get:</p>
  
  <pre><code>: jmglov@alhana; lein jar
  Compiling orron-iii.push-java
  Exception in thread "main" java.lang.ClassNotFoundException: java.lang.TokenStore, compiling:(orron_iii/push_java.clj:1:1)
  </code></pre>
  
  <p>Can anybody give me a simple example of how to do this?</p>