public
Description: All the extra stuff you could want for the Mack Framework.
Homepage: http://www.mackframework.com
Clone URL: git://github.com/markbates/mack-more.git
100644 33 lines (29 sloc) 1.127 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
module Mack
  module Distributed # :nodoc:
    module Object
      
      def self.included(base)
        if app_config.mack.share_objects
          base.class_eval do
            include ::DRbUndumped
          end
          eval %{
class ::Mack::Distributed::#{base}Proxy
include Singleton
include DRbUndumped
 
def method_missing(sym, *args)
#{base}.send(sym, *args)
end
# def respond_to?(sym)
# #{base}.respond_to?(sym)
# end
end
}
          raise Mack::Distributed::Errors::ApplicationNameUndefined.new if app_config.mack.distributed_app_name.nil?
          Mack::Distributed::Utils::Rinda.register_or_renew(:space => app_config.mack.distributed_app_name.to_sym,
                                                            :klass_def => "#{base}".to_sym,
                                                            :object => "Mack::Distributed::#{base}Proxy".constantize.instance)
        end
      end
      
    end # Object
  end # Distributed
end # Mack