All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jadex.bridge.sensor.time.ComponentUptimeProperty Maven / Gradle / Ivy

Go to download

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.

There is a newer version: 4.0.267
Show newest version
package jadex.bridge.sensor.time;

import jadex.bridge.IInternalAccess;
import jadex.bridge.nonfunctional.NFPropertyMetaInfo;
import jadex.bridge.nonfunctional.NFRootProperty;
import jadex.bridge.sensor.unit.TimeUnit;

/**
 *  Property for the startup of a component.
 */
public class ComponentUptimeProperty extends NFRootProperty//extends TimedProperty
{
	/** The name of the property. */
	public static final String NAME = "uptime";
	
	/**
	 *  Create a new property.
	 */
	public ComponentUptimeProperty(final IInternalAccess comp)
	{
		super(comp, new NFPropertyMetaInfo(NAME, long.class, TimeUnit.class, true));
	}
	
	/**
	 *  Measure the value.
	 */
	public Long measureValue()
	{
		return System.currentTimeMillis()-comp.getDescription().getCreationTime();
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy