Examples of BinaryDataProvider


Examples of com.astamuse.asta4d.web.dispatch.response.provider.BinaryDataProvider

        if (info.content == null && info.firstTimeInput != null) {
            // no cache, and we have opened it at first time
            InputStream input = info.firstTimeInput;
            info.firstTimeInput = null;
            return new BinaryDataProvider(input);
        } else if (info.content == null && info.firstTimeInput == null) {
            // no cache
            return new BinaryDataProvider(servletContext, this.getClass().getClassLoader(), info.path);
        } else {
            // should cache
            byte[] data = null;
            data = info.content.get();
            if (data == null) {
                InputStream input = BinaryDataUtil.retrieveInputStreamByPath(servletContext, this.getClass().getClassLoader(), path);
                data = retrieveBytesFromInputStream(input, info.cacheLimit);
                info.content = new SoftReference<byte[]>(data);
            }
            return new BinaryDataProvider(data);
        }
    }
View Full Code Here

Examples of com.astamuse.asta4d.web.dispatch.response.provider.BinaryDataProvider

        if (info.content == null && info.firstTimeInput != null) {
            // no cache, and we have opened it at first time
            InputStream input = info.firstTimeInput;
            info.firstTimeInput = null;
            return new BinaryDataProvider(input);
        } else if (info.content == null && info.firstTimeInput == null) {
            // no cache
            return new BinaryDataProvider(servletContext, this.getClass().getClassLoader(), info.path);
        } else {
            // should cache
            byte[] data = null;
            data = info.content.get();
            if (data == null) {
                InputStream input = BinaryDataUtil.retrieveInputStreamByPath(servletContext, this.getClass().getClassLoader(), path);
                data = retrieveBytesFromInputStream(input, info.cacheLimit);
                info.content = new SoftReference<byte[]>(data);
            }
            return new BinaryDataProvider(data);
        }
    }
View Full Code Here

Examples of com.astamuse.asta4d.web.dispatch.response.provider.BinaryDataProvider

        if (info.content == null && info.firstTimeInput != null) {
            // no cache, and we have opened it at first time
            InputStream input = info.firstTimeInput;
            info.firstTimeInput = null;
            return new BinaryDataProvider(input);
        } else if (info.content == null && info.firstTimeInput == null) {
            // no cache
            return new BinaryDataProvider(servletContext, this.getClass().getClassLoader(), info.path);
        } else {
            // should cache
            byte[] data = null;
            data = info.content.get();
            if (data == null) {
                InputStream input = BinaryDataUtil.retrieveInputStreamByPath(servletContext, this.getClass().getClassLoader(), path);
                data = retrieveBytesFromInputStream(input, info.cacheLimit);
                info.content = new SoftReference<byte[]>(data);
            }
            return new BinaryDataProvider(data);
        }
    }
View Full Code Here

Examples of org.apache.cxf.jaxrs.provider.BinaryDataProvider

        sf.setResourceClasses(BookStore.class, SimpleBookStore.class, BookStorePerRequest.class);
       
        List<Object> providers = new ArrayList<Object>();
       
        //default lifecycle is per-request, change it to singleton
        BinaryDataProvider p = new BinaryDataProvider();
        p.setProduceMediaTypes(Collections.singletonList("application/bar"));
        p.setEnableBuffering(true);
        providers.add(p);
        JAXBElementProvider jaxbProvider = new JAXBElementProvider();
        Map<String, String> jaxbElementClassMap = new HashMap<String, String>();
        jaxbElementClassMap.put(BookNoXmlRootElement.class.getName(), "BookNoXmlRootElement");
        jaxbProvider.setJaxbElementClassMap(jaxbElementClassMap);
View Full Code Here

Examples of org.apache.cxf.jaxrs.provider.BinaryDataProvider

        sf.setResourceClasses(BookStore.class, SimpleBookStore.class, BookStorePerRequest.class);
       
        List<Object> providers = new ArrayList<Object>();
       
        //default lifecycle is per-request, change it to singleton
        BinaryDataProvider p = new BinaryDataProvider();
        p.setProduceMediaTypes(Collections.singletonList("application/bar"));
        p.setEnableBuffering(true);
        providers.add(p);
        providers.add(new BookStore.StringArrayBodyReaderWriter());
        providers.add(new BookStore.StringListBodyReaderWriter());
        JAXBElementProvider jaxbProvider = new JAXBElementProvider();
        Map<String, String> jaxbElementClassMap = new HashMap<String, String>();
