You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by ChadDavis <ch...@gmail.com> on 2009/12/01 02:24:12 UTC

RMI Shutdown

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.

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

Re: RMI Shutdown

Posted by Felix Meschberger <fm...@gmail.com>.
Hi,

ChadDavis schrieb:
>> 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).
>>
> 
> What exactly does the JackrabbitRepository.shutdown method do?  I
> mean, since the RMI package doesn't even use it.

AFAITC the method is implemented in the JackrabbitRepositoryImpl class
to actually shutdown the repository.

In the RMI context, I could very well imagine the ServerRepository to
implement a shutdown method by unregistering and unexporting the
repository. Whether the ServerRepository should implement the
JackrabbitRepository interface or not, I am not really sure....

Regards
Felix

Re: RMI Shutdown

Posted by ChadDavis <ch...@gmail.com>.
> 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).
>

What exactly does the JackrabbitRepository.shutdown method do?  I
mean, since the RMI package doesn't even use it.

Re: RMI Shutdown

Posted by Felix Meschberger <fm...@gmail.com>.
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