01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: *
15: * See the License for the specific language governing permissions and
16: * limitations under the License.
17: */
18:
19: /**
20: * @author Vasily Zakharov
21: * @version $Revision: 1.1.2.2 $
22: */package org.apache.harmony.rmi.transport.proxy;
23:
24: import java.io.IOException;
25: import java.io.Serializable;
26: import java.net.Socket;
27: import java.rmi.server.RMISocketFactory;
28:
29: /**
30: * Template of a socket factory for proxy connections.
31: *
32: * @author Vasily Zakharov
33: * @version $Revision: 1.1.2.2 $
34: */
35: public abstract class ProxyRMISocketFactory extends RMISocketFactory
36: implements Serializable {
37:
38: /**
39: * serialVersionUID
40: */
41: private static final long serialVersionUID = 4993249257557742620L;
42:
43: /**
44: * {@inheritDoc}
45: *
46: * Equivalent to <code>createSocket(new Proxy(), host, port)</code>
47: */
48: public final Socket createSocket(String host, int port)
49: throws IOException {
50: return createSocket(new Proxy(), host, port);
51: }
52:
53: /**
54: * Creates socket for specified host and port using the specified proxy
55: * configuration.
56: *
57: * @param proxy
58: * Proxy configuration.
59: *
60: * @param host
61: * Host to connect to.
62: *
63: * @param port
64: * Port to connect to.
65: *
66: * @return Created socket.
67: *
68: * @throws IOException
69: * If I/O error occurs.
70: */
71: public abstract Socket createSocket(Proxy proxy, String host,
72: int port) throws IOException;
73: }
|