|
From: <pe...@us...> - 2003-12-19 18:03:37
|
Update of /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/id/resolver
In directory sc8-pr-cvs1:/tmp/cvs-serv5310/src/java/org/neuclear/id/resolver
Modified Files:
NSResolver.java
Log Message:
Revamped a lot of exception handling throughout the framework, it has been simplified in most places:
- For most cases the main exception to worry about now is InvalidNamedObjectException.
- Most lowerlevel exception that cant be handled meaningful are now wrapped in the LowLevelException, a
runtime exception.
- Source and Store patterns each now have their own exceptions that generalizes the various physical
exceptions that can happen in that area.
Index: NSResolver.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/id/resolver/NSResolver.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** NSResolver.java 19 Dec 2003 00:31:30 -0000 1.16
--- NSResolver.java 19 Dec 2003 18:03:34 -0000 1.17
***************
*** 5,8 ****
--- 5,9 ----
import org.neuclear.id.cache.NSCache;
import org.neuclear.source.Source;
+ import org.neuclear.source.SourceException;
/**
***************
*** 29,33 ****
* @return
*/
! public final static Identity resolveIdentity(final String name) throws NameResolutionException, NeuClearException,InvalidNamedObjectException {
final SignedNamedObject id = resolve(name);
if (id instanceof Identity)
--- 30,34 ----
* @return
*/
! public final static Identity resolveIdentity(final String name) throws NameResolutionException, InvalidNamedObjectException {
final SignedNamedObject id = resolve(name);
if (id instanceof Identity)
***************
*** 44,48 ****
* @return
*/
! public final static SignedNamedObject resolve(final String name) throws NameResolutionException,NeuClearException, InvalidNamedObjectException {
SignedNamedObject obj = NSCACHE.fetchCached(name);
if (obj != null)
--- 45,49 ----
* @return
*/
! public final static SignedNamedObject resolve(final String name) throws NameResolutionException, InvalidNamedObjectException {
SignedNamedObject obj = NSCACHE.fetchCached(name);
if (obj != null)
***************
*** 59,63 ****
store = parent.getRepository();
}
! obj = Source.getInstance().fetch(store, name);
if (obj == null)
throw new NameResolutionException(name);
--- 60,68 ----
store = parent.getRepository();
}
! try {
! obj = Source.getInstance().fetch(store, name);
! } catch (SourceException e) {
! throw new NameResolutionException(name,e.getLocalizedMessage());
! }
if (obj == null)
throw new NameResolutionException(name);
|