my question is : the standard method 'create' belongs to which interface or class?i know that the container implements it by : Class.newInstance("myBean.class").
when is the actual create() method that instantiates ejbObject called?at the time the application server boots up?if so,then whenever the client calls a create() (parameterized/empty) on home interface, there actually may not be any actual instantiation occuring, in fact just the ejbCreate method is being called on an existing free-to-use instance of ejbObject in the instance pool.am i right?
the client executes the following statement: remote=home.create()
if this is a stateful session bean,the container will look for an instance in the pool,if it finds one,it does not call create(),instead it sets its session context,then it calls bean's ejbCreate() for initialization. am i right?should a stateless session bean have ejbCreate()?what is the actual flow of execution?
1) "create" is only invoked by the client -- never the container.
after create is invoked at the client, where does the control go,where is the executable code...the code that runs before ejbCreate?
Joined: May 29, 2003
As I said, it depends on the bean type.
Joined: Nov 22, 2008
it depends on the bean type. yeah. but also on the vendor, how the creation actually takes place.
i-Ok, Using JNDI get the reference of an EJBHome Object. (it might even be instantiated while you call the lookup. or already have been instantiated by the appln server at startup) Now the Home stub object is also available at the client. ii-the container creates a Bean object or gets an already created bean instance object from a pool-like container.. sets a SessionContext or EntityContext etc. iii-the home at the server also coordinates the EJBRemote I such that an EJBRemote object is instantiated and it is passed a reference to the actual bean object in part ii. iv-the stub of the remote component object is sent to the client. that is all..