felix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthias Jeschke <matth...@gmail.com>
Subject Re: Question regarding Config Admin
Date Thu, 05 Mar 2015 12:25:45 GMT
Hi,

After creating the instances I think you have to create the configuration.
What I did was to inject the ConfigurationAdmin and then create a new
configuration (with the respective managed service pid) via
"createFactoryConfiguration()".

Best regards

Matthias


On Thu, Mar 5, 2015 at 1:09 PM, Andrew Phillips <andyphillips404@gmail.com>
wrote:

> I am using iPojo and trying to create some instances of a component with
> different configuration and tying the configuration to the Config Admin in
> karat (so it can be managed with the config commands).
>
> No matter what i do, i cannot get the configuration of these instances to
> show up when i do a config:list in karat.   Any help would be greatly
> appreciated!
>
> Here is how i am creating the instances:
>
> Instance instance = Instance.instance().of(MapQuestGeocodeProvider.class)
>         .named("com.hdscores.geocode.mapquest.MapQuetGeocodeOpenProvider")
>
> .with("managed.service.pid").setto("com.hdscores.geocode.mapquest.MapQuetGeocodeOpenProvider")
>         .with(MapQuestGeocodeProvider.API_URL).setto("
> http://open.mapquestapi.com/geocoding/v1/address")
>
> .with(MapQuestGeocodeProvider.API_KEY).setto("Fmjtd%7Cluur2d6anu%2C7g%3Do5-9ab55u")
>         .with(Constants.SERVICE_RANKING).setto("10")
>         .with(GeocodeServiceProperties.USE_IN_MANAGER).setto("true");
>
> Instance instance2 = Instance.instance().of(MapQuestGeocodeProvider.class)
>
> .named("com.hdscores.geocode.mapquest.MapQuetGeocodeLicensedProvider")
>
> .with("managed.service.pid").setto("com.hdscores.geocode.mapquest.MapQuetGeocodeLicensedProvider")
>         .with(MapQuestGeocodeProvider.API_URL).setto("
> http://www.mapquestapi.com/geocoding/v1/address")
>
> .with(MapQuestGeocodeProvider.API_KEY).setto("Gmjtd%7Cluur2gutnq%2C2l%3Do5-lrasd")
>         .with(Constants.SERVICE_RANKING).setto("1")
>         .with(GeocodeServiceProperties.USE_IN_MANAGER).setto("true”);
>
> the GeocodeProvider class starts off like this:
>
> @Component()
> @Provides(strategy = “SERVICE")
> public class MapQuestGeocodeProvider implements GeocodeService {
>
>     public static final String API_URL = "apiUrl";
>     public static final String API_KEY = "apiKey";
>
>     private Client client;
>
>     @ServiceProperty(name = GeocodeServiceProperties.USE_IN_MANAGER)
>     private boolean useInManager;
>
>     @ServiceProperty(name=API_URL)
>     private String apiUrl;
>
>     @ServiceProperty(name=API_KEY)
>     private String apiKey;
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message