Class ConfigurationEvent

java.lang.Object
org.osgi.service.cm.ConfigurationEvent

public class ConfigurationEvent extends Object
A Configuration Event.

ConfigurationEvent objects are delivered to all registered ConfigurationListener service objects. ConfigurationEvents must be delivered in chronological order with respect to each listener.

A type code is used to identify the type of event. The following event types are defined:

Additional event types may be defined in the future.

Security Considerations. ConfigurationEvent objects do not provide Configuration objects, so no sensitive configuration information is available from the event. If the listener wants to locate the Configuration object for the specified pid, it must use ConfigurationAdmin.

Since:
1.2
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    A Configuration has been deleted.
    static final int
    The location of a Configuration has been changed.
    static final int
    A Configuration has been updated.
    private final String
    The factory pid associated with this event.
    private final String
    The pid associated with this event.
    private final org.osgi.framework.ServiceReference<ConfigurationAdmin>
    The ConfigurationAdmin service which created this event.
    private final int
    Type of this event.
  • Constructor Summary

    Constructors
    Constructor
    Description
    ConfigurationEvent(org.osgi.framework.ServiceReference<ConfigurationAdmin> reference, int type, String factoryPid, String pid)
    Constructs a ConfigurationEvent object from the given ServiceReference object, event type, and pids.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the factory pid of the associated configuration.
    Returns the pid of the associated configuration.
    org.osgi.framework.ServiceReference<ConfigurationAdmin>
    Return the ServiceReference object of the Configuration Admin service that created this event.
    int
    Return the type of this event.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • CM_UPDATED

      public static final int CM_UPDATED
      A Configuration has been updated.

      This ConfigurationEvent type that indicates that a Configuration object has been updated with new properties. An event is fired when a call to Configuration.update(Dictionary) successfully changes a configuration.

      See Also:
    • CM_DELETED

      public static final int CM_DELETED
      A Configuration has been deleted.

      This ConfigurationEvent type that indicates that a Configuration object has been deleted. An event is fired when a call to Configuration.delete() successfully deletes a configuration.

      See Also:
    • CM_LOCATION_CHANGED

      public static final int CM_LOCATION_CHANGED
      The location of a Configuration has been changed.

      This ConfigurationEvent type that indicates that the location of a Configuration object has been changed. An event is fired when a call to Configuration.setBundleLocation(String) successfully changes the location.

      Since:
      1.4
      See Also:
    • type

      private final int type
      Type of this event.
      See Also:
    • factoryPid

      private final String factoryPid
      The factory pid associated with this event.
    • pid

      private final String pid
      The pid associated with this event.
    • reference

      private final org.osgi.framework.ServiceReference<ConfigurationAdmin> reference
      The ConfigurationAdmin service which created this event.
  • Constructor Details

    • ConfigurationEvent

      public ConfigurationEvent(org.osgi.framework.ServiceReference<ConfigurationAdmin> reference, int type, String factoryPid, String pid)
      Constructs a ConfigurationEvent object from the given ServiceReference object, event type, and pids.
      Parameters:
      reference - The ServiceReference object of the Configuration Admin service that created this event.
      type - The event type. See getType().
      factoryPid - The factory pid of the associated configuration if the target of the configuration is a ManagedServiceFactory. Otherwise null if the target of the configuration is a ManagedService.
      pid - The pid of the associated configuration.
  • Method Details

    • getFactoryPid

      public String getFactoryPid()
      Returns the factory pid of the associated configuration.
      Returns:
      Returns the factory pid of the associated configuration if the target of the configuration is a ManagedServiceFactory. Otherwise null if the target of the configuration is a ManagedService.
    • getPid

      public String getPid()
      Returns the pid of the associated configuration.
      Returns:
      Returns the pid of the associated configuration.
    • getType

      public int getType()
      Return the type of this event.

      The type values are:

      Returns:
      The type of this event.
    • getReference

      public org.osgi.framework.ServiceReference<ConfigurationAdmin> getReference()
      Return the ServiceReference object of the Configuration Admin service that created this event.
      Returns:
      The ServiceReference object for the Configuration Admin service that created this event.