Package org.apache.felix.cm.impl
Class ConfigurationAdminImpl
java.lang.Object
org.apache.felix.cm.impl.ConfigurationAdminImpl
- All Implemented Interfaces:
org.osgi.service.cm.ConfigurationAdmin
public class ConfigurationAdminImpl
extends Object
implements org.osgi.service.cm.ConfigurationAdmin
The
ConfigurationAdminImpl is the per-bundle frontend to the
configuration manager. Instances of this class are created on-demand for
each bundle trying to get hold of the ConfigurationAdmin
service.-
Field Summary
FieldsFields inherited from interface org.osgi.service.cm.ConfigurationAdmin
SERVICE_BUNDLELOCATION, SERVICE_FACTORYPID -
Constructor Summary
ConstructorsConstructorDescriptionConfigurationAdminImpl(ConfigurationManager configurationManager, org.osgi.framework.Bundle bundle) -
Method Summary
Modifier and TypeMethodDescription(package private) voidcheckPermission(ConfigurationManager configurationManager, String name, boolean checkOwn) Checks whether the current access control context (call stack) has the given permission for the given bundle location and throws aSecurityExceptionif this is not the case.(package private) voidcheckPermission(ConfigurationManager configurationManager, String name, String action, boolean checkOwn) Checks whether the current access control context (call stack) has the given permission for the given bundle location and throws aSecurityExceptionif this is not the case.org.osgi.service.cm.ConfigurationcreateFactoryConfiguration(String factoryPid) org.osgi.service.cm.ConfigurationcreateFactoryConfiguration(String factoryPid, String location) (package private) voiddispose()(package private) org.osgi.framework.Bundleorg.osgi.service.cm.ConfigurationgetConfiguration(String pid) org.osgi.service.cm.ConfigurationgetConfiguration(String pid, String location) private ConfigurationManagerReturns theConfigurationManagerbacking this configuration admin instance or throwsIllegalStateExceptionif already disposed off.org.osgi.service.cm.ConfigurationgetFactoryConfiguration(String factoryPid, String name) org.osgi.service.cm.ConfigurationgetFactoryConfiguration(String factoryPid, String name, String location) (package private) booleanhasPermission(ConfigurationManager configurationManager, String name) Returnstrueif the current access control context (call stack) has the CONFIGURE permission.org.osgi.service.cm.Configuration[]listConfigurations(String filter) private org.osgi.service.cm.Configurationwrap(ConfigurationImpl configuration)
-
Field Details
-
configurationManager
-
bundle
private volatile org.osgi.framework.Bundle bundle
-
-
Constructor Details
-
ConfigurationAdminImpl
ConfigurationAdminImpl(ConfigurationManager configurationManager, org.osgi.framework.Bundle bundle)
-
-
Method Details
-
dispose
void dispose() -
getBundle
org.osgi.framework.Bundle getBundle() -
createFactoryConfiguration
public org.osgi.service.cm.Configuration createFactoryConfiguration(String factoryPid) throws IOException - Specified by:
createFactoryConfigurationin interfaceorg.osgi.service.cm.ConfigurationAdmin- Throws:
IOException
-
createFactoryConfiguration
public org.osgi.service.cm.Configuration createFactoryConfiguration(String factoryPid, String location) throws IOException - Specified by:
createFactoryConfigurationin interfaceorg.osgi.service.cm.ConfigurationAdmin- Throws:
IOException
-
getConfiguration
- Specified by:
getConfigurationin interfaceorg.osgi.service.cm.ConfigurationAdmin- Throws:
IOException
-
getConfiguration
public org.osgi.service.cm.Configuration getConfiguration(String pid, String location) throws IOException - Specified by:
getConfigurationin interfaceorg.osgi.service.cm.ConfigurationAdmin- Throws:
IOException
-
listConfigurations
public org.osgi.service.cm.Configuration[] listConfigurations(String filter) throws IOException, org.osgi.framework.InvalidSyntaxException - Specified by:
listConfigurationsin interfaceorg.osgi.service.cm.ConfigurationAdmin- Throws:
IOExceptionorg.osgi.framework.InvalidSyntaxException
-
wrap
-
hasPermission
Returnstrueif the current access control context (call stack) has the CONFIGURE permission. -
checkPermission
Checks whether the current access control context (call stack) has the given permission for the given bundle location and throws aSecurityExceptionif this is not the case.- Parameters:
name- The bundle location to check for permission. If this isnullpermission is always granted.checkOwn- Iffalsepermission is always granted ifnameis the same the using bundle's location.- Throws:
SecurityException- if the access control context does not have the appropriate permission
-
checkPermission
void checkPermission(ConfigurationManager configurationManager, String name, String action, boolean checkOwn) Checks whether the current access control context (call stack) has the given permission for the given bundle location and throws aSecurityExceptionif this is not the case.- Parameters:
name- The bundle location to check for permission. If this isnullpermission is always granted.action- The action to check.checkOwn- Iffalsepermission is always granted ifnameis the same as the using bundle's location.- Throws:
SecurityException- if the access control context does not have the appropriate permission
-
getConfigurationManager
Returns theConfigurationManagerbacking this configuration admin instance or throwsIllegalStateExceptionif already disposed off.- Returns:
- The
ConfigurationManagerinstance if still active - Throws:
IllegalStateException- if this instance has been disposed off already.
-
getFactoryConfiguration
public org.osgi.service.cm.Configuration getFactoryConfiguration(String factoryPid, String name, String location) throws IOException - Specified by:
getFactoryConfigurationin interfaceorg.osgi.service.cm.ConfigurationAdmin- Throws:
IOException- See Also:
-
getFactoryConfiguration
public org.osgi.service.cm.Configuration getFactoryConfiguration(String factoryPid, String name) throws IOException - Specified by:
getFactoryConfigurationin interfaceorg.osgi.service.cm.ConfigurationAdmin- Throws:
IOException- See Also:
-