com.day.cq.commons
Interface ConfigHelper


public interface ConfigHelper

ConfigHelper provide convenience methods for retrieving osgi configs.


Method Summary
 org.osgi.service.cm.Configuration getConfiguration(org.osgi.service.component.ComponentContext ctx)
          Returns the configuration for the component with the given context.
 org.osgi.service.cm.Configuration getConfiguration(String servicePid)
          Returns the configuration for the given service pid.
 String getJcrConfigPath(org.osgi.service.cm.Configuration config)
          Returns the path to a configuration stored in the repository or null if the configuration is not stored in the repository.
 

Method Detail

getConfiguration

org.osgi.service.cm.Configuration getConfiguration(org.osgi.service.component.ComponentContext ctx)
                                                   throws IOException
Returns the configuration for the component with the given context. this is a convenience method that retrieves the service.pid from the context and then calls getConfiguration(String)

Parameters:
ctx - the component context
Returns:
the configuration or null
Throws:
IOException - if an error in the underlying config admin occurrs.

getConfiguration

org.osgi.service.cm.Configuration getConfiguration(String servicePid)
                                                   throws IOException
Returns the configuration for the given service pid.

Parameters:
servicePid - the pid of the service
Returns:
the configuration
Throws:
IOException - if an error in the underlying config admin occurrs.

getJcrConfigPath

String getJcrConfigPath(org.osgi.service.cm.Configuration config)
Returns the path to a configuration stored in the repository or null if the configuration is not stored in the repository.

Parameters:
config - the configuration to retrieve the path for
Returns:
the path or null


Copyright © 2009 Day Management AG. All Rights Reserved.