The reason is that the connection-pool may to have to be informed when it can close its connections. You can do this yourself or let HiveMind do it for you. Just a few days ago Howard has commited code so that all service- implementations which implement org.hivemind.RegistryShutdownListener are informed when the registry ends. This information happens exactly when you call Registry.shutdown(). A connection-pool implementation (and other services) may relay now on this and therefore you should do it. (Note: the registry can not be used anymore after this).

On Fri, 3 Oct 2003 09:53:29 -0500, Bill Lear <[EMAIL PROTECTED]> wrote:

On Friday, October 3, 2003 at 16:45:42 (+0200) Christian Essl writes:
Sorry I wrote my answer send it and than just saw that Harish was faster (and better). Maybe the only thing you should keep from my anser that you should shutdown the registry (the pool may need it, because HiveMind now supports a shut-down event).

No reason to apologize --- very helpful stuff, except I'm not sure I understand the need to shut down the registry.

I've refactored a bit, now my Global is simpler:

public class Global {
private DAO dao;

public Global() throws DAOException {
Services services = new Services();
DAOFactory factory =
(DAOFactory) services.getService(DAOFactory.class);
dao = factory.createDAO();
}

public DAO getDAO() {
return dao;
}
}

as is my Services class:

public class Services {
private Registry registry;

public Services() {
ClassResolver resolver = new DefaultClassResolver();
RegistryBuilder builder = new RegistryBuilder();

builder.processModules(resolver);

Registry registry = builder.constructRegistry(Locale.getDefault());
}

public Object getService(Class theClass) {
return registry.getService(theClass.getName(), theClass);
}
}

Now I need to see about incorporating the other ideas about
connections, shutting down the registry (again, is this really
needed?)  etc.


Bill


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




-- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/

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



Reply via email to