示例#1
0
 protected String getStringProperty(Device device, String key, String dft) {
   DCServerConfig dcs =
       (device != null) ? DCServerFactory.getServerConfig(device.getDeviceCode()) : null;
   String prop = null;
   if (dcs != null) {
     prop = dcs.getStringProperty(key, dft);
     Print.logInfo("DCServerConfig property '" + key + "' ==> " + prop);
     if (StringTools.isBlank(prop) && RTConfig.hasProperty(key)) {
       Print.logInfo("(RTConfig property '" + key + "' ==> " + RTConfig.getString(key, "") + ")");
     }
   } else {
     prop = RTConfig.getString(key, dft);
     Print.logInfo("RTConfig property '" + key + "' ==> " + prop);
   }
   return prop;
 }
示例#2
0
 public static void configInit() {
   DCServerConfig dcs = Main.getServerConfig();
   if (dcs != null) {
     TrackServer.setTcpIdleTimeout(dcs.getTcpIdleTimeoutMS(Constants.TIMEOUT_TCP_IDLE));
     TrackServer.setTcpPacketTimeout(dcs.getTcpPacketTimeoutMS(Constants.TIMEOUT_TCP_PACKET));
     TrackServer.setTcpSessionTimeout(dcs.getTcpSessionTimeoutMS(Constants.TIMEOUT_TCP_SESSION));
     TrackServer.setUdpIdleTimeout(dcs.getUdpIdleTimeoutMS(Constants.TIMEOUT_UDP_IDLE));
     TrackServer.setUdpPacketTimeout(dcs.getUdpPacketTimeoutMS(Constants.TIMEOUT_UDP_PACKET));
     TrackServer.setUdpSessionTimeout(dcs.getUdpSessionTimeoutMS(Constants.TIMEOUT_UDP_SESSION));
   }
 }