Module: Rex::Service
Overview
The service module is used to extend classes that are passed into the service manager start routine. It provides extra methods, such as reference counting, that are used to track the service instances more uniformly.
Instance Attribute Summary collapse
-
#alias ⇒ Object
Returns the value of attribute alias.
Class Method Summary collapse
-
.hardcore_alias(*args) ⇒ Object
Returns the hardcore, as in porno, alias for this service.
Instance Method Summary collapse
-
#cleanup ⇒ Object
Calls stop on the service once the ref count drops.
- #deref ⇒ Object
Instance Attribute Details
#alias ⇒ Object
Returns the value of attribute alias.
44 45 46 |
# File 'lib/rex/service.rb', line 44 def alias @alias end |
Class Method Details
.hardcore_alias(*args) ⇒ Object
Returns the hardcore, as in porno, alias for this service. This is used by the service manager to manage singleton services.
21 22 23 |
# File 'lib/rex/service.rb', line 21 def self.hardcore_alias(*args) return "__#{args}" end |
Instance Method Details
#cleanup ⇒ Object
Calls stop on the service once the ref count drops.
40 41 42 |
# File 'lib/rex/service.rb', line 40 def cleanup stop end |
#deref ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/rex/service.rb', line 25 def deref rv = super # If there's only one reference, then it's the service managers. if @_references == 1 Rex::ServiceManager.stop_service(self) return true end rv end |