I would like to do the following:
Write a file to disk. Then run a shell command. The shell command reads/manipulates this file sends a request over the network writes the response to another file and returns and exit value.
In order to run the shell command i have read about ProcessBuilder and Runtime.exec().
How exactly would one implement the above functionality. The webapp (struts) responsible will be hosted in Jbossas 7.1.
Do i need some like JCA since i.o and EJBs are not recommended (although only one server will be used in my case). Can i simply use a POJO (Struts action) i am not sure how to deal with multiple threads, although Struts actions are "thread safe".
Thanks in advaadvance,
If i were to use a pool of threads in order to handle multiple requests in parallel would this be a reason to use a JCA.
I would like to do the following:
Write a file to disk. Then run a shell command. The shell command reads/manipulates this file sends a request over the network writes the response to another file and returns and exit value.
In order to run the shell command i have read about ProcessBuilder and Runtime.exec().
How exactly would one implement the above functionality. The webapp (struts) responsible will be hosted in Jbossas 7.1.
Do i need some like JCA since i.o and EJBs are not recommended (although only one server will be used in my case). Can i simply use a POJO (Struts action) i am not sure how to deal with multiple threads, although Struts actions are "thread safe".
Thanks in adva
I would like to do the following:
Write a file to disk. Then run a shell command. The shell command reads/manipulates this file sends a request over the network writes the response to another file and returns and exit value.
In order to run the shell command i have read about ProcessBuilder and Runtime.exec().
How exactly would one implement the above functionality. The webapp (struts) responsible will be hosted in Jbossas 7.1.
Do i need some like JCA since i.o and EJBs are not recommended (although only one server will be used in my case). Can i simply use a POJO (Struts action) i am not sure how to deal with multiple threads, although Struts actions are "thread safe".
Thanks in advance,
If i were to use a pool of threads in order to handle multiple requests in parallel would this be a reason to use a JCA.
Implementation design regarding ProcessBuilder
I would like to do the following:
Write a file to disk. Then run a shell command. The shell command reads/manipulates this file sends a request over the network writes the response to another file and returns and exit value.
In order to run the shell command i have read about ProcessBuilder and Runtime.exec().
How exactly would one implement the above functionality. The webapp (struts) responsible will be hosted in Jbossas 7.1.
Do i need some like JCA since i.o and EJBs are not recommended (although only one server will be used in my case). Can i simply use a POJO (Struts action) i am not sure how to deal with multiple threads, although Struts actions are "thread safe".
Thanks in adva