jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Angela Schreiber <anch...@day.com>
Subject Re: exception handling in jcr-server io subsystem
Date Thu, 08 Dec 2005 08:37:34 GMT
hi brian

> i'm in the middle of updating cosmo to use the current revision of 
> jackrabbit, and one thing is giving me a bit of trouble - the fact that 
> jcr-server's import/export subsystem only allows IOExceptions to be 
> propagated up to the DavResource level. in fact, in some places it 
> actively swallows RepositoryExceptions.

during the import of properties in the default handler, because
i wanted this to be used by all the derived handlers as well,
which use the same structure:

- 'File'-node
- 'Resource'-node
-  <data>

thus i did it on purpose during the import of properties (see below)
and only during import of properties...
if you find other places e.g. during the import of data without
an explaining comment its probably a bug.

> i understand that DefaultHandler is written to assume that a certain 
> node type structure is validated by the canImport/canExport methods. 

yes, 'a certain'... with the handlers available no check is made
against the nodetype-definition that would reveal whether a
certain property can be set or not :).

but of cause you may write your own handlers that assert
the complete nodetype structure...

> however, given that this is not the case, i'd like to revisit the io 
> subsystem and perhaps explicitly throw RepositoryExceptions where they 
> make sense.

> angela, what do you think?

i didn't throw RepositoryException on purpose, due to the fact,
that the io-stuff was originally (thus already with the command-chains)
designed to provide some abstraction of the import/export.
currently i don't see a benefit of throwing RepositoryException(s).

kind regards

View raw message