io.firebus.FunctionEntry Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of firebus-core Show documentation
Show all versions of firebus-core Show documentation
Firebus core functionality
package io.firebus;
import io.firebus.interfaces.BusFunction;
public class FunctionEntry
{
protected String serviceName;
protected BusFunction function;
protected int maxConcurrent;
protected int currentCount;
public FunctionEntry(String sn, BusFunction f, int mc)
{
serviceName = sn;
function = f;
maxConcurrent = mc;
currentCount = 0;
}
public void setFunction(BusFunction f)
{
function = f;
}
public synchronized void runStarted()
{
currentCount++;
}
public synchronized void runEnded()
{
currentCount--;
}
public boolean canRunOneMore()
{
return currentCount < maxConcurrent;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy