jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Felix Meschberger <fmesc...@gmail.com>
Subject Re: RMI Shutdown
Date Tue, 01 Dec 2009 07:12:32 GMT
Hi,

ChadDavis schrieb:
> I'm creating my own server wrapper around a RMI exposed repository.
> I'm trying to figure out how to properly write the shutdown method.
> 
> In my start up method, I do the following:
> 
>  RemoteRepository remote = factory.getRemoteRepository(repository);
>  Registry reg = LocateRegistry.createRegistry(1100);
>  reg.rebind("jackrabbit", remote);
> 
> 
> In my shutdown method, I would like to follow RMI recommendations for
> clean up.  This includes two steps:
> 
> 1) UnicastRemoteObject.unexport ()
> 2) reg.unbind()
> 
> Since, the ServerRepository object itself extends UnicastRemoteObject,
> I wonder if it takes care of step one itself.  Or perhaps there's some
> higher level method for shutdown of the RMI'ness of the repository.

No, the AFAICT the ServerRespository does not implement these steps, you
would have to do it expressly in your application (and don't forget to
remove the RMI registry if you created it yourself).

The ServerRepository does not implement the JackrabbitRepository
interface, in fact the jcr-rmi libray does not contain an implementation
of that, thus there is no "official" shutdown method in this context
(would probably be an interesting extension, though).

> 
> And, should I also call the JackrabbitRepository's shutdown method?  I
> think not, since I'm using the TransientRepository.  Is this accurate?
> 

Whether you call the shutdown method or not is your call and that of
your application and IMHO has nothing to do with how and when to
unregister/unexport the RMI server part.


Regards
Felix

Mime
View raw message