Class: Trinidad::Lifecycle::Host
- Defined in:
- lib/trinidad/lifecycle/host.rb
Overview
A host lifecycle listener - monitors deployed web apps.
Defined Under Namespace
Classes: RestartReload, RollingReload
Instance Attribute Summary collapse
-
#app_holders ⇒ Object
(also: #contexts)
readonly
Returns the value of attribute app_holders.
-
#server ⇒ Object
readonly
Returns the value of attribute server.
Instance Method Summary collapse
- #before_start(event) ⇒ Object
-
#initialize(server, *app_holders) ⇒ Host
constructor
#server current server instance #app_holders deployed web application holders.
- #periodic(event) ⇒ Object
-
#tomcat ⇒ Object
for backwards compatibility.
Methods inherited from Base
#after_destroy, #after_init, #after_start, #after_stop, #before_destroy, #before_init, #before_stop, #configure_start, #configure_stop, #lifecycleEvent, #start, #stop
Constructor Details
#initialize(server, *app_holders) ⇒ Host
#server current server instance #app_holders deployed web application holders
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/trinidad/lifecycle/host.rb', line 14 def initialize(server, *app_holders) app_holders.map! do |app_holder| if app_holder.is_a?(Hash) # backwards compatibility Trinidad::WebApp::Holder.new(app_holder[:app], app_holder[:context]) else app_holder end end @server, @app_holders = server, app_holders end |
Instance Attribute Details
#app_holders ⇒ Object (readonly) Also known as: contexts
Returns the value of attribute app_holders.
8 9 10 |
# File 'lib/trinidad/lifecycle/host.rb', line 8 def app_holders @app_holders end |
#server ⇒ Object (readonly)
Returns the value of attribute server.
8 9 10 |
# File 'lib/trinidad/lifecycle/host.rb', line 8 def server @server end |
Instance Method Details
#before_start(event) ⇒ Object
26 27 28 |
# File 'lib/trinidad/lifecycle/host.rb', line 26 def before_start(event) init_monitors end |
#periodic(event) ⇒ Object
31 32 33 |
# File 'lib/trinidad/lifecycle/host.rb', line 31 def periodic(event) check_monitors end |
#tomcat ⇒ Object
for backwards compatibility
35 |
# File 'lib/trinidad/lifecycle/host.rb', line 35 def tomcat; @server.tomcat; end |