public class CpuUsageStrategyFactory extends ArrayBasedStrategyFactory
| Modifier and Type | Field and Description |
|---|---|
protected int |
lowCpuUsage
lowCpuUsage ~= zero CPU usage
|
protected int |
maxTries
This strategy compares number of 'maxTries' random node.
|
protected Transporter |
transporter |
preferLocalbroker, logger, name| Constructor and Description |
|---|
CpuUsageStrategyFactory() |
CpuUsageStrategyFactory(boolean preferLocal) |
CpuUsageStrategyFactory(boolean preferLocal,
int maxTries,
int lowCpuUsage) |
| Modifier and Type | Method and Description |
|---|---|
<T extends Endpoint> |
create() |
int |
getLowCpuUsage() |
int |
getMaxTries() |
void |
setLowCpuUsage(int lowCpuUsage) |
void |
setMaxTries(int maxTries) |
void |
started(ServiceBroker broker)
Initializes strategy instance.
|
isPreferLocal, setPreferLocalgetBroker, getLogger, getName, stoppedprotected int maxTries
protected int lowCpuUsage
protected Transporter transporter
public CpuUsageStrategyFactory()
public CpuUsageStrategyFactory(boolean preferLocal)
public CpuUsageStrategyFactory(boolean preferLocal,
int maxTries,
int lowCpuUsage)
public void started(ServiceBroker broker) throws java.lang.Exception
started in class MoleculerComponentbroker - parent ServiceBrokerjava.lang.Exceptionpublic <T extends Endpoint> Strategy<T> create()
create in class StrategyFactorypublic int getMaxTries()
public void setMaxTries(int maxTries)
public int getLowCpuUsage()
public void setLowCpuUsage(int lowCpuUsage)