jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jukka Zitting <jzitt...@adobe.com>
Subject RE: RuntimeException on interrupted shutdown
Date Tue, 16 Nov 2010 16:23:43 GMT
Hi,

From: Ista Pouss [mailto:istaous@gmail.com]
> I observe jackrabbit throw a RuntimeException when a shutdown is
> interrupted.
> 
> I see in RepositoryImpl :
> 
>     public void shutdown() {
>         try {
>             shutdownLock.writeLock().acquire();
>         } catch (InterruptedException e) {
>             // TODO: Should this be a checked exception?
>             throw new RuntimeException("Shutdown lock could not be
> acquired", e);
>         }
> 
> 
> Perhaps best to rethrow an InterruptedException as in
> http://download.oracle.com/javase/tutorial/essential/concurrency/interr
> upt.html?
> 
> Why do you throw a RuntimeException ?

Adding a checked exception like InterruptedException (or RepositoryException, as that would
fit better with the overall API) would break backwards compatibility of the JackrabbitRepository.shutdown()
method defined in jackrabbit-api.

BR,

Jukka Zitting
Mime
View raw message