Hi,

I have extended RunShellImpl to add some features. In particular, I overrode 
didProcessFail method, which now scans process standard output and matches it 
to a user-supplied pattern. I use the parent class's setOutputStreamObj method 
to supply my OutputStreamIntf implementation, based on ByteArrayOutputStream, 
to capture the process standard output.  (By the way, why isn't there a similar 
way to capture standard error?)

One problem that I ran into is that sometimes when didProcessFail is called, 
the output stream gobbler has not finished writing to my output stream, and so 
when I inspect the stream contents, I don't get the full output. The reason, I 
think, is that the execute() method of the parent class launches the two stream 
gobblers and  sets them adrift, never joining to the parent thread, so that 
there is no control over their execution. I think it would be better if the 
stream gobblers were explicitly joined in the run() method, after the process 
returns.

Unfortunately, since nearly all methods of RunShellImpl are declared as 
private, there is only so much I can do in my derived class. Do you have any 
suggestions for me? For now, I just added a short wait before inspecting the 
output stream, to give time to the stream gobbler to finish.

Thanks,
Dmitry
------------------------------------------------------------------------------
What happens now with your Lotus Notes apps - do you make another costly 
upgrade, or settle for being marooned without product support? Time to move
off Lotus Notes and onto the cloud with Force.com, apps are easier to build,
use, and manage than apps on traditional platforms. Sign up for the Lotus 
Notes Migration Kit to learn more. http://p.sf.net/sfu/salesforce-d2d
_______________________________________________
Smartfrog-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/smartfrog-users

Reply via email to