@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 start(ResteasyDeployment deployment) throws Exception { netty = new NettyJaxrsServer(); netty.setDeployment(deployment); netty.setPort(PortProvider.getPort()); netty.setRootResourcePath(""); netty.setSecurityDomain(null); netty.start(); }
public static void start(ResteasyDeployment deployment) throws Exception { netty = new NettyJaxrsServer(); netty.setDeployment(deployment); netty.setPort(PortProvider.getPort()); netty.setRootResourcePath(""); netty.setSecurityDomain(null); netty.start(); }
public static ResteasyDeployment start(String bindPath, SecurityDomain domain, ResteasyDeployment deployment) throws Exception { netty = new NettyJaxrsServer(); netty.setDeployment(deployment); netty.setPort(PortProvider.getPort()); netty.setRootResourcePath(bindPath); netty.setSecurityDomain(domain); netty.start(); return netty.getDeployment(); }
public static ResteasyDeployment start(String bindPath, SecurityDomain domain, ResteasyDeployment deployment) throws Exception { netty = new NettyJaxrsServer(); netty.setDeployment(deployment); netty.setPort(PortProvider.getPort()); netty.setRootResourcePath(bindPath); netty.setSecurityDomain(domain); netty.start(); return netty.getDeployment(); }
@Override public void start() { super.start(); Injector injector = Guice.createInjector(new GossipLogModule(configPath), new GossipConfigModule(configPath, configFile), new GossipDataModule(), new GossipResourceModule()); ModuleProcessor processor = new ModuleProcessor(deployment.getRegistry(), deployment.getProviderFactory()); processor.processInjector(injector); log.info("Successfully launched gossip server"); } }
public static void start(ResteasyDeployment deployment) throws Exception { netty = new NettyJaxrsServer(); netty.setDeployment(deployment); netty.setPort(PortProvider.getPort()); netty.setRootResourcePath(""); netty.setSecurityDomain(null); netty.start(); }
public static void start(ResteasyDeployment deployment) throws Exception { netty = new NettyJaxrsServer(); netty.setDeployment(deployment); netty.setPort(PortProvider.getPort()); netty.setRootResourcePath(""); netty.setSecurityDomain(null); netty.start(); }
public static ResteasyDeployment start(String bindPath, SecurityDomain domain, ResteasyDeployment deployment) throws Exception { netty = new NettyJaxrsServer(); netty.setDeployment(deployment); netty.setPort(PortProvider.getPort()); netty.setRootResourcePath(bindPath); netty.setSecurityDomain(domain); netty.start(); return netty.getDeployment(); }
public static ResteasyDeployment start(String bindPath, SecurityDomain domain, ResteasyDeployment deployment) throws Exception { netty = new NettyJaxrsServer(); netty.setDeployment(deployment); netty.setPort(PortProvider.getPort()); netty.setRootResourcePath(bindPath); netty.setSecurityDomain(domain); netty.start(); return netty.getDeployment(); }
protected void doStart(URL url) { server.setPort(url.getPort()); server.setKeepAlive(url.getParameter(Constants.KEEP_ALIVE_KEY, Constants.DEFAULT_KEEP_ALIVE)); server.setExecutorThreadCount(url.getParameter(Constants.THREADS_KEY, Constants.DEFAULT_THREADS)); server.setIoWorkerCount(url.getParameter(Constants.IO_THREADS_KEY, Constants.DEFAULT_IO_THREADS)); server.start(); }
public RestMossroseUI(final JobOperation jobOperation, final Competitive competitive, final int port) { super(); final ResteasyDeployment deployment = new ResteasyDeployment(); deployment.setSecurityEnabled(true); deployment.setApplication(new Application() { private Set<Object> singletons = Sets.<Object> newHashSet(new MossroseRequestHandler(jobOperation)); @Override public Set<Object> getSingletons() { return singletons; } }); deployment.setProviders(Lists.<Object> newArrayList(new MasterRouting(competitive), new MossroseJackson2Provider())); final NettyJaxrsServer server = new NettyJaxrsServer(); server.setDeployment(deployment); server.setExecutorThreadCount(1); server.setPort(port); server.setRootResourcePath(""); server.setSecurityDomain(null); server.start(); LOGGER.info("Server startup at port [{}].", port); }
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 RestMossroseUI(final JobOperation jobOperation, final LeaderSelector leaderSelector, final int port) { super(); final ResteasyDeployment deployment = new ResteasyDeployment(); deployment.setSecurityEnabled(true); deployment.setApplication(new Application() { private Set<Object> singletons = Sets.<Object> newHashSet(new MossroseRequestHandler(jobOperation)); @Override public Set<Object> getSingletons() { return singletons; } }); deployment.setProviders(Lists.<Object> newArrayList(new MasterRouting(leaderSelector), new MossroseJackson2Provider())); final NettyJaxrsServer server = new NettyJaxrsServer(); server.setDeployment(deployment); server.setExecutorThreadCount(1); server.setPort(port); server.setRootResourcePath(""); server.setSecurityDomain(null); server.start(); LOGGER.info("Server startup at port [{}].", port); }
protected void doStart(URL url) { server.setPort(url.getPort()); server.setKeepAlive(url.getParameter(Constants.KEEP_ALIVE_KEY, Constants.DEFAULT_KEEP_ALIVE)); server.setExecutorThreadCount(url.getParameter(Constants.THREADS_KEY, Constants.DEFAULT_THREADS)); server.setIoWorkerCount(url.getParameter(Constants.IO_THREADS_KEY, Constants.DEFAULT_IO_THREADS)); 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(); } }
@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(); }