diff --git a/text/0003-declarative-services.md b/text/0003-declarative-services.md index e985f56..158bbf8 100644 --- a/text/0003-declarative-services.md +++ b/text/0003-declarative-services.md @@ -115,6 +115,8 @@ time to auto-generate code included in the bundle. Both the declared metadata and the auto generated code are utilized by the implemented bundle at runtime to manage services on behalf of the client bundles. +Configuration Properties for the managed services are initialized and updated +according to the OSGI ConfigurationAdmin specification. ## Requirements Analysis @@ -154,6 +156,23 @@ bundle at runtime to manage services on behalf of the client bundles.
  • Create scalable, extensible and reactive systems
  • + +

    3

    +

    High

    +

    Advanced User

    +

    What: Create a service that can receive configuration properties at activation through constructor injection.
    +Why: +Prevent activation of a service until its configuration object is available. + + +

    4

    +

    High

    +

    Advanced User

    +

    What: Create a service that can receive updated configuration properties after activation without having to be deactivated and reactivated.
    +Why:Update the service properties of a service after the service has been activated.

    + + @@ -250,6 +269,35 @@ create a CppMicroService bundle with the following workflow. 3. The action could be as simple as constructing a new service object by passing tracked service dependencies as constructor arguments. +#### UC5: Service Requiring Configuration Properties to be Updated After Activation + +##### User Role and Goal + +Chuck is a service author responsible for providing users with a Virtual File System. Users can store their files with different online providers. Chuck would like the VFS service to start up without configuration information and for the configuration information (like the particular online provider the user would like to use) to be provided later after the user logs in. Chuck needs a way to update the service properties after the service has been activated. Chuck's service is a DS service so without Configuration Admin functionality there is no way for Chuck to update the service properties after activation because he doesn't have access to the service registration object. To solve this problem Chuck has developed a workaround. He has created callbacks in the VFS service that can be called by the login service to update properties. (PP6) Since he doesn't have access to the service registration object he has to maintain a copy of the service properties in the login service. (PP7) + +#### UC6: Service With Dependency on Configuration Object + +##### User Role and Goal + +Andy has developed an application that reads command line arguments and uses those inputs to update the service properties of several services at startup. The services for which properties are being updated are DS services that may have already been activated. Andy doesn't have a way to update the services after activation because he doesn't have access to the service registration object for those services. Also Andy doesn't have any way of preventing a service from being activated before its service properties are available. (PP8) Andy would like services who need startup configuration to be able to specify a dependency on the startup configuration object so they wouldn't be activated until after their configuration properties were available. + +##### Current workflow: + +1. Create an Activator with a BundleActivator class to publish a + service that provides business functionality. (**PP1**) +2. Add a Service Listener to keep track of the target services + (**PP1**, **PP2**) the extender is interested in + - When a target service becomes available, push it onto a list and + perform an appropriate action (**PP5**). + - When a target service becomes unavailable, remove it from the + tracked list and perform an appropriate action (**PP5**). +3. The action could be as simple as constructing a new service object + by passing tracked service dependencies as constructor arguments. +4. Add methods to the public API of services to enable configuration + information to be changed after activation. (PP6,PP8) Maintain a copy + of the configuration information for each service that requires + an update (PP7). + ### Pain Point Summary PP1: Using the framework requires the developers to write boilerplate @@ -265,6 +313,18 @@ bundle unaware of the service providers and consumer bundles. PP5: Service consumers have to write non-trivial code to respond to the dynamic availability of service dependencies. +PP6: Adding callback methods to the public API for a service so that the +service properties can be updated after activation makes the public API +messy and confusing. +PP7: Maintaining a copy of the service properties in a service or application +is error prone and means those updated properties are unavailable to other +services or applications. The only way to solve this would be to add new +public APIs to the service which could violate the single responsibility +principle (from SOLID principles). +PP8: Preventing a service from activating until the configuration object +is available could be accomplished by introducing a configuration +interface which the service depends on. Would need one of these for every +service. Unnecessary complication. ### Requirements @@ -282,6 +342,12 @@ dependencies. | R10\_Decoupled | Decoupled from the core CppMicroServices framework. No requirements imposed on the framework. | OSGi requires that features mentioned in the OSGi compendium specification are implemented as a layer of abstraction on top of the framework, without breaking any existing framework functionality | Must Have | | R11\_Linker | The solution must not rely on the native dynamic linker for dependency analysis, nor should it interfere with the dynamic loader's functionality. | One of the fundamental design principle for native OSGi implementation. Linker information embedded in the shared library is not only platform specific, it could vary on the same platform based on the toolchain used. This increases our system complexity by introducing a third party dependency into our runtime. | Must Have | | R12\_Backwards\_Compatibility | Service Providers using Declarative Service should have no affect on Service Consumers using the core framework. | OSGi requires that features mentioned in the OSGi compendium specification are implemented as a layer of abstraction on top of the framework, without breaking any existing framework functionality | Must Have | +| R13\_Constructor\_Injection | Provide a service's configuration using the service implementation's constructor when the service is activated. | PP6 | Must Have | +| R14\_Update\_Configuration | Update a service's configuration after the service is activated without deactivating and reactivating the service. This requires that the service author provide a "Modified" method that can be called by DS while the service is active to update configuration. | PP6,PP7 | Must Have | +| R15\_Config\_Dependency |Implement the configuration-policy feature. This controls whether service activation is dependent on configuration objects. | | Must Have | +| R16\_Multiple\_Config |Services may be dependent on more than one configuration. | PP8 | Must Have | +| R17\_Factory\_Pids |The solution should support factory PIDS when configuration information is needed for services that can be instantiated multiple times. | | Must Have | +| R18\_Update\_Notification |Notify user application that the configuration changes they have requested have been applied to the service. | | Must Have | #### Requirements Delivery for this iteration @@ -292,11 +358,17 @@ dependencies. * R5_Lazy_Instantiation * R6_Dependency_Count * R7_Introspection -* R9_Dependency_Information_Visibility -* R10_OSGi_Spec -* R11_Decoupled -* R12_Linker -* R13_Backwards_Compatibility +* R8_Dynamic_Rebinding +* R9_OSGi_Spec +* R10_Decoupled +* R11_Linker +* R12_Backwards_Compatibility +* R13_Constructor_Injection +* R14_Update_Configuration +* R15_Config_Dependency +* R16_Multiple_Config +* R17_Factory_Pids +* R18_Update_Notification ## Functional Design @@ -306,14 +378,13 @@ The design proposed in this section simplifies authoring services for microservices developers. They will be able to implement their business logic as services and declare service information in the bundle's metadata. Operations such as service registration, lookup, and -dependency management are automatically handled, freeing up the -developer to focus on the business logic. +service dependency management and configuration property management are +automatically handled, freeing up the developer to focus on the business logic. ### Main Functional Design Description The proposed design implements a service component model, as described -in the [OSGi Declarative Services -specification](https://osgi.org/download/r6/osgi.cmpn-6.0.0.pdf#page=289). +in the [OSGi Declarative Services specification](https://osgi.org/download/r6/osgi.cmpn-6.0.0.pdf#page=289). A service component model uses a declarative model for publishing, finding and binding to services. This model simplifies the task of authoring services by performing the work of registering the service and @@ -321,6 +392,9 @@ handling service dependencies. This minimizes the amount of code a programmer has to write; it also allows lazy loading of bundle code and lazy instantiation of service implementations. +The proposed design manages configuration properties for services by +implmenting the functionality described in the [OSGI Configuration Admin specification](http://docs.osgi.org/specification/osgi.cmpn/7.0.0/service.cm.html). + A Service Component is the basic building block of the service component model. A service component contains a description and an implementation. The information in the description is interpreted at runtime to track @@ -348,11 +422,12 @@ component is contained within the life cycle of the bundle it is contained in. Components can be created, satisfied and activated only when they are enabled. -A service component becomes satisfied when all its service dependencies -become available in the framework. Once the service component is -satisfied, if the component description specifies that it provides a -service, the component is registered with the framework and the -component state is set to "REGISTERED". If the component type is +A service component becomes satisfied when all its dependencies +become available in the framework. Dependencies include +dependencies on other services and dependencies on configuration objects. +Once the service component is satisfied, if the component description +specifies that it provides a service, the component is registered with the +framework and the component state is set to "REGISTERED". If the component type is "immediate", the component is activated as soon as the registration is finished. If the component type is "delayed", the component is not activated until a call to GetService is received. An instance of the @@ -409,6 +484,10 @@ elements of a JSON object representing the service component: |service|map|A JSON object in the format described in the service element specification below.|No|null object| |references|array|An array of JSON objects, each object in the format described in the references element specification below.|No|null object| |inject-references|bool|A value indicating whether the references need to be injected into the component instance. Valid values are
    false - References are not injected into the instance, however, they are available through the lookup strategy if the instance needs to retrieve them. See LocateService(s) API on ComponentContext class.
    true - References are injected using constructor injection. See Constructor Injection. If the "policy" key of the reference is "dynamic, then Bind/Unbind methods of the reference are also used. The convention for the methods is "Bind" & "Unbind", where ReferenceName is the value specified by the "name" key. See Dependency Injection|No|true| +|configuration-policy|string|Controls whether component configurations must be satisfied depending on the presence of a corresponding Configuration object in Configuration Admin service. A corresponding configuration is a Configuration object where the Persistent Identity (PID) is the name of the component. Valid values are
    optional - Use the corresponding Configuration object if present but allow the component to be satisfied even if the corresponding Configuration object is not present.
    require - There must be a corresponding Configuration object for the component configuration to become satisfied.
    ignore - Always allow the component configuration to be satisfied and do not use the corresponding Configuration object even if it is present|No|"ignore". Note: the OSGI spec specifies a default value of "optional" for configuration-policy but for backwards compatibility reasons, a default of "ignore" has been implemented.| +|configuration-pid|array|An array of configuration PIDs to be used for the component in conjunction with Configuration Admin. |No|None| +|factory|string|If set to a non-empty string, it indicates that this component is a factory component. This attribute is the factory id for the factory component. This identifier can be used by a bundle to associate the factory with externally defined information.|No|Empty string| +|factory-properties|object|These are only used for factory components. These are the service properties that will be registered for the factory component.|No|For factory components, DS adds:
    component.name-component name
    component.factory-component factory id| **service** The service element is a child of the component object and describes the @@ -574,6 +653,29 @@ See Dep "properties": {}, "type": "object" }, + "configuration-policy": { + "default": "ignore", + "id": "/properties/scr/properties/components/items/properties/configuration-policy", + "type": "string" + }, + "configuration-pid": { + "id": "/properties/scr/properties/components/items/properties/configuration-pid", + "items": { + "id": "/properties/scr/properties/components/items/properties/configuration-pid/items", + "type": "string" + }, + "type": "array" + }, + "factory": { + "default": "", + "id": "/properties/scr/properties/components/items/properties/factory", + "type": "string" + }, + "factory-properties": { + "id": "/properties/scr/properties/components/items/properties/factory-properties", + "factory-properties": {}, + "type": "object" + }, "references": { "id": "/properties/scr/properties/components/items/properties/references", "items": { @@ -688,10 +790,16 @@ schema: "immediate": true, // specifies the component type "enabled": true, // Specifies if the component is default enabled "implementation-class": "sample::impl::LogLookupImpl", // Specifies the fully qualified name of the implementation class - "properties": { // Specifies the custome properties for the service component + "properties": { // Specifies the custom properties for the service component "Service.description": "Sample Service", "Service.vendor": "Foo Inc" }, + "configuration-policy": "optional", // Specifies the configuration policy + "configuration-pid": ["sample.foo","sample.bar"], // List of configuration objects on which the component is dependent + "factory" : "factory id", // Indicates this is a factory component + "factory-properties" : { // Specifies the custom properties for the factory component + "abc" : "123" + }, "service": { // Specifies the information needed for service registration "scope": "singleton", // Specifies the scope of the registered service "interfaces": ["cpp::util::Comparator"] // Specifies the list of interfaces used to register the service @@ -750,6 +858,25 @@ If the deactivate method throws an exception, SCR will log an error message containing the exception and the deactivation of the component configuration will continue. +##### Modified Method + +The service component implementation class can implement a Modified +method with the following signature to receive a callback +when the component's configuration properties change.The component instance +receives its component context object as an argument to the callback +methods. + +Method signature + +``` cpp +void Modified(const std::shared_ptr& context, const std::shared_ptr& configuration); +``` + +Exception handling +If a Modified method throws an exception, DS will log an error message containing the +exception to the Log Service, deactivate the component and reactivate it with +the new configuration. + #### Component Context A Component Context object is used by a component instance to interact @@ -860,15 +987,29 @@ the component is deactivated will result in a std::runtime\_exception. A service component can opt into the dependency injection mechanism by setting the value for "inject-references" key in the component description to true (Note that this is the default behavior). If the -value for "inject-references" is true, all references are injected into -the component instance and if the value is false, none of the references +value for "inject-references" is true, all service references are injected into +the component instance and if the value is false, none of the service references are injected. +A service component can also opt into injection of configuration properties +into the component instance. +* If the configuration-policy is "require" then the all of the configuration +properties for the configuration objects listed in the configuration-pid +attribute will be injected into the component instance. +* If the configuration-policy is "optional" all of the configuration properties for +the configuration objects listed in the configuration-pid attribute which +happen to be available when the service component becomes satisfied will be +injected into the component instance. +* If the configuration-policy is "ignore", no configuration properties will +be injected into the component instance. + If the value for "inject-references" is true, the following is a sequence of calls received by a service component instance during a component activation: -* Constructor with references as arguments is called. Refer to the +* Constructor with references as arguments is called. If configuration +properties are also being injected the constructor will include +the configuration property argument. Refer to the [\#Constructor Injection](#Constructor_Injection "wikilink") section * "Activate" method is invoked. @@ -881,7 +1022,9 @@ However, If the value for "inject-references" is false, the following is a sequence of calls received by a service component instance during a component activation: -* Default constructor +* Default constructor unless configuration properties are being injected. In +that case the constructor with the configuration property argument will be +called. * "Activate" method is invoked @@ -908,12 +1051,76 @@ component description, the constructor must look like the following: ``` cpp public: - ServiceComponentImpl(const std::shared_ptr& bar, const std::shared_ptr& baz) : + ServiceComponentImpl(const std::shared_ptr& bar, const std::shared_ptr& baz) : + mBar(bar), + mBaz(baz) + {} +``` +If configuration properties are also being injected then the configuration +property argument precedes the references as follows: + +``` cpp +public: + ServiceComponentImpl(const std::shared_ptr& config,const std::shared_ptr& bar, const std::shared_ptr& baz) : + mconfig(config), mBar(bar), mBaz(baz) {} ``` +If the *inject-references* element is set to false in the component +description but the configuration properties are being injected then +the component instance must implement a constructor that takes in the +configuration property argument as follows: +``` cpp +public: + ServiceComponentImpl(const std::shared_ptr& config) : + mconfig(config) + {} +``` +A service could be dependent on more than one configuration object. +The AnyMap input parameter that is passed to the constructor is a merged map +that contains all the configuration information from all of the configuration +objects on which the service is dependent and which also includes the +component properties. If a property in one configuration object has the same +name as a property in another configuration object or the same name as one +of the component properties then the following precedence applies (listed +from highest precedence to lowest) + + - properties retrieved from Configuration Admin. If more than one + configuration object is retrieved from Configuration Admin then the + precedence is determined by the order in which they appeared in the + configuration-pid attribute. The first item in the configuration-pid + list has the lowest precedence. + - properties specified in the component description. Only user defined + properties in the component element are configuration properties that + may appear in a configuration object. + +We don't have a use case for the items on the following list to be included +in a configuration object. In the future if a use case presents itself, +these properties may be added to the list of properties that may be included +in a configuration object. For now they may not appear in a configuration object. + + - references target property - a filter expression that constrains the set + of target services that may satisfy this dependency. + - references cardinality property - Can be used to raise the minimum + cardinality of a reference from it's initial value. 0..1 can be raised + to a 1..1. We do not currently support higher levels of cardinality. + - reference policy-option - greedy or reluctant + +The following items in the component element may not appear in a configuration +object. These attributes cannot be changed without a rebuild. + + - name + - implementation-class + - enabled + - immediate + - factory + - configuration-policy, configuration-pid + - reference element (name, interface, cardinality, policy, policy option, target, scope, bind,unbind, updated, etc) + - service element (scope, interface) + - activate, activation-fields, init,deactivate, modified + #### Bind & Unbind Callbacks If the *inject-references* element is set to true in the component @@ -1214,7 +1421,116 @@ descriptions. void UnbindReference(const std::string& name, const ServiceReferenceBase& sRef) ``` +#### ConfigurationListener Interface + +Configuration Admin can update interested parties of changes in its repository. Configuration +Listener services are registered with the service registry. + +There are two types of Configuration Listener services: + + - ConfigurationListener - The default Configuration Listener receives events + asynchronously from the method that initiated the event and on another thread. + - Synchronous ConfigurationListener - A Synchronous Configuration Listener is + guaranteed to be called on the same thread as the method call that initiated the event. + +DS only registers a ConfigurationListener at this time. No support is provided for the +Synchronous ConfigurationListener. +The Configuration Listener service will receive ConfigurationEvent objects if important +changes take place. Configuration Admin calls the configurationEvent method for all +ConfigurationListeners for all changes to the repository. It is up to the ConfigurationListener +to determine if this event requires action. DS maintains a listenersMap which contains a callback +method for each pid that components it is managing are dependent upon. When DS starts a bundle +it registers the pids each component is dependent upon in the listenersMap. When a configurationEvent +is received DS searches its listenersMap to determine if the pid is one for which action is required. + +ConfigurationListener class + ```cpp +enum class ConfigurationEventType +{ +/* The ConfigurationEvent type for when a Configuration object has been +* updated +*/ +CM_UPDATED = 1, + +/* The ConfigurationEvent type for when a Configuration object has been +* removed +*/ + +CM_DELETED = 2 +}; + +/** +* The ConfigurationEvent object is passed to the ConfigurationListener when +* the configuration for any service is updated or removed by ConfigurationAdmin +*/ +class ConfigurationEvent +{ +public: +ConfigurationEvent(const ServiceReference configAdmin, +const ConfigurationEventType type, +const std::string factoryPid, +const std::string pid) +: configAdmin(std::move(configAdmin)) +, type(type) +, factoryPid(std::move(factoryPid)) +, pid(std::move(pid)) +{} + +/** +* Get the ServiceReference object of the Configuration Admin Service that created +* this event. +*/ +const ServiceReference& getReference() const { return configAdmin; } +/** +* Get the PID of this ConfigurationEvent. +*/ +const std::string& getPid() const { return pid; } +/** +* Get the Factory PID which is responsible for this Configuration. +*/ +const std::string& getFactoryPid() const { return factoryPid; } +/** +* Get the type of this Configuration. +*/ +ConfigurationEventType getType() const { return type; } + +private: +const ServiceReference configAdmin; +const ConfigurationEventType type; +const std::string factoryPid; +const std::string pid; +}; +/** +* The ConfigurationListener interface is the interface that services should implement +* to receive updates from the ConfigurationAdmin implementation for all configuration +* updates. This interface is used by Declarative Services to receive updates to +* configuration objects for services that are managed by DS. +*/ +class ConfigurationListener +{ +public: +/** +* Called whenever the Configuration for any service is updated or removed from ConfigurationAdmin, +* and when the ConfigurationListener is first registered with the Framework, to provide the initial Configuration. +*/ +virtual void configurationEvent(const ConfigurationEvent& event) noexcept = 0; +virtual ~ConfigurationListener() = default; +}; + ``` +The ConfigurationEvent input parameter in the configurationEvent method has: + + - configAdmin is the service reference for the ConfigurationAdmin service that generated the + ConfigurationEvent. + - type: + - CM_DELETED - the configuration object has been deleted. + - CM_UPDATED - the configuration object has been removed. + - CM_LOCATION_CHANGED (out of scope. No support provided) + - factoryPid - The factory pid for the configuration object which has changed. Takes the form - factorycomponentname~instancename. This field must be null if pid is not null. + - pid - The Persistent Identity (pid) for the configuration object which has changed. Will + be null if the factoryPid is not null. + +Both factoryPid and pid cannot be null. ### Design Cases ##### DC1 : Service provider bundle @@ -1395,7 +1711,132 @@ The following requirements are satisfied: } } ``` +##### DC5 : Service provider bundle with Configuration dependency + +###### Proposed Workflow + +1. Add a CMakeList.txt file with the following content + `usFunctionCreateDeclarativeServicesBundleWithResources(Foo SOURCES Foo.cpp RESOURCES manifest.json)` + +2. Remove the bundle activators. + +3. The service component description to the bundle's manifest.json file would resemble something like the following: + +``` json +{ + "scr": { + "version": 1, + "components": [{ + "enabled": true, + "immediate": true, + "implementation-class": "Foo::FooImpl", + "configuration-policy": "require", + "configuration-pid": [ "startup.configuration" ], + "service": { + "interfaces": ["test::CAInterface"] + } + }] + } +} +``` +The .hpp file for Foo::FooImpl could have the following elements. Note the constructor +with the AnyMap input parameter which enables injection of the configuration properties. +``` cpp +#ifndef _FOO_FOOIMPL_HPP_ +#define _FOO_FOOIMPL_HPP_ + +#include "TestInterfaces/Interfaces.hpp" +#include "cppmicroservices/servicecomponent/ComponentContext.hpp" +#include + +using ComponentContext = cppmicroservices::service::component::ComponentContext; + +namespace Foo{ + class FooImpl : public test::CAInterface + { + public: + FooImpl(const std::shared_ptr& props) + : properties(props) + {} + void Modified(const std::shared_ptr& context, + const std::shared_ptr& configuration); + ~FooImpl() = default; + + private: + std::mutex propertiesLock; + std::shared_ptr properties; + }; +} // namespace Foo + +#endif // _FOO_FOOIMPL_HPP_ +``` +The .cpp file for Foo::FooImpl could have the following elements. Note the Modified method +with the AnyMap input parameter which enables updates of configuration properties for the +component instance without activating and deactivating the component. + +``` cpp +#include "FooImpl.hpp" +#include + +namespace Foo{ + +void FooImpl::Modified( + const std::shared_ptr& /*context*/, + const std::shared_ptr& configuration) +{ + std::lock_guard lock(propertiesLock); + properties = configuration; +} + +} //namespace Foo +``` +To create an instance of the component the application author will create an AnyMap +with the configuration properties for the startup.configuration object and create the +Configuration object in ConfigAdmin as follows: + +``` cpp +//configAdmin variable in this example contains a reference to the Configuration Admin Service.// +//Start Foo (details not shown). After starting the bundle the +// DS state will be UNSATISFIED_REFERENCES. DS has not constructed the Foo::FooImpl service +// because it is not satisfied. It is waiting for the startup.configuration +// configuration object to become available. + +// Create an AnyMap with one or more properties +cppmicroservices::AnyMap props(cppmicroservices::AnyMap::UNORDERED_MAP_CASEINSENSITIVE_KEYS); +const std::string startupProp1Value { "startupProp1Value" }; +props["startupProp1"] = startupProp1Value; + +// GetConfiguration gets an empty configuration object. No notification is sent to DS as a result of this call. +auto configuration = configAdmin->GetConfiguration("startup.configuration"); + +// The Update method updates the startup.configuration object with the startupProp1 property. A notification +// is sent to DS telling DS that the startup.configuration object has been updated. +configuration->Update(props); +``` +After the execution of the Update method in the previous code snippet, Foo::FooImpl is in the ACTIVE state. +The constructor was called with an AnyMap input parameter containing: + + - the component properties. None were included in the manifest.json file but DS always adds component.name + and component.id + - component.name = Foo::FooImpl + - component.id = unique id created by DS. + - startup.configuration properties (startupProp1 in this example). + The Service Registration properties in the framework have also been updated with the same 3 properties. + +###### Notes + +The following requirements are satisfied: + +1. R13\_Constructor\_Injection : Provide a service's configuration using the service + implementation's constructor when the service is activated. +2. R14\_Update\_Configuration : Update a service's configuration after the service is + activated without deactivating and reactivating the service. This requires that the + service author provide a "Modified" method that can be called by DS while the service + is active to update configuration. +3. R15\_Config\_Dependency : Implement the configuration-policy feature. This controls + whether service activation is dependent on configuration objects. + | ### Special Considerations #### Compatibility @@ -1493,6 +1934,26 @@ bundles. +#### Configuration Admin Interaction + +DS handles configuration object dependencies much the same way that it handles service +reference dependencies for the component. A service with service reference dependencies +will not be satisfied until all of the service references are satisfied. A service with +configuration object dependencies will not be satisfied until all of its configuration +objects are available. A component with configuration object dependencies will not be +registered until all of those configuration objects are available and all of it's service +references are satisfied. Changes to configuration objects on which the component is dependent +can result in the component becoming unsatisfied just like changes to the service references +can result in a component becoming unsatisfied. + +DS implements a ConfigurationListener interface in order to receive updates from ConfigurationAdmin +when configuration objects change. Configuration Admin calls the configurationEvent method +of the ConfigurationListener interface when a configuration object is deleted or updated. When +DS receives the configurationEvent it determines if this event affects any of the service components +that DS is managing and if so, processes the configuration object change. This could mean updating +the component using the component's Modified method or deactivating and reactivating the component +if no Modified method is provided. + #### Lazy Loading and Instantiation of Service objects DS supports lazy loading of the bundle binary and lazy instantiation of @@ -1596,7 +2057,7 @@ is failed and a nullptr is returned to the service consumer. ### Functional Units -The following diagram shows the functional units inside the declarative +The following two diagrams show the functional units inside the declarative services runtime bundle and their interaction with the external components @@ -1605,10 +2066,18 @@ components +The following diagram shows the functional units inside the declarative +services runtime bundle that interact with Configuration Admin + + + + - BundleActivator: This unit receives the start and stop calls from the framework when the DS bundle is started and stopped. The unit is - responsible for setting up and tearing down the DS runtime system. + responsible for setting up and tearing down the DS runtime system + including creating the ConfigurationNotifier object and registering + the ConfigurationListener interface with Configuration Admin. - BundleListener: This unit receives the bundle events from the framework when any bundle is installed, started, stopped, or uninstalled in the framework. The unit is responsible for creating @@ -1635,7 +2104,25 @@ components machine using the state design pattern. All access to data from this object is through the state object associated with this object. The state transition is atomic and includes the side effects of the - state transition. + state transition. This unit is responsible for registering a callback + function (ConfigChangedState) with ConfigurationNotifier for each + configuration object on which it is dependent. ConfigurationNotifier + will call these callback functions when ConfigurationAdmin notifies + ConfigurationListener that a configuration object has been  updated + or deleted.  + - ConfigurationListener: Receives configurationEvent notifications from + ConfigurationAdmin whenever a configuration object is updated or deleted. + ConfigurationListener notifies ConfigurationNotifier who then determines + whether or not this is an event for which it has a listener and if so calls + the callback function to send the notification of the changed configuration + object. The configurationEvent method does not return to the caller until + all of it's processing is complete. If the change to the configuration object + results in the Modified method in the component instance being called the + Modified method has already been called when the configurationEvent method + returns. The configurationEvent method is threadsafe and may be called by more + than one thread simultaneously. All exceptions will be trapped and logged.  + - ConfigurationManager: Manages the properties for the component and determines + whether or not the configuration object dependencies are satisfied.  - ReferenceManager: This unit tracks a dependency of the component by implementing the ServiceTracker interface. All data access is protected by a mutex. No locks are held while calls to notify the @@ -1677,6 +2164,11 @@ changes 5. Create and destroy the task queue and dedicated thread used for serving the enable and disable requests from the ServiceComponentRuntime service. +6. Create the ConfigurationNotifier object. Only one ConfigurationNotifier + object is created. This object contains a map of all listeners of configuration + object changes. +7. Publish the ConfigurationListener interface to receive update notifications + from Configuration Admin. **Concurrency Note** @@ -1701,6 +2193,12 @@ description found in the bundle. 2. Populate the shared ComponentRegistry with the ComponentManager objects +3. Parse the manifest.json attributes including configuration-policy, + configuration-pid, factory and factory-properties. Both the + configuration-policy and configuration-pid must be present if + either of them is present. If only one is present, the + configuration policy is set to "ignore". + **Concurrency Note** @@ -1833,18 +2331,55 @@ service. component configuration 3. Implement the ServiceFactory interface to facilitate lazy loading of the bundle binary and lazy instantiation of the service object. +4. Manage the Configuration object dependencies when deciding if a component is satisfied + or not. A component with configuration-policy = "require" for example will have one or + more configuration object dependencies that must be satisfied before the component can + be satisfied. A Configuration object dependency is satisfied if the Configuration object + exists in the ConfigurationAdmin repository. **Concurrency Note:** 1. State transitions are atomic, so there is no interleaving of transition methods. -2. A class named TransitionState is used to indicate the state - transition is in progress. Any operations performed on the - transition state are deletegated to the next stable state. See - [state transition - algorithm](Declarative_Services_RFA#State_Transition_Algorithm "wikilink") - for more details about state transitions. + + +#### ConfigurationManager +**Responsibilities:** +1. Keep merged configuration properties up to date. + +2. Determine if the configuration object dependencies are satisfied. + +**Concurrency Note:** + + +1. Access to the configuration properties is protected by a lock. + + +#### ConfigurationNotifier +**Responsibilities:** +1. Maintains a listenersMap for each configuration object on which any component + is dependent. More than one component may be listening for changes to the same + configuration object. The listenersMap is keyed according to pid. +**Concurrency Note:** + + +1. Access to the listenersMap is protected by a lock. + + +#### ConfigurationListener +**Responsibilities:** +1. Receives UPDATE and DELETED notifications from Configuration Admin when + configuration objects are updated or deleted. + +2. Determines if there are any components listening for updates to this pid and + calls the registered callback if so. + +**Concurrency Note:** + + +1. This class is threadsafe. + #### ReferenceManager @@ -1964,7 +2499,7 @@ system. - + @@ -1972,7 +2507,7 @@ system. - + @@ -1980,7 +2515,7 @@ system. - + @@ -1988,7 +2523,7 @@ system. - + @@ -1996,7 +2531,7 @@ system. - + @@ -2004,7 +2539,7 @@ system. - + @@ -2012,10 +2547,32 @@ system. - + + + + +#### Component is active, configuration object is updated +The following diagram illustrates what happens when a component that is currently active +receives notification of an updated configuration object on which it is dependent. +ComponentConfiguration will call the Modify method of the Component Instance if it's +available (9.1). If the Modify method is not available, it will deactivate and +reactivate the component (9.2).  + + + + +#### Component is active, configuration object is deleted +The following diagram illustrates what happens when a component that is currently +active receives notification of a deleted configuration object on which it is +dependent. The component is no longer satisfied. + + + + + ### Sequence Diagrams The following diagrams show the control flow for various events in @@ -2081,7 +2638,7 @@ SCR. - + @@ -2089,15 +2646,23 @@ SCR. - + -##### ComponentConfiguration::Resolve +##### ComponentConfiguration::CreateConfigurationManager + + + + + + + +##### ComponentConfiguration::Initialize - + @@ -2105,7 +2670,39 @@ SCR. - + + + + +##### ComponentConfiguration::Rebind + + + + + + + +##### ComponentConfiguration::RefChangedState Satisfied + + + + + + + +##### ComponentConfiguration::RefChangedState Unsatisfied + + + + + + + +##### ComponentConfiguration::Resolve + + + + @@ -2113,7 +2710,7 @@ SCR. - + @@ -2121,15 +2718,31 @@ SCR. - + + + + +##### ActiveState::Activate + + + + + + + +##### ConfigurationListener::configurationEvent(CM_UPDATED) + + + + -##### SatisfiedState::DoActivate +##### ConfigurationListener::configurationEvent(CM_DELETED) - + @@ -2137,7 +2750,7 @@ SCR. - + @@ -2145,7 +2758,7 @@ SCR. - + @@ -2153,27 +2766,59 @@ SCR. - + + + + +##### ReferenceManager::AddingService Static + + + + + + + +##### ReferenceManager::AddingService Static Reluctant + + + + + + + +##### ReferenceManager::AddingService Static Greedy + + + + + + + +##### ReferenceManager::AddingService Dynamic + + + + -##### ReferenceManager::AddingService +##### ReferenceManager::RemovedService Static - + -##### ReferenceManager::RemovedService +##### ReferenceManager::RemovedService Dynamic - + -### Code Generation Tool +#### Code Generation Tool As described in the functional design, a code generator is used to generate runtime discoverable extern “C” functions at build time. The diff --git a/text/0003-declarative-services/ActiveStateActivate.svg b/text/0003-declarative-services/ActiveStateActivate.svg new file mode 100644 index 0000000..540068b --- /dev/null +++ b/text/0003-declarative-services/ActiveStateActivate.svg @@ -0,0 +1,3 @@ + + +
    Component
     Configuration
    Component...
    ActiveState::Activate
    ActiveState::Activate
    Activate
    Activate
    ActiveState
    ActiveState
    latch.Countup
    latch.Countup
    true
    true
    CreateAndActivateComponentInstance
    CreateAndActivateComponentInstance
    true/false
    true/false
    ComponentContextImpl
    ComponentContextImpl
    ReferenceManager
    ReferenceManager
    CreateInstanceAndBindReferences
    CreateInstanceAndBindReferences
    Activate
    Activate
    DoActivate
    DoActivate
    RegisteredState
    RegisteredState
    ComponentInstance
    ComponentInstance
    ConstructComponentContextImpl
    ConstructComponentContextI...
    GetAllDependencyManagers
    GetAllDependencyManagers
    ComponentInstanceImpl
    autogenerated
    ComponentInstanceImpl...
    GetBoundReferences
    GetBoundReferences
    reference managers
    reference managers
    bound references
    bound reference...
    GetService
    GetService
    ComponentContextImpl
    ComponentContextImpl
    false
    false
    Component Instance
    Component Instance
    nullptr
    nullptr
    Create Component Instance using extern C method
    Create Component Instance using extern C...
    for each service reference
    for each service refe...
    loop
    loop
    DoCreate
    DoCreate
    Component Instance
    Component Instance
    ServiceImpl
    handwritten
    ServiceImpl...
    bind
    bind
    Activate
    Activate
    Client bundle
    Client bundle
    Component
     Configuration
    Component...
    ActiveState
    ActiveState
    ComponentContextImpl
    ComponentContextImpl
    ReferenceManager
    ReferenceManager
    RegisteredState
    RegisteredState
    ComponentInstanceImpl
    autogenerated
    ComponentInstanceImpl...
    ServiceImpl
    handwritten
    ServiceImpl...
    for each bound  reference
    for each bound  reference
    loop
    loop
    for each manager
    for each manager
    loop
    loop
    opt
    opt
    Viewer does not support full SVG 1.1
    \ No newline at end of file diff --git a/text/0003-declarative-services/ComponentConfigurationCreateConfigurationManager.svg b/text/0003-declarative-services/ComponentConfigurationCreateConfigurationManager.svg new file mode 100644 index 0000000..fe263a2 --- /dev/null +++ b/text/0003-declarative-services/ComponentConfigurationCreateConfigurationManager.svg @@ -0,0 +1,3 @@ + + +
    opt
    opt
    ComponentConfiguration
    ComponentConfiguration
    ComponentConfigurationFactory::CreateConfigurationManager
    ComponentConfigurationFactory::CreateConfigurationManager
    ActiveState
    ActiveState
    RegisteredState
    RegisteredState
    UnsatisfiedReferenceState
    UnsatisfiedReferenceState
    EnabledState
    EnabledState
    ComponentConfiguration
    ComponentConfigura...
    ActiveState
    ActiveState
    RegisteredState
    RegisteredState
    UnsatisfiedReferenceState
    UnsatisfiedReferenceState
    DisabledState
    DisabledState
    See sequence diagram for CCUnsatisfiedReferenceState::Register 
    See sequence diagram for CCU...
    CreateConfiguration
    Manager
    Create...
    no reference or configuration object dependencies
    no reference or configuration object dependencies
    Register
    Regist...
    state = ActiveState
    state = ActiveState
    no-op
    no-op
    state = RegisteredState
    state = RegisteredSta...
    no-op
    no-op
    state = UnsatisfiedReference State 
    state = UnsatisfiedReference Stat...
    Register
    Regist...
    dependencies exist
    dependencies exist
    See sequence diagram for ComponentConfigurationImpl::Initialize
    See sequence diagram for Com...
    Register
    Register
    opt
    opt
    Note: Don't have to deal with the DisabledState here because the CreateConfigurationManager is only called from the EnabledState 
    Note: Don't have to deal with the DisabledState...
    Viewer does not support full SVG 1.1
    \ No newline at end of file diff --git a/text/0003-declarative-services/ComponentConfigurationInitialize.svg b/text/0003-declarative-services/ComponentConfigurationInitialize.svg new file mode 100644 index 0000000..c66930d --- /dev/null +++ b/text/0003-declarative-services/ComponentConfigurationInitialize.svg @@ -0,0 +1,3 @@ + + +
    opt
    opt
    ComponentConfiguration
    ComponentConfigura...
    ComponentConfigurationImpl::Initialize
    ComponentConfigurationImpl::Initialize
    ReferenceManager
    ReferenceManager
    dependencies
     exist
    dependencies...
    Initialize
    Initialize
    RegisterListener
    RegisterListener
    Update bound references
    Update bound references
    References satisfied%3CmxGraphModel%3E%3Croot%3E%3CmxCell%20id%3D%220%22%2F%3E%3CmxCell%20id%3D%221%22%20parent%3D%220%22%2F%3E%3CmxCell%20id%3D%222%22%20value%3D%22Matched%20references%20%26amp%3Blt%3B%20min%20Cardinality%26amp%3Bnbsp%3B%22%20style%3D%22text%3Bhtml%3D1%3BstrokeColor%3Dnone%3BfillColor%3Dnone%3Balign%3Dcenter%3BverticalAlign%3Dmiddle%3BwhiteSpace%3Dwrap%3Brounded%3D0%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%3CmxGeometry%20x%3D%22330%22%20y%3D%22210%22%20width%3D%22220%22%20height%3D%2220%22%20as%3D%22geometry%22%2F%3E%3C%2FmxCell%3E%3C%2Froot%3E%3C%2FmxGraphModel%3E
    References satisfied%3Cmx...
    BECAME_SATISIFIED Event
    BECAME_SATISIFIED Eve...
    RefChangedState
    RefChangedState
    References not satisfied%3CmxGraphModel%3E%3Croot%3E%3CmxCell%20id%3D%220%22%2F%3E%3CmxCell%20id%3D%221%22%20parent%3D%220%22%2F%3E%3CmxCell%20id%3D%222%22%20value%3D%22Matched%20references%20%26amp%3Blt%3B%20min%20Cardinality%26amp%3Bnbsp%3B%22%20style%3D%22text%3Bhtml%3D1%3BstrokeColor%3Dnone%3BfillColor%3Dnone%3Balign%3Dcenter%3BverticalAlign%3Dmiddle%3BwhiteSpace%3Dwrap%3Brounded%3D0%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%3CmxGeometry%20x%3D%22330%22%20y%3D%22210%22%20width%3D%22220%22%20height%3D%2220%22%20as%3D%22geometry%22%2F%3E%3C%2FmxCell%3E%3C%2Froot%3E%3C%2FmxGraphModel%3E
    References not satisfied%...
    ComponentConfiguration
    ComponentConfigura...
    Reference Manager
    Reference Manager
     reference dependencies exist
     reference dependencies exist
    Note: This diagram describes the functionality in  ComponentConfigurationImpl::Initialize when reference or configuration object dependencies exist. Please see ComponentConfigurationImpl::CreateConfigurationManager for functionality when no dependencies exist.  
    Note: This diagram describes the functional...
    for each reference
    for each reference
    RegisterListener
    RegisterListener
    Configuration objects satisfied%3CmxGraphModel%3E%3Croot%3E%3CmxCell%20id%3D%220%22%2F%3E%3CmxCell%20id%3D%221%22%20parent%3D%220%22%2F%3E%3CmxCell%20id%3D%222%22%20value%3D%22Matched%20references%20%26amp%3Blt%3B%20min%20Cardinality%26amp%3Bnbsp%3B%22%20style%3D%22text%3Bhtml%3D1%3BstrokeColor%3Dnone%3BfillColor%3Dnone%3Balign%3Dcenter%3BverticalAlign%3Dmiddle%3BwhiteSpace%3Dwrap%3Brounded%3D0%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%3CmxGeometry%20x%3D%22330%22%20y%3D%22210%22%20width%3D%22220%22%20height%3D%2220%22%20as%3D%22geometry%22%2F%3E%3C%2FmxCell%3E%3C%2Froot%3E%3C%2FmxGraphModel%3E
    Configuration objects satisfied%3C...
    ConfigChangedState
    ConfigChangedState
    Configuration objects not satisfied%3CmxGraphModel%3E%3Croot%3E%3CmxCell%20id%3D%220%22%2F%3E%3CmxCell%20id%3D%221%22%20parent%3D%220%22%2F%3E%3CmxCell%20id%3D%222%22%20value%3D%22Matched%20references%20%26amp%3Blt%3B%20min%20Cardinality%26amp%3Bnbsp%3B%22%20style%3D%22text%3Bhtml%3D1%3BstrokeColor%3Dnone%3BfillColor%3Dnone%3Balign%3Dcenter%3BverticalAlign%3Dmiddle%3BwhiteSpace%3Dwrap%3Brounded%3D0%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%3CmxGeometry%20x%3D%22330%22%20y%3D%22210%22%20width%3D%22220%22%20height%3D%2220%22%20as%3D%22geometry%22%2F%3E%3C%2FmxCell%3E%3C%2Froot%3E%3C%2FmxGraphModel%3E
    Configuration objects not satis...
     configuration object dependencies exist
    configuration object dependencies ex...
    for each configuration object
    for each configuration object
    See sequence diagram for ComponentConfigurationImpl
    ::RefChangedState(BECAME_SATISFIED) 
    See sequence diagram for Com...
    See sequence diagram for ComponentConfigurationImpl
    ::ConfigChangedState(CONFIG_SATISFIED)
    See sequence diagram for Com...
    ConfigurationNotifier
    ConfigurationNotifier
    ConfigurationNotifier
    ConfigurationNotifier
    opt
    opt
    loop
    loop
    opt
    opt
    loop
    loop
    ConfigurationNotifier
    ConfigurationNotifier
    ConfigurationManager
    ConfigurationManager
    ConfigurationAdmin
    ConfigurationAdmin
    ConfigurationAdmin
    ConfigurationAdmin
    Initialize
    Initialize
    Update Merged Properties
    Update Merg...
    ListConfigurations
    ListCo...
    opt
    opt
    Viewer does not support full SVG 1.1
    \ No newline at end of file diff --git a/text/0003-declarative-services/ComponentConfigurationRebind.svg b/text/0003-declarative-services/ComponentConfigurationRebind.svg new file mode 100644 index 0000000..7faac27 --- /dev/null +++ b/text/0003-declarative-services/ComponentConfigurationRebind.svg @@ -0,0 +1,3 @@ + + +
    ActiveState
    ActiveState
    ComponentConfiguration
    ComponentConfiguration
    ActiveState
    ActiveState
    ComponentConfiguration
    ComponentConfigura...
    REBIND
    REBIND
    ComponentConfigurationImp::RefChangedState(Rebind)
    ComponentConfiguration...
    state = ActiveState
    state = ActiveState
    Rebind
    Rebind
    SatisfiedState
    SatisfiedState
    SatisfiedState
    SatisfiedState
    UnsatisfiedReferenceState
    UnsatisfiedReferenceState
    UnsatisfiedReferenceState
    UnsatisfiedReferenceS...
    ComponentContext
    ComponentContext
    ComponentContext
    ComponentContext
    BindReference
    BindRe...
    AddToBoundServicesCache
    AddToB...
    Invoke Bind Method
    Invoke Bind Method
    ComponentInstance
    ComponentInstance
    ComponentInstance
    ComponentInstance
    service  ref to bind
    service  ref to bi...
    service  ref to unbind
    service  ref to unbind
    UnBindReference
    UnBind...
    Invoke Unbind Method
    Invoke Unbind Method
    RemoveFromBoundServicesCache
    R...
    state = SatisfiedState
    state = SatisfiedState
    Rebind
    Rebind
    no-op
    no-op
    state = SatisfiedState
    state = SatisfiedState
    Rebind
    Rebind
    no-op
    no-op
    Client Bundle
    Client Bundle
    latch.CountUp = true
    latch.CountUp = true
    Note: this diagram shows functionality for SingletonComponentConfigurationImpl only
    Note: this diagram shows functionality for...
    opt
    opt
    opt
    opt
    opt
    opt
    opt
    opt
    Viewer does not support full SVG 1.1
    \ No newline at end of file diff --git a/text/0003-declarative-services/ComponentConfigurationRefChangedSatisfied.svg b/text/0003-declarative-services/ComponentConfigurationRefChangedSatisfied.svg new file mode 100644 index 0000000..63789d8 --- /dev/null +++ b/text/0003-declarative-services/ComponentConfigurationRefChangedSatisfied.svg @@ -0,0 +1,3 @@ + + +
    ComponentConfiguration
    ComponentConfigura...
    ComponentConfigurationImpl::RefChangedState(BECAME_SATISFIED)
    ComponentConfigurationImpl::RefChangedState(BECAME_SATISFIED)
    UnsatisfiedReferenceState
    UnsatisfiedReferenceState
    BECAME_SATISFIED
    notification
    BECAME_SATISFIED...
    RefManager
    RefManager
    See sequence diagram for CCUnsatisfiedReferenceState
    ::Register 
    See sequence diagram for CCU...
    Register
    Regist...
    state = ActiveState
    state = ActiveState
    no-op
    no-op
    state = RegisteredState
    state = RegisteredSta...
    no-op
    no-op
    state = UnsatisfiedReference State 
    state = UnsatisfiedReference Stat...
    Register
    Regist...
    ActiveState
    ActiveState
    RegisteredState
    RegisteredState
    ComponentConfiguration
    ComponentConfigura...
    UnsatisfiedReferenceState
    UnsatisfiedReferenceState
    ActiveState
    ActiveState
    RegisteredState
    RegisteredState
    all references and configuration object dependencies are satisfied
    all references and configuration objec...
    ComponentConfigurationImpl::ConfigSatisfied
    ComponentConfigurationImpl::ConfigSatisfied
    Register
    Regist...
    opt
    opt
    opt
    opt
    ConfigSatisfied
    Config...
    Viewer does not support full SVG 1.1
    \ No newline at end of file diff --git a/text/0003-declarative-services/ComponentConfigurationRefChangedUnsatisfied.svg b/text/0003-declarative-services/ComponentConfigurationRefChangedUnsatisfied.svg new file mode 100644 index 0000000..3ec010e --- /dev/null +++ b/text/0003-declarative-services/ComponentConfigurationRefChangedUnsatisfied.svg @@ -0,0 +1,3 @@ + + +
    ComponentConfiguration
    ComponentConfigura...
    ComponentConfigurationImpl::RefChangedState(BECAME_UNSATISFIED)
    ComponentConfigurationImpl::RefChangedState(BECAME_UNSATISFIED)
    UnsatisfiedReferenceState
    UnsatisfiedReferenceState
    BECAME_UNSATISFIED
    notification
    BECAME_UNSATISFIED...
    RefManager
    RefManager
    See sequence diagram for CCSatisfiedState
    ::Deactivate
    See sequence diagram for CCS...
    Deactivate
    Deacti...
    state = UnsatisfiedReferenceState
    state = UnsatisfiedReferenceSta...
    state = SatisfiedState
    state = SatisfiedState
    Deactivate
    Deacti...
    SatisfiedState
    SatisfiedState
    ComponentConfiguration
    ComponentConfigura...
    UnsatisfiedReferenceState
    UnsatisfiedReferenceState
    SatisfiedState
    SatisfiedState
    CONFIG_UNSATISFIED
    notification
    CONFIG_UNSATISFIED...
    ConfigManager
    ConfigManager
    a reference  or  configuration object dependency is unsatisfied
    a reference  or  configuration object...
    ComponentConfigurationImpl::ConfigChangedState(CONFIG_UNSATISFIED)
    ComponentConfigurationImpl::ConfigChangedState(CONFIG_UNSATISFIED)
    Wait for transitions to finish
    Wait for transitions t...
    Viewer does not support full SVG 1.1
    \ No newline at end of file diff --git a/text/0003-declarative-services/ComponentConfiguration_GetService.svg b/text/0003-declarative-services/ComponentConfiguration_GetService.svg index 9296f71..4689388 100644 --- a/text/0003-declarative-services/ComponentConfiguration_GetService.svg +++ b/text/0003-declarative-services/ComponentConfiguration_GetService.svg @@ -1,55 +1,3 @@ -ComponentConfiguration::GetServiceClientClientFrameworkFrameworkComponentConfigurationComponentConfigurationSatisfiedStateSatisfiedStateActiveStateActiveStateComponentInstanceImpl(autogenerated)ComponentInstanceImpl(autogenerated)GetServiceGetServiceActivatesee the sequence diagram forSatisfiedState::Activatealt[activate succeeded]GetStateGetComponentInstancecomponent instanceGetInterfaceMapmap with service instance and interface namesmapthrow exceptionFRAMEWORK_ERROR event with ServiceExceptionof type FACTORY_EXCEPTIONservice object / null \ No newline at end of file + + +
    opt
    opt
    Framework
    Framework
    SingletonComponentConfiguration::GetService
    SingletonComponentConfiguration::GetService
    Component Configuration
    Component Configuration
    ActiveState
    ActiveState
    UnsatisfiedReferenceState
    UnsatisfiedReferenceState
    RegisteredState
    RegisteredState
    Framework
    Framework
    ComponentConfiguration
    ComponentConfiguration
    ActiveState
    ActiveState
    UnsatisfiedReferenceState
    UnsatisfiedReferenceState
    RegisteredState
    RegisteredState
    Client
    Client
    GetService
    GetSer...
    GetService
    GetSer...
    state = ActiveState 
    state = ActiveStat...
    GetState
    GetSta...
    See the sequence diagram for CCActiveState::Activate
    See the sequence diagram f...
    state = UnsatisfiedState 
    state = UnsatisfiedState 
    success/failure
    succes...
    Component Instance /nullptr
    Component Instance /nullptr
    Component Instance /nullptr
    Component Instance /nullptr
    nullptr
    nullptr
    nullptr
    nullptr
    nullptr
    nullptr
    Activate
    Activa...
    Activate
    Activa...
    state = RegisteredState 
    state = RegisteredState 
    success/failure
    success/failure
    Activate
    Activa...
    Component Instance /nullptr
    Component Instance /nullptr
    Component Instance /nullptr
    Component Instance /nullptr
    See the sequence
     diagram for CCRegisteredState::Activate
    See the sequence...
    BundleOrPrototypeComponentConfiguration::GetService
    BundleOrPrototypeComponentConfiguration::GetService
    Note: the framework interaction with DS is simplified here
    Note: the framework interact...
    Viewer does not support full SVG 1.1
    \ No newline at end of file diff --git a/text/0003-declarative-services/ComponentConfiguration_Resolve.svg b/text/0003-declarative-services/ComponentConfiguration_Resolve.svg index 14e9a0d..c57ca63 100644 --- a/text/0003-declarative-services/ComponentConfiguration_Resolve.svg +++ b/text/0003-declarative-services/ComponentConfiguration_Resolve.svg @@ -1,37 +1,3 @@ -ComponentConfiguration::ResolveComponentConfigurationComponentConfigurationReferenceManagerReferenceManagerUnsatisfiedReferenceStateUnsatisfiedReferenceStateResolveloop[for each dependencyManager]IsSatisfiedtrue/falsealt[all dependencies satisfied]Register(this)see the sequence diagram forUnsatisfiedReferenceState::Register \ No newline at end of file + + +
    opt
    opt
    loop
    loop
    ComponentConfiguration
    ComponentConfigura...
    ComponentConfiguration::Resolve
    ComponentConfiguration::Resolve
    Reference Manager
    Reference Manager
    UnsatisfiedReferenceState
    UnsatisfiedReferenceState
    dependencies
     exist
    dependencies...
    Initialize
    Initialize
    RegisterListener
    RegisterListener
    Update bound references
    Update bound references
    References satisfied%3CmxGraphModel%3E%3Croot%3E%3CmxCell%20id%3D%220%22%2F%3E%3CmxCell%20id%3D%221%22%20parent%3D%220%22%2F%3E%3CmxCell%20id%3D%222%22%20value%3D%22Matched%20references%20%26amp%3Blt%3B%20min%20Cardinality%26amp%3Bnbsp%3B%22%20style%3D%22text%3Bhtml%3D1%3BstrokeColor%3Dnone%3BfillColor%3Dnone%3Balign%3Dcenter%3BverticalAlign%3Dmiddle%3BwhiteSpace%3Dwrap%3Brounded%3D0%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%3CmxGeometry%20x%3D%22330%22%20y%3D%22210%22%20width%3D%22220%22%20height%3D%2220%22%20as%3D%22geometry%22%2F%3E%3C%2FmxCell%3E%3C%2Froot%3E%3C%2FmxGraphModel%3E
    References satisfied%3Cmx...
    BECAME_SATISIFIED Event
    BECAME_SATISIFIED Eve...
    RefChangedState
    RefChangedState
    all references satisfied
    all references satisfied
    References not satisfied%3CmxGraphModel%3E%3Croot%3E%3CmxCell%20id%3D%220%22%2F%3E%3CmxCell%20id%3D%221%22%20parent%3D%220%22%2F%3E%3CmxCell%20id%3D%222%22%20value%3D%22Matched%20references%20%26amp%3Blt%3B%20min%20Cardinality%26amp%3Bnbsp%3B%22%20style%3D%22text%3Bhtml%3D1%3BstrokeColor%3Dnone%3BfillColor%3Dnone%3Balign%3Dcenter%3BverticalAlign%3Dmiddle%3BwhiteSpace%3Dwrap%3Brounded%3D0%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%3CmxGeometry%20x%3D%22330%22%20y%3D%22210%22%20width%3D%22220%22%20height%3D%2220%22%20as%3D%22geometry%22%2F%3E%3C%2FmxCell%3E%3C%2Froot%3E%3C%2FmxGraphModel%3E
    References not satisfied%...
    Add Service
    Add Service
    BECAME_SATISIFIED Event
    BECAME_SATISIFIED Eve...
    Client
    Client
    See sequence diagram for UnsatisfiedReferenceState::Register 
    See sequence diagram for Uns...
    Register
    Regist...
    state = ActiveState
    state = ActiveState
    no-op
    no-op
    state = RegisteredState
    state = RegisteredSta...
    no-op
    no-op
    state = UnsatisfiedReference State 
    state = UnsatisfiedReference Stat...
    Register
    Regist...
    ActiveState
    ActiveState
    RegisteredState
    RegisteredState
    ComponentConfiguration
    ComponentConfigura...
    Reference Manager
    Reference Manager
    UnsatisfiedReferenceState
    UnsatisfiedReferenceState
    ActiveState
    ActiveState
    RegisteredState
    RegisteredState
    for each dependency
    for each dependency
    opt
    opt
    opt
    opt
    Viewer does not support full SVG 1.1
    \ No newline at end of file diff --git a/text/0003-declarative-services/ComponentContextImpl_DisableComponent.svg b/text/0003-declarative-services/ComponentContextImpl_DisableComponent.svg index 10a5d39..961d2ad 100644 --- a/text/0003-declarative-services/ComponentContextImpl_DisableComponent.svg +++ b/text/0003-declarative-services/ComponentContextImpl_DisableComponent.svg @@ -1 +1,3 @@ -ClientClientComponentContextImplComponentContextImplComponentRegistryComponentRegistryComponentManagerComponentManagerruntime_errorruntime_errorDisableComponent(name)GetComponent(name, mBundleID)compMgralt[component found]Disablesee the sequence diagram forComponentManager::Disablethrow("Component not found") \ No newline at end of file + + +
    opt
    opt
    ComponentConfiguration
    ComponentConfigura...
    ComponentContextImpl::DisableComponent
    ComponentContextImpl::DisableComponent
    Component Registry
    Component Registry
    ComponentManager
    ComponentManager
    Disable Component
    Disable Component
    See sequence diagram for ComponentManagerImpl::Disable
    See sequence diagram for Com...
    ComponentConfiguration
    ComponentConfigura...
    ComponentRegistry
    ComponentRegistry
    ComponentManager
    ComponentManager
    context is invalid
    context is invalid
    compMgr
    compMgr
    Disable
    Disable
    shared_future
    shared...
    GetComponentManager
    GetComponentManager
    Throw exception "Context is invalid"
    Throw exception "Context is invalid"
    context is valid
    context is valid
    (name)
    (name)
    GetRegistry
    GetReg...
    registry
    regist...
    Viewer does not support full SVG 1.1
    \ No newline at end of file diff --git a/text/0003-declarative-services/ComponentContextImpl_EnableComponent.svg b/text/0003-declarative-services/ComponentContextImpl_EnableComponent.svg index 23114ea..5a0a6a5 100644 --- a/text/0003-declarative-services/ComponentContextImpl_EnableComponent.svg +++ b/text/0003-declarative-services/ComponentContextImpl_EnableComponent.svg @@ -1 +1,3 @@ -ClientClientComponentContextImplComponentContextImplComponentRegistryComponentRegistryComponentManagerComponentManagerruntime_errorruntime_errorEnableComponent(name)GetComponent(name, mBundleID)compMgralt[component found]Enablesee the sequence diagram forComponentManager::Enablethrow("Component not found") \ No newline at end of file + + +
    opt
    opt
    ComponentConfiguration
    ComponentConfigura...
    ComponentContextImpl::EnableComponent
    ComponentContextImpl::EnableComponent
    Component Registry
    Component Registry
    ComponentManager
    ComponentManager
    Enable Component
    Enable Component
    GetComponentManager
    GetComponentManager
    See sequence diagram for ComponentManagerImpl::Enable
    See sequence diagram for Com...
    ComponentConfiguration
    ComponentConfigura...
    ComponentRegistry
    ComponentRegistry
    ComponentManager
    ComponentManager
    name is not empty
    name is not empty
    compMgr
    compMgr
    Enable
    Enable
    shared_future
    shared...
    name is empty
    name is empty
    GetComponentManagers
    GetComponentManagers
    compMgrs
    compMg...
    for each compMgr
    for each compMgr
    See sequence diagram for ComponentManagerIml::Enable
    See sequence diagram for Com...
    Enable
    Enable
    shared_future
    shared...
    context is invalid
    context is invalid
    Exception
    Except...
    Context is invalid
    Context is inval...
    context is valid
    context is valid
    (name)
    (name)
    GetRegistry
    GetReg...
    registry
    regist...
    loop
    loop
    opt
    opt
    Viewer does not support full SVG 1.1
    \ No newline at end of file diff --git a/text/0003-declarative-services/ComponentManager_Disable.svg b/text/0003-declarative-services/ComponentManager_Disable.svg index 1aef987..791fa53 100644 --- a/text/0003-declarative-services/ComponentManager_Disable.svg +++ b/text/0003-declarative-services/ComponentManager_Disable.svg @@ -1,73 +1,3 @@ -ComponentManager::DisableComponentManagerComponentManagerEnabled_StateEnabled_StatepromisepromiseDisabled_StateDisabled_StateTransitionStateTransitionStateComponentManagerBaseState{abstract}ComponentManagerBaseState{abstract}ComponentConfigurationComponentConfigurationDisableDisable(this)Createget_futureCreate(future)transitionStateCompareAndSwap(this,transitionState)success/failurealt[swap suceeded]Delete {Async}Create(future)disabledStateCompareAndSwap(transitionState, disabledState)set_valueshared_future[this object is not the current state anymore]GetStatecurrent stateDisable(manager)shared_futureshared_futureshared_future \ No newline at end of file + + +
    loop
    loop
    EnabledState
    EnabledState
    ComponentManagerImpl::Disable

    ComponentManagerImpl::Disable...
    promise
    promise
    DisabledState
    DisabledState
    ComponentConfiguration
    ComponentConfiguration
    ComponentManager
    ComponentManager
    Disable
    Disable
    Disable(this)
    Disable(thi...
    Create
    Create
    GetFuture
    GetFuture
    Create(Future)
    Create(Future)
    disabledState
    disabledState
    CompareAndSetState
    CompareAndSetState
    (currentState, disabledState)
    (currentState, disabled...
    success
    success
    for each component configuration )
    for each component configura...
    loop
    loop
    EnabledState
    EnabledState
    promise
    promise
    DisbledState
    DisbledState
    ComponentConfiguration
    ComponentConfiguration
    ComponentManager
    ComponentManager
    loop until state successfully changed
    loop until state successfully...
    Deactivate
    Deacti...
    Stop
    Stop
    ReferenceManager
    ReferenceManager
    UnregisterListener
    UnregisterListener
    ReferenceManager
    ReferenceManager
    See sequence diagram for CCSatisfiedState::Deactivate
    See sequence diagram for CC...
    DeleteConfigurations
     (asynchronously)
    DeleteConfiguration...
    for each ref manager
    for each ref manager
    loop
    loop
    UnregisterListener
    UnregisterListener
    for each configuration Listener
    for each configuration Listener
    ConfigurationNotifier
    ConfigurationNotif...
    ConfigurationNotifier
    ConfigurationNotif...
    loop
    loop
    Viewer does not support full SVG 1.1
    \ No newline at end of file diff --git a/text/0003-declarative-services/ComponentManager_Enable.svg b/text/0003-declarative-services/ComponentManager_Enable.svg index 820fc52..2b45502 100644 --- a/text/0003-declarative-services/ComponentManager_Enable.svg +++ b/text/0003-declarative-services/ComponentManager_Enable.svg @@ -1,76 +1,3 @@ -ComponentManager::EnableComponentManagerComponentManagerDisabled_StateDisabled_StatepromisepromiseEnabled_StateEnabled_StateTransitionStateTransitionStateComponentManagerBaseState{abstract}ComponentManagerBaseState{abstract}ComponentConfigurationComponentConfigurationEnableEnable(this)CreateGetFutureCreate(future)transitionStateCompareAndSwap(this,transitionState)success/failurealt[swap suceeded]CreateCreate {Async}enabledStateCompareAndSwap(transitionState, enabledState)set_valueGetFutureshared_future[this object is not the current state anymore]GetStatecurrent stateEnable(manager)shared_futureshared_futureshared_future \ No newline at end of file + + +
    DisabledState
    DisabledState
    ComponentManagerImpl::Enable

    ComponentManagerImpl::Enable...
    promise
    promise
    EnabledState
    EnabledState
    ComponentConfiguration
    ComponentConfiguration
    ComponentManager
    ComponentManager
    Enable
    Enable
    Enable(this)
    Enable(this)
    Create
    Create
    GetFuture
    GetFuture
    Create(Future)
    Create(Future)
    enabledState
    enabledState
    CompareAndSetState
    CompareAndSetState
    (currentState, enabledState)
    (currentState, enabledS...
    success
    success
    CreateConfigurations (asynchronously)
    CreateConfigurations (asynchron...
    shared_future
    shared_future
    shared_future
    shared_future
    loop
    loop
    DisabledState
    DisabledState
    promise
    promise
    EnabledState
    EnabledState
    ComponentConfiguration
    ComponentConfiguration
    ComponentManager
    ComponentManager
    loop until state successfully changed
    loop until state successfully...
    See sequence diagram for ComponentConfigurationImpl::
    CreateConfigurationManager
    See sequence diagram for Com...
    CreateConfiguration
    Manager
    Create...
    Viewer does not support full SVG 1.1
    \ No newline at end of file diff --git a/text/0003-declarative-services/ConfigurationListenerConfigEvent.svg b/text/0003-declarative-services/ConfigurationListenerConfigEvent.svg new file mode 100644 index 0000000..a63139b --- /dev/null +++ b/text/0003-declarative-services/ConfigurationListenerConfigEvent.svg @@ -0,0 +1,3 @@ + + +
    opt
    opt
    opt
    opt
    opt
    opt
    ConfigurationListener
    ConfigurationListener
    ConfigurationListener::configurationEvent(CM_UPDATED)
    ConfigurationListener::configurationEvent(CM_UPDATED)
    ComponentConfiguration
    ComponentConfiguration
    See sequence diagram for ComponentConfigurationImpl
    ::ConfigSatisfied 
    See sequence diagram for Com...
    configurationEvent
    config...
    Send CM_UPDATED ConfigEvent
    Send CM_UPDATED Config...
    See sequence diagram for CCSatisfiedState::Deactivate
    See sequence diagram for CCSat...
    ConfigAdmin
    ConfigAdmin
    CM_UPDATED
    CM_UPDATED
    configuration becomes satisfied
    configuration becomes satisfied
    Update Component Properties
    Update Merged Properties
    Update Component Properties...
    Modified method exists 
    Modified method exists 
    ComponentInstanceImpl
    ComponentInstanceImpl
    Call Modified Method with Merged Properties
    Call Modified Method with Merge...
    Configuration is not satisfied
    Configuration is not satisfi...
    Configuration is satisfied
    Configuration is satisfied
    state = ActiveState and configurationPolicy = require or optional 
    state = ActiveState and configurationPolicy =...
    Modified method does not exists
    Modified method does not exists
    ConfigurationListener
    ConfigurationListener
    ComponentConfiguration
    ComponentConfiguration
    ConfigAdmin
    ConfigAdmin
    ComponentInstanceImpl
    ComponentInstanceImpl
    opt
    opt
    ConfigurationNotifier
    ConfigurationNotifier
    ConfigurationNotifier
    ConfigurationNotifier
    NotifyAllListeners
    NotifyAllL...
    configurationEvent
    configurationEvent
    Note: this diagram describes the functionality when the CM_UPDATED event is received for a component with a non-factory pid. 
    Note: this diagram describes the fun...
    Viewer does not support full SVG 1.1
    \ No newline at end of file diff --git a/text/0003-declarative-services/ConfigurationListenerConfigEventDeleted.svg b/text/0003-declarative-services/ConfigurationListenerConfigEventDeleted.svg new file mode 100644 index 0000000..f044630 --- /dev/null +++ b/text/0003-declarative-services/ConfigurationListenerConfigEventDeleted.svg @@ -0,0 +1,3 @@ + + +
    ConfigurationListener
    ConfigurationListener
    ConfigurationListener::configurationEvent(CM_DELETED)
    ConfigurationListener::configurationEvent(CM_DELETED)
    ComponentConfiguration
    ComponentConfiguration
    See sequence diagram for CCSatisfiedState::Deactivate 
    See sequence diagram for CCS...
    configurationEvent
    config...
    NotifyAllListeners
    NotifyAllListeners
    See sequence diagram for CCSatisfiedState::Deactivate
    See sequence diagram for CCSat...
    ConfigAdmin
    ConfigAdmin
    CM_DELETED
    CM_DELETED
    Update Component Properties
    Update Merged Properties
    Update Component Properties...
    Modified method exists
    Modified method exists
    ComponentInstanceImpl
    ComponentInstanceImpl
    Call Modified Method with Merged Properties
    Call Modified Method with Merge...
    Configuration was satisfied
    Configuration was satisfied
    Configuration is still satisfied
    Configuration is still satis...
    state = ActiveState and configurationPolicy = require or optional 
    state = ActiveState and configurationP...
    Modified method does not exists
    Modified method does not exists
    ConfigurationListener
    ConfigurationListener
    ComponentConfiguration
    ComponentConfiguration
    ConfigAdmin
    ConfigAdmin
    ComponentInstanceImpl
    ComponentInstanceImpl
    Configuration is no longer satisfied
    Configuration is no longer satisf...
    ConfigurationNotifier
    ConfigurationNotifier
    Send CM_DELETED ConfigEvent
    Send CM_DELETED Config...
    ConfigurationNotifier
    ConfigurationNotifier
    configurationEvent
    config...
    opt
    opt
    opt
    opt
    opt
    opt
    opt
    opt
    Viewer does not support full SVG 1.1
    \ No newline at end of file diff --git a/text/0003-declarative-services/DependencyBecomesAvailable_v3.svg b/text/0003-declarative-services/DependencyBecomesAvailable_v3.svg index e1726dd..ffb3565 100644 --- a/text/0003-declarative-services/DependencyBecomesAvailable_v3.svg +++ b/text/0003-declarative-services/DependencyBecomesAvailable_v3.svg @@ -1,2 +1,4 @@ + + -
    Actor
    Actor
    Framework
    Framework
    1. RegisterService
    1. RegisterService
    DependencyManager
    DependencyManager
    2. AddingService
    2. AddingService
    ComponentConfiguration
    ComponentConfiguration
    4. Satisfied
    4. Satisfied
    UnsatisfiedReferenceState
    UnsatisfiedReferenceState
    5. Register
    [Not supported by viewer]
    RegisteredState
    RegisteredState
    5.4 Create
    [Not supported by viewer]
    RegistrationManager
    RegistrationManager
    5.3 RegisterService
    [Not supported by viewer]
    5.2 CompaereAndSetState(TransitionState) 🔒
    5.5 CompareAndSetState(RegisteredState) 🔒
    [Not supported by viewer]
    TransitionState
    TransitionState
    5.1 Create
    [Not supported by viewer]
    3. AddMatchedReference 🔒
    [Not supported by viewer]
    Legend
    [Not supported by viewer]
    Execution on calling thread
    [Not supported by viewer]
    --
    --
    🔒              --            Atomic operation
    [Not supported by viewer]
    \ No newline at end of file +
    Actor
    Act...
    Framework
    Framework
    1. RegisterService
    1. RegisterService
    DependencyManager
    DependencyManager
    2. AddingService
    2. AddingService
    3. AddMatchedReference🔒

    3. AddMatchedReference🔒...
    ComponentConfiguration
    ComponentConfiguration
    4.Satisfied
    4.Satisfied
    ConfigurationManager
    ConfigurationManager
    4.2 IsConfigSatisfied
    4.2 IsConfigSatisfied
    4.3 IsSatisfied
    4.3 IsSatisfied
    UnsatisfiedReferenceState%3CmxGraphModel%3E%3Croot%3E%3CmxCell%20id%3D%220%22%2F%3E%3CmxCell%20id%3D%221%22%20parent%3D%220%22%2F%3E%3CmxCell%20id%3D%222%22%20value%3D%22ComponentConfiguration%22%20style%3D%22rounded%3D0%3BwhiteSpace%3Dwrap%3Bhtml%3D1%3BfillColor%3D%23dae8fc%3BstrokeColor%3D%236c8ebf%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%3CmxGeometry%20x%3D%22650%22%20y%3D%22220%22%20width%3D%22150%22%20height%3D%2240%22%20as%3D%22geometry%22%2F%3E%3C%2FmxCell%3E%3C%2Froot%3E%3C%2FmxGraphModel%3E
    UnsatisfiedReferenceState...
    RegisteredState%3CmxGraphModel%3E%3Croot%3E%3CmxCell%20id%3D%220%22%2F%3E%3CmxCell%20id%3D%221%22%20parent%3D%220%22%2F%3E%3CmxCell%20id%3D%222%22%20value%3D%22UnsatisfiedReferenceState%26lt%3Bspan%20style%3D%26quot%3Bcolor%3A%20rgba(0%20%2C%200%20%2C%200%20%2C%200)%20%3B%20font-family%3A%20monospace%20%3B%20font-size%3A%200px%26quot%3B%26gt%3B%253CmxGraphModel%253E%253Croot%253E%253CmxCell%2520id%253D%25220%2522%252F%253E%253CmxCell%2520id%253D%25221%2522%2520parent%253D%25220%2522%252F%253E%253CmxCell%2520id%253D%25222%2522%2520value%253D%2522ComponentConfiguration%2522%2520style%253D%2522rounded%253D0%253BwhiteSpace%253Dwrap%253Bhtml%253D1%253BfillColor%253D%2523dae8fc%253BstrokeColor%253D%25236c8ebf%253B%2522%2520vertex%253D%25221%2522%2520parent%253D%25221%2522%253E%253CmxGeometry%2520x%253D%2522650%2522%2520y%253D%2522220%2522%2520width%253D%2522150%2522%2520height%253D%252240%2522%2520as%253D%2522geometry%2522%252F%253E%253C%252FmxCell%253E%253C%252Froot%253E%253C%252FmxGraphModel%253E%26lt%3B%2Fspan%26gt%3B%22%20style%3D%22rounded%3D0%3BwhiteSpace%3Dwrap%3Bhtml%3D1%3BfillColor%3D%23dae8fc%3BstrokeColor%3D%236c8ebf%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%3CmxGeometry%20x%3D%22900%22%20y%3D%22220%22%20width%3D%22150%22%20height%3D%2240%22%20as%3D%22geometry%22%2F%3E%3C%2FmxCell%3E%3C%2Froot%3E%3C%2FmxGraphModel%3E
    RegisteredState%3CmxGraph...
    RegistrationManager
    RegistrationManager
    5.3 RegisterService
    5.3 RegisterService
    5. Register
    5. Register
    5.2 CompareAndSetState
    5.2 CompareAndSetState
    5.1 Create
    5.1 Create
    Viewer does not support full SVG 1.1
    \ No newline at end of file diff --git a/text/0003-declarative-services/DependencyBecomesUnsatisfied_v3.svg b/text/0003-declarative-services/DependencyBecomesUnsatisfied_v3.svg index 9d7e3fe..33250d2 100644 --- a/text/0003-declarative-services/DependencyBecomesUnsatisfied_v3.svg +++ b/text/0003-declarative-services/DependencyBecomesUnsatisfied_v3.svg @@ -1,2 +1,4 @@ + + -
    1. UnregisterService
    [Not supported by viewer]
    Actor
    Actor
    2. RemovedService
    [Not supported by viewer]
    Framework
    Framework
    4. UnSatisfied
    [Not supported by viewer]
    DependencyManager
    DependencyManager
    5. Deactivate
    [Not supported by viewer]
    ComponentConfiguration
    ComponentConfiguration
    4.7 Create
    4.7 Create
    5.3 UnregisterService
    [Not supported by viewer]
    5.2 CompareAndSetState(TransitionState) 🔒
    5.4 RemoveContextAndInstance 
    5.8 CompareAndSetState(UnsatisfiedReference) 🔒
    [Not supported by viewer]
    ActiveState
    ActiveState
    UnsatisfiedReferenceState
    UnsatisfiedReferenceState
    RegistrationManager
    RegistrationManager
    ComponentContext
    ComponentContext
    ComponentInstanceImpl
    <<autogenerated>>
    [Not supported by viewer]
    5.6 Invalidate
    5.6 Invalidate
    5.5 Deactivate
    <div>5.5 Deactivate</div>
    ServiceImpl
    ServiceImpl
    5.5.1 Deactivate
    5.5.1 Deactivate
    TransitionState
    TransitionState
    5.1 Create
    5.1 Create
    3. RemoveMatchedReference 🔒
    [Not supported by viewer]
    Legend
    [Not supported by viewer]
    Execution on calling thread
    [Not supported by viewer]
    --
    --
    🔒              --            Atomic operation
    [Not supported by viewer]
    \ No newline at end of file +
    Actor
    Act...
    Framework
    Framework
    1. UnRegisterService
    1. UnRegisterService
    DependencyManager
    DependencyManager
    2. RemovedService
    2. RemovedService
    3. RemoveMatchedReference🔒

    3. RemoveMatchedReference🔒...
    ComponentConfiguration
    ComponentConfiguration
    4.Unsatisfied
    4.Unsatisfied
    ActiveState
    ActiveState
    UnsatisfiedReferenceState
    UnsatisfiedReferenceState
    RegistrationManager
    RegistrationManager
    5.2 UnregisterService
    5.2 UnregisterService
    5. Deactivate
    5. Deactivate
    5.1 Create
    5.1 Create
    5.7 CompareAndSetState UnsatisfiedReference🔒

    5.7 CompareAndSetState UnsatisfiedReference...
    5.3 RemoveContextAndInstance
    5.3 RemoveContextAndInstance
    ComponentContext
    ComponentContext
    ComponentInstanceImpl3CmxGraphModel%3E%3Croot%3E%3CmxCell%20id%3D%220%22%2F%3E%3CmxCell%20id%3D%221%22%20parent%3D%220%22%2F%3E%3CmxCell%20id%3D%222%22%20value%3D%22RegistrationManager%22%20style%3D%22rounded%3D0%3BwhiteSpace%3Dwrap%3Bhtml%3D1%3BfillColor%3D%23dae8fc%3BstrokeColor%3D%236c8ebf%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%3CmxGeometry%20x%3D%221190%22%20y%3D%22340%22%20width%3D%22150%22%20height%3D%2240%22%20as%3D%22geometry%22%2F%3E%3C%2FmxCell%3E%3C%2Froot%3E%3C%2FmxGraphModel%3E%3CmxGraphModel%3E%3Croot%3E%3CmxCell%20id%3D%220%22%2F%3E%3CmxCell%20id%3D%221%22%20parent%3D%220%22%2F%3E%3CmxCell%20id%3D%222%22%20value%3D%22RegistrationManager%22%20style%3D%22rounded%3D0%3BwhiteSpace%3Dwrap%3Bhtml%3D1%3BfillColor%3D%23dae8fc%3BstrokeColor%3D%236c8ebf%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%3CmxGeometry%20x%3D%221190%22%20y%3D%22340%22%20width%3D%22150%22%20height%3D%2240%22%20as%3D%22geometry%22%2F%3E%3C%2FmxCell%3E%3C%2Froot%3E%3C%2FmxGraphModel%3E
    ComponentInstanceImpl3Cmx...
    ServerImpl
    ServerImpl
    5.4 Deactivate%3CmxGraphModel%3E%3Croot%3E%3CmxCell%20id%3D%220%22%2F%3E%3CmxCell%20id%3D%221%22%20parent%3D%220%22%2F%3E%3CmxCell%20id%3D%222%22%20value%3D%225.2%20UnregisterService%22%20style%3D%22text%3Bhtml%3D1%3BstrokeColor%3Dnone%3BfillColor%3Dnone%3Balign%3Dcenter%3BverticalAlign%3Dmiddle%3BwhiteSpace%3Dwrap%3Brounded%3D0%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%3CmxGeometry%20x%3D%221050%22%20y%3D%22200%22%20width%3D%22130%22%20height%3D%2230%22%20as%3D%22geometry%22%2F%3E%3C%2FmxCell%3E%3C%2Froot%3E%3C%2FmxGraphModel%3E
    5.4 Deactivate%3CmxGr...
    5.6 Invalidate
    5.6 Invalidate
    5.5 Deactivate%3CmxGraphModel%3E%3Croot%3E%3CmxCell%20id%3D%220%22%2F%3E%3CmxCell%20id%3D%221%22%20parent%3D%220%22%2F%3E%3CmxCell%20id%3D%222%22%20value%3D%225.2%20UnregisterService%22%20style%3D%22text%3Bhtml%3D1%3BstrokeColor%3Dnone%3BfillColor%3Dnone%3Balign%3Dcenter%3BverticalAlign%3Dmiddle%3BwhiteSpace%3Dwrap%3Brounded%3D0%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%3CmxGeometry%20x%3D%221050%22%20y%3D%22200%22%20width%3D%22130%22%20height%3D%2230%22%20as%3D%22geometry%22%2F%3E%3C%2FmxCell%3E%3C%2Froot%3E%3C%2FmxGraphModel%3E
    5.5 Deactivate%3CmxGr...
    Viewer does not support full SVG 1.1
    \ No newline at end of file diff --git a/text/0003-declarative-services/ReferenceManagerAddingServiceStaticGreedy.svg b/text/0003-declarative-services/ReferenceManagerAddingServiceStaticGreedy.svg new file mode 100644 index 0000000..feaa7f6 --- /dev/null +++ b/text/0003-declarative-services/ReferenceManagerAddingServiceStaticGreedy.svg @@ -0,0 +1,3 @@ + + +
    ComponentConfiguration
    ComponentConfigura...
    ReferenceManagerImpl::AddingService binding policy is static greedy
    ReferenceManagerImpl::AddingService binding policy is static greedy
    ReferenceManager
    ReferenceManager
    ComponentConfiguration
    ComponentConfigura...
    ReferenceManager
    ReferenceManager
    AddingService
    AddingService
    Client
    Client
    Add service ref to matched list
    Add service re...
    component has a name
    and the name does not match this component name
    component has a name...
    (reference)
    (refer...
    references are not satisfied
    references are not satisfied
    Clear bound refs
    Copy matched refs to bound refs
    Clear bound refs...
    Notify all Listeners
    Notify all Listeners
    See sequence diagram for
    ComponentConfigurationImpl
    ::RefChangedState(BECAME_SATISFIED)
    See sequence diagram for...
    BECAME_SATISFIED
    BECAME_SATISFIED
    new service is a better match
    new service is a better match
    Clear Bound Reference List to unbind previous reference
    Clear Bound Reference List...
    Notify all Listeners
    Notify all Listeners
    See sequence diagram for
    ComponentConfigurationImpl
    ::RefChangedState(BECAME_UNSATISFIED)
    See sequence diagram for...
    BECAME_UNSATISFIED
    BECAME_UNSATISFIED
    matched refs >= min cardinaltiy
    matched refs >= min cardinaltiy
    Copy matched refs to bound refs
    Copy matched refs to bound refs
    Notify all Listeners
    Notify all Listeners
    See sequence diagram for
    ComponentConfigurationImpl
    ::RefChangedState(BECAME_SATISFIED)
    See sequence diagram for...
    BECAME_SATISFIED
    BECAME_SATISFIED
    matched refs >= min cardinaltiy
    matched refs >= min cardinaltiy
    component is satisfied
    component is satisfied
    opt
    opt
    opt
    opt
    opt
    opt
    opt
    opt
    opt
    opt
    Viewer does not support full SVG 1.1
    \ No newline at end of file diff --git a/text/0003-declarative-services/ReferenceManagerAddingServiceStaticReluctant.svg b/text/0003-declarative-services/ReferenceManagerAddingServiceStaticReluctant.svg new file mode 100644 index 0000000..83c3cae --- /dev/null +++ b/text/0003-declarative-services/ReferenceManagerAddingServiceStaticReluctant.svg @@ -0,0 +1,3 @@ + + +
    ComponentConfiguration
    ComponentConfigura...
    ReferenceManagerImpl::AddingService binding policy is static reluctant
    ReferenceManagerImpl::AddingService binding policy is static reluctant
    ReferenceManager
    ReferenceManager
    ComponentConfiguration
    ComponentConfigura...
    ReferenceManager
    ReferenceManager
    AddingService
    AddingService
    Client
    Client
    Add service ref to matched list
    Add service re...
    component has a name
    and the name does not match this component name
    component has a name...
    (reference)
    (refer...
    component is not satisfied
    component is not satisfied
    Clear bound refs
    Copy matched refs to bound refs
    Clear bound refs...
    Notify all Listeners
    Notify all Listeners
    See sequence diagram for
    ComponentConfigurationImpl
    ::RefChangedState(BECAME_SATISFIED)
    See sequence diagram for...
    BECAME_SATISFIED
    BECAME_SATISFIED
    matched refs >= min cardinaltiy
    matched refs >= min cardinaltiy
    opt
    opt
    opt
    opt
    opt
    opt
    Viewer does not support full SVG 1.1
    \ No newline at end of file diff --git a/text/0003-declarative-services/ReferenceManagerRemovedServiceDynamic.svg b/text/0003-declarative-services/ReferenceManagerRemovedServiceDynamic.svg new file mode 100644 index 0000000..48bdd76 --- /dev/null +++ b/text/0003-declarative-services/ReferenceManagerRemovedServiceDynamic.svg @@ -0,0 +1,3 @@ + + +
    ComponentConfiguration
    ComponentConfigura...
    ReferenceManager::RemovedService binding policy is dynamic
    ReferenceManager::RemovedService binding policy is dynamic
    ReferenceManager
    ReferenceManager
    ComponentConfiguration
    ComponentConfigura...
    ReferenceManager
    ReferenceManager
    RemovedService
    RemovedService
    Remove service from matched list
    Remove service from match...
    (reference)
    (refer...
    reference is in Bound Reference list
    reference is in Bound Reference l...
    Send Notification
    Send Notification
    BECAME_UNSATISFIED
    BECAME...
    See sequence diagram for
    ComponentConfigurationImpl::
    RefChangedState(BECAME_UNSATISFIED)
    See sequence diagram for...

    Copy matched reference list to Bound Reference list
    Copy matched reference list t...
    Clear Bound Reference list
    Clear Bound Reference list
    matched refs >= min cardinality
    matched refs >= min cardinality
    Send Notification
    Send Notification
    REBIND
    REBIND
    See sequence diagram for
    ComponentConfigurationImpl::
    RefChangedState(REBIND)
    See sequence diagram for...
    matched refs < min cardinality
    matched refs < min cardinality
    Client
    Client
    opt
    opt
    opt
    opt
    Viewer does not support full SVG 1.1
    \ No newline at end of file diff --git a/text/0003-declarative-services/ReferenceManager_AddingService.svg b/text/0003-declarative-services/ReferenceManager_AddingService.svg index b2b61db..047eb81 100644 --- a/text/0003-declarative-services/ReferenceManager_AddingService.svg +++ b/text/0003-declarative-services/ReferenceManager_AddingService.svg @@ -1,64 +1,3 @@ -ReferenceManager::AddingServiceReferenceManagerReferenceManagerComponentConfigurationComponentConfigurationComponentConfigurationBaseState{abstract}ComponentConfigurationBaseState{abstract}AddingServiceAdd service reference to matched list 🔒opt[cardinality becomes satisfied]Add service reference to bound list 🔒ResolveRegistersee the sequence diagram forUnsatisfiedReferenceState::Register[cardinality stays satisfied. policy option is GREEDY and the new service is a better match]DeactivateDeactivatesee the sequence diagram forSatisfiedState::DeactivateSwap lowest ranked service reference inbound list with the new service reference🔒ResolveRegister \ No newline at end of file + + +
    opt
    opt
    ComponentConfiguration
    ComponentConfigura...
    ReferenceManager::AddingService binding policy is static
    ReferenceManager::AddingService binding policy is static
    ReferenceManager
    ReferenceManager
    ComponentConfiguration
    ComponentConfigura...
    ReferenceManager
    ReferenceManager
    AddingService
    AddingService
    Client
    Client
    Add service ref to matched list
    Add service re...
    component has a name
    and the name does not match this component name
    component has a name...
    (reference)
    (refer...
    component is not satisfied
    component is not satisfied
    Copy matched refs to bound refs
    Copy matched refs to bound refs
    Notify all Listeners
    Notify all Listeners
    See sequence diagram for
    ComponentConfiguration
    ::Resolve
    See sequence diagram for...
    BECAME_SATISFIED
    BECAME_SATISFIED
    binding policy is static reluctant
    binding policy is static reluc...
    component becomes satisfied
    component becomes satisfied
    binding policy is static greedy
    binding policy is static greedy
    new service is a better match
    new service is a better match
    Clear Bound Reference List to unbind previous reference
    Clear Bound Reference List...
    Notify all Listeners
    Notify all Listeners
    See sequence diagram for
    SatisfiedState::Deactivate
    See sequence diagram for...
    BECAME_UNSATISFIED
    BECAME_UNSATISFIED
    matched refs >= min cardinaltiy
    matched refs >= min cardinaltiy
    Copy matched refs to bound refs
    Copy matched refs to bound refs
    Notify all Listeners
    Notify all Listeners
    See sequence diagram for
    ComponentConfiguration
    ::Resolve
    See sequence diagram for...
    BECAME_SATISFIED
    BECAME_SATISFIED
    component becomes satisfied
    component becomes satisfied
    matched refs >= min cardinaltiy
    matched refs >= min cardinaltiy
    opt
    opt
    opt
    opt
    opt
    opt
    opt
    opt
    opt
    opt
    opt
    opt
    Viewer does not support full SVG 1.1
    \ No newline at end of file diff --git a/text/0003-declarative-services/ReferenceManager_AddingServiceDynamic.svg b/text/0003-declarative-services/ReferenceManager_AddingServiceDynamic.svg new file mode 100644 index 0000000..f222afe --- /dev/null +++ b/text/0003-declarative-services/ReferenceManager_AddingServiceDynamic.svg @@ -0,0 +1,3 @@ + + +
    ComponentConfiguration
    ComponentConfigura...
    ReferenceManagerImpl::AddingService dynamic policy
    ReferenceManagerImpl::AddingService dynamic policy
    ReferenceManager
    ReferenceManager
    ComponentConfiguration
    ComponentConfigura...
    ReferenceManager
    ReferenceManager
    Clear bound refs
    Copy matched refs to bound refs
    Clear bound refs...
    Notify all Listeners
    Notify all Listeners
    See sequence diagram for
    ComponentConfigurationImpl
    ::RefChangedState(BECAME_SATISFIED)
    See sequence diagram for...
    BECAME_SATISFIED
    BECAME_SATISFIED
    reference is not satisfied
    reference is not satisfied
    Clear bound refs
    Copy matched refs to bound refs
    Clear bound refs...
    REBIND
    REBIND
    Notify all Listeners
    Notify all Listeners
    See sequence diagram for
    ComponentConfigurationImpl::RefChangedState
    (REBIND)
    See sequence diagram for...
    AddingService
    AddingService
    Client
    Client
    Add service ref to matched list
    Add service ref to matched list
    component has a name
    and the name does not match this component name
    component has a name...
    (reference)
    (refer...
    min cardinality is 0 or binding policy is dynamic greedy and the new service is a better match
    min cardinality is 0 or binding pol...
    opt
    opt
    matched refs >= min cardinality
    matched refs >= min cardinali...
    reference are satisfied
    reference are satisfied
    opt
    opt
    opt
    opt
    opt
    opt
    Viewer does not support full SVG 1.1
    \ No newline at end of file diff --git a/text/0003-declarative-services/ReferenceManager_RemovedService.svg b/text/0003-declarative-services/ReferenceManager_RemovedService.svg index 2705353..4f72181 100644 --- a/text/0003-declarative-services/ReferenceManager_RemovedService.svg +++ b/text/0003-declarative-services/ReferenceManager_RemovedService.svg @@ -1,56 +1,3 @@ -ReferenceManager::RemovedServiceReferenceManagerReferenceManagerComponentConfigurationComponentConfigurationComponentConfigurationBaseState{abstract}ComponentConfigurationBaseState{abstract}RemovedServiceRemove service reference from matched list 🔒opt[bound reference is being removed]DeactivateDeactivatesee the sequence diagram forSatisfiedState::DeactivateRemove service reference from bound list 🔒[cardinality stays satisfied and policy option is GREEDY]Move next best service reference from matched list to bound list 🔒ResolveRegistersee the sequence diagram forUnsatisfiedReferenceState::Register \ No newline at end of file + + +
    ComponentConfiguration
    ComponentConfigura...
    ReferenceManagerImpl::RemovedService binding policy is static
    ReferenceManagerImpl::RemovedService binding policy is static
    ReferenceManager
    ReferenceManager
    ComponentConfiguration
    ComponentConfigura...
    ReferenceManager
    ReferenceManager
    RemovedService
    RemovedService
    Remove service from matched list
    Remove service from match...
    (reference)
    (refer...
    reference is in Bound Reference list
    reference is in Bound Reference l...

    Copy matched reference list to Bound Reference list
    Copy matched reference list t...
    Clear Bound Reference list
    Clear Bound Reference list
    matched refs >= min cardinality
    matched refs >= min cardinality
    Send Notification
    Send Notification
    BECAME_SATISFIED
    BECAME...
    See sequence diagram for
    ComponentConfigurationImpl
    ::RefChangedState(BECAME_SATISFIED)
    See sequence diagram for...
    Client
    Client
    Send Notification
    Send Notification
    BECAME_UNSATISFIED
    BECAME...
    See sequence diagram for
    ComponentConfigurationImpl
    ::RefChangedState(BECAME_UNSATISFIED)
    See sequence diagram for...
    opt
    opt
    opt
    opt
    Viewer does not support full SVG 1.1
    \ No newline at end of file diff --git a/text/0003-declarative-services/SCRBundleActivator_Start.svg b/text/0003-declarative-services/SCRBundleActivator_Start.svg index 847d03f..0363825 100644 --- a/text/0003-declarative-services/SCRBundleActivator_Start.svg +++ b/text/0003-declarative-services/SCRBundleActivator_Start.svg @@ -1 +1,3 @@ -SCRBundleActivator::StartFrameworkFrameworkSCRBundleActivatorSCRBundleActivatorBundleContextBundleContextComponentRegistryComponentRegistryServiceComponentRuntimeImplServiceComponentRuntimeImplStartGetService<Logger>mLogger<<create>>mRegistryRegisterBundleListener(BundleChanged)mListenerToken<<create>>serviceInstanceRegisterService(serviceInstance)mServiceReg \ No newline at end of file + + +
    SCRActivator
    SCRActivator
    SCRActivator::Start
    SCRActivator::Start
    BundleContext
    BundleContext
    ComponentRegistry
    ComponentRegistry
    ServiceComponentRuntimeImpl
    ServiceComponentRuntimeImpl
    ConfigurationListenerImpl
    ConfigurationListenerImpl
    Framework
    Frame...
    Start
    Start
    GetService<Logger>
    GetSer...
    componentRegistry
    componentRegistry
    logger
    logger
    bundleListenerToken
    bundleListenerToken
    scrServiceReg
    scrSer...
    <<create>>
    <<crea...
    serviceInstance
    serviceInstance
    <<create>>
    <<crea...
    RegisterBundleListener
    RegisterBundleListener
    BundleChanged
    BundleChanged
    serviceInstance
    serviceInstance
    <<create>>
    <<crea...
    RegisterServiceInstance
    RegisterServiceInstance
    configListenerReg
    configL...
    RegisterServiceInstance
    RegisterServiceInstance
    SCRActivator
    SCRActivator
    BundleContext
    BundleContext
    ComponentRegistry
    ComponentRegistry
    ServiceComponentRuntimeImpl
    ServiceComponentRuntimeImpl
    ConfigurationListenerImpl
    ConfigurationListenerImpl
    Framework
    Frame...
    ConfigurationNotifier
    ConfigurationNotifier
    ConfigurationNotifier
    ConfigurationNotifier
    <<create>>
    <<crea...
    Viewer does not support full SVG 1.1
    \ No newline at end of file diff --git a/text/0003-declarative-services/SCRBundleActivator_Stop.svg b/text/0003-declarative-services/SCRBundleActivator_Stop.svg index 1623cfd..cc8a8a0 100644 --- a/text/0003-declarative-services/SCRBundleActivator_Stop.svg +++ b/text/0003-declarative-services/SCRBundleActivator_Stop.svg @@ -1 +1,3 @@ -SCRBundleActivator::StopFrameworkFrameworkSCRBundleActivatorSCRBundleActivatorServiceRegistrationServiceRegistrationServiceComponentRuntimeImplServiceComponentRuntimeImplBundleContextBundleContextSCRBundleExtensionSCRBundleExtensionComponentRegistryComponentRegistryComponentManagerComponentManagerStopUnregister(mServiceReg)deleteRemoveBundleListener(mListenerToken)loop[for each bundle extension created by SCR]deleteremoveComponentManagerdeleteDisablesee the sequence diagram forComponentManager::DisableWait for all stored futuresdelete \ No newline at end of file + + +
    SCRActivator
    SCRActivator
    SCRActivator::Stop
    SCRActivator::Stop
    ServiceRegistration
    ServiceRegistration
    ServiceComponentRuntimeImpl
    ServiceComponentRuntimeImpl
    ComponentRegistry
    ComponentRegistry
    Framework
    Frame...
    Stop
    Stop
    UnregisterService
    Unregi...
    delete
    delete
    for each bundle extension
    for each bundle extension
    BundleContext
    BundleContext
    SCRBundleExtension
    SCRBundleExtension
    ComponentManager
    ComponentManager
    ConfigurationListenerImpl
    ConfigurationListenerImpl
    RemoveBundleListener(bundleListenerToken)
    RemoveBundleListener(bundleListener...
    UnregisterService
    UnregisterService
    scrServiceReg
    scrSer...
    configListenerReg
    configListenerReg
    delete
    delete
    for each component manager 
    for each component manager 
    RemoveComponentManager
    RemoveComponentManager
    delete
    delete
    Disable(asynchronously)
    Disable(asynchronou...
    See sequence diagram for ComponentManager::Disable
    See sequence diagr...
    wait for stored futures from ComponentManager::Disable operation
    wait for stored futures from...
    delete
    delete
    loop
    loop
    SCRActivator
    SCRActivator
    ServiceRegistration
    ServiceRegistration
    ServiceComponentRuntimeImpl
    ServiceComponentRuntimeImpl
    ComponentRegistry
    ComponentRegistry
    BundleContext
    BundleContext
    SCRBundleExtension
    SCRBundleExtension
    ComponentManager
    ComponentManager
    ConfigurationListenerImpl
    ConfigurationListenerImpl
    loop
    loop
    Wait for threadpool
     threads to complete execution
    Wait for threadpool...
    Viewer does not support full SVG 1.1
    \ No newline at end of file diff --git a/text/0003-declarative-services/SatisfiedState_Activate.svg b/text/0003-declarative-services/SatisfiedState_Activate.svg index b4ef30b..ab90a0a 100644 --- a/text/0003-declarative-services/SatisfiedState_Activate.svg +++ b/text/0003-declarative-services/SatisfiedState_Activate.svg @@ -1,76 +1,3 @@ -SatisfiedState::ActivateComponentConfigurationComponentConfigurationSatisfiedStateSatisfiedStatepromisepromiseTransitionStateTransitionStateActiveStateActiveStateUnsatisfiedReferenceStateUnsatisfiedReferenceStateComponentConfigurationBaseState{abstract}ComponentConfigurationBaseState{abstract}Activatecreateget_futureCreate(future)CompareAndSwap(this, transitionObj)true/falsealt[success]DoActivatesee the sequence diagram forSatisfiedState::DoActivateCheckIfRecursionDetectedtrue/falsealt[DoActivate suceeded and no recursion found]CreatenextStateDoDeactivatesee the sequence diagram forSatisfiedState::DoDeactivateCreatenextStateCompareAndSwap(transitionObj, nextState)set_valuealt[if DoActivate failed]throw exception[someother thread succeeded in changing state]GetStatecurrent stateActivate \ No newline at end of file + + +
    Component
     Configuration
    Component...
    RegisteredState
    RegisteredState
    CCRegisteredState::Activate
    CCRegisteredState::Activate
    Activate
    Activate
    ActiveState
    ActiveState
    Create
    Create
    activeState with latch
    activeState with l...
    CompareAndSetState 
    CompareAndSetState 
    (this, activeState)
    (this, activeSt...
    Activate
    Activate
    nullptr
    nullptr
    CompareAndSetState
    (activeState, registeredState
    CompareAndSetState...
    See the sequence diagram for
    CCActiveState::Activate
    See the sequence diagram for...
    ComponentInstance/nullptr
    ComponentInstance/nullptr
    CopmponentInstance
    CopmponentInstance
    ComponentInstance
    ComponentInstance
    nullptr
    nullptr
    Component
     Configuration
    Component...
    RegisteredState
    RegisteredState
    ActiveState
    ActiveState
    Activate
    Activate
    loop until state successfully changed
    loop until state successfu...
    success
    success
    loop
    loop
    ComponentInstance
    ComponentIn...
    nullptr
    nullptr
    opt
    opt
    Viewer does not support full SVG 1.1
    \ No newline at end of file diff --git a/text/0003-declarative-services/SatisfiedState_Deactivate.svg b/text/0003-declarative-services/SatisfiedState_Deactivate.svg index 0521541..c572ab4 100644 --- a/text/0003-declarative-services/SatisfiedState_Deactivate.svg +++ b/text/0003-declarative-services/SatisfiedState_Deactivate.svg @@ -1,56 +1,3 @@ -SatisfiedState::DeactivateComponentConfigurationComponentConfigurationSatisfiedStateSatisfiedStatepromisepromiseTransitionStateTransitionStateUnsatisfiedReferenceStateUnsatisfiedReferenceStateComponentConfigurationBaseState{abstract}ComponentConfigurationBaseState{abstract}Deactivatecreateget_futureCreate(future)CompareAndSwap(this, transitionObj)true/falsealt[success]DoDeactivatesee the sequence diagram forSatisfiedState::DoDeactivateCreatenextStateCompareAndSwap(transitionObj, nextState)set_value[someother thread succeeded in changing state]GetStatecurrent stateDeactivate \ No newline at end of file + + +
    SatisfiedState
    SatisfiedState
    CCSatisfiedState::Deactivate
    CCSatisfiedState::Deactivate
    promise
    promise
    UnsatisfiedReferenceState
    UnsatisfiedReferenceState
    ComponentManager
    ComponentManager
    ComponentConfiguration
    ComponentConfiguration
    Deactivate
    Deactivate
    Create
    Create
    GetFuture
    GetFuture
    Create(Future)
    Create(Future)
    unsatisfiedReferenceState
    unsatisfiedReferenceS...
    CompareAndSetState
    CompareAndSetState
    success/failure
    success/failu...
    UnregisterService(Async)
    UnregisterService(Asy...
    loop
    loop
    DisabledState
    DisabledState
    promise
    promise
    EnabledState
    EnabledState
    ComponentConfiguration
    ComponentConfiguration
    ComponentManager
    ComponentManager
    loop until state successfully changed
    loop until state successfully...
    (currentState, unsatisfiedReferenceState)
    (currentState, unsatisfiedReferen...
    Wait for previous 
    transitions 
    Wait for previo...
    DestroyComponentInstances(Async)
    DestroyComponentInstances(Asy...
    ComponentInstance
    ComponentInstance
    ComponentInstance
    ComponentInstance
    Component Instance DeActivate
     method exists
    Component Instance DeActiv...
    Deactivate
    Deactivate
    opt
    opt
    for each bound references 
    for each bound refere...
    Unbind
    Unbind
    loop
    loop
    Client Bundle
    Client Bundle
    Note: this diagram shows the DestroyComponentInstances functionality for the SingletonComponentConfigurationImpl. The BundleOrPrototypeComponentConfigurationImpl is the same except that the Deactivate and Unbind may happen for more than one component instance. 
    Note: this diagram shows the DestroyComponentInstances functionality for the SingletonComponentConfigurationImpl. T...
    Viewer does not support full SVG 1.1
    \ No newline at end of file diff --git a/text/0003-declarative-services/ServiceComponentRuntime_DisableComponent_v5.svg b/text/0003-declarative-services/ServiceComponentRuntime_DisableComponent_v5.svg index 733b08a..f34f048 100644 --- a/text/0003-declarative-services/ServiceComponentRuntime_DisableComponent_v5.svg +++ b/text/0003-declarative-services/ServiceComponentRuntime_DisableComponent_v5.svg @@ -1,2 +1,4 @@ + + -
    Service Consumer
    Service Consumer
    ServiceComponentRuntimeImpl
    <font style="font-size: 12px">ServiceComponentRuntimeImpl</font>
    1. DisableComponent
    [Not supported by viewer]
    ComponentRegistry
    [Not supported by viewer]
    2. FindComponent
    [Not supported by viewer]
    3. Disable
    [Not supported by viewer]
    ComponentManager
    [Not supported by viewer]
    6. CompareAndSetState(DisabledState)🔒
    8.AddToFuturesList
    [Not supported by viewer]
    EnabledState
    EnabledState
    4. Disable
    4. Disable
    7.1 GetConfigurations
    7.1 GetConfigurations
    a : DisabledState
    a : DisabledState
    7. DeleteConfigurations(this)
    7. DeleteConfigurations(this)
    5. Create
    5. Create
    DependencyManager
    [Not supported by viewer]
    7.3 StopTracking
    [Not supported by viewer]
    BundleContext
    [Not supported by viewer]
    7.6 UnregisterService
    [Not supported by viewer]
    ComponentInstanceImpl
    <<autogenerated>>

    [Not supported by viewer]
    ActiveState
    ActiveState
    7.4 Deactivate
    [Not supported by viewer]
    7.8 Deactivate
    [Not supported by viewer]
    7.5 CompareAndSetState(TransitionState) 🔒
    7.7 RemoveContextAndInstance 
    7.11 CompareAndSetState(UnsatisfiedReferenceState) 🔒
    [Not supported by viewer]
    ServiceImpl
    ServiceImpl
    7.9 Deactivate
    [Not supported by viewer]
    ComponentContext
    ComponentContext
    7.10 Invalidate
    [Not supported by viewer]
    ComponentConfiguration
    [Not supported by viewer]
    7.2. Deactivate(disposed)
    7.2. Deactivate(disposed)
    a : DisabledState
    a : DisabledState
    This operation waits for the future object created during the Enable state transition 
    This operation waits for the future object created during the Enable state transition 
    Legend
    [Not supported by viewer]
    Execution on thread 2
    [Not supported by viewer]
    --
    --
    --
    --
    Asynchronous call
    [Not supported by viewer]
    --
    --
    🔒               --           Atomic operation
    [Not supported by viewer]
    Execution on calling thread
    [Not supported by viewer]
    \ No newline at end of file +
    Service Consumer
    Service Co...
    ServiceComponentRuntimeImpl
    ServiceComponentRuntimeImpl
    1. DisableComponent
    1. DisableComponent
    ComponentRegistry
    ComponentRegistry
    2. FindComponent
    2. FindComponent
    3. Disable
    3. Disable
    ComponentManager
    ComponentManager
    6. CompareAndSetState(DisabledState)🔒
    8.AddToFuturesList
    6. CompareAndSetState(DisabledState)🔒...
    EnabledState
    EnabledState
    4. Disable
    4. Disable
    7.1 GetConfigurations
    7.1 GetConfigurations
    a : DisabledState
    a : DisabledState
    7. DeleteConfigurations(this)
    7. DeleteConfigurations(this)
    5. Create
    5. Create
    DependencyManager
    DependencyManager
    7.3 StopTracking
    7.3 StopTracking
    BundleContext
    BundleContext
    7.6 UnregisterService
    7.6 UnregisterService
    ComponentInstanceImpl
    <<autogenerated>>

    ComponentInstanceImpl...
    ActiveState
    ActiveState
    7.5 Deactivate
    7.5 Deactivate
    7.8 Deactivate
    7.8 Deactivate

    7.7 RemoveContextAndInstance 
    7.11 CompareAndSetState(UnsatisfiedReferenceState) 🔒
    7.7 RemoveContextAndInstance...
    ServiceImpl
    ServiceImpl
    7.9 Deactivate
    7.9 Deactivate
    ComponentContext
    ComponentContext
    7.10 Invalidate
    7.10 Invalidate
    ComponentConfiguration
    ComponentConfiguration
    7.2. Deactivate(disposed)
    7.2. Deactivate(disposed)
    a : DisabledState
    a : DisabledState
    This operation waits for the future object created during the Enable state transition 
    This operation waits for the future obje...
    Legend
    Legend
    Execution on thread 2
    Execution on threa...
    --
    --
    --
    --
    Asynchronous call
    Asynchronous call
    --
    --
    🔒               --           Atomic operation
    🔒               --           Atomic op...
    Execution on calling thread
    Execution on callin...
    Configuration Notifier
    Configuration Notifier
    7.4 Unregister Listener
    7.4 Unregister Listener
    Viewer does not support full SVG 1.1
    \ No newline at end of file diff --git a/text/0003-declarative-services/ServiceConsumerWorkflow_v3.svg b/text/0003-declarative-services/ServiceConsumerWorkflow_v3.svg index 3f797f2..d26b9e6 100644 --- a/text/0003-declarative-services/ServiceConsumerWorkflow_v3.svg +++ b/text/0003-declarative-services/ServiceConsumerWorkflow_v3.svg @@ -1,2 +1,4 @@ + + -
    Service Consumer
    Service Consumer
    BundleContext
    [Not supported by viewer]
    1. GetService
    1. GetService
    ComponentConfiguration
    ComponentConfiguration
    2. GetService
    2. GetService
    ComponentInstanceImpl
    <<autogenerated>>
    [Not supported by viewer]
    ComponentContext
    ComponentContext
    3.3 Create
    3.5 CreateInstanceAndBindDependencies
    3.7 Activate
    3.3 Create<div>3.5 CreateInstanceAndBindDependencies<br></div><div>3.7 Activate</div>
    3.2 Create
    3.2 Create
    ServicveImpl
    ServicveImpl
    3.6 Create
    3.8 Activate
    [Not supported by viewer]
    RegisteredState
    RegisteredState
    3. Activate
    3. Activate
    3.1 CompareAndSetState(TransitionState) 🔒
    3.4 SetContextAndInstance 
    3.9 CompareAndSetState(ActiveStete) 🔒
    [Not supported by viewer]
    Legend
    [Not supported by viewer]
    Execution on calling thread
    [Not supported by viewer]
    --
    --
    🔒              --            Atomic operation
    [Not supported by viewer]
    \ No newline at end of file +
    Actor
    Act...
    BundleContext
    BundleContext
    1. GetService
    1. GetService
    2. GetService
    2. GetService
    3.8. CompareAndSetState(ActiveState🔒

    3.8. CompareAndSetState(ActiveState🔒...
    ComponentConfiguration
    ComponentConfiguration
    RegisteredState
    RegisteredState
    3.3 SetContextAndInstance
    3.3 SetContextAndInstance
    3.2 Create
    3.4 CreateInstanceAndBindDependencies
    3.6 Activate
    3.2 Create...
    UnsatisfiedReferenceState%3CmxGraphModel%3E%3Croot%3E%3CmxCell%20id%3D%220%22%2F%3E%3CmxCell%20id%3D%221%22%20parent%3D%220%22%2F%3E%3CmxCell%20id%3D%222%22%20value%3D%22ComponentConfiguration%22%20style%3D%22rounded%3D0%3BwhiteSpace%3Dwrap%3Bhtml%3D1%3BfillColor%3D%23dae8fc%3BstrokeColor%3D%236c8ebf%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%3CmxGeometry%20x%3D%22650%22%20y%3D%22220%22%20width%3D%22150%22%20height%3D%2240%22%20as%3D%22geometry%22%2F%3E%3C%2FmxCell%3E%3C%2Froot%3E%3C%2FmxGraphModel%3E
    UnsatisfiedReferenceState...
    ComponentContext
    ComponentContext
    ComponentInstanceImpl
    ComponentInstanceImpl
    3.1 Create
    3.1 Create
    3.Activate
    3.Activate
    3.5 Create
    3.7 Activate
    3.5 Create...
    Viewer does not support full SVG 1.1
    \ No newline at end of file diff --git a/text/0003-declarative-services/UnsatisfiedReferenceState_Register.svg b/text/0003-declarative-services/UnsatisfiedReferenceState_Register.svg index fe05e9c..63bb29f 100644 --- a/text/0003-declarative-services/UnsatisfiedReferenceState_Register.svg +++ b/text/0003-declarative-services/UnsatisfiedReferenceState_Register.svg @@ -1,57 +1,3 @@ -UnsatisfiedState::RegisterComponentConfigurationComponentConfigurationUnsatisfiedReferenceStateUnsatisfiedReferenceStatepromisepromiseTransitionStateTransitionStateSatisfiedStateSatisfiedStateComponentConfigurationBaseState{abstract}ComponentConfigurationBaseState{abstract}Registercreateget_futureCreate(future)CompareAndSwap(this, transitionObj)true/falseopt[success]RegisterServicetrue/falseopt[registration suceeded]CreatenextStateCompareAndSwap(transitionObj, nextState)set_value[someother thread succeeded in changing state]GetStatecurrent stateDeactivate \ No newline at end of file + + +
    opt
    opt
    opt
    opt
    UnsatisfiedReference
    State
    UnsatisfiedReferen...
    CCUnsatisfiedReferenceState::Register
    CCUnsatisfiedReferenceState::Register
    promise
    promise
    RegisteredState
    RegisteredState
    ComponentConfiguration
    ComponentConfigura...
    Register
    Register
    Create
    Create
    GetFuture
    GetFuture
    Create(Future)
    Create(Future)
    registeredState
    registeredSta...
    CompareAndSetState
    CompareAndSetState
    (currentState, registeredState)
    (currentState, registered...
    success/failure
    success/failu...
    DisabledState
    DisabledState
    promise
    promise
    EnabledState
    EnabledState
    ComponentManager
    ComponentManager
    loop while state = UnsatisfiedReferenceState
    loop while state = UnsatisfiedRefer...
    Wait for transition
    task to finish
    Wait for transi...
    is service provider
    is service provi...
    RegisterService
    RegisterService
    true/false
    true/false
    service successfully registered
    service successfully regi...
    set_value
    set_value
    meta data immediate = true
    meta data immediate = t...
    Activate
    Activate
    opt
    opt
    See the sequence diagram for
    CCRegisteredState::Activate
    See the sequence diagram...
    CompareAndSetState
    CompareAndSetState
    (registeredState,
    unsatisfiedReferenceState)
    (registeredState,...
    set_value
    set_value
    service registration failed
    service registration...
    loop
    loop
    Initialize
    Initiali...
    Viewer does not support full SVG 1.1
    \ No newline at end of file diff --git a/text/0003-declarative-services/config object deleted.svg b/text/0003-declarative-services/config object deleted.svg new file mode 100644 index 0000000..720e3e3 --- /dev/null +++ b/text/0003-declarative-services/config object deleted.svg @@ -0,0 +1,3 @@ + + +
    Configuration
    Listener
    Configuration...
    ConfigAdmin
    ConfigAdmin
    Actor
    Actor
    1. Remove Configuration Object
    1. Remove Configuration...
    2. configEvent
    2. configEvent
    5. NotifyAllListeners
    5. NotifyAllListeners
    Configuration
    Notifier
    Configuration...
    Component
    Configuration
    Component...
    6. ConfigChangedState
    6. ConfigChangedState
    9 Deactivate
    9 Deactivate
    Unsatisfied
    ReferencesState
    Unsatisfied...
    CM_DELETED
    CM_DELETED
    7. Update Merged Properties
    7. Update Merged Propert...
    Configuration
    Manager
    Configuration...
    8. Not Satisfied
    8. Not Satisfied
    Viewer does not support full SVG 1.1
    \ No newline at end of file diff --git a/text/0003-declarative-services/config object updated.svg b/text/0003-declarative-services/config object updated.svg new file mode 100644 index 0000000..bcfe453 --- /dev/null +++ b/text/0003-declarative-services/config object updated.svg @@ -0,0 +1,3 @@ + + +
    Configuration
    Listener
    Configuration...
    ConfigAdmin
    ConfigAdmin
    Actor
    Actor
    1. Update Configuration Object
    1. Update Configuration...
    2. configEvent
    2. configEvent
    3. GetProperties
    3. GetProperties
    4. properties
    4. properties
    5. NotifyAllListeners
    5. NotifyAllListeners
    Configuration
    Notifier
    Configuration...
    6. ConfigChangedState
    6. ConfigChangedState
    9.1 Modify
    9.1 Modify
    Component
    Instance
    Component...
    9.2 Deactivate
    9.2 Deactivate
    Component
    Configuration
    Component...
    ActiveState
    ActiveState
    7. Update Merged Properties
    7. Update Merged Propert...
    Configuration
    Manager
    Configuration...
    8. Is Satisfied
    8. Is Satisfied
    Viewer does not support full SVG 1.1
    \ No newline at end of file diff --git a/text/0003-declarative-services/functionalUnits.svg b/text/0003-declarative-services/functionalUnits.svg new file mode 100644 index 0000000..debf677 --- /dev/null +++ b/text/0003-declarative-services/functionalUnits.svg @@ -0,0 +1,3 @@ + + +
    ComponentConfiguration
    ComponentConfiguration
    ConfigurationNotifier
    ConfigurationNotifier
    ConfigurationManager
    ConfigurationManager
    ConfigurationAdmin
    ConfigurationAdmin
    Register Callback
    Register Callback
    Notify
    Notify
    ConfigurationListener
    ConfigurationLis...
    Interface
    Interface
    configurationEvent
    configurationEve...
    CM_UPDATED
    CM_DELETED
    CM_UPDATED...
    ConfigChangedState
    ConfigChangedSta...
    Configuration updated or deleted
    Configuration upda...
    Read
    Read
    Properties and State
    Properties...
    Declarative Services Runtime Bundle
    Declarative Services Runtime Bundle
    ConfigurationListener
    ConfigurationListener
    NotifyAllLIsteners
    NotifyAllLIstene...
    Viewer does not support full SVG 1.1
    \ No newline at end of file