Package org.graphstream.stream.thread

Examples of org.graphstream.stream.thread.ThreadProxyPipe.addSink()


    "workspace0");
  receiver.setDebug(true);
  // - received events end up in the "default" pipe
  ThreadProxyPipe pipe = receiver.getStream();
  // - plug the pipe to the sink of the graph
  pipe.addSink(g);
  // ----- The sender side (in another thread) ------
  //
  new Thread() {
      public void run() {
    // - the original graph from which events are generated
View Full Code Here


  ThreadProxyPipe pipe = receiver.getStream();

  Graph g = new MultiGraph("workspace0", false, true);

  pipe.addSink(g);

  g.addSink(new SinkAdapter() {

      public void graphAttributeAdded(String sourceId, long timeId,
        String attribute, Object value) {
View Full Code Here

  // receiver.setDebug(true);

  ThreadProxyPipe pipe = receiver.getStream();

  pipe.addSink(g);

  launchClient("localhost", 8080, "workspace0", "0");
  launchClient("localhost", 8080, "workspace0", "1");

  for (int i = 0; i < 10; i++) {
View Full Code Here

  JSONReceiver receiver = new JSONReceiver("localhost", 8080,
    "workspace0");

  ThreadProxyPipe pipe = receiver.getStream();

  pipe.addSink(g);

  g.addSink(new SinkAdapter() {
      /*
       * public void graphAttributeAdded(String sourceId, long timeId,
       * String attribute, Object value) { assertEquals(0, value);
View Full Code Here

  JSONReceiver receiver = new JSONReceiver("localhost", 8080,
    "workspace0");
  receiver.setDebug(true);
  ThreadProxyPipe pipe = receiver.getStream();
  // plug the pipe to the sink of the graph
  pipe.addSink(g);
  // The receiver pro-actively checks for events on the ThreadProxyPipe
  while (true) {
      pipe.pump();
  }
    }
View Full Code Here

      System.err.println(e1.toString());
    }

    ThreadProxyPipe pipe = net.getDefaultStream();

    pipe.addSink(new SinkAdapter() {
      public void graphAttributeAdded(String sourceId, long timeId,
          String attribute, Object value) {
        validate(attribute, value);
      }
      public void graphAttributeChanged(String sourceId, long timeId,
View Full Code Here

    net.setUnpacker(new  Base64Unpacker());
   
    // - received events end up in the "default" pipe
    ThreadProxyPipe pipe = net.getStream("default");
    // - plug the pipe to the sink of the graph
    pipe.addSink(g);
    // -The receiver pro-actively checks for events on the ThreadProxyPipe
    while (true) {
      pipe.pump();
      Thread.sleep(100);
    }
View Full Code Here

    }

    try {
      ThreadProxyPipe pipe = net.getDefaultStream();

      pipe.addSink(new SinkAdapter() {

        public void graphAttributeAdded(String sourceId, long timeId,
            String attribute, Object value) {
        }
      });
View Full Code Here

    net.setUnpacker(new Base64Unpacker());

    ThreadProxyPipe pipe = net.getDefaultStream();

    pipe.addSink(new SinkAdapter() {

      public void graphAttributeAdded(String sourceId, long timeId,
          String attribute, Object value) {
        validate(attribute, value);
      }
View Full Code Here

    ThreadProxyPipe pipe1 = net.getStream("G1");
    ThreadProxyPipe pipe2 = net.getStream("G2");

    pipe1.addSink(g1);
    pipe2.addSink(g2);

    Thread t1 = launchClient(2002, "G1", "0");
    Thread t2 = launchClient(2002, "G1", "1");
    Thread t3 = launchClient(2002, "G2", "0");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.