To enable this mechanism, register the injection in your {@link Application#init()} method likethis:
getComponentInstantiationListeners().add(new OsgiComponentInjector());By default, injected services are wrapped in a proxy to take care of class loading issues when deserializing a component from the page store. On serialization, the proxy replaces the wrapped service (which may not be serializable itself) by a serializable reference (its interface name, essentially). On deserialization, the proxy retrieves the matching service from the OSGi service registry.
TODO Injection is not deterministic when there is more than one service of the required type. This class should be extended to disambiguate candidate services either by a {@code @Named}qualifier or by a dedicated qualifier taking service properties as parameters. @author Harald Wellmann
|
|