On 10/12/01 5:21 PM, "Daniel Rall" <[EMAIL PROTECTED]> wrote:

> Jason van Zyl <[EMAIL PROTECTED]> writes:
> 
>> On 10/1/01 8:06 PM, "Daniel Rall" <[EMAIL PROTECTED]> wrote:
>> 
>>> Shouldn't the {init,shutdown}Service(String) methods be sync'd to
>>> avoid problems in a multi-threaded environment?
>> 
>> Should we consider it the job of the application using fulcrum to make sure
>> that these methods only get called once. We should definitely document it.
>> 
>> I haven't given it much thought, I'm just going through all the patches :-)
> 
> I need to be able to startup and shutdown inidividual services at
> will, and would rather have the mechanism for doing so be thread-safe.
> I checked in this patch a while back, but as always am open to
> comments and revision.

Ah, I didn't know you were shutting down individual services. I have no
problem with the patch.
 
>>> Index: BaseServiceBroker.java
>>> ===================================================================
>>> RCS file: 
>>> /home/cvs/jakarta-turbine-fulcrum/src/core/java/org/apache/fulcrum/BaseServi
>>> ce
>>> Broker.java,v
>>> retrieving revision 1.9
>>> diff -u -u -r1.9 BaseServiceBroker.java
>>> --- BaseServiceBroker.java    2001/10/01 23:55:38    1.9
>>> +++ BaseServiceBroker.java    2001/10/02 00:02:54
>>> @@ -441,7 +441,7 @@
>>>     * @exception InitializationException Initilaization of this
>>>     * service was not successful.
>>>     */
>>> -    public void initService(String name)
>>> +    public synchronized void initService(String name)
>>>        throws InitializationException
>>>    {
>>>        String className = (String) mapping.get(name);
>>> @@ -483,7 +483,6 @@
>>>     * after one service fails, the other will not have the chance
>>>     * to initialize.
>>>     *
>>> -     * @param data An Object to use for initialization activities.
>>>     * @param report <code>true</code> if you want exceptions thrown.
>>>     */
>>>    public void initServices(boolean report)
>>> @@ -562,7 +561,7 @@
>>>     *
>>>     * @param name The name of the <code>Service</code> to be uninitialized.
>>>     */
>>> -    public void shutdownService(String name)
>>> +    public synchronized void shutdownService(String name)
>>>    {
>>>        String className = (String) mapping.get(name);
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to