01: package vicazh.hyperpool.stream.net.http.html;
02:
03: import java.io.*;
04: import vicazh.hyperpool.stream.*;
05: import vicazh.hyperpool.stream.Connection;
06: import vicazh.hyperpool.stream.Service;
07:
08: /**
09: * The switch
10: *
11: * @author Victor Zhigunov
12: * @version 0.4.0
13: */
14: public class SwitchService extends Service implements
15: SwitchServiceMBean {
16: public SwitchService() {
17: }
18:
19: private Element element;
20:
21: /**
22: * @param element
23: * service element
24: */
25: public SwitchService(Element element) {
26: this .element = element;
27: }
28:
29: public OutputStream get(OutputStream outputstream)
30: throws IOException {
31: Connection connection = getConnection();
32: connection.setServer(outputstream);
33: connection.setClient(element.get(connection.getServer()));
34: add(connection);
35: return connection.getClient();
36: }
37: }
|