use of org.apache.cxf.jaxrs.lifecycle.SingletonResourceProvider in project tika by apache.
the class TikaMimeTypesTest method setUpResources.
@Override
protected void setUpResources(JAXRSServerFactoryBean sf) {
sf.setResourceClasses(TikaMimeTypes.class);
sf.setResourceProvider(TikaMimeTypes.class, new SingletonResourceProvider(new TikaMimeTypes()));
}
use of org.apache.cxf.jaxrs.lifecycle.SingletonResourceProvider in project tika by apache.
the class TikaResourceTest method setUpResources.
@Override
protected void setUpResources(JAXRSServerFactoryBean sf) {
sf.setResourceClasses(TikaResource.class);
sf.setResourceProvider(TikaResource.class, new SingletonResourceProvider(new TikaResource()));
}
use of org.apache.cxf.jaxrs.lifecycle.SingletonResourceProvider in project tika by apache.
the class TikaVersionTest method setUpResources.
@Override
protected void setUpResources(JAXRSServerFactoryBean sf) {
sf.setResourceClasses(TikaVersion.class);
sf.setResourceProvider(TikaVersion.class, new SingletonResourceProvider(new TikaVersion()));
}
use of org.apache.cxf.jaxrs.lifecycle.SingletonResourceProvider in project tika by apache.
the class StackTraceTest method setUpResources.
@Override
protected void setUpResources(JAXRSServerFactoryBean sf) {
List<ResourceProvider> rCoreProviders = new ArrayList<ResourceProvider>();
rCoreProviders.add(new SingletonResourceProvider(new MetadataResource()));
rCoreProviders.add(new SingletonResourceProvider(new RecursiveMetadataResource()));
rCoreProviders.add(new SingletonResourceProvider(new DetectorResource()));
rCoreProviders.add(new SingletonResourceProvider(new TikaResource()));
rCoreProviders.add(new SingletonResourceProvider(new UnpackerResource()));
sf.setResourceProviders(rCoreProviders);
}
use of org.apache.cxf.jaxrs.lifecycle.SingletonResourceProvider in project cxf by apache.
the class MultipartServer method run.
protected void run() {
JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean();
sf.setResourceClasses(MultipartStore.class);
Map<String, Object> props = new HashMap<>();
props.put(AttachmentDeserializer.ATTACHMENT_MAX_SIZE, String.valueOf(1024 * 10));
props.put(AttachmentDeserializer.ATTACHMENT_MEMORY_THRESHOLD, String.valueOf(1024 * 5));
props.put(AttachmentDeserializer.ATTACHMENT_MAX_HEADER_SIZE, String.valueOf(400));
sf.setProperties(props);
// default lifecycle is per-request, change it to singleton
sf.setResourceProvider(MultipartStore.class, new SingletonResourceProvider(new MultipartStore()));
sf.setAddress("http://localhost:" + PORT + "/");
server = sf.create();
}
Aggregations