Module: OpenWFE::ServiceMixin
- Includes:
- Contextual, Logging
- Included in:
- CacheExpressionStorage, ExpressionPool, HistoryMixin, InMemoryExpressionStorage, Service, YamlFileStorage
- Defined in:
- lib/openwfe/service.rb
Overview
Most of the functionalities of an OpenWFEru service are implemented here as a mixin. It’s then easy to either extend Service or include ServiceMixin, to compose an OpenWFEru service class.
Instance Attribute Summary collapse
-
#service_name ⇒ Object
The name of the service.
Attributes included from Contextual
Instance Method Summary collapse
-
#service_init(service_name, application_context) ⇒ Object
Inits the service by setting the service name and the application context.
-
#stop ⇒ Object
Some services (like the scheduler one for example) need to free some resources upon stopping.
Methods included from Contextual
#get_work_directory, #init_service, #lookup
Methods included from Logging
#ldebug, #ldebug_callstack, #lerror, #lfatal, #linfo, #llog, #lunknown, #lwarn
Instance Attribute Details
#service_name ⇒ Object
The name of the service
57 58 59 |
# File 'lib/openwfe/service.rb', line 57 def service_name @service_name end |
Instance Method Details
#service_init(service_name, application_context) ⇒ Object
Inits the service by setting the service name and the application context. Does also bind the service under the service name in the application context.
64 65 66 67 68 69 70 71 |
# File 'lib/openwfe/service.rb', line 64 def service_init (service_name, application_context) @service_name = service_name @application_context = application_context @application_context[@service_name.to_s] = self \ if @service_name and @application_context end |
#stop ⇒ Object
Some services (like the scheduler one for example) need to free some resources upon stopping. This can be achieved by overwriting this method.
78 79 |
# File 'lib/openwfe/service.rb', line 78 def stop end |