Class: Trinidad::Lifecycle::Base

Inherits:
Object
  • Object
show all
Includes:
Tomcat::LifecycleListener
Defined in:
lib/trinidad/lifecycle/base.rb

Overview

Trinidad lifecycle listener (generic) base class. Allows hooking into the container’s lifecycle using the provided methods.

Constant Summary collapse

EVENTS =

:nodoc:

Trinidad::Tomcat::Lifecycle

Instance Method Summary collapse

Instance Method Details

#after_destroy(event) ⇒ Object



64
# File 'lib/trinidad/lifecycle/base.rb', line 64

def after_destroy(event); end

#after_init(event) ⇒ Object



51
# File 'lib/trinidad/lifecycle/base.rb', line 51

def after_init(event); end

#after_start(event) ⇒ Object



56
# File 'lib/trinidad/lifecycle/base.rb', line 56

def after_start(event); end

#after_stop(event) ⇒ Object



61
# File 'lib/trinidad/lifecycle/base.rb', line 61

def after_stop(event); end

#before_destroy(event) ⇒ Object



63
# File 'lib/trinidad/lifecycle/base.rb', line 63

def before_destroy(event); end

#before_init(event) ⇒ Object

Event hook methods for a more Ruby-ish API :



50
# File 'lib/trinidad/lifecycle/base.rb', line 50

def before_init(event); end

#before_start(event) ⇒ Object



53
# File 'lib/trinidad/lifecycle/base.rb', line 53

def before_start(event); end

#before_stop(event) ⇒ Object



58
# File 'lib/trinidad/lifecycle/base.rb', line 58

def before_stop(event); end

#configure_start(event) ⇒ Object



54
# File 'lib/trinidad/lifecycle/base.rb', line 54

def configure_start(event); end

#configure_stop(event) ⇒ Object



60
# File 'lib/trinidad/lifecycle/base.rb', line 60

def configure_stop(event); end

#lifecycleEvent(event) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# 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) ⇒ Object



66
# File 'lib/trinidad/lifecycle/base.rb', line 66

def periodic(event); end

#start(event) ⇒ Object



55
# File 'lib/trinidad/lifecycle/base.rb', line 55

def start(event); end

#stop(event) ⇒ Object



59
# File 'lib/trinidad/lifecycle/base.rb', line 59

def stop(event); end