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();
}
}