1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
5
<!-- Generated by javadoc (build 1.5.0_11) on Sat Aug 18 11:01:02 CEST 2007 -->
6
<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
8
ReflectionSocketFactory (HttpClient 3.1 API)
11
<META NAME="keywords" CONTENT="org.apache.commons.httpclient.protocol.ReflectionSocketFactory class">
13
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">
15
<SCRIPT type="text/javascript">
16
function windowTitle()
18
parent.document.title="ReflectionSocketFactory (HttpClient 3.1 API)";
26
<BODY BGCOLOR="white" onload="windowTitle();">
29
<!-- ========= START OF TOP NAVBAR ======= -->
30
<A NAME="navbar_top"><!-- --></A>
31
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
32
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
34
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
35
<A NAME="navbar_top_firstrow"><!-- --></A>
36
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
37
<TR ALIGN="center" VALIGN="top">
38
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
39
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
40
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
41
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/ReflectionSocketFactory.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
42
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
43
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
44
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
45
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
49
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
55
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
56
<A HREF="../../../../../org/apache/commons/httpclient/protocol/ProtocolSocketFactory.html" title="interface in org.apache.commons.httpclient.protocol"><B>PREV CLASS</B></A>
57
<A HREF="../../../../../org/apache/commons/httpclient/protocol/SecureProtocolSocketFactory.html" title="interface in org.apache.commons.httpclient.protocol"><B>NEXT CLASS</B></A></FONT></TD>
58
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
59
<A HREF="../../../../../index.html?org/apache/commons/httpclient/protocol/ReflectionSocketFactory.html" target="_top"><B>FRAMES</B></A>
60
<A HREF="ReflectionSocketFactory.html" target="_top"><B>NO FRAMES</B></A>
61
<SCRIPT type="text/javascript">
64
document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
69
<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
76
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
77
SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD>
78
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
79
DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD>
82
<A NAME="skip-navbar_top"></A>
83
<!-- ========= END OF TOP NAVBAR ========= -->
86
<!-- ======== START OF CLASS DATA ======== -->
89
org.apache.commons.httpclient.protocol</FONT>
91
Class ReflectionSocketFactory</H2>
93
<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html" title="class or interface in java.lang">java.lang.Object</A>
94
<IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><B>org.apache.commons.httpclient.protocol.ReflectionSocketFactory</B>
98
<DT><PRE>public final class <B>ReflectionSocketFactory</B><DT>extends <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A></DL>
102
This helper class uses refelction in order to execute Socket methods
103
available in Java 1.4 and above
108
<DT><B>Since:</B></DT>
110
<DT><B>Author:</B></DT>
111
<DD>Oleg Kalnichevski</DD>
117
<!-- ========== METHOD SUMMARY =========== -->
119
<A NAME="method_summary"><!-- --></A>
120
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
121
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
122
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
123
<B>Method Summary</B></FONT></TH>
125
<TR BGCOLOR="white" CLASS="TableRowColor">
126
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
127
<CODE>static <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/net/Socket.html" title="class or interface in java.net">Socket</A></CODE></FONT></TD>
128
<TD><CODE><B><A HREF="../../../../../org/apache/commons/httpclient/protocol/ReflectionSocketFactory.html#createSocket(java.lang.String, java.lang.String, int, java.net.InetAddress, int, int)">createSocket</A></B>(<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> socketfactoryName,
129
<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> host,
131
<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/net/InetAddress.html" title="class or interface in java.net">InetAddress</A> localAddress,
133
int timeout)</CODE>
136
This method attempts to execute Socket method available since Java 1.4
137
using reflection.</TD>
140
<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
141
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
142
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
143
<TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A></B></TH>
145
<TR BGCOLOR="white" CLASS="TableRowColor">
146
<TD><CODE><A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD>
152
<!-- ============ METHOD DETAIL ========== -->
154
<A NAME="method_detail"><!-- --></A>
155
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
156
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
157
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
158
<B>Method Detail</B></FONT></TH>
162
<A NAME="createSocket(java.lang.String, java.lang.String, int, java.net.InetAddress, int, int)"><!-- --></A><H3>
165
public static <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/net/Socket.html" title="class or interface in java.net">Socket</A> <B>createSocket</B>(<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> socketfactoryName,
166
<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> host,
168
<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/net/InetAddress.html" title="class or interface in java.net">InetAddress</A> localAddress,
171
throws <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A>,
172
<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/net/UnknownHostException.html" title="class or interface in java.net">UnknownHostException</A>,
173
<A HREF="../../../../../org/apache/commons/httpclient/ConnectTimeoutException.html" title="class in org.apache.commons.httpclient">ConnectTimeoutException</A></PRE>
175
<DD>This method attempts to execute Socket method available since Java 1.4
176
using reflection. If the methods are not available or could not be executed
177
<tt>null</tt> is returned
180
<DT><B>Parameters:</B><DD><CODE>socketfactoryName</CODE> - name of the socket factory class<DD><CODE>host</CODE> - the host name/IP<DD><CODE>port</CODE> - the port on the host<DD><CODE>localAddress</CODE> - the local host name/IP to bind the socket to<DD><CODE>localPort</CODE> - the port on the local machine<DD><CODE>timeout</CODE> - the timeout value to be used in milliseconds. If the socket cannot be
181
completed within the given time limit, it will be abandoned
182
<DT><B>Returns:</B><DD>a connected Socket
184
<DD><CODE><A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></CODE> - if an I/O error occurs while creating the socket
185
<DD><CODE><A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/net/UnknownHostException.html" title="class or interface in java.net">UnknownHostException</A></CODE> - if the IP address of the host cannot be
187
<DD><CODE><A HREF="../../../../../org/apache/commons/httpclient/ConnectTimeoutException.html" title="class in org.apache.commons.httpclient">ConnectTimeoutException</A></CODE> - if socket cannot be connected within the
188
given time limit</DL>
191
<!-- ========= END OF CLASS DATA ========= -->
195
<!-- ======= START OF BOTTOM NAVBAR ====== -->
196
<A NAME="navbar_bottom"><!-- --></A>
197
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
198
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
200
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
201
<A NAME="navbar_bottom_firstrow"><!-- --></A>
202
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
203
<TR ALIGN="center" VALIGN="top">
204
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
205
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
206
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
207
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/ReflectionSocketFactory.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
208
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
209
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
210
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
211
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
215
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
221
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
222
<A HREF="../../../../../org/apache/commons/httpclient/protocol/ProtocolSocketFactory.html" title="interface in org.apache.commons.httpclient.protocol"><B>PREV CLASS</B></A>
223
<A HREF="../../../../../org/apache/commons/httpclient/protocol/SecureProtocolSocketFactory.html" title="interface in org.apache.commons.httpclient.protocol"><B>NEXT CLASS</B></A></FONT></TD>
224
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
225
<A HREF="../../../../../index.html?org/apache/commons/httpclient/protocol/ReflectionSocketFactory.html" target="_top"><B>FRAMES</B></A>
226
<A HREF="ReflectionSocketFactory.html" target="_top"><B>NO FRAMES</B></A>
227
<SCRIPT type="text/javascript">
230
document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
235
<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
242
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
243
SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD>
244
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
245
DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD>
248
<A NAME="skip-navbar_bottom"></A>
249
<!-- ======== END OF BOTTOM NAVBAR ======= -->
252
Copyright © 2001-2007 Apache Software Foundation. All Rights Reserved.