Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright (c) OSGi Alliance (2004, 2011). All Rights Reserved.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *      http://www.apache.org/licenses/LICENSE-2.0
   *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
 package org.osgi.service.cm;
 
 
A Configuration Event.

ConfigurationEvent objects are delivered to all registered ConfigurationListener service objects. ConfigurationEvents must be asynchronously 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.

Version:
$Id: 1493c281dfd9387837e6399b9b815cdc8dc43453 $
Since:
1.2
See also:
ConfigurationListener
Immutable:
 
 public class ConfigurationEvent {
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(java.util.Dictionary) successfully changes a configuration.

 
 	public static final int			CM_UPDATED	= 1;
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.

 
 	public static final int			CM_DELETED	= 2;

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(java.lang.String) successfully changes the location.

Since:
1.4
 
 	public static final int			CM_LOCATION_CHANGED	= 3;
Type of this event.

See also:
getType()
 
 	private final int				type;
The factory pid associated with this event.
 
	private final String			factoryPid;
The pid associated with this event.
	private final String			pid;
The ConfigurationAdmin service which created this event.
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.
			int type,
			String factoryPidString pid) {
		this. = reference;
		this. = type;
		this. = factoryPid;
		this. = pid;
		if ((reference == null) || (pid == null)) {
			throw new NullPointerException("reference and pid must not be null");
		}
	}

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.
	public String getFactoryPid() {
		return ;
	}

Returns the pid of the associated configuration.

Returns:
Returns the pid of the associated configuration.
	public String getPid() {
		return ;
	}

Return the type of this event.

The type values are:

Returns:
The type of this event.
	public int getType() {
		return ;
	}

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.
		return ;
	}
New to GrepCode? Check out our FAQ X