Sha256: e83c9129018b34b3b5c050ca77ab9bed48e2742a6ac49643323a99fe72969980

Contents?: true

Size: 530 Bytes

Versions: 10

Compression:

Stored size: 530 Bytes

Contents

module Trinidad
  module Lifecycle
    class Takeover
      include Trinidad::Tomcat::LifecycleListener
      def initialize(old)
        @old = old
      end

      def lifecycleEvent(event)
        if event.type == Trinidad::Tomcat::Lifecycle::AFTER_START_EVENT
          begin
            name = @old[:context].name

            @old[:context].stop
            @old[:context].destroy

            event.lifecycle.name = name
          ensure
            @old.delete(:lock)
          end
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
trinidad-1.3.5 lib/trinidad/lifecycle/takeover.rb
trinidad-1.3.4 lib/trinidad/lifecycle/takeover.rb
trinidad-1.3.3 lib/trinidad/lifecycle/takeover.rb
trinidad-1.3.2 lib/trinidad/lifecycle/takeover.rb
trinidad-1.3.1 lib/trinidad/lifecycle/takeover.rb
trinidad-1.3.0 lib/trinidad/lifecycle/takeover.rb
trinidad-1.2.3 lib/trinidad/lifecycle/takeover.rb
trinidad-1.2.2 lib/trinidad/lifecycle/takeover.rb
trinidad-1.2.1 lib/trinidad/lifecycle/takeover.rb
trinidad-1.2.0 lib/trinidad/lifecycle/takeover.rb