felix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Carlos Quiroz <cqui...@gemini.edu>
Subject Re: iPojo and FileInstall component configuration
Date Fri, 18 Feb 2011 18:48:04 GMT
Hi

Thanks for the answer, I tried option 1 and 3 and though it says that the configuration is
picked up and a configuration update is scheduled my component is never created

However in a variation of option 3 if I keep the @Instantiate it works.

It seems fileinstall won't create a component by default?

My class looks like this now:
@Component(managedservice = "ActiveMQBrokerComponent")
@Instantiate
public class ActiveMQBrokerComponent {

Carlos

On Feb 18, 2011, at 3:04 PM, Clement Escoffier wrote:

> 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" <cquiroz@gemini.edu> 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: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Mime
View raw message