Exemple #1
0
 /** Pass a string to kdb for evaluation. */
 public void evaluate(SimpleEvaluationObject obj, String code) {
   try {
     kdbProcess.getErrorHandler().reset(obj);
     kdbProcess.getOutputHandler().reset(obj);
     Object result = kdbClient.execute(code);
     obj.finished(convert(result));
   } catch (Exception e) {
     obj.error(e);
   }
   kdbProcess.getErrorHandler().reset(null);
   kdbProcess.getOutputHandler().reset(null);
 }
Exemple #2
0
 /** So long, farewell. */
 public void exit() {
   try {
     kdbClient.close();
   } catch (IOException e) {
     //
   }
   kdbProcess.interrupt();
   try {
     kdbProcess.join(5000);
   } catch (InterruptedException e) {
     //
   }
 }
Exemple #3
0
  public KdbShell(
      String shellId, String sessionId, int corePort, BeakerObjectConverter objConv, String qh)
      throws Exception {
    this.shellId = shellId;
    this.sessionId = sessionId;
    this.corePort = corePort;
    this.objConv = objConv;

    kdbPort = getPortFromCore();
    kdbProcess = new KdbProcess(sessionId, kdbPort, qh);
    kdbProcess.start();

    kdbClient = new KdbClient("localhost", kdbPort);
  }