Let's say I have a singleton as below:
| public class Singleton
| {
| private TradeProcessor myProcessor = null; // SSB
| private static Singleton INSTANCE = new Singleton();
|
| private Singleton()
| {
| //lookup something and then create as below
| myProcessor = home.create();
| }
|
| // singleton accessor method
|
| private void foo1()
| {
| myProcessor.bookTrace("1234","100","IBM","25"); //ID,#,SYM,RATE
| }
|
| private void foo2()
| {
| myProcessor.amendTrade("1234","50","IBM","25");
| }
| }
|
and let's say I have two client methods calling these methods (in different
threads) as:
| Singleton.getInstance().foo1();
|
| Singleton.getInstance().foo2();
|
In this case, Singleton object has only one instance of TradeProcessor (which
is only associated with only one Proxy in JBoss client container). Where is the
guarantee here that, the same SSB instance is not used by multiple clients?
Will the Proxy take care of directing the call to a different SSB instance for
every client used by it?
Thanks,
Kalyan.
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3867110#3867110
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3867110
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user