diff options
author | Thomas Watson | 2013-08-19 19:36:18 +0000 |
---|---|---|
committer | Thomas Watson | 2013-08-19 19:36:18 +0000 |
commit | f48da5275ec3112c07f84e38efddd3765240adc5 (patch) | |
tree | 89b5018b5ffa45cbc7d49a8af17836e976e84a56 /bundles/org.eclipse.equinox.cm/src/org/eclipse/equinox/internal/cm/ConfigurationImpl.java | |
parent | fe4710104535d10c0a28a7e8ae6154bcf770c69e (diff) | |
download | rt.equinox.bundles-f48da5275ec3112c07f84e38efddd3765240adc5.tar.gz rt.equinox.bundles-f48da5275ec3112c07f84e38efddd3765240adc5.tar.xz rt.equinox.bundles-f48da5275ec3112c07f84e38efddd3765240adc5.zip |
No longer use wrapped configuration objects
- OSGi CT no longer requires this for permissions
Diffstat (limited to 'bundles/org.eclipse.equinox.cm/src/org/eclipse/equinox/internal/cm/ConfigurationImpl.java')
-rw-r--r-- | bundles/org.eclipse.equinox.cm/src/org/eclipse/equinox/internal/cm/ConfigurationImpl.java | 78 |
1 files changed, 6 insertions, 72 deletions
diff --git a/bundles/org.eclipse.equinox.cm/src/org/eclipse/equinox/internal/cm/ConfigurationImpl.java b/bundles/org.eclipse.equinox.cm/src/org/eclipse/equinox/internal/cm/ConfigurationImpl.java index e15ba7a42..fcda0a717 100644 --- a/bundles/org.eclipse.equinox.cm/src/org/eclipse/equinox/internal/cm/ConfigurationImpl.java +++ b/bundles/org.eclipse.equinox.cm/src/org/eclipse/equinox/internal/cm/ConfigurationImpl.java @@ -23,7 +23,7 @@ import org.osgi.service.cm.*; * The lock and unlock methods are used for synchronization. Operations outside of * ConfigurationImpl that expect to have control of the lock should call checkLocked */ -class ConfigurationImpl { +class ConfigurationImpl implements Configuration { final static String LOCATION_BOUND = "org.eclipse.equinox.cm.location.bound"; //$NON-NLS-1$ final static String PROPERTIES_NULL = "org.eclipse.equinox.cm.properties.null"; //$NON-NLS-1$ final static String CHANGE_COUNT = "org.eclipse.equinox.cm.change.count"; //$NON-NLS-1$ @@ -193,12 +193,11 @@ class ConfigurationImpl { } } - public String getBundleLocation(String forBundleLocation) { + public String getBundleLocation() { try { lock(); checkDeleted(); - if (forBundleLocation != null && !forBundleLocation.equals(bundleLocation)) - configurationAdminFactory.checkConfigurePermission(bundleLocation, forBundleLocation); + configurationAdminFactory.checkConfigurePermission(bundleLocation, null); if (bundleLocation != null) return bundleLocation; return null; @@ -294,12 +293,12 @@ class ConfigurationImpl { } } - public void setBundleLocation(String bundleLocation, String forBundleLocation) { + public void setBundleLocation(String bundleLocation) { try { lock(); checkDeleted(); - configurationAdminFactory.checkConfigurePermission(this.bundleLocation, forBundleLocation); - configurationAdminFactory.checkConfigurePermission(bundleLocation, forBundleLocation); + configurationAdminFactory.checkConfigurePermission(this.bundleLocation, null); + configurationAdminFactory.checkConfigurePermission(bundleLocation, null); String oldLocation = this.bundleLocation; this.bundleLocation = bundleLocation; this.bound = false; @@ -401,69 +400,4 @@ class ConfigurationImpl { unlock(); } } - - Configuration getConfiguration(String forBundleLocation) { - return new ConfigurationForBundle(forBundleLocation); - } - - class ConfigurationForBundle implements Configuration { - private final String forBundleLocation; - - ConfigurationForBundle(String forBundleLocation) { - this.forBundleLocation = forBundleLocation; - } - - public String getPid() { - return getImpl().getPid(); - } - - public Dictionary<String, Object> getProperties() { - return getImpl().getProperties(); - } - - public void update(Dictionary<String, ?> properties) throws IOException { - getImpl().update(properties); - } - - public void delete() { - getImpl().delete(); - } - - public String getFactoryPid() { - return getImpl().getFactoryPid(); - } - - public void update() throws IOException { - getImpl().update(); - } - - public void setBundleLocation(String location) { - getImpl().setBundleLocation(location, forBundleLocation); - } - - public String getBundleLocation() { - return getImpl().getBundleLocation(forBundleLocation); - } - - public long getChangeCount() { - return getImpl().getChangeCount(); - } - - @Override - public boolean equals(Object other) { - if (!(other instanceof ConfigurationForBundle)) { - return false; - } - return getImpl().equals(((ConfigurationForBundle) other).getImpl()); - } - - @Override - public int hashCode() { - return getImpl().hashCode(); - } - - private ConfigurationImpl getImpl() { - return ConfigurationImpl.this; - } - } }
\ No newline at end of file |