torquebox-messaging 2.0.2-java → 2.0.3-java

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -33,6 +33,11 @@ module TorqueBox
33
33
  base.send(:include, FutureStatus)
34
34
  end
35
35
 
36
+ # Signals if the newrelic gem is loaded.
37
+ def self.newrelic_available?
38
+ defined?(NewRelic::Agent)
39
+ end
40
+
36
41
  # Allows you to background any method that has not been marked
37
42
  # as a backgrounded method via {ClassMethods#always_background}.
38
43
  # @param [Hash] options that are passed through to
@@ -77,13 +82,13 @@ module TorqueBox
77
82
  end
78
83
 
79
84
  def __enable_backgroundable_newrelic_tracing(method)
80
- if defined?(NewRelic::Agent)
81
- include(NewRelic::Agent::Instrumentation::ControllerInstrumentation) unless
85
+ if Backgroundable.newrelic_available?
86
+ include(NewRelic::Agent::Instrumentation::ControllerInstrumentation) unless
82
87
  include?(NewRelic::Agent::Instrumentation::ControllerInstrumentation)
83
88
  begin
84
89
  add_transaction_tracer(method, :name => method.sub("__sync_", ""), :category => :task)
85
90
  rescue Exception => e
86
- log.error "Error loading New Relic for backgrounded method #{method.sub("__sync_", "")}: #{e}"
91
+ TorqueBox::Logger.new( Backgroundable ).error "Error loading New Relic for backgrounded method #{method.sub("__sync_", "")}: #{e}"
87
92
  end
88
93
  end
89
94
  end
@@ -23,16 +23,28 @@ module TorqueBox
23
23
  module Messaging
24
24
  class BackgroundableProcessor < MessageProcessor
25
25
 
26
+ def self.log_newrelic_notice(klass)
27
+ @newrelic_notice_logged ||=
28
+ log.warn( "The New Relic agent is loaded, but an issue with the inheritance hierachy of " <<
29
+ klass.name << " prevents us from reporting on its Backgroundable calls." ) || true
30
+ end
31
+
26
32
  def on_message(hash)
27
33
  FutureResponder.new( Queue.new( hash[:future_queue] ), hash[:future_id] ).respond do
28
- hash[:receiver].class.__enable_backgroundable_newrelic_tracing(hash[:method])
34
+ klass = hash[:receiver].class
35
+ if klass.respond_to?( :__enable_backgroundable_newrelic_tracing )
36
+ klass.__enable_backgroundable_newrelic_tracing( hash[:method] )
37
+ elsif Backgroundable.newrelic_available?
38
+ self.class.log_newrelic_notice( klass )
39
+ end
40
+
29
41
  hash[:receiver].send(hash[:method], *hash[:args])
30
42
  end
31
43
  end
32
44
 
33
45
  private
34
- def log
35
- @logger ||= TorqueBox::Logger.new(self.class)
46
+ def self.log
47
+ @logger ||= TorqueBox::Logger.new( self )
36
48
  end
37
49
  end
38
50
  end
Binary file
@@ -1,6 +1,6 @@
1
1
  module TorqueboxMessaging
2
- VERSION = '2.0.2'
3
- MAVEN_VERSION = '2.0.2'
2
+ VERSION = '2.0.3'
3
+ MAVEN_VERSION = '2.0.3'
4
4
  end
5
5
  begin
6
6
  require 'java'
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: torquebox-messaging
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 2.0.2
5
+ version: 2.0.3
6
6
  platform: java
7
7
  authors:
8
8
  - The TorqueBox Team
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2012-05-01 00:00:00 Z
13
+ date: 2012-05-04 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: torquebox-core
@@ -20,7 +20,7 @@ dependencies:
20
20
  requirements:
21
21
  - - "="
22
22
  - !ruby/object:Gem::Version
23
- version: 2.0.2
23
+ version: 2.0.3
24
24
  type: :runtime
25
25
  version_requirements: *id001
26
26
  - !ruby/object:Gem::Dependency
@@ -31,7 +31,7 @@ dependencies:
31
31
  requirements:
32
32
  - - "="
33
33
  - !ruby/object:Gem::Version
34
- version: 2.0.2
34
+ version: 2.0.3
35
35
  type: :runtime
36
36
  version_requirements: *id002
37
37
  - !ruby/object:Gem::Dependency
@@ -88,42 +88,42 @@ files:
88
88
  - lib/gem_hook.rb
89
89
  - lib/org.torquebox.messaging-client.rb
90
90
  - lib/torquebox/messaging.rb
