Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Configuration

...

Management

The configuration handler aims to manage component configuration. This handler allows the configuration and dynamic reconfiguration of instances. A configuration is a set of couple (name, value). The name can be a field name or a property name associated to a field or/and a method.

...

In the previous snippet, you can see three configurable properties. The first is a configurable property attached to the field 'foo' that is a service property too. The second is an array property attached to a method (updatArrayupdateArray). The third property is a staticproperty, in the sense that neither field nor method is attached to this property.

...

By setting the attribute propagation to "true", you allow the property propagation to the service registration. It means that at each time that  the that the configuration of the instance is updated, all property contained in the configuration is propagate to the service registrations. For example, in the previous example, not only foowill be published but array and hello.lanaguage too.allows the exposition of the ManagedService service. Therefore, when a new configuration is pushed, the published service properties changes toolanguage are also published.

If a property has a method, this method in invoke is invoked each time that the proeprty property value changes (the method is called to push the initial value just after the constructor). The method receive receives one argument of the type of the property (int an integer array int in the example).

Dynamic Reconfiguration

The handler supports reconfiguration. To reconfigure an instance you can use both iPOJO Factory and the ManagedServiceFactory Managed Service Factory exposed by the factory of the targetted targeted instance. By calling the method reconfigure or update (according of the service do you use), the handler receive the new configuratino configuration and apply it. If the propagation is activated, the service registratinos registrations are updated too.