Package net.kuujo.vertigo.io.port

Examples of net.kuujo.vertigo.io.port.OutputPort


    return ports.values();
  }

  @Override
  public OutputPort port(String name) {
    OutputPort port = ports.get(name);
    if (port == null) {
      log.debug(String.format("%s - Lazily creating out port: %s", this, name));

      // Attempt to search for the port in the existing context. If the
      // port isn't an explicitly configured port then lazily create
      // and open the port. The lazy port will be empty.
      OutputPortContext portContext = context.port(name);
      if (portContext == null) {
        portContext = DefaultOutputPortContext.Builder.newBuilder()
            .setAddress(UUID.randomUUID().toString())
            .setName(name)
            .build();
        DefaultOutputContext.Builder.newBuilder((DefaultOutputContext) context).addPort(portContext);
      }
      port = new DefaultOutputPort(vertx, context.port(name));
      if (started) {
        port.open();
      }
      ports.put(name, port);
    }
    return port;
  }
View Full Code Here


          for (OutputPortContext output : context.ports()) {
            if (ports.containsKey(output.name())) {
              ((DefaultOutputPort) ports.get(output.name())).open(startCounter);
            } else {
              final OutputPort port = new DefaultOutputPort(vertx, output);
              log.debug(String.format("%s - Opening out port: %s", DefaultOutputCollector.this, output));
              port.open(new Handler<AsyncResult<Void>>() {
                @Override
                public void handle(AsyncResult<Void> result) {
                  if (result.failed()) {
                    log.error(String.format("%s - Failed to open out port: %s", DefaultOutputCollector.this, port));
                    startCounter.fail(result.cause());
                  } else {
                    log.info(String.format("%s - Opened out port: %s", DefaultOutputCollector.this, port));
                    ports.put(port.name(), port);
                    startCounter.succeed();
                  }
                }
              });
            }
View Full Code Here

TOP

Related Classes of net.kuujo.vertigo.io.port.OutputPort

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.