<commit_before>Service Hooks
=============

The CppMicroServices library implements the Service Hook Service
Specification Version 1.1 from OSGi Core Release 5 for C++. Below is a
summary of the concept - consult the OSGi specifications for more
details.

Service hooks provide mechanisms for bundle writers to closely interact
with the CppMicroServices service registry. These mechanisms are not
intended for use by application bundles but rather by bundles in need of
*hooking* into the service registry and modifying the behaviour of
application bundles.

Some example use cases for service hooks include:

   - Proxying of existing services by hiding the original service and 
     registering a *proxy service* with the same properties 
   - Providing services *on demand* based on registered service listeners from external bundles

Event Listener Hook
-------------------

A bundle can intercept events being delivered to other bundles by
registering a :any:`ServiceEventListenerHook <cppmicroservices::ServiceEventListenerHook>`
object as a service. The CppMicroServices library will send all service
events to all the registered hooks using the reversed ordering of their
ServiceReference objects. 

Note that event listener hooks are called
*after* the event was created, but *before* it is filtered by the optional
filter expression of the service listeners. Therefore, an event listener hook
receives all
:any:`SERVICE_REGISTERED <gr_serviceevent::SERVICE_REGISTERED>`,
:any:`SERVICE_MODIFIED <gr_serviceevent::SERVICE_MODIFIED>`,
:any:`SERVICE_UNREGISTERING <gr_serviceevent::SERVICE_UNREGISTERING>`, and
:any:`SERVICE_MODIFIED_ENDMATCH <gr_serviceevent::SERVICE_MODIFIED_ENDMATCH>`
events regardless of the presence of a service listener filter. It may
then remove bundles or specific service listeners from the
:any:`ServiceEventListenerHook::ShrinkableMapType <cppmicroservices::ServiceEventListenerHook::ShrinkableMapType>`
object passed to the
:any:`ServiceEventListenerHook::Event() <cppmicroservices::ServiceEventListenerHook::Event>`
method to hide service events.

Implementers of the Event Listener Hook must ensure that bundles
continue to see a consistent set of service events.

Find Hook
---------
<commit_msg>Fixed indentation for list block.<commit_after>Service Hooks
=============

The CppMicroServices library implements the Service Hook Service
Specification Version 1.1 from OSGi Core Release 5 for C++. Below is a
summary of the concept - consult the OSGi specifications for more
details.

Service hooks provide mechanisms for bundle writers to closely interact
with the CppMicroServices service registry. These mechanisms are not
intended for use by application bundles but rather by bundles in need of
*hooking* into the service registry and modifying the behaviour of
application bundles.

Some example use cases for service hooks include:

-  Proxying of existing services by hiding the original service and
   registering a *proxy service* with the same properties
-  Providing services *on demand* based on registered service listeners
   from external bundles

Event Listener Hook
-------------------

A bundle can intercept events being delivered to other bundles by
registering a :any:`ServiceEventListenerHook <cppmicroservices::ServiceEventListenerHook>`
object as a service. The CppMicroServices library will send all service
events to all the registered hooks using the reversed ordering of their
ServiceReference objects. 

Note that event listener hooks are called
*after* the event was created, but *before* it is filtered by the optional
filter expression of the service listeners. Therefore, an event listener hook
receives all
:any:`SERVICE_REGISTERED <gr_serviceevent::SERVICE_REGISTERED>`,
:any:`SERVICE_MODIFIED <gr_serviceevent::SERVICE_MODIFIED>`,
:any:`SERVICE_UNREGISTERING <gr_serviceevent::SERVICE_UNREGISTERING>`, and
:any:`SERVICE_MODIFIED_ENDMATCH <gr_serviceevent::SERVICE_MODIFIED_ENDMATCH>`
events regardless of the presence of a service listener filter. It may
then remove bundles or specific service listeners from the
:any:`ServiceEventListenerHook::ShrinkableMapType <cppmicroservices::ServiceEventListenerHook::ShrinkableMapType>`
object passed to the
:any:`ServiceEventListenerHook::Event() <cppmicroservices::ServiceEventListenerHook::Event>`
method to hide service events.

Implementers of the Event Listener Hook must ensure that bundles
continue to see a consistent set of service events.

Find Hook
---------

{'fraction_non_alphanumeric': 0.06348852751169526, 'fraction_numerical': 0.0013366005791935842, 'mean_word_length': 5.854961832061068, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1532384', 'n_tokens_mistral': 1098, 'n_tokens_neox': 1054, 'n_words': 516}