Search in sources :

Example 6 with ResteasyDeploymentImpl

use of org.jboss.resteasy.core.ResteasyDeploymentImpl in project resteasy by resteasy.

the class SeCdiNettyTest method init.

@SuppressWarnings("unchecked")
@Before
public void init() {
    while (port < 8000) this.port = (int) ((new Random().nextDouble() * 8000) + 1000);
    SeContainerInitializer initializer = SeContainerInitializer.newInstance();
    SeContainer container = initializer.disableDiscovery().addBeanClasses(EchoResource.class).addBeanClasses(DefaultExceptionMapper.class).addExtensions(ResteasyCdiExtension.class).initialize();
    ResteasyCdiExtension cdiExtension = container.select(ResteasyCdiExtension.class).get();
    CdiNettyJaxrsServer netty = new CdiNettyJaxrsServer(container);
    ResteasyDeployment rd = new ResteasyDeploymentImpl();
    rd.setActualResourceClasses(cdiExtension.getResources());
    rd.setInjectorFactory(new CdiInjectorFactory(container.getBeanManager()));
    rd.getActualProviderClasses().addAll(cdiExtension.getProviders());
    netty.setDeployment(rd);
    netty.setPort(port);
    netty.setRootResourcePath("/api");
    netty.start();
    this.server = netty;
}
Also used : ResteasyDeployment(org.jboss.resteasy.spi.ResteasyDeployment) Random(java.util.Random) ResteasyDeploymentImpl(org.jboss.resteasy.core.ResteasyDeploymentImpl) SeContainer(jakarta.enterprise.inject.se.SeContainer) CdiInjectorFactory(org.jboss.resteasy.cdi.CdiInjectorFactory) SeContainerInitializer(jakarta.enterprise.inject.se.SeContainerInitializer) ResteasyCdiExtension(org.jboss.resteasy.cdi.ResteasyCdiExtension) Before(org.junit.Before)

Example 7 with ResteasyDeploymentImpl

use of org.jboss.resteasy.core.ResteasyDeploymentImpl in project resteasy by resteasy.

the class ReactorNettyContainer method start.

public static ResteasyDeployment start(String bindPath, SecurityDomain domain) throws Exception {
    ResteasyDeployment deployment = new ResteasyDeploymentImpl();
    deployment.setSecurityEnabled(true);
    return start(bindPath, domain, deployment);
}
Also used : ResteasyDeployment(org.jboss.resteasy.spi.ResteasyDeployment) ResteasyDeploymentImpl(org.jboss.resteasy.core.ResteasyDeploymentImpl)

Example 8 with ResteasyDeploymentImpl

use of org.jboss.resteasy.core.ResteasyDeploymentImpl in project resteasy by resteasy.

the class HttpServerContainer method start.

public static ResteasyDeployment start(String bindPath, SecurityDomain domain, Hashtable<String, String> initParams, Hashtable<String, String> contextParams) throws Exception {
    ResteasyDeployment deployment = new ResteasyDeploymentImpl();
    deployment.setSecurityEnabled(true);
    return start(bindPath, domain, deployment, initParams, contextParams);
}
Also used : ResteasyDeployment(org.jboss.resteasy.spi.ResteasyDeployment) ResteasyDeploymentImpl(org.jboss.resteasy.core.ResteasyDeploymentImpl)

Example 9 with ResteasyDeploymentImpl

use of org.jboss.resteasy.core.ResteasyDeploymentImpl in project resteasy by resteasy.

the class UndertowJaxrsServer method deploy.

public UndertowJaxrsServer deploy(Application application, String contextPath) {
    ResteasyDeployment resteasyDeployment = new ResteasyDeploymentImpl();
    resteasyDeployment.setApplication(application);
    resteasyDeployment.start();
    return deploy(resteasyDeployment, serverHelper.checkContextPath(contextPath), application.getClass().getClassLoader());
}
Also used : ResteasyDeployment(org.jboss.resteasy.spi.ResteasyDeployment) ResteasyDeploymentImpl(org.jboss.resteasy.core.ResteasyDeploymentImpl)

Example 10 with ResteasyDeploymentImpl

use of org.jboss.resteasy.core.ResteasyDeploymentImpl in project resteasy by resteasy.

the class WADLNettyContainerTest method setup.

@BeforeClass
public static void setup() throws Exception {
    ResteasyDeployment deployment = new ResteasyDeploymentImpl();
    deployment.setSecurityEnabled(true);
    netty = new NettyJaxrsServer();
    netty.setDeployment(deployment);
    netty.setPort(port);
    netty.setRootResourcePath("");
    netty.setSecurityDomain(null);
    netty.start();
    deployment.getRegistry().addPerRequestResource(BasicResource.class);
    deployment.getRegistry().addPerRequestResource(RESTEASY1246.class);
    ResteasyWadlDefaultResource defaultResource = new MyWadlResource();
    deployment.getRegistry().addSingletonResource(defaultResource);
    defaultResource.getServices().put("/", ResteasyWadlGenerator.generateServiceRegistry(deployment));
}
Also used : ResteasyWadlDefaultResource(org.jboss.resteasy.wadl.ResteasyWadlDefaultResource) ResteasyDeployment(org.jboss.resteasy.spi.ResteasyDeployment) NettyJaxrsServer(org.jboss.resteasy.plugins.server.netty.NettyJaxrsServer) ResteasyDeploymentImpl(org.jboss.resteasy.core.ResteasyDeploymentImpl) BeforeClass(org.junit.BeforeClass)

Aggregations

ResteasyDeploymentImpl (org.jboss.resteasy.core.ResteasyDeploymentImpl)29 ResteasyDeployment (org.jboss.resteasy.spi.ResteasyDeployment)29 Test (org.junit.Test)9 NettyJaxrsServer (org.jboss.resteasy.plugins.server.netty.NettyJaxrsServer)8 ReactorNettyJaxrsServer (org.jboss.resteasy.plugins.server.reactor.netty.ReactorNettyJaxrsServer)4 BeforeClass (org.junit.BeforeClass)4 DeploymentInfo (io.undertow.servlet.api.DeploymentInfo)3 Client (jakarta.ws.rs.client.Client)3 Response (jakarta.ws.rs.core.Response)3 EventLoopGroup (io.netty.channel.EventLoopGroup)2 EpollEventLoopGroup (io.netty.channel.epoll.EpollEventLoopGroup)2 KQueueEventLoopGroup (io.netty.channel.kqueue.KQueueEventLoopGroup)2 SslContext (io.netty.handler.ssl.SslContext)2 File (java.io.File)2 ArrayList (java.util.ArrayList)2 Random (java.util.Random)2 CdiInjectorFactory (org.jboss.resteasy.cdi.CdiInjectorFactory)2 ResteasyCdiExtension (org.jboss.resteasy.cdi.ResteasyCdiExtension)2 Before (org.junit.Before)2 IPCController (com.datastax.mgmtapi.ipc.IPCController)1