本文整理汇总了Java中org.eclipse.californium.core.network.config.NetworkConfig.getInt方法的典型用法代码示例。如果您正苦于以下问题:Java NetworkConfig.getInt方法的具体用法?Java NetworkConfig.getInt怎么用?Java NetworkConfig.getInt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.californium.core.network.config.NetworkConfig
的用法示例。
在下文中一共展示了NetworkConfig.getInt方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: BlockwiseLayer
import org.eclipse.californium.core.network.config.NetworkConfig; //导入方法依赖的package包/类
/**
* Constructs a new blockwise layer.
* Changes to the configuration are observed and automatically applied.
* @param config the configuration
*/
public BlockwiseLayer(NetworkConfig config) {
this.config = config;
max_message_size = config.getInt(NetworkConfig.Keys.MAX_MESSAGE_SIZE);
preferred_block_size = config.getInt(NetworkConfig.Keys.PREFERRED_BLOCK_SIZE);
block_timeout = config.getInt(NetworkConfig.Keys.BLOCKWISE_STATUS_LIFETIME);
LOGGER.config("BlockwiseLayer uses MAX_MESSAGE_SIZE="+max_message_size+", DEFAULT_BLOCK_SIZE="+preferred_block_size+", and BLOCKWISE_STATUS_LIFETIME="+block_timeout);
observer = new NetworkConfigObserverAdapter() {
@Override
public void changed(String key, int value) {
if (NetworkConfig.Keys.MAX_MESSAGE_SIZE.equals(key))
max_message_size = value;
if (NetworkConfig.Keys.PREFERRED_BLOCK_SIZE.equals(key))
preferred_block_size = value;
if (NetworkConfig.Keys.BLOCKWISE_STATUS_LIFETIME.equals(key))
block_timeout = value;
}
};
config.addConfigObserver(observer);
}
示例2: Matcher
import org.eclipse.californium.core.network.config.NetworkConfig; //导入方法依赖的package包/类
public Matcher(NetworkConfig config) {
this.started = false;
this.exchangesByMID = new ConcurrentHashMap<KeyMID, Exchange>();
this.exchangesByToken = new ConcurrentHashMap<KeyToken, Exchange>();
this.ongoingExchanges = new ConcurrentHashMap<KeyUri, Exchange>();
DeduplicatorFactory factory = DeduplicatorFactory.getDeduplicatorFactory();
this.deduplicator = factory.createDeduplicator(config);
boolean randomMID = config.getBoolean(NetworkConfig.Keys.USE_RANDOM_MID_START);
if (randomMID) {
currendMID = new AtomicInteger(new Random().nextInt(1<<16));
} else {
currendMID = new AtomicInteger(0);
}
tokenSizeLimit = config.getInt(NetworkConfig.Keys.TOKEN_SIZE_LIMIT);
LOGGER.config("Matcher uses USE_RANDOM_MID_START="+randomMID+" and TOKEN_SIZE_LIMIT="+tokenSizeLimit);
healthStatusLevel = Level.parse(config.getString(NetworkConfig.Keys.HEALTH_STATUS_PRINT_LEVEL));
healthStatusInterval = config.getInt(NetworkConfig.Keys.HEALTH_STATUS_INTERVAL);
}
示例3: CropRotation
import org.eclipse.californium.core.network.config.NetworkConfig; //导入方法依赖的package包/类
public CropRotation(NetworkConfig config) {
this.rotation = new Rotation();
maps = new ExchangeMap[3];
maps[0] = new ExchangeMap();
maps[1] = new ExchangeMap();
maps[2] = new ExchangeMap();
first = 0;
second = 1;
period = config.getInt(NetworkConfig.Keys.CROP_ROTATION_PERIOD);
}
示例4: ReliabilityLayer
import org.eclipse.californium.core.network.config.NetworkConfig; //导入方法依赖的package包/类
/**
* Constructs a new reliability layer.
* Changes to the configuration are observed and automatically applied.
* @param config the configuration
*/
public ReliabilityLayer(NetworkConfig config) {
this.config = config;
ack_timeout = config.getInt(NetworkConfig.Keys.ACK_TIMEOUT);
ack_random_factor = config.getFloat(NetworkConfig.Keys.ACK_RANDOM_FACTOR);
ack_timeout_scale = config.getFloat(NetworkConfig.Keys.ACK_TIMEOUT_SCALE);
max_retransmit = config.getInt(NetworkConfig.Keys.MAX_RETRANSMIT);
LOGGER.config("ReliabilityLayer uses ACK_TIMEOUT="+ack_timeout+", ACK_RANDOM_FACTOR="+ack_random_factor+", and ACK_TIMEOUT_SCALE="+ack_timeout_scale);
observer = new NetworkConfigObserverAdapter() {
@Override
public void changed(String key, int value) {
if (NetworkConfig.Keys.ACK_TIMEOUT.equals(key))
ack_timeout = value;
if (NetworkConfig.Keys.MAX_RETRANSMIT.equals(key))
max_retransmit = value;
}
@Override
public void changed(String key, float value) {
if (NetworkConfig.Keys.ACK_RANDOM_FACTOR.equals(key))
ack_random_factor = value;
if (NetworkConfig.Keys.ACK_TIMEOUT_SCALE.equals(key))
ack_timeout_scale = value;
}
};
config.addConfigObserver(observer);
}
示例5: RemoteEndpoint
import org.eclipse.californium.core.network.config.NetworkConfig; //导入方法依赖的package包/类
public RemoteEndpoint(int remotePort, InetAddress remoteAddress, NetworkConfig config){
Address = remoteAddress;
Port = remotePort;
// Fill Array with initial values
overallRTO = new long[RTOARRAYSIZE];
for(int i=0; i < RTOARRAYSIZE; i++){
overallRTO[i] = config.getInt(NetworkConfig.Keys.ACK_TIMEOUT) ;
}
currentRTO = config.getInt(NetworkConfig.Keys.ACK_TIMEOUT);
xRTO = new long[3];
xRTT = new long[3];
xRTTVAR = new long[3];
RTOupdateTimestamp = new long[3];
for(int i=0; i <= 2; i++){
setEstimatorValues(config.getInt(NetworkConfig.Keys.ACK_TIMEOUT), 0, 0, i);
setRTOtimestamp(System.currentTimeMillis(), i);
}
meanOverallRTO = config.getInt(NetworkConfig.Keys.ACK_TIMEOUT);
currentArrayElement = 0;
nonConfirmableCounter = 7;
usesBlindEstimator = true;
isBlindStrong = true;
isBlindWeak = true;
processingNON = false;
exchangeInfoMap = new ConcurrentHashMap<Exchange, exchangeInfo>();
confirmableQueue = new LinkedList<Exchange>();
nonConfirmableQueue = new LinkedList<Exchange>();
}