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
Methods included from Ref
Instance Attribute Details
#alias ⇒ Object
Returns the value of attribute alias.
45 46 47 |
# File 'lib/rex/service.rb', line 45 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.
23 24 25 |
# File 'lib/rex/service.rb', line 23 def self.hardcore_alias(*args) return "__#{args}" end |
Instance Method Details
#cleanup ⇒ Object
Calls stop on the service once the ref count drops.
41 42 43 |
# File 'lib/rex/service.rb', line 41 def cleanup stop end |
#deref ⇒ Object
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/rex/service.rb', line 27 def deref rv = super # If there's only one reference, then it's the service managers. if @_references == 1 Rex::ServiceManager.stop_service(self) end rv end |