Class ConfigurationAdapter

java.lang.Object
org.apache.felix.cm.impl.ConfigurationAdapter
All Implemented Interfaces:
org.osgi.service.cm.Configuration

public class ConfigurationAdapter extends Object implements org.osgi.service.cm.Configuration
The ConfigurationAdapter is just an adapter to the internal configuration object. Instances of this class are returned as Configuration objects to the client, where each caller gets a fresh instance of this class while internal Configuration objects are shared.
  • Field Details

  • Constructor Details

  • Method Details

    • getPid

      public String getPid()
      Specified by:
      getPid in interface org.osgi.service.cm.Configuration
      See Also:
    • getFactoryPid

      public String getFactoryPid()
      Specified by:
      getFactoryPid in interface org.osgi.service.cm.Configuration
      See Also:
    • getBundleLocation

      public String getBundleLocation()
      Specified by:
      getBundleLocation in interface org.osgi.service.cm.Configuration
      See Also:
    • setBundleLocation

      public void setBundleLocation(String bundleLocation)
      Specified by:
      setBundleLocation in interface org.osgi.service.cm.Configuration
      Parameters:
      bundleLocation -
      See Also:
    • update

      public void update() throws IOException
      Specified by:
      update in interface org.osgi.service.cm.Configuration
      Throws:
      IOException
      See Also:
    • update

      public void update(Dictionary<String,?> properties) throws IOException
      Specified by:
      update in interface org.osgi.service.cm.Configuration
      Parameters:
      properties -
      Throws:
      IOException
      See Also:
    • getProperties

      public Dictionary<String,Object> getProperties()
      Specified by:
      getProperties in interface org.osgi.service.cm.Configuration
    • getChangeCount

      public long getChangeCount()
      Specified by:
      getChangeCount in interface org.osgi.service.cm.Configuration
    • delete

      public void delete() throws IOException
      Specified by:
      delete in interface org.osgi.service.cm.Configuration
      Throws:
      IOException
      See Also:
    • updateIfDifferent

      public boolean updateIfDifferent(Dictionary<String,?> properties) throws IOException
      Specified by:
      updateIfDifferent in interface org.osgi.service.cm.Configuration
      Throws:
      IOException
      See Also:
      • Configuration.updateIfDifferent(java.util.Dictionary)
    • addAttributes

      public void addAttributes(org.osgi.service.cm.Configuration.ConfigurationAttribute... attrs) throws IOException
      Specified by:
      addAttributes in interface org.osgi.service.cm.Configuration
      Throws:
      IOException
      See Also:
      • Configuration.addAttributes(org.osgi.service.cm.Configuration.ConfigurationAttribute[])
    • getAttributes

      public Set<org.osgi.service.cm.Configuration.ConfigurationAttribute> getAttributes()
      Specified by:
      getAttributes in interface org.osgi.service.cm.Configuration
      See Also:
      • Configuration.getAttributes()
    • removeAttributes

      public void removeAttributes(org.osgi.service.cm.Configuration.ConfigurationAttribute... attrs) throws IOException
      Specified by:
      removeAttributes in interface org.osgi.service.cm.Configuration
      Throws:
      IOException
      See Also:
      • Configuration.removeAttributes(org.osgi.service.cm.Configuration.ConfigurationAttribute[])
    • getProcessedProperties

      public Dictionary<String,Object> getProcessedProperties(org.osgi.framework.ServiceReference<?> sr)
      Specified by:
      getProcessedProperties in interface org.osgi.service.cm.Configuration
      See Also:
      • Configuration.getProcessedProperties(ServiceReference)
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in interface org.osgi.service.cm.Configuration
      Overrides:
      hashCode in class Object
      See Also:
    • equals

      public boolean equals(Object obj)
      Specified by:
      equals in interface org.osgi.service.cm.Configuration
      Overrides:
      equals in class Object
      Parameters:
      obj -
      See Also:
    • toString

      public String toString()
      Overrides:
      toString in class Object
      See Also:
    • checkActive

      private void checkActive()
      Checks whether this configuration object is backed by an active Configuration Admin Service (ConfigurationManager here).
      Throws:
      IllegalStateException - If this configuration object is not backed by an active ConfigurationManager
    • checkDeleted

      private void checkDeleted()
      Checks whether this configuration object has already been deleted.
      Throws:
      IllegalStateException - If this configuration object has been deleted.
    • checkLocked

      private void checkLocked() throws IOException
      Checks whether this configuration object is locked.
      Throws:
      org.osgi.service.cm.ReadOnlyConfigurationException - If this configuration object is locked.
      IOException