Permalink
Browse files

add Trinidad as a dispatcher

  • Loading branch information...
calavera committed Oct 28, 2010
1 parent 00a926c commit 7da0115e72867272896f125698963471f21ef177
Showing with 11 additions and 3 deletions.
  1. +11 −3 lib/new_relic/local_environment.rb
@@ -205,12 +205,20 @@ def check_for_glassfish
return unless defined?(::JRuby) &&
(((com.sun.grizzly.jruby.rack.DefaultRackApplicationFactory rescue nil) &&
defined?(com::sun::grizzly::jruby::rack::DefaultRackApplicationFactory)) ||
- ((org.jruby.rack.DefaultRackApplicationFactory rescue nil) &&
- defined?(org::jruby::rack::DefaultRackApplicationFactory)) ||
- defined?(::GlassFish::Server))
+ (jruby_rack? && defined?(::GlassFish::Server)))
@dispatcher = :glassfish
end
+ def check_for_trinidad
+ return unless defined?(::JRuby) && jruby_rack? && defined?(::Trinidad::Server)
+ @dispatcher = :trinidad
+ end
+
+ def jruby_rack?
+ ((org.jruby.rack.DefaultRackApplicationFactory rescue nil) &&
+ defined?(org::jruby::rack::DefaultRackApplicationFactory))
+ end
+
def check_for_webrick
return unless defined?(::WEBrick) && defined?(::WEBrick::VERSION)
@dispatcher = :webrick

0 comments on commit 7da0115

Please sign in to comment.