Class: Trinidad::Extensions::HotdeployWebAppExtension

Inherits:
WebAppExtension
  • Object
show all
Defined in:
lib/trinidad_hotdeploy_extension.rb

Instance Method Summary collapse

Instance Method Details

#configure(tomcat, app_context) ⇒ Object



10
11
12
13
14
15
16
17
# File 'lib/trinidad_hotdeploy_extension.rb', line 10

def configure(tomcat, app_context)
  monitor_file = File.expand_path(monitor(app_context))
  delay = @options[:delay] || 1000

  listener = org.jruby.trinidad.HotDeployLifecycleListener.new(app_context, monitor_file, delay)
  app_context.addLifecycleListener(listener)
  listener
end

#monitor(app_context) ⇒ Object



19
20
21
22
23
24
25
# File 'lib/trinidad_hotdeploy_extension.rb', line 19

def monitor(app_context)
  @options[:monitor] ||= begin
    doc_base = app_context.doc_base
    doc_base = File.join(doc_base, 'tmp/restart.txt') if !(doc_base =~ /\.war$/)
    doc_base
  end
end