> BTW, if you're just coming from Ruby to Java, I wrote an 
> article on my blog that you might find really useful: 
> http://fhwang.net/blog/40.html

Thanks.  If nothing else, I've changed to underscores for
my methods...

I've got it all working nicely now.  I used Tom's sample 
code as a starting point.  Thanks, Tom!

The Observable pattern that itsme213 recommended doesn't
seem to fit my needs since I need multiple listeners per 
emitter but maybe that's just Java think...

Anyway, here's the code I ended up using, in case anyone
else wants to do this sort of thing.  (I tried defining
attr_emitter as "def self.attr_emitter" in the Emitter
module, but that didn't work.  It seems like you have 
to define these types of things in the Module class?)

Thanks everyone for your help!

-Paul




class Module

  def attr_emitter(*attrs)
    attrs.each do |attr|
      class_eval %{

        def #{attr}
          @#{attr}
        end

        def #{attr}=(x)
          old = @#{attr}
          @#{attr} = x
          emit(:#{attr}, old)
        end
      }
    end
  end

end


module Emitter

  def add_listener(listener)
    raise "Invalid listener" unless listener.respond_to? :property_changed
    @emitter_listeners = [] unless @emitter_listeners
    @emitter_listeners.push(listener)
    self
  end

  def remove_listener(listener)
    return self unless @emitter_listeners
    @emitter_listeners.delete(listener)
    self
  end

  def emit(sym, oldValue)
    return self unless @emitter_listeners
    @emitter_listeners.each { |x| x.property_changed(self, sym, oldValue) }
    self
  end

end