Search in sources :

Example 6 with SingletonResourceProvider

use of org.apache.cxf.jaxrs.lifecycle.SingletonResourceProvider in project tika by apache.

the class StackTraceOffTest 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);
}
Also used : RecursiveMetadataResource(org.apache.tika.server.resource.RecursiveMetadataResource) MetadataResource(org.apache.tika.server.resource.MetadataResource) SingletonResourceProvider(org.apache.cxf.jaxrs.lifecycle.SingletonResourceProvider) ResourceProvider(org.apache.cxf.jaxrs.lifecycle.ResourceProvider) TikaResource(org.apache.tika.server.resource.TikaResource) ArrayList(java.util.ArrayList) DetectorResource(org.apache.tika.server.resource.DetectorResource) RecursiveMetadataResource(org.apache.tika.server.resource.RecursiveMetadataResource) UnpackerResource(org.apache.tika.server.resource.UnpackerResource) SingletonResourceProvider(org.apache.cxf.jaxrs.lifecycle.SingletonResourceProvider)

Example 7 with SingletonResourceProvider

use of org.apache.cxf.jaxrs.lifecycle.SingletonResourceProvider in project tika by apache.

the class TikaParsersTest method setUpResources.

@Override
protected void setUpResources(JAXRSServerFactoryBean sf) {
    sf.setResourceClasses(TikaParsers.class);
    sf.setResourceProvider(TikaParsers.class, new SingletonResourceProvider(new TikaParsers()));
}
Also used : TikaParsers(org.apache.tika.server.resource.TikaParsers) SingletonResourceProvider(org.apache.cxf.jaxrs.lifecycle.SingletonResourceProvider)

Example 8 with SingletonResourceProvider

use of org.apache.cxf.jaxrs.lifecycle.SingletonResourceProvider in project tika by apache.

the class UnpackerResourceTest method setUpResources.

@Override
protected void setUpResources(JAXRSServerFactoryBean sf) {
    sf.setResourceClasses(UnpackerResource.class);
    sf.setResourceProvider(UnpackerResource.class, new SingletonResourceProvider(new UnpackerResource()));
}
Also used : UnpackerResource(org.apache.tika.server.resource.UnpackerResource) SingletonResourceProvider(org.apache.cxf.jaxrs.lifecycle.SingletonResourceProvider)

Example 9 with SingletonResourceProvider

use of org.apache.cxf.jaxrs.lifecycle.SingletonResourceProvider in project tika by apache.

the class TikaWelcomeTest method setUpResources.

@Override
protected void setUpResources(JAXRSServerFactoryBean sf) {
    List<ResourceProvider> rpsCore = new ArrayList<ResourceProvider>();
    rpsCore.add(new SingletonResourceProvider(new TikaVersion()));
    rpsCore.add(new SingletonResourceProvider(new DetectorResource()));
    rpsCore.add(new SingletonResourceProvider(new MetadataResource()));
    List<ResourceProvider> all = new ArrayList<ResourceProvider>(rpsCore);
    all.add(new SingletonResourceProvider(new TikaWelcome(rpsCore)));
    sf.setResourceProviders(all);
}
Also used : MetadataResource(org.apache.tika.server.resource.MetadataResource) SingletonResourceProvider(org.apache.cxf.jaxrs.lifecycle.SingletonResourceProvider) ResourceProvider(org.apache.cxf.jaxrs.lifecycle.ResourceProvider) ArrayList(java.util.ArrayList) DetectorResource(org.apache.tika.server.resource.DetectorResource) TikaVersion(org.apache.tika.server.resource.TikaVersion) TikaWelcome(org.apache.tika.server.resource.TikaWelcome) SingletonResourceProvider(org.apache.cxf.jaxrs.lifecycle.SingletonResourceProvider)

Example 10 with SingletonResourceProvider

use of org.apache.cxf.jaxrs.lifecycle.SingletonResourceProvider in project tika by apache.

the class TranslateResourceTest method setUpResources.

@Override
protected void setUpResources(JAXRSServerFactoryBean sf) {
    sf.setResourceClasses(TranslateResource.class);
    sf.setResourceProvider(TranslateResource.class, new SingletonResourceProvider(new TranslateResource()));
}
Also used : TranslateResource(org.apache.tika.server.resource.TranslateResource) SingletonResourceProvider(org.apache.cxf.jaxrs.lifecycle.SingletonResourceProvider)

Aggregations

SingletonResourceProvider (org.apache.cxf.jaxrs.lifecycle.SingletonResourceProvider)84 JAXRSServerFactoryBean (org.apache.cxf.jaxrs.JAXRSServerFactoryBean)63 Bus (org.apache.cxf.Bus)17 JacksonJsonProvider (com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider)15 ArrayList (java.util.ArrayList)14 LoggingOutInterceptor (org.apache.cxf.ext.logging.LoggingOutInterceptor)14 ResourceProvider (org.apache.cxf.jaxrs.lifecycle.ResourceProvider)9 HashMap (java.util.HashMap)7 Before (org.junit.Before)7 SpringBusFactory (org.apache.cxf.bus.spring.SpringBusFactory)5 ClassResourceInfo (org.apache.cxf.jaxrs.model.ClassResourceInfo)5 Map (java.util.Map)4 ReactiveIOCustomizer (org.apache.cxf.jaxrs.rx3.server.ReactiveIOCustomizer)4 DetectorResource (org.apache.tika.server.resource.DetectorResource)4 MetadataResource (org.apache.tika.server.resource.MetadataResource)4 HttpServletRequest (javax.servlet.http.HttpServletRequest)3 HttpServletResponse (javax.servlet.http.HttpServletResponse)3 Feature (org.apache.cxf.feature.Feature)3 ReactiveIOCustomizer (org.apache.cxf.jaxrs.rx2.server.ReactiveIOCustomizer)3 Message (org.apache.cxf.message.Message)3