class RJack::Solr::Server

Attributes

solr_home[RW]

Public Class Methods

new() click to toggle source
Calls superclass method
# File lib/rjack-solr/server.rb, line 32
def initialize()
  super()

  self.webapp_contexts[ '/' ] = WEBAPP_PATH
  self.port = 8983
  @solr_home = '.'

  Hooker.apply( [ :solr, :http_server ], self )
end

Public Instance Methods

create_request_log( log_file ) click to toggle source
Calls superclass method
# File lib/rjack-solr/server.rb, line 42
def create_request_log( log_file )
  super.tap do |log|
    log.extended = true
    log.log_latency = true
  end
end
join() click to toggle source
# File lib/rjack-solr/server.rb, line 59
def join
  @server.join if @server
end
start() click to toggle source
# File lib/rjack-solr/server.rb, line 49
def start
  Java::java.lang.System.set_property( 'solr.solr.home', @solr_home )

  @server = create
  @server.start
  self.port = @server.connectors[0].local_port

  @server
end
stop() click to toggle source
# File lib/rjack-solr/server.rb, line 63
def stop
  @server.stop if @server
end