Thanks Daniel. I submitted a patch a couple of days back, but it kinda fixed only what needed fixing (shutdown mechanism), not the code clean-up.
One question. getServiceInstance(String name) attempts to retrieve a service by services.get(name), failing which, it retrieves the classname from mapping and then tries services.get(className)? I don't see how it is possible that services.get(className) will return the services in any scenario, so I actually skipped the checking stage and directly went for Class.forName(className).newInstance(). Am I missing something here? Kelvin ----- Original Message ----- From: Daniel Rall <[EMAIL PROTECTED]> To: Turbine Users List <[EMAIL PROTECTED]> Cc: Kelvin Tan <[EMAIL PROTECTED]> Sent: Wednesday, December 12, 2001 4:56 PM Subject: Re: [Fulcrum] Services hashtable > "Kelvin Tan" <[EMAIL PROTECTED]> writes: > > > From: Jason van Zyl <[EMAIL PROTECTED]> > > > >> When the services were decoupled from fulcrum I started cleaning up the > >> service code but it still needs work. It is somewhat confusing, we know. > >> > >> Bottom line is that you get hold of the service by its name and not > >> the classname. Those methods that refer to getting a service by > >> classname should be made protected because they aren't used outside > >> the service broker. > > > > Sure, and because I'm only using the framework (base classes and > > interfaces), I hope I can help with the cleaning. > > > > I experienced trouble shutting down, even though initialization was fine. > > The problem was that shutdownService(String serviceName) obtains the > > service's classname via the mapping hashtable, then proceeds to call > > shutdownClass(String className). This doesn't work because shutdownClass() > > ... > > Service service = getServiceInstance(className); > > > > attempts to retrieve the service from the services hashtable which actually > > maps according to serviceName:service. > > > > Moving the shutdown code to shutdownService() itself or changing the mapping > > to className:service fixed the problem. > > Hi Kelvin. I refactored BaseServiceBroker to use service name > vs. class names consistantly, and in the process corrected the > shutdown mechanism. > > -- > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
