• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HttpSessionBindingListener to speed up the execution

 
ramnna jain
Ranch Hand
Posts: 129
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my web application there is an action which takes time to complete because it does several things like
resizes an image in two different sizes and saves record also sends mail.

To reduce time I am trying to do it in a different way!

I am creating a class which is implementing HttpSessionBindingListener so that when the action gets executed
the action will create an object from it. The object will have required instance variables. When I add the object to
the users session, the valueBaund() will be called. The method is programmed to does other tasks.

I want to know if this approach is correct to implement?

I am using tomcat 5.5 and struts 1.3.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How would that speed up execution? (This question is mostly so I know what your thought process is about why you went this route.)

How best to implement it also depends on your actual requirements (and infrastructure)--there are a number of ways to go about it, from starting up threads to full-blown message queues to avoid managing the threads ourselves (which technically we're not supposed to do, or at least that used to be the case).
 
ramnna jain
Ranch Hand
Posts: 129
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually I mean the end user get quick response(action quickly returns back) & things happening in the background... may be I am still wrong.. please correct me.

As far as resources, infrastructure and efficient ways to do things... I really like the idea of using thread for resizing images
and using Message Ques to send mails. I must really think this way...

Thanks for your guidance.


 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic