use of com.weibo.api.motan.protocol.restful.EmbedRestServer in project motan by weibocom.
the class NettyEndpointFactory method innerCreateServer.
@Override
protected RestServer innerCreateServer(URL url) {
NettyJaxrsServer server = new NettyJaxrsServer();
server.setMaxRequestSize(url.getIntParameter(URLParamType.maxContentLength.getName(), URLParamType.maxContentLength.getIntValue()));
ResteasyDeployment deployment = new ResteasyDeployment();
server.setDeployment(deployment);
server.setExecutorThreadCount(url.getIntParameter(URLParamType.maxWorkerThread.getName(), URLParamType.maxWorkerThread.getIntValue()));
server.setPort(url.getPort());
server.setRootResourcePath("");
server.setSecurityDomain(null);
deployment.setInjectorFactoryClass(RestfulInjectorFactory.class.getName());
deployment.getProviderClasses().add(RpcExceptionMapper.class.getName());
return new EmbedRestServer(server);
}
Aggregations