Class: Contrast::Framework::BaseSupport
- Defined in:
- lib/contrast/framework/base_support.rb
Overview
The API for all subclasses to implement to correctly support a given framework
Direct Known Subclasses
Class Method Summary collapse
-
.after_load_patches ⇒ Set<Contrast::Agent::Patching::Policy::AfterLoadPatch>?
Some Frameworks require specific patching for their classes to handle functionality like routing.
- .application_name ⇒ Object
-
.before_load_patches! ⇒ Object
Some Frameworks require specific patching for their classes to handle functionality like configuration scanning.
-
.collect_routes ⇒ Object
Find all the predefined routes for this application and append them to the provided inventory message msg should be a Contrast::Api::Dtm::ApplicationUpdate or some other msg that has a routes array consisting of Contrast::Api::Dtm::RouteCoverage.
- .current_route ⇒ Object
-
.detection_class ⇒ Object
The top level module name used by the framework.
- .retrieve_request(_env) ⇒ Object
- .server_type ⇒ Object
-
.streaming?(_env) ⇒ Boolean
We only support websockets in rails right now, so we won’t detect streaming in any other framework.
- .version ⇒ Object
Class Method Details
.after_load_patches ⇒ Set<Contrast::Agent::Patching::Policy::AfterLoadPatch>?
Some Frameworks require specific patching for their classes to handle functionality like routing. To accommodate this, this method provides a place to register those patches for invocation in our AfterLoadPatcher flow.
By default, and hopefully in all cases, we won’t need these patches, so we’re allowing nil here rather than raising an exception.
62 |
# File 'lib/contrast/framework/base_support.rb', line 62 def after_load_patches; end |
.application_name ⇒ Object
18 19 20 |
# File 'lib/contrast/framework/base_support.rb', line 18 def application_name raise NoMethodError, 'Subclasses of BaseSupport should implement this method' end |
.before_load_patches! ⇒ Object
Some Frameworks require specific patching for their classes to handle functionality like configuration scanning. To accommodate this, this method provides a place to register those patches for invocation on Agent load.
By default, and hopefully in all cases, we won’t need these patches, so we’re allowing nil here rather than raising an exception.
49 |
# File 'lib/contrast/framework/base_support.rb', line 49 def before_load_patches!; end |
.collect_routes ⇒ Object
Find all the predefined routes for this application and append them to the provided inventory message msg should be a Contrast::Api::Dtm::ApplicationUpdate or some other msg that has a routes array consisting of Contrast::Api::Dtm::RouteCoverage
30 31 32 |
# File 'lib/contrast/framework/base_support.rb', line 30 def collect_routes raise NoMethodError, 'Subclasses of BaseSupport should implement this method' end |
.current_route ⇒ Object
34 35 36 |
# File 'lib/contrast/framework/base_support.rb', line 34 def current_route raise NoMethodError, 'Subclasses of BaseSupport should implement this method' end |
.detection_class ⇒ Object
The top level module name used by the framework
10 11 12 |
# File 'lib/contrast/framework/base_support.rb', line 10 def detection_class raise NoMethodError('Subclasses of BaseSupport should implement this method') end |
.retrieve_request(_env) ⇒ Object
38 39 40 |
# File 'lib/contrast/framework/base_support.rb', line 38 def retrieve_request _env raise NoMethodError, 'Subclasses of BaseSupport should implement this method' end |
.server_type ⇒ Object
22 23 24 |
# File 'lib/contrast/framework/base_support.rb', line 22 def server_type raise NoMethodError, 'Subclasses of BaseSupport should implement this method' end |
.streaming?(_env) ⇒ Boolean
We only support websockets in rails right now, so we won’t detect streaming in any other framework
66 67 68 |
# File 'lib/contrast/framework/base_support.rb', line 66 def streaming? _env false end |
.version ⇒ Object
14 15 16 |
# File 'lib/contrast/framework/base_support.rb', line 14 def version raise NoMethodError('Subclasses of BaseSupport should implement this method') end |