public class ContextSourceManager extends java.lang.Object implements ContextListener
Modifier and Type | Field and Description |
---|---|
static java.util.List<java.lang.Character> |
FORBIDDEN_CHARACTERS
List of characters forbidden in variable names
|
static char |
VARIABLE_END
The variable end
|
static java.lang.String |
VARIABLE_START
The variable prefix
|
Constructor and Description |
---|
ContextSourceManager(DependencyModel dependency)
Creates the context source manager.
|
Modifier and Type | Method and Description |
---|---|
void |
addContextSource(ContextSource source)
A context source appears.
|
static java.util.List<java.lang.String> |
extractVariablesFromFilter(java.lang.String filter)
Extracts the variables (${name}) from the given filter.
|
void |
removeContextSource(ContextSource source)
A context source disappears.
|
void |
start()
Start the context management.
|
void |
stop()
Stop the context management.
|
static java.lang.String |
substitute(java.lang.String str,
java.util.Dictionary values)
This method substitutes ${var} substring by values stored in a map.
|
void |
update(ContextSource source,
java.lang.String property,
java.lang.Object value)
A context source has modified a monitored property.
|
public static final java.lang.String VARIABLE_START
public static final char VARIABLE_END
public static final java.util.List<java.lang.Character> FORBIDDEN_CHARACTERS
public ContextSourceManager(DependencyModel dependency) throws org.osgi.framework.InvalidSyntaxException
dependency
- the dependency model on which this manager is plugged.org.osgi.framework.InvalidSyntaxException
public static java.lang.String substitute(java.lang.String str, java.util.Dictionary values)
str
- : string with variablesvalues
- : dictionary containing the variable name and the value.public static java.util.List<java.lang.String> extractVariablesFromFilter(java.lang.String filter) throws org.osgi.framework.InvalidSyntaxException
filter
- : string form of the filter.org.osgi.framework.InvalidSyntaxException
- thrown when the variables are not consistent.public void start()
public void stop()
public void update(ContextSource source, java.lang.String property, java.lang.Object value)
update
in interface ContextListener
source
- : sourceproperty
- : modified propertyvalue
- : new value.ContextListener.update(org.apache.felix.ipojo.ContextSource, String, Object)
public void addContextSource(ContextSource source)
source
- : new context source.public void removeContextSource(ContextSource source)
source
- : leaving context source.Copyright © 2006-2014 The Apache Software Foundation. All Rights Reserved.