/[svn]/jsampler/trunk/src/org/jsampler/task/Global.java
ViewVC logotype

Diff of /jsampler/trunk/src/org/jsampler/task/Global.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1688 by iliev, Thu Feb 14 16:52:36 2008 UTC revision 1776 by iliev, Thu Sep 11 18:48:36 2008 UTC
# Line 139  public class Global { Line 139  public class Global {
139                          }                          }
140                  }                  }
141          }          }
142    
143            
144            /**
145             * This task sets the LSCP client's read timeout.
146             */
147            public static class SetClientReadTimeout extends EnhancedTask {
148                    private int timeout;
149            
150                    /**
151                     * Creates new instance of <code>SetClientReadTimeout</code>.
152                     * @param timeout The new timeout value (in seconds).
153                     */
154                    public
155                    SetClientReadTimeout(int timeout) {
156                            setTitle("Global.SetClientReadTimeout_task");
157                            setDescription(i18n.getMessage("Global.SetClientReadTimeout.desc"));
158                            this.timeout = timeout;
159                    }
160            
161                    /** The entry point of the task. */
162                    public void
163                    run() {
164                            try {
165                                    CC.getClient().setSoTimeout(timeout * 1000);
166                            } catch(Exception x) {
167                                    setErrorMessage(getDescription() + ": " + HF.getErrorMessage(x));
168                                    CC.getLogger().log(Level.FINE, getErrorMessage(), x);
169                            }
170                    }
171            }
172                    
173          /**          /**
174           * This task gets the list of instruments in the specified instrument file.           * This task gets the list of instruments in the specified instrument file.
# Line 160  public class Global { Line 190  public class Global {
190                          try { setResult(CC.getClient().getFileInstruments(filename)); }                          try { setResult(CC.getClient().getFileInstruments(filename)); }
191                          catch(Exception x) {                          catch(Exception x) {
192                                  String s = getDescription() + ": " + HF.getErrorMessage(x);                                  String s = getDescription() + ": " + HF.getErrorMessage(x);
193                                  CC.getLogger().log(Level.FINER, s, x);                                  CC.getLogger().log(Level.FINE, s, x);
194                            }
195                    }
196            }
197            
198            /**
199             * This task gets information about the specified instrument.
200             */
201            public static class GetFileInstrument extends EnhancedTask<Instrument> {
202                    private final String filename;
203                    private final int instrIdx;
204                    
205                    /** Creates a new instance of <code>GetFileInstrument</code>. */
206                    public
207                    GetFileInstrument(String filename, int instrIdx) {
208                            this.filename = filename;
209                            this.instrIdx = instrIdx;
210                            setTitle("Global.GetFileInstrument_task");
211                            setDescription(i18n.getMessage("Global.GetFileInstrument.desc"));
212                    }
213            
214                    /** The entry point of the task. */
215                    public void
216                    run() {
217                            try { setResult(CC.getClient().getFileInstrumentInfo(filename, instrIdx)); }
218                            catch(Exception x) {
219                                    String s = getDescription() + ": " + HF.getErrorMessage(x);
220                                    CC.getLogger().log(Level.FINE, s, x);
221                          }                          }
222                  }                  }
223          }          }

Legend:
Removed from v.1688  
changed lines
  Added in v.1776

  ViewVC Help
Powered by ViewVC