[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjms-developer
Subject:    [openjms-developer] [ openjms-Bugs-1040960 ] Singleton pattern not implemented properly in ConsumerM
From:       "SourceForge.net" <noreply () sourceforge ! net>
Date:       2005-08-31 5:52:09
Message-ID: E1EALW5-0002wu-Vj () sc8-sf-web1 ! sourceforge ! net
[Download RAW message or body]

Bugs item #1040960, was opened at 2004-10-06 06:15
Message generated for change (Comment added) made by tanderson
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=474136&aid=1040960&group_id=54559

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: v0.7.6.1
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: kungfucode (kungfucode)
>Assigned to: Tim Anderson (tanderson)
Summary: Singleton pattern not implemented properly in ConsumerManage

Initial Comment:
The _instance member is declared static, however,
multiple calls to createInstance will continually
create new ConsumerManager objects and assign their
references to _instance.  With createInstance being
callable from anywhere, it is public after all, this
leaves the door open for potentially difficult to
diagnose concurrency issues down the road.

Recommend checking for null value in createInstance and
only creating a new object if the Singleton reference
_instance has yet to be initialized.  

Also recommend synchronizing the method createInstance
to protect against problems stemming from calls to the
method by multiple threads.

Finally, _instance does not need to be declared static
since the null check as suggested above will take care
of maintaining only a single reference.

----------------------------------------------------------------------

>Comment By: Tim Anderson (tanderson)
Date: 2005-08-31 15:52

Message:
Logged In: YES 
user_id=557161

Fixed in CVS. Changes will be available in 0.7.7-alpha-2

----------------------------------------------------------------------

Comment By: Tim Anderson (tanderson)
Date: 2005-02-17 00:20

Message:
Logged In: YES 
user_id=557161

This is a known issue. For the next major release, the plan is 
to remove all singleton instances.

----------------------------------------------------------------------

Comment By: kungfucode (kungfucode)
Date: 2004-10-06 06:20

Message:
Logged In: YES 
user_id=1133617

Actually I spoke too soon, _instance will in fact need to
remain static so it's accesible from the static method call.
 All other recommendations stand.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=474136&aid=1040960&group_id=54559


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
openjms-developer mailing list
openjms-developer@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openjms-developer
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic