Class: Seasar::Aop::Interceptor::TraceInterceptor

Inherits:
Object
  • Object
show all
Defined in:
lib/seasar/aop/interceptor/trace-interceptor.rb

Instance Method Summary collapse

Instance Method Details

#call(invocation) ⇒ Object

  • args

    1. Seasar::Aop::MethodInvocation invocation

  • return

    • Object



32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/seasar/aop/interceptor/trace-interceptor.rb', line 32

def call(invocation)
  #class_name  = invocation.this.class.name
  class_name  = invocation.component_class.name
  method_name = invocation.method.name
  msg = "before : #{class_name}.#{method_name}(#{invocation.args.inspect})"
  s2logger.debug(self.class.name) {msg}
  start_time = Time.now
  result = invocation.proceed()
  time = Time.now - start_time
  msg = "after  : #{class_name}.#{method_name}(#{invocation.args.inspect}) : #{result} : #{time}"
  s2logger.debug(self.class.name) {msg}
  return result
end