Search in sources :

Example 1 with EmbedRestServer

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);
}
Also used : ResteasyDeployment(org.jboss.resteasy.spi.ResteasyDeployment) NettyJaxrsServer(org.jboss.resteasy.plugins.server.netty.NettyJaxrsServer) RestfulInjectorFactory(com.weibo.api.motan.protocol.restful.support.RestfulInjectorFactory) RpcExceptionMapper(com.weibo.api.motan.protocol.restful.support.RpcExceptionMapper) EmbedRestServer(com.weibo.api.motan.protocol.restful.EmbedRestServer)

Aggregations

EmbedRestServer (com.weibo.api.motan.protocol.restful.EmbedRestServer)1 RestfulInjectorFactory (com.weibo.api.motan.protocol.restful.support.RestfulInjectorFactory)1 RpcExceptionMapper (com.weibo.api.motan.protocol.restful.support.RpcExceptionMapper)1 NettyJaxrsServer (org.jboss.resteasy.plugins.server.netty.NettyJaxrsServer)1 ResteasyDeployment (org.jboss.resteasy.spi.ResteasyDeployment)1