use of org.everrest.core.impl.EverrestConfiguration in project che by eclipse.
the class ServerContainerInitializeListener method createExecutor.
protected ExecutorService createExecutor(final ServletContext servletContext) {
final EverrestConfiguration everrestConfiguration = getEverrestConfiguration(servletContext);
final String threadNameFormat = "everrest.WSConnection." + servletContext.getServletContextName() + "-%d";
return Executors.newFixedThreadPool(everrestConfiguration.getAsynchronousPoolSize(), new ThreadFactoryBuilder().setNameFormat(threadNameFormat).setUncaughtExceptionHandler(LoggingUncaughtExceptionHandler.getInstance()).setDaemon(true).build());
}
use of org.everrest.core.impl.EverrestConfiguration in project che by eclipse.
the class ServiceDescriptorTest method setUp.
@BeforeTest
public void setUp() throws Exception {
DependencySupplierImpl dependencies = new DependencySupplierImpl();
ResourceBinder resources = new ResourceBinderImpl();
ProviderBinder providers = new ApplicationProviderBinder();
EverrestProcessor processor = new EverrestProcessor(new EverrestConfiguration(), dependencies, new RequestHandlerImpl(new RequestDispatcher(resources), providers), null);
launcher = new ResourceLauncher(processor);
processor.addApplication(new Deployer());
ApplicationContext.setCurrent(anApplicationContext().withProviders(providers).build());
System.out.println("initialized");
}
use of org.everrest.core.impl.EverrestConfiguration in project che by eclipse.
the class DownloadFileResponseFilterTest method before.
/**
* Setup env for launching requests
* @throws Exception
*/
@BeforeMethod
public void before() throws Exception {
//set up launcher
final ResourceBinderImpl resources = new ResourceBinderImpl();
resources.addResource(MyJaxRSService.class, null);
final DependencySupplierImpl dependencies = new DependencySupplierImpl();
final ApplicationProviderBinder providers = new ApplicationProviderBinder();
providers.addExceptionMapper(ApiExceptionMapper.class);
providers.addResponseFilter(EverrestDownloadFileResponseFilter.class);
final URI uri = new URI(BASE_URI);
final ContainerRequest req = new ContainerRequest(null, uri, uri, null, null, null);
final ApplicationContext context = anApplicationContext().withRequest(req).withProviders(providers).withDependencySupplier(dependencies).build();
ApplicationContext.setCurrent(context);
final EverrestProcessor processor = new EverrestProcessor(new EverrestConfiguration(), dependencies, new RequestHandlerImpl(new RequestDispatcher(resources), providers), null);
resourceLauncher = new ResourceLauncher(processor);
}
use of org.everrest.core.impl.EverrestConfiguration in project che by eclipse.
the class ETagResponseFilterTest method before.
/**
* Setup env for launching requests
* @throws Exception
*/
@BeforeMethod
public void before() throws Exception {
//set up launcher
final ResourceBinderImpl resources = new ResourceBinderImpl();
resources.addResource(MyJaxRSService.class, null);
final DependencySupplierImpl dependencies = new DependencySupplierImpl();
final ApplicationProviderBinder providers = new ApplicationProviderBinder();
providers.addExceptionMapper(ApiExceptionMapper.class);
providers.addResponseFilter(ETagResponseFilter.class);
final URI uri = new URI(BASE_URI);
final ContainerRequest req = new ContainerRequest(null, uri, uri, null, null, null);
final ApplicationContext contextImpl = anApplicationContext().withRequest(req).withProviders(providers).build();
contextImpl.setDependencySupplier(dependencies);
ApplicationContext.setCurrent(contextImpl);
final EverrestProcessor processor = new EverrestProcessor(new EverrestConfiguration(), dependencies, new RequestHandlerImpl(new RequestDispatcher(resources), providers), null);
resourceLauncher = new ResourceLauncher(processor);
}
use of org.everrest.core.impl.EverrestConfiguration in project che by eclipse.
the class ServerContainerInitializeListener method getEverrestProcessor.
protected EverrestProcessor getEverrestProcessor(ServletContext servletContext) {
final DependencySupplier dependencies = (DependencySupplier) servletContext.getAttribute(DependencySupplier.class.getName());
final ResourceBinder resources = (ResourceBinder) servletContext.getAttribute(ResourceBinder.class.getName());
final ProviderBinder providers = (ProviderBinder) servletContext.getAttribute(ApplicationProviderBinder.class.getName());
final EverrestConfiguration copyOfEverrestConfiguration = new EverrestConfiguration(getEverrestConfiguration(servletContext));
copyOfEverrestConfiguration.setProperty(EverrestConfiguration.METHOD_INVOKER_DECORATOR_FACTORY, WebSocketMethodInvokerDecoratorFactory.class.getName());
final RequestHandlerImpl requestHandler = new RequestHandlerImpl(new RequestDispatcher(resources), providers);
return new EverrestProcessor(copyOfEverrestConfiguration, dependencies, requestHandler, null);
}
Aggregations