public void run() {
   sp1.addListener(key, this);
   long stamp = System.nanoTime();
   for (int i = 0; i < COUNT; i++) sp1.out(key, Boolean.TRUE);
   long stamp2 = System.nanoTime();
   t1.add(stamp2 - stamp);
   System.err.println("Perform. " + key + " out: " + (stamp2 - stamp) / 1000000);
 }
示例#2
0
  public void setConfiguration(Configuration cfg) {
    if (this.cfg != null) sp.removeListener(from, this);

    this.cfg = cfg;
    from = cfg.get("from");
    to = cfg.get("to");

    sp.addListener(from, this);
  }
示例#3
0
 public Connector(String from, String to) {
   this();
   this.from = from;
   this.to = to;
   sp.addListener(from, this);
 }