Sorry, CC-ing to users again,

I've refactored a default BinaryDataProvider:

http://svn.apache.org/repos/asf/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/BinaryDataProvider.java

see handleRangeRequest. Will add the rev link to a subsequent JIRA.

I think we can get ranges supported there easily enough, we have a range value ready to be parsed and then we just copy a range of bytes and set the response headers if needed...

Can you please consider updating that section with some initial code and I will then apply a patch ?

Thanks, Sergey

On 27/09/11 22:21, Sergey Beryozkin wrote:
Or simply return a (ByteArray) InputStream representing a specific
range. But the complexity of dealing with the ranges would be hidden
ideally...
Sergey
On 27/09/11 22:05, Sergey Beryozkin wrote:
Actually, the really simple option to start is to return
JAX-RS StreamingOutput from a resource method and have "@Context
HttpHeaders headers;" injected or even have a range header passed in as
a parameter to this method which will be further passed to
StreamingOutputImpl...

Cheers, Sergey

On 27/09/11 22:02, Sergey Beryozkin wrote:
Hi

It has to be CXFNonSpringJaxrsServlet:

http://cxf.apache.org/docs/jaxrs-services-configuration.html#JAXRSServicesConfiguration-ConfiguringJAXRSservicesincontainerwithoutSpring




I'm also modifying a bit the existing input stream provider, will let
you know when it's ready

Cheers, Sergey
This page:

http://cxf.apache.org/docs/jax-rs-basics.html

Says:

One can easily register a provider either from Spring configuration or
programmatically:

And gives a Spring example, but doesn’t show it ‘programmatically’. How
do I register

the provider if not using spring?

I tried adding this to my web.xml:

<servlet>

<servlet-name>CXFServlet</servlet-name>

<servlet-class>

org.apache.cxf.transport.servlet.CXFServlet

</servlet-class>

*<**init-param**>***

*<**param-name**>**jaxrs.providers**</**param-name**>***

*<**param-value**>**com.alcatel_lucent.lvc.ThorThingyWriter**</**param-value**>***




*</**init-param**>*****

</servlet>

But isWriteable on ThorThingyWriter is still never called.

Thanks

-- DC

-----Original Message-----

From: Sergey Beryozkin [mailto:[email protected]]

Sent: Wednesday, September 21, 2011 11:39 AM

To: [email protected]

Subject: Re: CXF Servlet support of HTTP Byte Range

That can be easier implemented in a custom MessageBodyWriter which

operates on InputStream. Or may be even in the StreamingOutputImpl.

Perhaps it would make sense to ship such a MessageBodyWriter...

Cheers, Sergey

On 21/09/11 15:43, Collard, David L (Dave) wrote:

ehcache could be used to cache the complete response, then

hand out byte ranges as requested. But I think this would

best be done in the CXF servlet implementation.





-----Original Message-----

From: Sergey Beryozkin [mailto:[email protected]]

Sent: Wednesday, September 21, 2011 10:39 AM

To: [email protected]

Subject: Re: CXF Servlet support of HTTP Byte Range



Though I guess the correlation is not actually needed for the concrete

impls. What about encache or similar, can they do it ?



Cheers, Sergey

On 21/09/11 15:36, Sergey Beryozkin wrote:

> Hi

>

> On 21/09/11 15:07, Collard, David L (Dave) wrote:

>> Does/Can CXF servlet support/be configured to support

>> HTTP Byte Ranges?

>>

>> From http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html

>> 14.35 Range

>> 14.35.1 Byte Ranges

>>

>

> I'm wondering if it is what the actual origin server may/should
support,

> say Tomcat or Apache ?

>

> We don't support at the CXF level, I'm not even sure how the
correlation

> between multiple range requests is achieved, using cookies ?

> Cheers, Sergey

>

>>

>> Thanks,

>>

>> -- Thor

>>

>







Reply via email to