Class: Crossroads::Stomp::EventLogger

Inherits:
Object
  • Object
show all
Defined in:
lib/crossroads/stomp.rb

Instance Method Summary collapse

Instance Method Details

#on_connected(params = nil) ⇒ Object



11
12
13
14
# File 'lib/crossroads/stomp.rb', line 11

def on_connected(params=nil)
  Log.info("Conncted to #{stomp_url(params)}")
rescue
end

#on_connectfail(params = nil) ⇒ Object



21
22
23
24
# File 'lib/crossroads/stomp.rb', line 21

def on_connectfail(params=nil)
  Log.info("Connction to #{stomp_url(params)} failed on attempt #{params[:cur_conattempts]}")
rescue
end

#on_connecting(params = nil) ⇒ Object



6
7
8
9
# File 'lib/crossroads/stomp.rb', line 6

def on_connecting(params=nil)
  Log.info("Connection attempt %d to %s" % [params[:cur_conattempts], stomp_url(params)])
rescue
end

#on_disconnect(params = nil) ⇒ Object



16
17
18
19
# File 'lib/crossroads/stomp.rb', line 16

def on_disconnect(params=nil)
  Log.info("Disconnected from #{stomp_url(params)}")
rescue
end

#on_miscerr(params, errstr) ⇒ Object



26
27
28
29
# File 'lib/crossroads/stomp.rb', line 26

def on_miscerr(params, errstr)
  Log.debug("Unexpected error on connection #{stomp_url(params)}: #{errstr}")
rescue
end

#stomp_url(params) ⇒ Object



31
32
33
# File 'lib/crossroads/stomp.rb', line 31

def stomp_url(params)
  "stomp://%s@%s:%d" % [params[:cur_login], params[:cur_host], params[:cur_port]]
end