You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@abdera.apache.org by Brian Moseley <bc...@osafoundation.org> on 2007/11/03 18:03:02 UTC

Re: svn commit: r591523 - in /incubator/abdera/java/trunk: core/src/main/java/org/apache/abdera/ core/src/main/java/org/apache/abdera/parser/ core/src/main/java/org/apache/abdera/util/ core/src/main/java/org/apache/abdera/writer/ examples/src/main/ja

On Nov 2, 2007 5:32 PM,  <jm...@apache.org> wrote:

> When writing out large Atom documents, going through an creating a bunch of objects is less than
> optimum.  The new StreamWriter interface allows us to write out Atom documents using a streaming
> interface.  This is a work in progress.  There are some features, such as xml:lang and xml:base that need better support.

*cheer*

i had meant to suggest this a while back, but it totally slipped my
mind. i'm *very* happy to see it land, because Cosmo can often deliver
huge feeds. what features are missing besides xml:lang and xml:base? i
might be able to help.

Re: svn commit: r591523 - in /incubator/abdera/java/trunk: core/src/main/java/org/apache/abdera/ core/src/main/java/org/apache/abdera/parser/ core/src/main/java/org/apache/abdera/util/ core/src/main/java/org/apache/abdera/writer/ examples/src/main/ja

Posted by Brian Moseley <bc...@osafoundation.org>.
On Nov 6, 2007 2:05 PM, James M Snell <ja...@gmail.com> wrote:
> Right now, the implementation flushes the buffer automatically during
> write.  We can have an option to disable autoflushing.  We can leave
> reseting the buffer to whatever stream/writer we're writing to.

okay, but that doesn't address two points: how does the error get
communicated to the client, and how does the StreamWriter know to
reset the buffer and write the error information instead?

for the former, how about an abdera:error wrapping an atom:id and a
specific error condition element? something like this:

<abdera:unknown-entry-generation-error>This is the message from the
exception that the Provider
caught.</abdera:unknown-entry-generation-error>

specific exceptions can provide their own error condition elements,
and clients can code for them.

for the latter, maybe StreamWriter needs a sendError(Exception) method
that clears the underlying stream's buffer and writes the error and
flushes it?

Re: svn commit: r591523 - in /incubator/abdera/java/trunk: core/src/main/java/org/apache/abdera/ core/src/main/java/org/apache/abdera/parser/ core/src/main/java/org/apache/abdera/util/ core/src/main/java/org/apache/abdera/writer/ examples/src/main/ja

Posted by James M Snell <ja...@gmail.com>.
Right now, the implementation flushes the buffer automatically during
write.  We can have an option to disable autoflushing.  We can leave
reseting the buffer to whatever stream/writer we're writing to.

- James

Brian Moseley wrote:
> On Nov 3, 2007 9:03 AM, Brian Moseley <bc...@osafoundation.org> wrote:
> 
>> *cheer*
>>
>> i had meant to suggest this a while back, but it totally slipped my
>> mind. i'm *very* happy to see it land, because Cosmo can often deliver
>> huge feeds. what features are missing besides xml:lang and xml:base? i
>> might be able to help.
> 
> something that needs to be considered when switching to streamed
> writing - what happens if you write enough data to commit the
> response, and then an error occurs? how does the error get reported to
> the client?
> 
> my first thought is to have the writer buffer each entry and only
> write it out when the close entry method is called. then, at any point
> before the entry is closed, allow the caller to signal an error
> condition. the writer would throw away the buffered partial entry and
> instead write some sort of error element to the stream.
> 
> thoughts?
> 

Re: svn commit: r591523 - in /incubator/abdera/java/trunk: core/src/main/java/org/apache/abdera/ core/src/main/java/org/apache/abdera/parser/ core/src/main/java/org/apache/abdera/util/ core/src/main/java/org/apache/abdera/writer/ examples/src/main/ja

Posted by Brian Moseley <bc...@osafoundation.org>.
On Nov 3, 2007 9:03 AM, Brian Moseley <bc...@osafoundation.org> wrote:

> *cheer*
>
> i had meant to suggest this a while back, but it totally slipped my
> mind. i'm *very* happy to see it land, because Cosmo can often deliver
> huge feeds. what features are missing besides xml:lang and xml:base? i
> might be able to help.

something that needs to be considered when switching to streamed
writing - what happens if you write enough data to commit the
response, and then an error occurs? how does the error get reported to
the client?

my first thought is to have the writer buffer each entry and only
write it out when the close entry method is called. then, at any point
before the entry is closed, allow the caller to signal an error
condition. the writer would throw away the buffered partial entry and
instead write some sort of error element to the stream.

thoughts?