inital plugin from webtools project
[phpeclipse.git] / archive / net.sourceforge.phpeclipse.monitor.core / src / net / sourceforge / phpdt / monitor / core / internal / http / HTTPProtocolAdapter.java
1 /**********************************************************************
2  * Copyright (c) 2003 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Common Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/cpl-v10.html
7   *
8  * Contributors:
9  *    IBM - Initial API and implementation
10  **********************************************************************/
11 package net.sourceforge.phpdt.monitor.core.internal.http;
12
13 import java.io.IOException;
14 import java.net.Socket;
15
16 import net.sourceforge.phpdt.monitor.core.IMonitor;
17 import net.sourceforge.phpdt.monitor.core.IProtocolAdapterDelegate;
18 import net.sourceforge.phpdt.monitor.core.internal.Connection;
19
20 /**
21  * 
22  */
23 public class HTTPProtocolAdapter implements IProtocolAdapterDelegate {
24         public void parse(IMonitor monitor, Socket in, Socket out) throws IOException {
25                 Connection conn2 = new Connection(in, out);
26                 HTTPConnection conn = new HTTPConnection(monitor);
27                 HTTPThread request = new HTTPThread(conn2, in.getInputStream(), out.getOutputStream(), conn, true, monitor.getRemoteHost(), monitor.getRemotePort());
28                 HTTPThread response = new HTTPThread(conn2, out.getInputStream(), in.getOutputStream(), conn, false, "localhost", monitor.getLocalPort(), request);
29                 request.start();
30                 response.start();
31         }
32 }