It's quite possible to implement something very analogous to
ServletBeanContext for the EJB tier, the rub is that there is no
"generic" implementation, since base J2EE doesn't provide the
definition of any EJB interceptor model that mirrors servlet filters.

Basically, what has to happen is:

- for each pooled EJB, you'd have one EJBBeanContext (likely created
when the bean goes into the pool).   You'd want to store this
somewhere easily accessible from the EJB instance (like in a wrapper
class).   Or you could create one on the fly (like ServletBeanContext
does if not using session state to store context info)
- when an EJB is invoked, its EJBBeanContext is found and will start its context
- when the EJB invocation is complete, the EJBBeanContext will end its context

All of the above are pretty trivial to implement for any specific EJB
container implementation.  Its only a trivial amount of code in any
EJB wrapper impl.   It just aren't possible to implement generically
across all of them given the lack of generalized EJB interception
model.

It's quite possible that there could be some generic code that is
sharable that would easily 'plug' into specific EJB container
impls.... it just would require be called at the right times by the
container.

-- Kyle

On Thu, 16 Dec 2004 01:57:31 +0530, Mridul Muralidharan
<[EMAIL PROTECTED]> wrote:
> Hi,
> 
> I was looking through the beehive code to understand how the beehive
> control runtime works.
> I have observed that for Beehive controls hosted in the web tier, the
> current implementation relies on a servlet filter to manage the
> construction and persistence of the control container context (i.e.
> ControlFilter, ServletBeanContext, ControlThreadContext and other
> classes collaborate to manage the context lifecycle).
> This is fairly clear.
> However, I have not found any mention of the approach that will be taken
> for Controls which might be hosted in the enterprise tier.
> For instance controls hosted by an EJB.
> Has this been discussed and/or is there a plan for the Beehive to
> provide an implementation of a control container runtime that will work
> in the enterprise tier?
> 
> Thanks and Regards
> Mridul
>

Reply via email to