Package com.twosigma.beaker.shared

Examples of com.twosigma.beaker.shared.NamespaceBinding


    String args = "name=" + URLEncoder.encode(name, "ISO-8859-1") +
      "&session=" + URLEncoder.encode(this.session, "ISO-8859-1");
    String valueString = Request.Get(urlBase + "/get?" + args)
      .addHeader("Authorization", auth)
      .execute().returnContent().asString();
    NamespaceBinding binding = mapper.readValue(valueString, NamespaceBinding.class);
    if (!binding.getDefined()) {
      throw new RuntimeException("name not defined: " + name);
    }
    return binding.getValue();
  }
View Full Code Here


    if (null == channel) {
      System.err.println("channel not found for session " + session);
      return null;
    }
    channel.publish(this.localSession, data, null);
    NamespaceBinding binding = getHandoff(session).take(); // blocks
    if (!binding.getName().equals(name)) {
      throw new RuntimeException("Namespace get, name mismatch.  Received " +
                                 binding.getName() + ", expected " + name);
    }
    return binding;
  }
View Full Code Here

      System.err.println("channel not found for session " + session);
      return;
    }
    channel.publish(this.localSession, data, null);
    if (sync) {
      NamespaceBinding binding = getHandoff(session).take(); // blocks
      if (!binding.getName().equals(name)) {
        throw new RuntimeException("Namespace set, name mismatch.  Received " +
                                   binding.getName() + ", expected " + name);
      }
    }
  }
View Full Code Here

  @Listener("/service/namespace/receive")
  public void receive(ServerSession session, ServerMessage msg)
    throws IOException, InterruptedException
  {
    NamespaceBinding binding = this.mapper.readValue(String.valueOf(msg.getData()), NamespaceBinding.class);
    getHandoff(binding.getSession()).put(binding);
  }
View Full Code Here

TOP

Related Classes of com.twosigma.beaker.shared.NamespaceBinding

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.