|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.felix.cm.impl.ConfigurationAdminImpl
public class ConfigurationAdminImpl
The ConfigurationAdminImpl is the per-bundle frontend to the
configuration manager. Instances of this class are created on-demand for
each bundle trying to get hold of the ConfigurationAdmin
service.
| Field Summary |
|---|
| Fields inherited from interface org.osgi.service.cm.ConfigurationAdmin |
|---|
SERVICE_BUNDLELOCATION, SERVICE_FACTORYPID |
| Method Summary | |
|---|---|
Configuration |
createFactoryConfiguration(String factoryPid)
Create a new factory Configuration object with a new PID. |
Configuration |
createFactoryConfiguration(String factoryPid,
String location)
Create a new factory Configuration object with a new PID. |
Configuration |
getConfiguration(String pid)
Get an existing or new Configuration object from the
persistent store. |
Configuration |
getConfiguration(String pid,
String location)
Get an existing Configuration object from the persistent
store, or create a new Configuration object. |
Configuration[] |
listConfigurations(String filter)
List the current Configuration objects which match the
filter. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public Configuration createFactoryConfiguration(String factoryPid)
throws IOException
ConfigurationAdminConfiguration object with a new PID.
The properties of the new Configuration object are
null until the first time that its
Configuration.update(Dictionary) method is called.
It is not required that the factoryPid maps to a
registered Managed Service Factory.
The Configuration object is bound to the location of the
calling bundle.
createFactoryConfiguration in interface ConfigurationAdminfactoryPid - PID of factory (not null).
Configuration object.
IOException - if access to persistent storage fails.
public Configuration createFactoryConfiguration(String factoryPid,
String location)
throws IOException
ConfigurationAdminConfiguration object with a new PID.
The properties of the new Configuration object are
null until the first time that its
Configuration.update(Dictionary) method is called.
It is not required that the factoryPid maps to a
registered Managed Service Factory.
The Configuration is bound to the location specified. If
this location is null it will be bound to the location of
the first bundle that registers a Managed Service Factory with a
corresponding PID.
createFactoryConfiguration in interface ConfigurationAdminfactoryPid - PID of factory (not null).location - A bundle location string, or null.
Configuration object.
IOException - if access to persistent storage fails.
public Configuration getConfiguration(String pid)
throws IOException
ConfigurationAdminConfiguration object from the
persistent store.
If the Configuration object for this PID does not exist,
create a new Configuration object for that PID, where
properties are null. Bind its location to the calling
bundle's location.
Otherwise, if the location of the existing Configuration object
is null, set it to the calling bundle's location.
getConfiguration in interface ConfigurationAdminpid - persistent identifier.
Configuration matching the PID.
IOException - if access to persistent storage fails.
public Configuration getConfiguration(String pid,
String location)
throws IOException
ConfigurationAdminConfiguration object from the persistent
store, or create a new Configuration object.
If a Configuration with this PID already exists in
Configuration Admin service return it. The location parameter is ignored
in this case.
Else, return a new Configuration object. This new object
is bound to the location and the properties are set to null.
If the location parameter is null, it will be set when a
Managed Service with the corresponding PID is registered for the first
time.
getConfiguration in interface ConfigurationAdminpid - Persistent identifier.location - The bundle location string, or null.
Configuration object.
IOException - if access to persistent storage fails.
public Configuration[] listConfigurations(String filter)
throws IOException,
org.osgi.framework.InvalidSyntaxException
ConfigurationAdminConfiguration objects which match the
filter.
Only Configuration objects with non- null
properties are considered current. That is,
Configuration.getProperties() is guaranteed not to return
null for each of the returned Configuration
objects.
Normally only Configuration objects that are bound to the
location of the calling bundle are returned, or all if the caller has
ConfigurationPermission[*,CONFIGURE].
The syntax of the filter string is as defined in the
Filter class. The filter can test any
configuration properties including the following:
service.pid-String- the PID under which
this is registeredservice.factoryPid-String- the factory if
applicableservice.bundleLocation-String- the bundle
locationnull, meaning that all
Configuration objects should be returned.
listConfigurations in interface ConfigurationAdminfilter - A filter string, or null to retrieve all
Configuration objects.
Configuration objects, or
null if there aren't any.
IOException - if access to persistent storage fails
org.osgi.framework.InvalidSyntaxException - if the filter string is invalid
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||