Search in sources :

Example 1 with NettyJaxrsServer

use of org.jboss.resteasy.plugins.server.netty.NettyJaxrsServer in project narayana by jbosstm.

the class VolatileParticipantResourceTestCase method beforeClass.

@BeforeClass
public static void beforeClass() {
    List<String> resourceClasses = new ArrayList<String>();
    resourceClasses.add("org.jboss.narayana.rest.integration.VolatileParticipantResource");
    ResteasyDeployment resteasyDeployment = new ResteasyDeployment();
    resteasyDeployment.setResourceClasses(resourceClasses);
    NETTY = new NettyJaxrsServer();
    NETTY.setDeployment(resteasyDeployment);
    NETTY.setPort(TestPortProvider.getPort());
    NETTY.start();
}
Also used : ResteasyDeployment(org.jboss.resteasy.spi.ResteasyDeployment) NettyJaxrsServer(org.jboss.resteasy.plugins.server.netty.NettyJaxrsServer) ArrayList(java.util.ArrayList) BeforeClass(org.junit.BeforeClass)

Example 2 with NettyJaxrsServer

use of org.jboss.resteasy.plugins.server.netty.NettyJaxrsServer in project narayana by jbosstm.

the class ParticipantResourceTestCase method beforeClass.

@BeforeClass
public static void beforeClass() {
    List<String> resourceClasses = new ArrayList<String>();
    resourceClasses.add("org.jboss.narayana.rest.integration.ParticipantResource");
    ResteasyDeployment resteasyDeployment = new ResteasyDeployment();
    resteasyDeployment.setResourceClasses(resourceClasses);
    NETTY = new NettyJaxrsServer();
    NETTY.setDeployment(resteasyDeployment);
    NETTY.setPort(TestPortProvider.getPort());
    NETTY.start();
}
Also used : ResteasyDeployment(org.jboss.resteasy.spi.ResteasyDeployment) NettyJaxrsServer(org.jboss.resteasy.plugins.server.netty.NettyJaxrsServer) ArrayList(java.util.ArrayList) BeforeClass(org.junit.BeforeClass)

Example 3 with NettyJaxrsServer

use of org.jboss.resteasy.plugins.server.netty.NettyJaxrsServer in project camunda-bpm-platform by camunda.

the class ResteasyServerBootstrap method setupServer.

private void setupServer(Application application) {
    Properties serverProperties = readProperties();
    int port = Integer.parseInt(serverProperties.getProperty(PORT_PROPERTY));
    server = new NettyJaxrsServer();
    server.setRootResourcePath(ROOT_RESOURCE_PATH);
    server.setPort(port);
    server.getDeployment().setApplication(application);
}
Also used : NettyJaxrsServer(org.jboss.resteasy.plugins.server.netty.NettyJaxrsServer) Properties(java.util.Properties)

Example 4 with NettyJaxrsServer

use of org.jboss.resteasy.plugins.server.netty.NettyJaxrsServer 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

NettyJaxrsServer (org.jboss.resteasy.plugins.server.netty.NettyJaxrsServer)4 ResteasyDeployment (org.jboss.resteasy.spi.ResteasyDeployment)3 ArrayList (java.util.ArrayList)2 BeforeClass (org.junit.BeforeClass)2 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 Properties (java.util.Properties)1