> -----Original Message-----
> From: [email protected] [mailto:[email protected]] On Behalf Of
> Sanjeeb Sahoo
> Sent: Friday, June 25, 2010 2:55 PM
> To: [email protected]
> Cc: Larry Touve
> Subject: Re: ManagedServiceFactory Properties
> 
> Typically one has to use ServiceReference.getProprty() method to know
> the properties of the service object. But, I have a feeling you are not
> using config admin correctly. Why are you interested in what properties
> are used to configure the ManagedServiceFactory? Typically, one sets
> only PID of the ManagesServiceFactory. This PID is then used to create a
> configuration using ConfigurationAdmin.createFactoryConfiguration. What
> are you going to achieve by setting all those extra properties in the
> ManagedServiceFactory object?

I wanted to set up a set of default properties for the service.  What I had in 
mind is that the bundle sets up some default properties in the manifest header 
and those are passed along to the registration of the MSF.  Then when a Client 
needs to create an instance, they provide additional properties, or override 
the default ones specified.  If I need to change the defaults, then I can just 
change the manifest header.

For example, I have some MSFs that create instances of Topic Subscribers.  The 
clients don't need to know the name of the topic that is being subscribed to, 
that is set in the bundle's Manifest header.  They just provide some properties 
specific to their instance.  Like I mentioned, it's really no different from 
passing the properties along through the MSF's constructor, which can then pass 
them along to the newly created instance of the class.  I just thought that 
there would be an easy way to get them from the configuration.

Thanks,
 Larry

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

Reply via email to