本文整理汇总了Java中com.wm.util.Values.getInt方法的典型用法代码示例。如果您正苦于以下问题:Java Values.getInt方法的具体用法?Java Values.getInt怎么用?Java Values.getInt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.wm.util.Values
的用法示例。
在下文中一共展示了Values.getInt方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: SOCKETListener
import com.wm.util.Values; //导入方法依赖的package包/类
public SOCKETListener(Values properties)
{
super(properties);
classid = "SOCKETListener";
int port = properties.getInt("port");
if(port == -1)
port = 4444;
setPort(port);
sockServer = null;
setPackage(properties.getString("pkg"));
setEnabled(properties.getBoolean("enabled"));
// Set plugin
plugin = properties.getString("plugin");
// Set server socket timeout value
so_timeout = properties.getInt("so_timeout");
if (so_timeout == -1)
so_timeout = 20000; // Set default timeout value to 20000 milliseconds
// Set service name to execute
service_name = properties.getString("service_name");
if (service_name == null )
service_name = "SimpleSocket:receive"; // Default service name
}
示例2: createListener
import com.wm.util.Values; //导入方法依赖的package包/类
public ServerListenerIf createListener(Values props)
throws ServerListenerException
{
if(!props.containsKey("port"))
throw new ServerListenerException(wm.server.net.resources.ServerListenerExceptionBundle.class, ServerListenerExceptionBundle.PORT_REQUIRED, "");
int port = props.getInt("port");
if(port == -1)
throw new ServerListenerException(wm.server.net.resources.ServerListenerExceptionBundle.class, ServerListenerExceptionBundle.PORT_NUMBER_REQUIRED, "");
if(port <= 0 || port > 65535)
{
JournalLogger.logError(1, 46, Integer.toString(port));
throw new ServerListenerException(SimpleSocket.server.net.resources.ServerListenerExceptionBundle.class, ServerListenerExceptionBundle.INVALID_PORT, "");
} else
{
return new SOCKETListener(props);
}
}