Thanks !!

        Your Answer was really helpful for me !!

  José Gustavo Zagato Rosa
System Analyst - Atos Origin
[EMAIL PROTECTED]


-----Original Message-----
From: Steve Hall [mailto:[EMAIL PROTECTED] 
Sent: sexta-feira, 5 de setembro de 2003 16:54
To: 'Struts Users Mailing List'
Subject: RE: how to start a background process using a struts action ?

José,

        This is really a system design question rather than a Struts
specific question so I've add the [OT] to the subject.  I've seen an
implementation similar to what you're asking about.  I'm not sure if
what I
can contribute will help you with your situation.  
        Something to keep in mind is that you want to encapsulate the
different layers of your system from each other as much as possible.
You
want to use Struts to collect data and pass it to the lower layers of
your
system for processing, then return the results to the user.  You
wouldn't
want a Struts Action class doing business logic or Thread control etc.
[stepping off of the soap box]

Here's what you could do:

Process Definitions:  Create a DB table, xml doc, properties file,
whatever
that contains a definition of all the processes you'll need to running.
If
these are Java classes, this data could contain the fully qualified
class
name.

Process Request Queue:  Create a DB table, JMS queue or some other
persistence mechanism to queue up you process requests.

Front End:  Create your Struts front end to capture the request data and
persist it to your Process Request Queue.  

Daemon: Write a daemon class that polls your Process Request Queue and
runs
the requested process.  You can get as fancy with this as you want, you
could: multi-thread it, use a Strategy Pattern (GOF) to allow it to run
different process types, integrate email as an output distribution
mechanism, etc.  All the daemon really needs to know how to do is poll
your
Request Queue and when it sees a Request, run the appropriate process
based
on the Process Definition.  Obviously, each Request must have an ID back
to
a Process Definition along with any parameters that the process
requires.
You'd run this daemon in a separate JVM, not in Tomcat's.  For
performance
reasons, you may even run it on a different server than the one running
Tomcat.  If you executed your process in your Struts class you wouldn't
have
this option.

I hope this  at least gives you something to think about.

Steve Hall 
Programmer Analyst 
Alterra Healthcare 
(414) 918 5636 
[EMAIL PROTECTED] 



        

-----Original Message-----
From: José Gustavo Zagato [mailto:[EMAIL PROTECTED]
Sent: Friday, September 05, 2003 12:11 PM
To: 'Struts Users Mailing List'
Subject: how to start a background process using a struts action ?


Hi Folks !

        Does anyone here know if is possible to start a background
process ( like a daemon/service) using an action ? I need this feature
because the user will input a few parameters and a schedule date then
the system generate the user specific information.

        Im using struts 1.1 and Toncat 4.1.18, so any tips on how can I
accomplish this task ?

Regards !

  José Gustavo Zagato Rosa
System Analyst - Atos Origin
[EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
This email may contain confidential protected health information.  This
information is intended only for the use of the individual or entity to
which it is addressed.  The authorized recipient of this information is
prohibited from disclosing this information to any other party unless
required to do so by law or regulation and is required to destroy the
information after its stated need has been fulfilled.  If you are not
the
intended recipient, you are hereby notified that any disclosure,
copying,
distribution, or action taken in reliance on the contents of this email
is
STRICTLY PROHIBITED.  If you have received this email in error, please
notify the sender immediately and arrange for the return or destruction
of
the contents of this email.  If you continue to receive emails from this
sender, please contact Alterra's Family Connection Hotline at
877-400-5296.

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





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

Reply via email to