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.

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



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

def after_init(event); end

#after_start(event) ⇒ Object



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

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 :



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

def before_init(event); end

#before_start(event) ⇒ Object



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

def before_start(event); end

#before_stop(event) ⇒ Object



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

def before_stop(event); end

#configure_start(event) ⇒ Object



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

def configure_start(event); end

#configure_stop(event) ⇒ Object



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

def configure_stop(event); end

#lifecycleEvent(event) ⇒ Object



13
14
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
# File 'lib/trinidad/lifecycle/base.rb', line 13

def lifecycleEvent(event)
  events = Trinidad::Tomcat::Lifecycle
  case event.type
  when events::BEFORE_INIT_EVENT then
    before_init(event)
  when events::AFTER_INIT_EVENT then
    after_init(event)
  when events::CONFIGURE_START_EVENT then
    configure_start(event)
  when events::CONFIGURE_STOP_EVENT then
    configure_stop(event)
  when events::BEFORE_START_EVENT then
    before_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::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



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

def start(event); end

#stop(event) ⇒ Object



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

def stop(event); end