Bugs item #764553, was opened at 2003-07-02 12:28
Message generated for change (Comment added) made by rodburgett
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=764553&group_id=22866

Category: JBossServer
Group: v3.2
Status: Open
Resolution: None
Priority: 5
Submitted By: Rod Burgett (rodburgett)
Assigned to: Nobody/Anonymous (nobody)
Summary: housekeeping in ServerImpl and ServerConfigLocator

Initial Comment:
This patch addresses housekeeping deficiencies in the 
org.jboss.system.server.ServerImpl and 
ServerConfigLocator classes.

The ServerConfigLocator class has no shutdown method 
but it does hold a static reference to an 
MBeanProxyExt.  This reference becomes invalid when 
the MBeanServer is shutdown.  This patch adds a static 
shutdown method to null out the reference.  Code to 
invoke this new method is added to the shutdown 
processing in ServerImpl.

Several updates are made to the ServerImpl class, some 
making use of updates to other classes from this and 
another patch.  The dependency on another patch is 
noted in the change descriptions below.

There are two changes to the ServerImpl.shutdown() 
method: the shutdown hook that was registered with 
the system runtime during startup is removed, and a null 
check is added before invoking accessors on the 
ServerConfig.

It makes sense to unregister the shutdown hook when 
JBoss is shutdown manually.  In the situation where 
JBoss startup/shutdown is controlled by an outside 
class, this shutdown hook will attempt to repeat the 
process when the VM exits.

Since the init() method will throw an 
IllegalStateException if it finds a non-null config field, 
the shutdown process needs to null out this field.  That 
makes it prudent to check for a null value prior to 
attempting to access methods.  Default values for 
local 'exitOnShutdown' and 'blockingShutdown' flags are 
taken from ServerConfig when config == null.

A few lines of cleanup are added to the 
ShutdownHook.run() method to null out some ServerImpl 
fields and to encourage the GC to run.  This shutdown() 
method needs a (config == null) before attempting to 
find and delete the tmp/deploy directory.

A few comments and error literals from the 
ShutdownHook.shutdownDeployments() and 
shutdownServices() methods suffered from cut-n-paste 
lapse, they are corrected in this patch.

The ShutdownHook.removeMBeans() method is updated 
to include a check for non-null mbean server reference.  
Also, the previous request that the MBeanServerFactory 
release the current mbean server is replaced with a 
request to shutdown the mbean registry.  The registry 
shutdown() method is added by JBoss patch #763378, 
which includes addition of a shutdown method to the 
MBeanServerImpl.  The mbean server shutdown process 
includes a call to the 
MBeanSercverFactory.releaseMBeanServer() method.  
Note that the current patch will cause a run time error - 
probably UnsupportedMethod - if patch #763378 is not 
applied before the current patch.

Prior to shutting down the registry, a new 
ShutdownHook method is called to remove any leftover 
service mbeans.  This new method, 
removeLeftoverMBeans(), queries the mbean server for 
all registered mbeans and attempts to remove most.  
This server impl lacks permission to remove mbeans from 
the 'implementation' domain, so these are skipped, they 
must be removed by the mbean server.


----------------------------------------------------------------------

>Comment By: Rod Burgett (rodburgett)
Date: 2003-07-02 12:28

Message:
Logged In: YES 
user_id=681969

add the other diff file...

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=764553&group_id=22866


-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to