[pool] Spring configuration of org.apache.commons.pool.impl.GenericObjectPool.Config

2011-08-04 Thread Norval Hope
Hi All,

I've written a wrapper bean (i.e. getters and setters) around
GenericObjectPool.Config to allow it to be configured using Spring XML. Is
this something that might find it's way in the Pool source itself, or is
there another way of achieving the same thing that I've missed?

Thanks,
Norval


RE: [pool] Spring configuration of org.apache.commons.pool.impl.GenericObjectPool.Config

2011-08-04 Thread Gary Gregory
Good question. I'm not sure where something like that could live.

Should we have a companions project/directory like there is for Log4J?

Gary

-Original Message-
From: Norval Hope [mailto:nrh...@gmail.com] 
Sent: Thursday, August 04, 2011 1:02 AM
To: user@commons.apache.org
Subject: [pool] Spring configuration of 
org.apache.commons.pool.impl.GenericObjectPool.Config

Hi All,

I've written a wrapper bean (i.e. getters and setters) around 
GenericObjectPool.Config to allow it to be configured using Spring XML. Is this 
something that might find it's way in the Pool source itself, or is there 
another way of achieving the same thing that I've missed?

Thanks,
Norval

-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: [exec] Draining process output/error

2011-08-04 Thread Siegfried Goeschl

Hi Diane,

I think the best is to have a look at the JUnit test of commons-exec - 
there are a few examples how to consume stdout/stderr either pumping 
into stdout/stderr or collecting into a byte[]


Regarding your requirements

+) is it possible that your code can get stuck - if yes checkout Watchdog
+) please note that there are issues killing grand-children processes of 
your child process (think recursive killing)


Cheers,

Siegfried Goeschl

On 03.08.11 22:25, Diane Baumgartner wrote:

Hi all,
  
I'm trying to run a shell script from a Java program.  I finally got a trivial example working wtih ProcessBuilder, and learned that I had to be sure to capture the child process's output so that my program would work correctly.  I have also seen the warning in the Sun documentation which states, It is possible that the examples will deadlock if the subprocess generates enough output to overflow the system.  A more robust solution requires draining the process stdout and stder in separate threads.  That got me looking for information on draining these streams, and also led me to find Apache commons exec. 
  
My ultimate goal is to have the following.

a. Java program calls shell script when user pushes a button.
b. Shell script executes a sql script.  This script produces several output 
files, some of which can be large.
c. Shell script then calls a java program which uses Apache Commons Net to FTP 
the files to an FTP server.
  
I have already successfully tested parts b and c, so now I'm trying to add part a (Java calls shell script).  My problem is that I'm having a hard time finding examples of how to drain the stdout/stderr for large amounts of data.  I have looked at the documentation, but don't have much experience with dealing with either streams or threads.  Can you please point me in the right direction?
  
Thanks.


-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org