Hi,

The 'managedservice' attribute cannot be the component class name as it's
already used as a ManagedServiceFactory. So, you've several choice:
- remove the @Instantiate and the managed service attribute: iPOJO will
registers the managed service factory and file install will push your
configuration (which creates an iPOJO instance)
- set publicFactory=false in the @Component : so the ManagedServiceFactory
won't be published by iPOJO, and so only the ManagedService will be
published (using the
pid:edu.gemini.jms.activemq.broker.ActiveMQBrokerComponent)
- Change the managedservice attribute to be something different and rename
your cfg file

Regards,

Clement

  

On 18.02.11 14:29, "Carlos Quiroz" <[email protected]> wrote:

>Hi
>
>I'm trying to use file install to configure my iPojo components which are
>normally singletons but I'm stuck in that my objects get configured twice
>once by iPojo and once by fileinstall.
>My objects are annotated like this:
>
>@Component(managedservice =
>"edu.gemini.jms.activemq.broker.ActiveMQBrokerComponent")
>@Instantiate
>public class ActiveMQBrokerComponent {
>    @Property(name = "brokerUrl", value = "INVALID", mandatory = true)
>    private String url;
>...
>
>And I have a configuration file called
>edu.gemini.jms.activemq.broker.ActiveMQBrokerComponent.cfg with the
>properties like brokerUrl
>
>It seems first ipojo creates the object and updates them with the default
>config and then fileinstall does it again with the correct ones from the
>file.
>
>What I'd like is that the object is created and updated only once when
>the configuration is available via fileinstall.
>
>It seems I can do that with FileInstall if I remove the @Instantiate and
>use a configuration file like
>edu.gemini.jms.activemq.broker.ActiveMQBrokerComponent-<PID>.cfg
>
>Is that the way this should be done, or is there a better way to achieve
>creating and configuring a single ipojo component
>
>Regards
>Carlos
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [email protected]
>For additional commands, e-mail: [email protected]
>



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to