Ulrich Mayring wrote:
Berin Loritsch wrote:

Hello Berin,

this is a different definition than the one from Robert. He said the component doesn't maintain caller state. You seem to say now that the component also doesn't maintain its own, internal state. To me that looks like a big difference.
It comes from the difference between stateless and stateful EJB Session
beans.  The stateful session beans use a Session object to store the
state internally.


I tend to agree with your stricter definition, which also IMHO automatically makes it thread-safe.
Yep.

 > A component cannot be accessed until it is completely instantiated.
 > As soon as you have the component in your hot little hands, it has
 > already been initialized and put through the lifecycle.

What about dynamic undeploy/deploy?
It is invisible to the client.  When the container undeploys a component
to either upgrade it or provide a different implementation, it will
perform the rewiring (assembly) immediately for the new component so
that all new requests use the newly deployed component.  The container
will wait until all clients release their component before it disposes
of the undeployed component.

Hense, from the client view, they can never have a handle to a component
in an inconsistent state.


> However, if the component does not need to store information, and
> does not force the client to call methods in a specific order, then
> all is well.

During initialize() the component stores information and it does matter in which order you call the lifecycle methods :)
Yes but all that is done within the same thread (if the component has to
be initialized).  By the time the *client* receives the component, it is
already fully initialized.  THere is no opportunity for more than one
thread to call lifecycle methods on the same component at the same time.
The container can easily manage concurrency for that purpose.



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to