Andrea Zoppello wrote:
Hi Felix,

See my comments inline:

Il 04/05/2010 08:28, Felix Meschberger ha scritto:
Hi,

On 03.05.2010 18:40, Andrea Zoppello wrote:
Hi Stojan,

Thanks for the response, actually as you described ( specifically for
component factories implementing the Event Handler ) interface, i see
SCR is
trying to reactivate the component.
Really ?

Component Factory component configurations are not created by SCR, they
are created by calling the ComponentFactory.newInstance() method.

IIUIC if the activate method throws, the newInstance method should throw
a ComponentException because "the Service Component Runtime is unable to
activate the component configuration." (112.12.5.1). Though this seems
to not be explicitly stated in 112.5.5, yet the Felix SCR does it.

Yes it's as you've described, i am calling "ComponentFactory.newInstance()" in explicit way from my code. and if the component won't be able to be activated a Component Exception is thrown, that's right.

But as Stojan write to me it seems SCR is tryng to reactivate my component.

The component configuration created by a ComponentFactory.newInstance() has slightly different life cycle. If it fails to activate, newInstance() must throw ComponentException. In this case the component configuration must be disposed by SCR. The equinox DS implementatin has a bug in this case and does not dispose the component configuration that failed to activate. I have opened a bug to track and fix this (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=311579).

In all other cases component configurations that fail to activate and are still satisfied, may be activated later by SCR. I was referring to this scenario in my previous mail.


I am confused ....

Aren't you using a factory components (or ComponentFactory) ? Or are you
using regular components configured with factory configurations ?

In the first case, you have to call the newInstance() method to create
component configurations and you won't get an instance back if the
activation fails.

In the second case, SCR of course deactivates the component but upon a
new event (like service registration/unregistration or configuration
update) may try to activate the component again.


Sorry probably i was not clear in my explanation.

In my architecture i've a set of Component Factories that are intended to be used by a Deployment Service ( this is implemented as simple DS component that have 1..n dependencies on component factory ).

Basically when an event happen ( btw a file is deployed in a particular folder ) the Deployment Service use one of the Component Factories and use it ( calling the "ComponentFactory.newInstance()" ) to create component instances, so i'm basically investigating if it's possible to implement what Stojan ( tarcking enabled/disabled components )
suggested in my Deployment Service.

Based on the latest info I think you may leave your code as it is.

Regards,
Stoyan


Hope now it's more clear...

Andrea

_______________________________________________
OSGi Developer Mail List
[email protected]
https://mail.osgi.org/mailman/listinfo/osgi-dev

Reply via email to