dev@glassfish.java.net

Re: Reloading a module without restarting the domain?

From: Chris Kasso <chris.kasso_at_oracle.com>
Date: Tue, 29 Jun 2010 17:54:10 -0700

Byron Nevins wrote:
> What if you change a constructor or invariants in a class -- and there
> are thousands of instances of that class already lying around? Oops!
> New code is a pretty good reason for restarting a domain. What is
> your reason for not wanting to do that?
Let's pretend I know what I'm doing and the scope of the impact of the
modified code.

This is partly an academic question and partly a how to
dev-test-debug-reload as quick as possible. Restarting the domain is
expensive compared to reloading a module (if it were possible).

The Felix shell has a bunch of commands: refresh, update, uninstall that
appear to operate on modules. What purpose do they serve?
> Have you tried "asadmin restart-domain" ?
Yes.
>
>
>
> On 6/29/2010 5:21 PM, Chris Kasso wrote:
>> Is it possible?
>>
>> I drop a module into the modules directory, start up the domain
>> and get the module to the Active state. I then drop in a new
>> build of the module into the modules directory replacing the old copy.
>> How do I get GF/Felix to reload the module without restarting the
>> domain?
>>
>> I tried telnet'ing to the Felix remote shell console and used
>> various commands (refresh<module id>, update<module id>,
>> uninstall<module id>) but known appeared to cause the new version
>> of the module to be loaded. It continued to use the old
>> module (even though it had been replaced in modules directory).
>>
>> The only way I could get the replacement module loaded was
>> to restart the domain.
>>
>> Chris
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>>
>>
>