All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.nitorcreations.willow.deployer.launch.StreamLinePumper Maven / Gradle / Ivy

There is a newer version: 2.0.2
Show newest version
package com.nitorcreations.willow.deployer.launch;

import java.io.InputStream;
import java.nio.charset.Charset;

import com.nitorcreations.willow.messages.LogMessage;
import com.nitorcreations.willow.messages.WebSocketTransmitter;
import com.nitorcreations.willow.utils.AbstractStreamPumper;

class StreamLinePumper extends AbstractStreamPumper {
  private final WebSocketTransmitter transmitter;

  public StreamLinePumper(InputStream in, WebSocketTransmitter transmitter, String name, Charset charset) {
    super(in, name, charset);
    this.transmitter = transmitter;
  }

  @Override
  public void handle(String line) {
    LogMessage msg = new LogMessage(System.currentTimeMillis(), getName(), line);
    transmitter.queue(msg);
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy