Hey
Sanjay Dalal wrote:
> I am wondering why there isn't any accessor on EnterpriseBean or its
> derivatives to access the context associated with the bean. It will make
> caching of beans easy if container providers do not have to do the
> housekeeping for it in addition to that of the bean.
The server is responsible for updating the contents of the context
(since it's dynamic and not static). Surely you do not want to rely on
the bean writer to manage it correctly in order for your code to work
properly. And the bean developer does not want to keep track of it just
to allow the server to access it (the context may be useless to the
bean).
It's not a good idea.
> The spec. says that
> bean provider can also specify the context as one of the container managed
> fields of the bean.
This is not correct. In s. 9.4.1 ("Container managed fields") the
following types are listed as candidates for CM:
"The Bean Provider must ensure that the Java types assigned to the
container-managed fields are
restricted to the following: Java primitive types, Java serializable
types, and references of
enterprise beans� remote or home interfaces."
The context is not primitive, serializable or reference to enterprise
bean or home interface.
> I think the context field inside the EnterpriseBean (or
> its derivatives) should be a default candidate for cm fields too. This field
> should be exposed.
Considering the above this is kinda pointless. In any case there might
not be a context field at all since the bean may not care about it. You
might have confused this with stateful session bean management, but
that's another story altogether and the reasons for managing the context
in the bean there is quite different.
/Rickard
--
Rickard �berg
@home: +46 13 177937
Email: [EMAIL PROTECTED]
Homepage: http://www-und.ida.liu.se/~ricob684
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".