@Override protected void doStart(URL url) { String bindIp = url.getParameter(Constants.BIND_IP_KEY, url.getHost()); if (!url.isAnyHost() && NetUtils.isValidLocalHost(bindIp)) { server.setHostname(bindIp); } server.setPort(url.getParameter(Constants.BIND_PORT_KEY, url.getPort())); Map<ChannelOption, Object> channelOption = new HashMap<ChannelOption, Object>(); channelOption.put(ChannelOption.SO_KEEPALIVE, url.getParameter(Constants.KEEP_ALIVE_KEY, Constants.DEFAULT_KEEP_ALIVE)); server.setChildChannelOptions(channelOption); server.setExecutorThreadCount(url.getParameter(Constants.THREADS_KEY, Constants.DEFAULT_THREADS)); server.setIoWorkerCount(url.getParameter(Constants.IO_THREADS_KEY, Constants.DEFAULT_IO_THREADS)); server.setMaxRequestSize(url.getParameter(Constants.PAYLOAD_KEY, Constants.DEFAULT_PAYLOAD)); server.start(); }
@Override protected void doStart(URL url) { String bindIp = url.getParameter(Constants.BIND_IP_KEY, url.getHost()); if (!url.isAnyHost() && NetUtils.isValidLocalHost(bindIp)) { server.setHostname(bindIp); } server.setPort(url.getParameter(Constants.BIND_PORT_KEY, url.getPort())); Map<ChannelOption, Object> channelOption = new HashMap<ChannelOption, Object>(); channelOption.put(ChannelOption.SO_KEEPALIVE, url.getParameter(Constants.KEEP_ALIVE_KEY, Constants.DEFAULT_KEEP_ALIVE)); server.setChildChannelOptions(channelOption); server.setExecutorThreadCount(url.getParameter(Constants.THREADS_KEY, Constants.DEFAULT_THREADS)); server.setIoWorkerCount(url.getParameter(Constants.IO_THREADS_KEY, Constants.DEFAULT_IO_THREADS)); server.setMaxRequestSize(url.getParameter(Constants.PAYLOAD_KEY, Constants.DEFAULT_PAYLOAD)); server.start(); }
public static void main(String[] args) throws Exception { String host = "0.0.0.0"; int port = 8080; if (args.length > 0) { host = args[0]; } if (args.length > 1) { port = Integer.parseInt(args[1]); } NettyJaxrsServer netty = new NettyJaxrsServer(); ResteasyDeployment deployment = new ResteasyDeployment(); deployment.setApplication(new MyApplication()); netty.setDeployment(deployment); netty.setHostname(host); netty.setPort(port); netty.setRootResourcePath("/"); netty.setSecurityDomain(null); netty.start(); } }
public static void main(String[] args) throws Exception { String host = "0.0.0.0"; int port = 8080; if (args.length > 0) { host = args[0]; } if (args.length > 1) { port = Integer.parseInt(args[1]); } NettyJaxrsServer netty = new NettyJaxrsServer(); ResteasyDeployment deployment = new ResteasyDeployment(); deployment.setApplication(new MyApplication()); netty.setDeployment(deployment); netty.setHostname(host); netty.setPort(port); netty.setRootResourcePath("/"); netty.setSecurityDomain(null); netty.start(); } }
@Override protected void doStart(URL url) { String bindIp = url.getParameter(Constants.BIND_IP_KEY, url.getHost()); if (!url.isAnyHost() && NetUtils.isValidLocalHost(bindIp)) { server.setHostname(bindIp); } server.setPort(url.getParameter(Constants.BIND_PORT_KEY, url.getPort())); Map<ChannelOption, Object> channelOption = new HashMap<ChannelOption, Object>(); channelOption.put(ChannelOption.SO_KEEPALIVE, url.getParameter(Constants.KEEP_ALIVE_KEY, Constants.DEFAULT_KEEP_ALIVE)); server.setChildChannelOptions(channelOption); server.setExecutorThreadCount(url.getParameter(Constants.THREADS_KEY, Constants.DEFAULT_THREADS)); server.setIoWorkerCount(url.getParameter(Constants.IO_THREADS_KEY, Constants.DEFAULT_IO_THREADS)); server.setMaxRequestSize(url.getParameter(Constants.PAYLOAD_KEY, Constants.DEFAULT_PAYLOAD)); server.start(); }
@Override protected void doStart(URL url) { String bindIp = url.getParameter(Constants.BIND_IP_KEY, url.getHost()); if (!url.isAnyHost() && NetUtils.isValidLocalHost(bindIp)) { server.setHostname(bindIp); } server.setPort(url.getParameter(Constants.BIND_PORT_KEY, url.getPort())); Map<ChannelOption, Object> channelOption = new HashMap<ChannelOption, Object>(); channelOption.put(ChannelOption.SO_KEEPALIVE, url.getParameter(Constants.KEEP_ALIVE_KEY, Constants.DEFAULT_KEEP_ALIVE)); server.setChildChannelOptions(channelOption); server.setExecutorThreadCount(url.getParameter(Constants.THREADS_KEY, Constants.DEFAULT_THREADS)); server.setIoWorkerCount(url.getParameter(Constants.IO_THREADS_KEY, Constants.DEFAULT_IO_THREADS)); server.setMaxRequestSize(url.getParameter(Constants.PAYLOAD_KEY, Constants.DEFAULT_PAYLOAD)); server.start(); }
@Override protected void doStart(URL url) { String bindIp = url.getParameter(Constants.BIND_IP_KEY, url.getHost()); if (!url.isAnyHost() && NetUtils.isValidLocalHost(bindIp)) { server.setHostname(bindIp); } server.setPort(url.getParameter(Constants.BIND_PORT_KEY, url.getPort())); Map<ChannelOption, Object> channelOption = new HashMap<ChannelOption, Object>(); channelOption.put(ChannelOption.SO_KEEPALIVE, url.getParameter(Constants.KEEP_ALIVE_KEY, Constants.DEFAULT_KEEP_ALIVE)); server.setChildChannelOptions(channelOption); server.setExecutorThreadCount(url.getParameter(Constants.THREADS_KEY, Constants.DEFAULT_THREADS)); server.setIoWorkerCount(url.getParameter(Constants.IO_THREADS_KEY, Constants.DEFAULT_IO_THREADS)); server.setMaxRequestSize(url.getParameter(Constants.PAYLOAD_KEY, Constants.DEFAULT_PAYLOAD)); server.start(); }