class Trinidad::Lifecycle::Base
Trinidad
lifecycle listener (generic) base class. Allows hooking into the container's lifecycle using the provided methods.
Public Instance Methods
after_destroy(event)
click to toggle source
# File lib/trinidad/lifecycle/base.rb, line 64 def after_destroy(event); end
after_init(event)
click to toggle source
# File lib/trinidad/lifecycle/base.rb, line 51 def after_init(event); end
after_start(event)
click to toggle source
# File lib/trinidad/lifecycle/base.rb, line 56 def after_start(event); end
after_stop(event)
click to toggle source
# File lib/trinidad/lifecycle/base.rb, line 61 def after_stop(event); end
before_destroy(event)
click to toggle source
# File lib/trinidad/lifecycle/base.rb, line 63 def before_destroy(event); end
before_init(event)
click to toggle source
Event hook methods for a more Ruby-ish API :
# File lib/trinidad/lifecycle/base.rb, line 50 def before_init(event); end
before_start(event)
click to toggle source
# File lib/trinidad/lifecycle/base.rb, line 53 def before_start(event); end
before_stop(event)
click to toggle source
# File lib/trinidad/lifecycle/base.rb, line 58 def before_stop(event); end
configure_start(event)
click to toggle source
# File lib/trinidad/lifecycle/base.rb, line 54 def configure_start(event); end
configure_stop(event)
click to toggle source
# File lib/trinidad/lifecycle/base.rb, line 60 def configure_stop(event); end
lifecycleEvent(event)
click to toggle source
The base implementation simply routes events to correspondig methods.
tomcat.apache.org/tomcat-7.0-doc/api/org/apache/catalina/Lifecycle.html tomcat.apache.org/tomcat-7.0-doc/api/org/apache/catalina/LifecycleListener.html
# File lib/trinidad/lifecycle/base.rb, line 15 def lifecycleEvent(event) case event.type when EVENTS::BEFORE_INIT_EVENT then before_init(event) when EVENTS::AFTER_INIT_EVENT then after_init(event) when EVENTS::BEFORE_START_EVENT then before_start(event) when EVENTS::CONFIGURE_START_EVENT then configure_start(event) when EVENTS::START_EVENT then start(event) when EVENTS::AFTER_START_EVENT then after_start(event) when EVENTS::BEFORE_STOP_EVENT then before_stop(event) when EVENTS::STOP_EVENT then stop(event) when EVENTS::CONFIGURE_STOP_EVENT then configure_stop(event) when EVENTS::AFTER_STOP_EVENT then after_stop(event) when EVENTS::BEFORE_DESTROY_EVENT then before_destroy(event) when EVENTS::AFTER_DESTROY_EVENT then after_destroy(event) when EVENTS::PERIODIC_EVENT then periodic(event) else raise "unsupported event.type = #{event.type}" end end
periodic(event)
click to toggle source
# File lib/trinidad/lifecycle/base.rb, line 66 def periodic(event); end
start(event)
click to toggle source
# File lib/trinidad/lifecycle/base.rb, line 55 def start(event); end
stop(event)
click to toggle source
# File lib/trinidad/lifecycle/base.rb, line 59 def stop(event); end