def _lease_server(options)
      options[:ignore_closed_registry] ||= false
      
      begin 
        # Get the server from the TS
        _, generation, uri = @tuplespace.take(['available', options[:generation], nil], options[:timeout])
        # Get the DRb object for it
        @servers[uri] ||= ServerWrapper.new(uri)
        # Check that the server is still up; the following call will throw if it is down
        @servers[uri].alive?
        # Note that we've leased this server
        @tuplespace.write(['leased', @client_id, generation, uri])
        # Return it
        @servers[uri] #.server    
      rescue ServerOffline => e
        @servers[uri] = nil
        raise   
      rescue Rinda::RequestExpiredError => e
        fail_unless_registry_open! if !options[:ignore_closed_registry]
      end
    end
def _lease_server(options)
      options[:ignore_closed_registry] ||= false
      
      begin 
        # Get the server from the TS
        _, generation, uri = @tuplespace.take(['available', options[:generation], nil], options[:timeout])
        # Get the DRb object for it
        @servers[uri] ||= ServerWrapper.new(uri)
        # Check that the server is still up; the following call will throw if it is down
        @servers[uri].alive?
        # Note that we've leased this server
        @tuplespace.write(['leased', @client_id, generation, uri])
        # Return it
        @servers[uri] #.server    
      rescue ServerOffline => e
        @servers[uri] = nil
        raise   
      rescue Rinda::RequestExpiredError => e
        fail_unless_registry_open! if !options[:ignore_closed_registry]
      end
    end
If a server is unavailable after the timeout, either returns nil or throws
 an exception if the registry is closed at that time.
    options[:timeout] => a number of seconds or nil for no timeout (only use 0 or nil)
    options[:generation] => a generation number or nil for no generation requirement
    options[:ignore_closed_registry] => if true, don't throw exception if registry closed