----- Original Message -----
From: Jason van Zyl <[EMAIL PROTECTED]>
To: Turbine Users List <[EMAIL PROTECTED]>
Sent: Saturday, December 08, 2001 11:23 AM
Subject: Re: [Fulcrum] Services hashtable
> On 12/7/01 9:55 PM, "Kelvin Tan" <[EMAIL PROTECTED]> wrote:
>
> > Sorry for the repost, but no response to this, so I thought I'd try
again.
> > Maybe this belongs to Turbine-Dev though...
> >
>
> 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.
Kelvin
> >> In BaseServiceBroker, how are the services supposed to be stored in the
> >> Services hashtable?
> >>
> >> services.put(name, service) or services.put(className, service) ?
> >>
> >> Within getServiceInstance(String name),
> >>
> >> service.setServiceBroker(this);
> >> service.setName(name);
> >> services.put(name, service);
> >>
> >> But there's code elsewhere which attempts to retrieve the service by
> >> classname...
> >>
> >> Kelvin
> >>
> >>
> >> --
> >> 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]>
>
> --
>
> jvz.
>
> Jason van Zyl
>
> http://tambora.zenplex.org
> http://jakarta.apache.org/turbine
> http://jakarta.apache.org/velocity
> http://jakarta.apache.org/alexandria
> http://jakarta.apache.org/commons
>
>
>
> --
> 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]>