Package vicazh.hyperpool.stream.net.http.html

Source Code of vicazh.hyperpool.stream.net.http.html.SwitchService

package vicazh.hyperpool.stream.net.http.html;

import java.io.*;
import vicazh.hyperpool.stream.*;
import vicazh.hyperpool.stream.Connection;
import vicazh.hyperpool.stream.Service;

/**
* The switch
*
* @author Victor Zhigunov
* @version 0.4.0
*/
public class SwitchService extends Service implements SwitchServiceMBean {
  public SwitchService() {
  }

  private Element element;

  /**
   * @param element
   *            service element
   */
  public SwitchService(Element element) {
    this.element = element;
  }

  public OutputStream get(OutputStream outputstream) throws IOException {
    Connection connection = getConnection();
    connection.setServer(outputstream);
    connection.setClient(element.get(connection.getServer()));
    add(connection);
    return connection.getClient();
  }
}
TOP

Related Classes of vicazh.hyperpool.stream.net.http.html.SwitchService

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.