title: Can I register a static method as a Guava EventBus subscriber?
body: <p>I have an application Config object that gathers information from several sources — .properties files, database tables, the OS, etc. — and makes this available to the rest of the application as if they were <code>java.util.Properties</code>, for example:</p>
  
  <pre><code>private static String devToAddress = Config.getConfig().getProperty("testAddress");
  </code></pre>
  
  <p>These are often stored, as shown above, as a static so it's always available to all instances of a class without having to constantly fetch it.</p>
  
  <p>I also have a way to tell this (web) application to re-load these "properties" so I can reconfigure the application while it's running without doing a restart.</p>
  
  <p>What I want to do is register with my Guava EventBus to subscribe to my "ConfigurationChangeEvent" so the class can update this <code>devToAddress</code> when I use my re-load feature.
  In some cases this may be a static class with only static methods that still needs the application Config information, so I can't necessarily count on having an instance to do the work of updating the static variables.</p>
  
  <p>What I tried is this:</p>
  
  <pre><code>package com.sample.mw;
  
  import com.google.common.eventbus.Subscribe;
  
  import com.example.mw.events.ConfigurationChangeEvent;
  import com.example.mw.events.EventDispatcher;
  import com.example.mw.Config;
  
  public class SampleMailer
  {
      private static String devToAddress;
  
      // constructor(s)
      public SampleMailer()
      {
          // ...
      }
  
      // instance methods
      //    ...
  
      // static methods
      public static String getTheAddress()
      {
          return devToAddress;
      }
  
      @Subscribe
      public static void loadConfig(ConfigurationChangeEvent cce)
      {
          devToAddress = Config.getConfig().getProperty("testAddress");
      }
  
      // static/class registration with the event bus
      static
      {
          loadConfig(null); // initial config load without an event
          // 'EventDispatcher' is my singleton that encapsulates the EventBus
          EventDispatcher.getDispatcher().register(SampleMailer.class); // &lt;-- not sure what to register here
      }
  }
  </code></pre>
  
  <p>The questions are (a) Is this possible at all? Can you statically register with the Guava EventBus? (b) What <em>Object</em> do I pass to the EventBus <code>.register(Object object)</code> method?</p>