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;
}
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);
}
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);
}
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());
}
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));
}
Aggregations