
jadex.bridge.nonfunctional.NFPropertyProvider Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jadex-bridge Show documentation
Show all versions of jadex-bridge Show documentation
Jadex bridge is a base package for kernels and platforms,
i.e. it is used by both and provides commonly used
interfaces and classes for active components and
their management.
The newest version!
package jadex.bridge.nonfunctional;
import jadex.bridge.IInternalAccess;
import jadex.bridge.service.types.monitoring.MonitoringEvent;
import jadex.bridge.service.types.monitoring.IMonitoringService.PublishEventLevel;
import jadex.bridge.service.types.monitoring.IMonitoringService.PublishTarget;
import jadex.commons.future.CounterResultListener;
import jadex.commons.future.DelegationResultListener;
import jadex.commons.future.Future;
import jadex.commons.future.IFuture;
import java.util.HashMap;
import java.util.LinkedHashSet;
import java.util.Map;
import java.util.Set;
/**
* Base impl for nf property property provider.
*/
public abstract class NFPropertyProvider implements INFPropertyProvider
{
/** The parent. */
protected INFPropertyProvider nfparent;
/** Non-functional properties. */
protected Map> nfproperties;
/**
* Create a new provider.
*/
public NFPropertyProvider()
{
}
/**
* Create a new provider.
*/
public NFPropertyProvider(INFPropertyProvider parent)
{
this.nfparent = parent;
}
/**
* Returns the names of all non-functional properties of this service.
* @return The names of the non-functional properties of this service.
*/
public IFuture getNFPropertyNames()
{
return new Future(nfproperties != null? nfproperties.keySet().toArray(new String[nfproperties.size()]) : new String[0]);
}
/**
* Returns the names of all non-functional properties of this service.
* @return The names of the non-functional properties of this service.
*/
public IFuture getNFAllPropertyNames()
{
final Future ret = new Future();
final String[] myprops = nfproperties != null? nfproperties.keySet().toArray(new String[nfproperties.size()]) : new String[0];
if(getParent()!=null)
{
getParent().getNFAllPropertyNames().addResultListener(new DelegationResultListener(ret)
{
public void customResultAvailable(String[] result)
{
Set tmp = new LinkedHashSet();
for(String p: result)
{
tmp.add(p);
}
for(String p: myprops)
{
tmp.add(p);
}
ret.setResult((String[])tmp.toArray(new String[tmp.size()]));
}
});
}
else
{
ret.setResult(myprops);
}
return ret;
}
/**
* Returns the meta information about a non-functional property of this service.
* @param name Name of the property.
* @return The meta information about a non-functional property of this service.
*/
public IFuture
© 2015 - 2025 Weber Informatics LLC | Privacy Policy