Top Description Fields Constructors Methods
org.osgi.service.cm

public Class ConfigurationEvent

extends Object
Class Inheritance
Imports
java.util.Dictionary, org.osgi.framework.ServiceReference

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.

Author
$Id: e266360d8a545733d97677262d7b3af4e17e873e $
Since
1.2
See Also
ConfigurationListener

Field Summary

Modifier and TypeField and Description
public static final int
CM_DELETED

A Configuration has been deleted.

public static final int
CM_LOCATION_CHANGED

The location of a Configuration has been changed.

public static final int
CM_UPDATED

A Configuration has been updated.

private final String
factoryPid

The factory pid associated with this event.

private final String
pid

The pid associated with this event.

private final ServiceReference<ConfigurationAdmin>
reference

The ConfigurationAdmin service which created this event.

private final int
type

Type of this event.

Constructor Summary

AccessConstructor and Description
public
ConfigurationEvent(ServiceReference<ConfigurationAdmin>
The ServiceReference object of the Configuration Admin service that created this event.
reference
,
int
The event type. See getType().
type
,
String
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.
factoryPid
,
String
The pid of the associated configuration.
pid
)

Constructs a ConfigurationEvent object from the given ServiceReference object, event type, and pids.

Method Summary

Modifier and TypeMethod and Description
public String

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.
getFactoryPid
()

Returns the factory pid of the associated configuration.

public String

Returns:

Returns the pid of the associated configuration.
getPid
()

Returns the pid of the associated configuration.

public ServiceReference<ConfigurationAdmin>

Returns:

The ServiceReference object for the Configuration Admin service that created this event.
getReference
()

Return the ServiceReference object of the Configuration Admin service that created this event.

public int

Returns:

The type of this event.
getType
()

Return the type of this event.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

CM_DELETEDback to summary
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.

CM_LOCATION_CHANGEDback to summary
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
CM_UPDATEDback to summary
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.

factoryPidback to summary
private final String factoryPid

The factory pid associated with this event.

pidback to summary
private final String pid

The pid associated with this event.

referenceback to summary
private final ServiceReference<ConfigurationAdmin> reference

The ConfigurationAdmin service which created this event.

typeback to summary
private final int type

Type of this event.

See Also
getType()

Constructor Detail

ConfigurationEventback to summary
public ConfigurationEvent(ServiceReference<ConfigurationAdmin> reference, int type, String factoryPid, String pid)

Constructs a ConfigurationEvent object from the given ServiceReference object, event type, and pids.

Parameters
reference:ServiceReference<ConfigurationAdmin>

The ServiceReference object of the Configuration Admin service that created this event.

type:int

The event type. See getType().

factoryPid:String

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:String

The pid of the associated configuration.

Method Detail

getFactoryPidback to summary
public String getFactoryPid()

Returns the factory pid of the associated configuration.

Returns:String

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.

getPidback to summary
public String getPid()

Returns the pid of the associated configuration.

Returns:String

Returns the pid of the associated configuration.

getReferenceback to summary
public ServiceReference<ConfigurationAdmin> getReference()

Return the ServiceReference object of the Configuration Admin service that created this event.

Returns:ServiceReference<ConfigurationAdmin>

The ServiceReference object for the Configuration Admin service that created this event.

getTypeback to summary
public int getType()

Return the type of this event.

The type values are:

Returns:int

The type of this event.