Hmmm.... I think it is certainly possible, however, the whole point of
J2EE is that you don't need to do this nitty-gritty details. Instead you
should be able to use the admin utility or xml config files to set
up how many session beans you want in your pool. Pool is created
automatically, and to get an instance over the distributed network, you simply
have to get a Home stub from context and ask it to create a remote instance
of the bean you want. The Home object will figure out if you already have
some free objects in the pool, or whether to create more, etc. You don't
need to worry, the J2EE framework should take care of it:
CreateXHome createXHome =
(CreateXHome) context.lookup("Your
App.CreateXHome");
CreateX createX = createXHome.create(); //get from a pool, or make a new one
createX.createX(someData); //call a remote method on a session bean
CreateX createX = createXHome.create(); //get from a pool, or make a new one
createX.createX(someData); //call a remote method on a session bean
Greg
--------Original Message-----
From: Sebastien RODRIGUES [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 14, 2003 7:17 AM
To: jdjlist
Subject: [jdjlist] J2EE session beanHi,
It is possible to connect a client to a session bean SessionBeanFactory containing a pool of the overs session.
and giving this method:
private Hashmap map;
SessionBean getSession(String nameToLookup)
{
if(map.contains(nameToLookup)) return map.get(nameToLookup);
//crete new connection to the bean session using a service locator
map.put(nameToLookup,mynewsession)
return mynewsession;
}
Regards.
--- You are currently subscribed to jdjlist as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED] http://www.sys-con.com/fusetalk To unsubscribe from all mailing lists, click: http://sys-con.com/[EMAIL PROTECTED]
You are currently subscribed to jdjlist as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
http://www.sys-con.com/fusetalk To unsubscribe from all mailing lists, click:
http://sys-con.com/[EMAIL PROTECTED]
