Thanks Clement!
A small question.
I still cannot find how to get the managedservice parameter from the
architecture.getInstanceDescription()
Currently I have:
@Component(architecture=true, immediate=true, propagation = true,
managedservice
=
"ch
.ethz.inf.vs.aparat.registry.osgi.services.DeviceRegistryServiceImpl")
@Provides
public class DeviceRegistryServiceImpl implements
DeviceRegistryService {
.......
@Requires
private Architecture architecture;
@Validate
public void start() {
......
// I need the managedservice value here
}
On Oct 12, 2009, at 7:58 AM, Clement Escoffier wrote:
Hi,
On 12.10.2009, at 02:01, Vlatko Davidovski wrote:
Hi!
As I am new to iPojo, I have a couple of questions:
1. How to get the value of the annotated field managedservice
programmatically?
The Architecture service can give you such information. If not
disabled, every instance exposed an Architecture service allowing
you to get the InstanceDescription. Thanks to that object you can
check the current state of properties, provided services,
dependencies...
2. Does immediate attribute of service A mean that required
services (B & C) are monitored and as soon as they are available,
an instance of the service A is created?
Immediate means that, as soon as valid (i.e.e service dependencies
resolved), a POJO instance will be created. It will not create a
component instance, but it will create a component implementation
class object.
3. What is the difference between @Property and @ServiceProperty?
@ServiceProperty are properties published with the provided services
(if the instance publishes services).
@Property are internal properties which are not published with the
provided services.
4. What is the usage of the attributes architecture,
factory_method, public_factory of @Component?
- architecture allows you to disable the introspection service. The
introspection is enabled by default.
- factory_method allows you to use a static method of the class to
create the POJO object. In that case, iPOJO call this method instead
of the regular constructor when the creation of one object is
required.
- public_factory allows you to set if the component type factory is
public or not. Public factories (the default) are exposed as
services (Factory, and ManagedServiceFactory) and allows the
creation of component instances from others bundles (either declared
inside a metadata.xml, or with the API).
Regards,
Clement
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]