Noel J. Bergman wrote:

Stephen,

Is it safe to do this?

 try {
   ((org.apache.james.James)
theConfigData.getMailServer()).getBlockContext().requestShutdown();
 }
 catch (Throwable t) {
   System.exit(0);
 }


NO. IMHO this is evil.

Basically a component has no knowlege of the components that are using it - on the other hand a container can maintain a complete usage graph for a component and can make decisions about decommissioning of a component based on usage.


Phoenix still leaves some droppings if we call System.exit(0). I figure that in a non-Phoenix container, we'd just catch the exception and call System.exit.

Thoughts/recommendations?


Calling System.exit(0) is not something a component should be doing. In effect any implemetation code calling System.exit is basically acting as a top level component - i.e. an application. In the Phoenix environment it is a somewhat simpler because James is packages as an application unit. However in the Merlin environment James is packages as a composite component that can be used by other components.


Can you give me a hint at the underlying rationale for this?
Perhaps it is something more appropriately handled at the level of a JMX management operation.


Cheers, Steve.


--- Noel






--


Stephen J. McConnell
mailto:[EMAIL PROTECTED]
http://www.osm.net

Sent via James running under Merlin as an NT service.
http://avalon.apache.org/sandbox/merlin




--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to