1 package fr.in2p3.jsaga.impl.job.instance.stream;
2
3 import fr.in2p3.jsaga.adaptor.job.control.interactive.JobIOSetter;
4 import org.ogf.saga.error.NoSuccessException;
5
6 import java.io.IOException;
7
8 /* ***************************************************
9 * *** Centre de Calcul de l'IN2P3 - Lyon (France) ***
10 * *** http://cc.in2p3.fr/ ***
11 * ***************************************************
12 * File: PipedStderr
13 * Author: Sylvain Reynaud (sreynaud@in2p3.fr)
14 * Date: 28 avr. 2008
15 * ***************************************************
16 * Description: */
17 /**
18 *
19 */
20 public class PipedStderr extends PipedStdout {
21 public PipedStderr(JobIOSetter ioHandler) throws NoSuccessException {
22 super(ioHandler);
23 }
24
25 public void run() {
26 try {
27 m_ioHandler.setStderr(m_out);
28 } catch (Exception e) {
29 m_exception = new IOException(e.getClass()+": "+e.getMessage());
30 } finally {
31 try {
32 // pipe must be closed to unlock read attempt
33 m_out.close();
34 } catch (IOException e) {
35 m_exception = e;
36 }
37 m_closed = true;
38 }
39 }
40 }