@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); }
public static ResteasyDeployment start(String bindPath, SecurityDomain domain) throws Exception { ResteasyDeployment deployment = new ResteasyDeployment(); deployment.setSecurityEnabled(true); return start(bindPath, domain, deployment); }
public static ResteasyDeployment start(String bindPath, SecurityDomain domain) throws Exception { ResteasyDeployment deployment = new ResteasyDeployment(); deployment.setSecurityEnabled(true); return start(bindPath, domain, deployment); }
public DeploymentInfo deployApplication(String appPath, Class<? extends Application> applicationClass) { ResteasyDeployment deployment = new ResteasyDeployment(); deployment.setInjectorFactoryClass("org.jboss.resteasy.cdi.CdiInjectorFactory"); deployment.setApplicationClass(applicationClass.getName()); return server.undertowDeployment(deployment, appPath); }
private static ResteasyDeployment getResteasyDeployment() { if (deployment == null) { deployment = new ResteasyDeployment();
@Override public Map<String, Object> getAttributes() { ResteasyDeployment deployment = new ResteasyDeployment(); deployment.getActualResourceClasses().addAll(resteasyCdiExtension.getResources()); deployment.getActualProviderClasses().addAll(resteasyCdiExtension.getProviders()); if( !(applicationInstance.isUnsatisfied() || applicationInstance.isAmbiguous())) { deployment.setApplication(applicationInstance.get()); } deployment.setInjectorFactoryClass(Cdi11InjectorFactory.class.getName()); return singletonMap(ResteasyDeployment.class.getName(), deployment); }
public static ResteasyDeployment start(String bindPath, SecurityDomain domain, Hashtable<String,String> initParams, Hashtable<String,String> contextParams) throws Exception ResteasyDeployment deployment = new ResteasyDeployment(); deployment.setSecurityEnabled(true); String applicationClass = null;
private static ResteasyDeployment getResteasyDeployment() { if (deployment == null) { deployment = new ResteasyDeployment();
@Inject public ResteasyHttpHandler(JaxrsApplication jaxrsApps) { this.deployment = new ResteasyDeployment(); deployment.setApplication(jaxrsApps); ResteasyJacksonProvider provider = new ResteasyJacksonProvider(); provider.configure(DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES, false); ResteasyProviderFactory resteasyFactory = ResteasyProviderFactory.getInstance(); resteasyFactory.registerProviderInstance(provider); deployment.setProviderFactory(resteasyFactory); deployment.start(); log.info("RestEasy started."); }
final ResteasyDeployment deployment = new ResteasyDeployment(); deployment.setApplication(jaxRsActivator);
public void start() { ResteasyDeployment dp = new ResteasyDeployment(); Collection<Object> providers = ac.getBeansWithAnnotation(Provider.class).values(); Collection<Object> controllers = ac.getBeansWithAnnotation(Controller.class).values(); Assert.notEmpty(controllers); // extract providers if (providers != null) { dp.getProviders().addAll(providers); } // extract only controller annotated beans dp.getResources().addAll(controllers); netty = new ConfigurableNettyJaxrsServer(); netty.initBootstrap().setOption("reuseAddress", true); netty.setDeployment(dp); netty.setPort(port); netty.setRootResourcePath("/resteasy"); netty.setSecurityDomain(null); netty.start(); }
ResteasyDeployment deployment = new ResteasyDeployment(); deployment.setInjectorFactoryClass(CdiInjectorFactory.class.getName()); List<String> applications;
private DeploymentInfo deploymentInfo() throws InterruptedException { final ResteasyDeployment resteasyDeployment = new ResteasyDeployment(); Utils.waitForCDIProvider(context); resteasyDeployment.setResourceFactories(resourceFactories()); final DeploymentInfo deploymentInfo = this.server.undertowDeployment(resteasyDeployment, String.valueOf(this.context.getProperties().get(HTTP_SERVER_REST_SERVLET_MAPPING_PREFIX))) .setContextPath(String.valueOf(this.context.getProperties().get(HTTP_SERVER_REST_CONTEXT_PATH))) .setClassLoader(this.getClass().getClassLoader()) .setDeploymentName("Silverware rest deployment"); if (this.sslEnabled) { deploymentInfo .addSecurityConstraint(new SecurityConstraint().addWebResourceCollection(new WebResourceCollection() .addUrlPattern("/*")) .setTransportGuaranteeType(TransportGuaranteeType.CONFIDENTIAL) .setEmptyRoleSemantic(SecurityInfo.EmptyRoleSemantic.PERMIT)) .setConfidentialPortManager(exchange -> sslPort()); } return deploymentInfo; }
public static ResteasyDeployment start(String bindPath, SecurityDomain domain, Hashtable<String,String> initParams, Hashtable<String,String> contextParams) throws Exception ResteasyDeployment deployment = new ResteasyDeployment(); deployment.setSecurityEnabled(true); String applicationClass = null;
public static void main(String[] args) throws Exception { String host = "0.0.0.0"; int port = 8080; if (args.length > 0) { host = args[0]; } if (args.length > 1) { port = Integer.parseInt(args[1]); } NettyJaxrsServer netty = new NettyJaxrsServer(); ResteasyDeployment deployment = new ResteasyDeployment(); deployment.setApplication(new MyApplication()); netty.setDeployment(deployment); netty.setHostname(host); netty.setPort(port); netty.setRootResourcePath("/"); netty.setSecurityDomain(null); netty.start(); } }
public void ensureHttpServerIsRunning() throws IOException { if (httpServer == null) { RestConfiguration.setFactory(getLightblueFactory()); ResteasyDeployment dataDeployment = new ResteasyDeployment(); dataDeployment.getActualResourceClasses().add(CrudResource.class); dataDeployment.getActualProviderClasses().add(LZFEncodingInterceptor.class); dataDeployment.getActualProviderClasses().add(LZFDecodingInterceptor.class); ResteasyDeployment metadataDeployment = new ResteasyDeployment(); metadataDeployment.getActualResourceClasses().add(MetadataResource.class); metadataDeployment.getActualProviderClasses().add(LZFEncodingInterceptor.class); metadataDeployment.getActualProviderClasses().add(LZFDecodingInterceptor.class); Undertow.Builder builder = Undertow.builder() .addHttpListener(getHttpPort(), getHttpHost()); httpServer = new UndertowJaxrsServer(); httpServer.start(builder); DeploymentInfo dataDeploymentInfo = httpServer.undertowDeployment(dataDeployment); configureDeployment(dataDeploymentInfo, "data", getDataContextPath()); DeploymentInfo metadataDeploymentInfo = httpServer.undertowDeployment(metadataDeployment); configureDeployment(metadataDeploymentInfo, "metadata", getMetadataContextPath()); //Optionally require authentication, by default none is used. if (getIdentityManager() != null) { configureDeploymentSecurity(dataDeploymentInfo); configureDeploymentSecurity(metadataDeploymentInfo); } httpServer.deploy(dataDeploymentInfo); httpServer.deploy(metadataDeploymentInfo); } }
public RestMossroseUI(final JobOperation jobOperation, final Competitive competitive, final int port) { super(); final ResteasyDeployment deployment = new ResteasyDeployment(); deployment.setSecurityEnabled(true); deployment.setApplication(new Application() { private Set<Object> singletons = Sets.<Object> newHashSet(new MossroseRequestHandler(jobOperation)); @Override public Set<Object> getSingletons() { return singletons; } }); deployment.setProviders(Lists.<Object> newArrayList(new MasterRouting(competitive), new MossroseJackson2Provider())); final NettyJaxrsServer server = new NettyJaxrsServer(); server.setDeployment(deployment); server.setExecutorThreadCount(1); server.setPort(port); server.setRootResourcePath(""); server.setSecurityDomain(null); server.start(); LOGGER.info("Server startup at port [{}].", port); }
public RestMossroseUI(final JobOperation jobOperation, final LeaderSelector leaderSelector, final int port) { super(); final ResteasyDeployment deployment = new ResteasyDeployment(); deployment.setSecurityEnabled(true); deployment.setApplication(new Application() { private Set<Object> singletons = Sets.<Object> newHashSet(new MossroseRequestHandler(jobOperation)); @Override public Set<Object> getSingletons() { return singletons; } }); deployment.setProviders(Lists.<Object> newArrayList(new MasterRouting(leaderSelector), new MossroseJackson2Provider())); final NettyJaxrsServer server = new NettyJaxrsServer(); server.setDeployment(deployment); server.setExecutorThreadCount(1); server.setPort(port); server.setRootResourcePath(""); server.setSecurityDomain(null); server.start(); LOGGER.info("Server startup at port [{}].", port); }
public static void main(String[] args) throws Exception { String host = "0.0.0.0"; int port = 8080; if (args.length > 0) { host = args[0]; } if (args.length > 1) { port = Integer.parseInt(args[1]); } NettyJaxrsServer netty = new NettyJaxrsServer(); ResteasyDeployment deployment = new ResteasyDeployment(); deployment.setApplication(new MyApplication()); netty.setDeployment(deployment); netty.setHostname(host); netty.setPort(port); netty.setRootResourcePath("/"); netty.setSecurityDomain(null); netty.start(); } }
public DeploymentInfo getDeployment( final String contextRoot ) final ResteasyDeployment deployment = new ResteasyDeployment();