Hi Tony,
There does not appear to be a way of shutting down a running registry.
As far as checking if one is already running: you could try binding to the registry (which will throw an exception if it is not already running). So this does not really gain you much. It depends on which situation is more likely - for the
SCJD assignment, having no registry running is the more likely scenario, so just trying to start the registry and catching the exception in the unlikely case that it is already running may make the most sense.
I wouldn't just ignore the exception though. At the bare minimum, I would log it and/or display a message to the user stating that the registry could not be started. But you have to then decide what to do next - is this a fatal error, or do you try to bind to the already running registry (probably setting the codebase before you do so).
Personally I chose the latter - that gave my server a bit more flexibility - it could run with the registry that it started, or it could run with a registry that someone else started.
Regards, Andrew