You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Heligon Sandra <Sa...@nextream.fr> on 2002/06/25 15:18:35 UTC
Event notification management in Struts
Hi,
I must specify the session management for my project and I am
a lot of questions and more precisely about the beans updates.
Imagine that the web application stores data in the user session,
in JavaBean form (not EJB).
If an external event (CORBA event or notification service) informs
the
web server that data changed, how does it work ?
Do I have to create an Action (or other component) dedicated to
receive
CORBA event and notification ? I am not sure that an Action can work
as a Consumer in an event service model.
Is this process able to modify data stored in sessions ?
In this case how are shared access managed ?
I read that expresso offers capabilities for event notification, but
I didn't
know how it works. Becoming familiar with this other framework
requires
a long time.
Has somebody a solution to event notification management in Struts ?
In a second time I don't know how the web server informs the client
browser
that data changed. But a simple solution consists in doing pooling
on the
client side, isn't it ?
Thanks a lot for helps.
Sandra
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Event notification management in Struts
Posted by "Craig R. McClanahan" <cr...@apache.org>.
On Tue, 25 Jun 2002, Heligon Sandra wrote:
> Date: Tue, 25 Jun 2002 15:18:35 +0200
> From: Heligon Sandra <Sa...@nextream.fr>
> Reply-To: Struts Users Mailing List <st...@jakarta.apache.org>
> To: "'struts-user@jakarta.apache.org'" <st...@jakarta.apache.org>
> Subject: Event notification management in Struts
>
>
> Hi,
>
> I must specify the session management for my project and I am
> a lot of questions and more precisely about the beans updates.
> Imagine that the web application stores data in the user session,
> in JavaBean form (not EJB).
> If an external event (CORBA event or notification service) informs
> the
> web server that data changed, how does it work ?
> Do I have to create an Action (or other component) dedicated to
> receive
> CORBA event and notification ? I am not sure that an Action can work
> as a Consumer in an event service model.
> Is this process able to modify data stored in sessions ?
> In this case how are shared access managed ?
>
> I read that expresso offers capabilities for event notification, but
> I didn't
> know how it works. Becoming familiar with this other framework
> requires
> a long time.
> Has somebody a solution to event notification management in Struts ?
>
> In a second time I don't know how the web server informs the client
> browser
> that data changed. But a simple solution consists in doing pooling
> on the
> client side, isn't it ?
>
> Thanks a lot for helps.
> Sandra
>
It's not really appropriate to use an Action as the receiver of an
external event (unless you convert your CORBA events to be sent by HTTP
:-). You might think about a strategy something like this:
* Create a class of some sort that represents the data. From the
Struts perspective, it will have just property getters that you
can use on the pages to display things (or in Actions that need
to base calculations on the current values). Note that this class
should not itself have any dependencies on Struts -- all it needs
is the APIs necessary to register it as a CORBA event listener.
* Arrange to store instances of this class in either application scope
(if they are shared across users) or session scope (if they are
particular to a single user).
* As the instances are added as application-scope or session-scope
attributes, register them as receivers of the CORBA events. When
those events happen, the event handler can update the data inside
the data state object, totally independent of Struts or anything in
the web layer. (You'll have to ensure that you code the data state
class in a threadsafe manner.
* WHen the object is removed from application scope or session scope,
be sure to deregister the CORBA event listening stuff, because the
receiving object is not there any more.
* Whenever a Struts request comes in to display something, the data
state object always has the most current information.
Craig
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>