org.apache.felix.ipojo.composite.util
Class SourceManager

java.lang.Object
  extended by org.apache.felix.ipojo.composite.util.SourceManager
All Implemented Interfaces:
ContextListener

public class SourceManager
extends Object
implements ContextListener

This class manages context-source management.

Author:
Felix Project Team

Field Summary
static String SOURCE_NAME
          Source Name service property.
 
Constructor Summary
SourceManager(String sources, String depfilter, DependencyModel dependency, CompositeManager manager)
          Constructor.
 
Method Summary
static String[] getProperties(String str)
          Compute the properties (${name}) from the given filter.
 int getState()
          Get the state of this source manager.
 void start()
          Start the context management.
 void stop()
          Stop the context management.
static String substitute(String str, Dictionary values)
          This method substitute ${var} substring by values stored in a map.
 void update(ContextSource source, String property, Object value)
          A context source has modified a monitored property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SOURCE_NAME

public static final String SOURCE_NAME
Source Name service property.

See Also:
Constant Field Values
Constructor Detail

SourceManager

public SourceManager(String sources,
                     String depfilter,
                     DependencyModel dependency,
                     CompositeManager manager)
              throws ConfigurationException
Constructor.

Parameters:
sources - : context-source attribute from the dependency metadata
depfilter - : original dependency filter
dependency - : dependency object
manager - : composite manager
Throws:
ConfigurationException - : the sources are incorrect.
Method Detail

start

public void start()
Start the context management.


stop

public void stop()
Stop the context management.


getState

public int getState()
Get the state of this source manager.

Returns:
the state of this source manager.

substitute

public static String substitute(String str,
                                Dictionary values)
This method substitute ${var} substring by values stored in a map.

Parameters:
str - : string with variables
values - : dictionary containing the variable name and the value.
Returns:
resulted string

getProperties

public static String[] getProperties(String str)
Compute the properties (${name}) from the given filter.

Parameters:
str - : string form of the filter.
Returns:
the list of found properties.

update

public void update(ContextSource source,
                   String property,
                   Object value)
A context source has modified a monitored property.

Specified by:
update in interface ContextListener
Parameters:
source - : source
property - : modified property
value - : new value.
See Also:
ContextListener.update(org.apache.felix.ipojo.ContextSource, java.lang.String, java.lang.Object)


Copyright © 2013 The Apache Software Foundation. All Rights Reserved.