Sha256: 0ac813f755d2696845c97b45a9ae98ccd1025a3b65e534092fc3f9e918af1a64

Contents?: true

Size: 1.01 KB

Versions: 1

Compression:

Stored size: 1.01 KB

Contents

module Trinidad
  module Extensions
    require File.expand_path('../../trinidad-libs/trinidad-hotdeploy-extension.jar', __FILE__)

    module Hotdeploy
      VERSION = '0.4.1'
    end

    class HotdeployWebAppExtension < WebAppExtension
      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

      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
    end

    class HotdeployOptionsExtension < OptionsExtension
      def configure(parser, default_options)
        default_options[:extensions] ||= {}
        default_options[:extensions][:hotdeploy] = {}
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
trinidad_hotdeploy_extension-0.4.1 lib/trinidad_hotdeploy_extension.rb