Show
Ignore:
Timestamp:
11/05/10 18:54:05 (7 years ago)
Author:
mauriciobomfim
Message:

Added jruby support

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • Explorator/trunk/vendor/plugins/activerdf_sparql-1.3.6/lib/activerdf_sparql/sparql_sesame_api.rb

    r483 r487  
    33# SPARQL adapter 
    44class SparqlSesameApiAdapter < ActiveRdfAdapter 
    5    
    6   include Java if RUBY_PLATFORM =~ /java/ 
    75   
    86  $activerdflog.info "loading SPARQL SESAME API adapter" 
     
    4644        Rjb::load sesame_jars , vmargs 
    4745      end 
    48              
     46      
    4947    rescue => ex 
    5048      raise ex, "Could not load Java Virtual Machine. Please, check if your JAVA_HOME environment variable is pointing to a valid JDK (1.4+). #{ex}" 
     
    5351      raise ex, "Could not load RJB. Please, install it properly with the command 'gem install rjb'" 
    5452    end         
    55      
    56     if RUBY_PLATFORM =~ /java/ 
    57       @bridge = (import 'br.tecweb.explorator.SesameApiRubyAdapter').new(@repository) 
     53    unless RUBY_PLATFORM =~ /java/ 
     54      @bridge = Rjb::import('br.tecweb.explorator.SesameApiRubyAdapter').new(@repository) 
    5855    else 
    59       @bridge = Rjb::import('br.tecweb.explorator.SesameApiRubyAdapter').new(@repository)   
    60     end   
     56      @bridge = Java::BrTecwebExplorator::SesameApiRubyAdapter.new(@repository) 
     57    end 
    6158  end   
    6259  def size 
     
    6865  def query(query, &block)     
    6966    qs = Query2SPARQL.translate(query) 
    70       
    7167    if !(@title.include?'INTERNAL' and qs.to_s.include? "http://www.tecweb.inf.puc-rio.br")       
    7268      if @caching