Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [virgo-dev] Configuration of bundles

Simple answer is "Yes".

With the code sample that you provided, your config properties file must be named: "my_unique_pid.properties".

Drop that file into pickup and it will be deployed as ConfigurationAdmin configuration and your ManagedService will be updated with correct configuration.

You can also use a ConfigurationListener and postone publishing your service (not ManagedService) till configuration that you are looking for is available.

Dmitry

On Tue, Nov 2, 2010 at 2:56 PM, Peter Lauri <peter.lauri@xxxxxx> wrote:
Hi,

I have a bundle that is providing a service that needs to be configured before it starts. As I have understood it there are two approaches, one is to use the ManagedService and one is to use the ConfigurationAdmin. However, how do this map to Virgo? If I put a properties file to "pickup" that will be deployed as a configuration artifact. Should that map directly to the ManagedService.update() call?

    Hashtable<String, String> prop = new Hashtable<String, String>();
    prop.put(Constants.SERVICE_PID, "my_unique_pid");
    this.managedServiceRegistration = bundleContext.registerService(ManagedService.class.getName(), this, prop);

/Peter

_______________________________________________
virgo-dev mailing list
virgo-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/virgo-dev



Back to the top