Package erjang.driver

Examples of erjang.driver.EDriverTask


      throw ERT.badarg(node_arg, cid_arg, type_arg);
    }

    EPeer n = EPeer.get_or_create(node, creation, port, flags.value, version.value);
   
    EDriverTask task = port.task();
    if (task != null) {
      task.node(n);

      /*TODO:
    send_nodes_mon_msgs(BIF_P,
                        am_nodeup,
                        BIF_ARG_1,
View Full Code Here


    copy.caller = caller;
    copy.opt = new RingQueue<AsyncOp>(2);
    copy.empty_out_q_subs = new ArrayList<EHandle>();
    copy.active = ActiveType.PASSIVE;

    final EDriverTask this_task = port().task();
    EDriverTask driver = new EDriverTask(caller, copy) {
      public EObject getName() {
        return this_task.getName();
      }
    };

    // two-way link to new owner
    EInternalPID caller_pid = caller.testInternalPID();
    if (caller_pid != null) {
      caller_pid.task().link_oneway(driver.self_handle());
      driver.link_oneway(caller_pid);
    }
    ERT.run(driver);

    return copy;
  }
View Full Code Here

  }

  @Override
  public void send_monitor_exit(EHandle from, ERef ref, EObject reason)
      throws Pausable {
    EDriverTask task = this.task;
    if (task != null) {
      task.send_monitor_exit(from, ref, reason);
    }
   
  }
View Full Code Here

    return task.port_info(spec);
  }

  @Override
  public EObject get_data() {
    EDriverTask dt = task;
    if (dt == null)
      return ERT.am_undefined;
    return dt.port_data;
  }
View Full Code Here

    return dt.port_data;
  }

  @Override
  public void set_data(EObject data) {
    EDriverTask dt = task;
    if (dt != null)
      dt.port_data = data;   
  }
View Full Code Here

    if (dt != null)
      dt.port_data = data;   
  }

  public void set_owner(EInternalPID ipid) {
    EDriverTask dt = task;
    if (dt != null)
      dt.owner(ipid);   
  }
View Full Code Here

      dt.owner(ipid);   
  }

  @Override
  public void close() throws Pausable {
    EDriverTask dt = task;
    if (dt != null)
      dt.close();   
  }
View Full Code Here

  private void setPort(EInternalPort port) throws Pausable {
    assert(port != null);
    assert(this.port == null);
    assert(this.port_queue != null);
    //System.err.println("EPeer: Patching port for "+node+" to "+port);
    EDriverTask task = port.task();
    assert(task != null);
    /* Note: The following could be simpler if
     * EDriverTask.outputv() wasn't Pausable - which it
     * shouldn't be, but is as long as we're using
     * bounded-size Mailboxes. -- eriksoe */

    try {
      // Empty port_queue, then set port:
      while (true) {
        ByteBuffer[] msg;
        synchronized (this) {
          if (port_queue.isEmpty()) { // Go from queueing mode to direct-port mode:
            this.port = port;
            this.port_queue = null;
            break;
          }
          msg = port_queue.removeFirst();
          assert(msg != null);
        }
        task.outputv(null, msg); // Pausable so called outside lock
      }
    } catch (IOException e) {
      e.printStackTrace();
      close_and_finish(port);
    }
View Full Code Here

        return;
      }
    }
    assert (port != null)// In direct-to-port mode

    EDriverTask task = port.task();
    if (task != null) {
      try {
        task.outputv(null, ev);
      } catch (IOException e) {
        e.printStackTrace();
        close_and_finish(port);
      }
    } else {
View Full Code Here

TOP

Related Classes of erjang.driver.EDriverTask

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.