View Full Code Here

Examples of org.apache.cxf.jaxrs.provider.BinaryDataProvider

        sf.setResourceClasses(BookStore.class, BookStorePerRequest.class);
       
        List<Object> providers = new ArrayList<Object>();
       
        //default lifecycle is per-request, change it to singleton
        BinaryDataProvider p = new BinaryDataProvider();
        p.setProduceMediaTypes(Collections.singletonList("application/bar"));
        p.setEnableBuffering(true);
       
        providers.add(p);
        providers.add(new GenericHandlerWriter());
        providers.add(new FaultyRequestHandler());
        sf.setProviders(providers);
View Full Code Here

Examples of org.apache.cxf.jaxrs.provider.BinaryDataProvider

        sf.setResourceClasses(BookStore.class, SimpleBookStore.class, BookStorePerRequest.class);
       
        List<Object> providers = new ArrayList<Object>();
       
        //default lifecycle is per-request, change it to singleton
        BinaryDataProvider p = new BinaryDataProvider();
        p.setProduceMediaTypes(Collections.singletonList("application/bar"));
        p.setEnableBuffering(true);
        providers.add(p);
        JAXBElementProvider jaxbProvider = new JAXBElementProvider();
        Map<String, String> jaxbElementClassMap = new HashMap<String, String>();
        jaxbElementClassMap.put(BookNoXmlRootElement.class.getName(), "BookNoXmlRootElement");
        jaxbProvider.setJaxbElementClassMap(jaxbElementClassMap);
View Full Code Here

Examples of org.apache.cxf.jaxrs.provider.BinaryDataProvider

        sf.setResourceClasses(BookStore.class, BookStorePerRequest.class);
       
        List<Object> providers = new ArrayList<Object>();
       
        //default lifecycle is per-request, change it to singleton
        BinaryDataProvider p = new BinaryDataProvider();
        p.setProduceMediaTypes(Collections.singletonList("application/bar"));
        p.setEnableBuffering(true);
        providers.add(p);
        JAXBElementProvider jaxbProvider = new JAXBElementProvider();
        Map<String, String> jaxbElementClassMap = new HashMap<String, String>();
        jaxbElementClassMap.put(BookNoXmlRootElement.class.getName(), "BookNoXmlRootElement");
        jaxbProvider.setJaxbElementClassMap(jaxbElementClassMap);
View Full Code Here

Examples of org.apache.cxf.jaxrs.provider.BinaryDataProvider

        sf.setResourceClasses(BookStore.class, BookStorePerRequest.class);
       
        List<Object> providers = new ArrayList<Object>();
       
        //default lifecycle is per-request, change it to singleton
        BinaryDataProvider p = new BinaryDataProvider();
        p.setProduceMediaTypes(Collections.singletonList("application/bar"));
        p.setEnableBuffering(true);
       
        providers.add(p);
        providers.add(new GenericHandlerWriter());
        providers.add(new FaultyRequestHandler());
        sf.setProviders(providers);
View Full Code Here

Examples of org.apache.cxf.jaxrs.provider.BinaryDataProvider

        sf.setResourceClasses(BookStore.class, SimpleBookStore.class, BookStorePerRequest.class);
       
        List<Object> providers = new ArrayList<Object>();
       
        //default lifecycle is per-request, change it to singleton
        BinaryDataProvider p = new BinaryDataProvider();
        p.setProduceMediaTypes(Collections.singletonList("application/bar"));
        p.setEnableBuffering(true);
        providers.add(p);
        JAXBElementProvider jaxbProvider = new JAXBElementProvider();
        Map<String, String> jaxbElementClassMap = new HashMap<String, String>();
        jaxbElementClassMap.put(BookNoXmlRootElement.class.getName(), "BookNoXmlRootElement");
        jaxbProvider.setJaxbElementClassMap(jaxbElementClassMap);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.