91
- - lib/torquebox/messaging/queue.rb
92
- - lib/torquebox/messaging/xa_connection.rb
93
- - lib/torquebox/messaging/const_missing.rb
94
- - lib/torquebox/messaging/processor_wrapper.rb
95
- - lib/torquebox/messaging/destination.rb
96
- - lib/torquebox/messaging/future.rb
97
- - lib/torquebox/messaging/clojure_message.rb
98
- - lib/torquebox/messaging/text_message.rb
99
- - lib/torquebox/messaging/xa_session.rb
100
91
  - lib/torquebox/messaging/connection_factory.rb
101
- - lib/torquebox/messaging/session.rb
102
- - lib/torquebox/messaging/future_responder.rb
103
- - lib/torquebox/messaging/backgroundable_processor.rb
104
- - lib/torquebox/messaging/topic.rb
105
92
  - lib/torquebox/messaging/future_status.rb
106
- - lib/torquebox/messaging/marshal_base64_message.rb
107
- - lib/torquebox/messaging/task.rb
108
- - lib/torquebox/messaging/message.rb
93
+ - lib/torquebox/messaging/xa_session.rb
94
+ - lib/torquebox/messaging/topic.rb
95
+ - lib/torquebox/messaging/message_processor.rb
109
96
  - lib/torquebox/messaging/backgroundable.rb
110
- - lib/torquebox/messaging/json_message.rb
111
- - lib/torquebox/messaging/connection.rb
97
+ - lib/torquebox/messaging/destination.rb
98
+ - lib/torquebox/messaging/backgroundable_processor.rb
99
+ - lib/torquebox/messaging/marshal_message.rb
112
100
  - lib/torquebox/messaging/xa_connection_factory.rb
113
- - lib/torquebox/messaging/message_processor.rb
101
+ - lib/torquebox/messaging/future_responder.rb
102
+ - lib/torquebox/messaging/connection.rb
103
+ - lib/torquebox/messaging/xa_connection.rb
114
104
  - lib/torquebox/messaging/core.rb
115
- - lib/torquebox/messaging/marshal_message.rb
105
+ - lib/torquebox/messaging/marshal_base64_message.rb
106
+ - lib/torquebox/messaging/message.rb
107
+ - lib/torquebox/messaging/task.rb
116
108
  - lib/torquebox/messaging/datamapper_marshaling.rb
109
+ - lib/torquebox/messaging/queue.rb
110
+ - lib/torquebox/messaging/clojure_message.rb
111
+ - lib/torquebox/messaging/text_message.rb
112
+ - lib/torquebox/messaging/processor_wrapper.rb
113
+ - lib/torquebox/messaging/json_message.rb
114
+ - lib/torquebox/messaging/const_missing.rb
115
+ - lib/torquebox/messaging/session.rb
116
+ - lib/torquebox/messaging/future.rb
117
117
  - lib/torquebox/messaging/ext/javax_jms_queue_browser.rb
118
- - spec/json_message_spec.rb
119
- - spec/future_spec.rb
120
- - spec/task_spec.rb
118
+ - spec/future_responder_spec.rb
121
119
  - spec/destination_spec.rb
122
120
  - spec/message_processor_spec.rb
123
- - spec/message_spec.rb
124
121
  - spec/backgroundable_spec.rb
122
+ - spec/future_spec.rb
123
+ - spec/task_spec.rb
124
+ - spec/message_spec.rb
125
+ - spec/json_message_spec.rb
125
126
  - spec/datamapper_marshaling_spec.rb
126
- - spec/future_responder_spec.rb
127
127
  homepage: http://torquebox.org/
128
128
  licenses:
129
129
  - lgpl
@@ -147,17 +147,17 @@ required_rubygems_version: !ruby/object:Gem::Requirement
147
147
  requirements: []
148
148
 
149
149
  rubyforge_project:
150
- rubygems_version: 1.8.15
150
+ rubygems_version: 1.8.24
151
151
  signing_key:
152
152
  specification_version: 3
153
153
  summary: TorqueBox Messaging Client
154
154
  test_files:
155
- - spec/json_message_spec.rb
156
- - spec/future_spec.rb
157
- - spec/task_spec.rb
155
+ - spec/future_responder_spec.rb
158
156
  - spec/destination_spec.rb
159
157
  - spec/message_processor_spec.rb
160
- - spec/message_spec.rb
161
158
  - spec/backgroundable_spec.rb
159
+ - spec/future_spec.rb
160
+ - spec/task_spec.rb
161
+ - spec/message_spec.rb
162
+ - spec/json_message_spec.rb
162
163
  - spec/datamapper_marshaling_spec.rb
163
- - spec/future_responder_spec.rb