[jboss-user] [Tomcat, HTTPD, Servlets & JSP] - IOException in HttpInvokerProxy
ssanjeev
do-not-reply at jboss.com
Tue Aug 8 17:07:19 EDT 2006
The code is from org.jboss.invocation.http.interfaces.Util.java
public static Object invoke(URL externalURL, Invocation mi)
| throws Exception
| {
| if( log.isTraceEnabled() )
| log.trace("invoke, externalURL="+externalURL);
| /* Post the MarshalledInvocation data. This is using the URL class
| for now but this should be improved to a cluster aware layer with
| full usage of HTTP 1.1 features, pooling, etc.
| */
| HttpURLConnection conn = (HttpURLConnection) externalURL.openConnection();
| configureHttpsHostVerifier(conn);
| conn.setDoInput(true);
| conn.setDoOutput(true);
| conn.setRequestProperty("ContentType", REQUEST_CONTENT_TYPE);
| conn.setRequestMethod("POST");
| OutputStream os = conn.getOutputStream();
| ObjectOutputStream oos = new ObjectOutputStream(os);
| try
| {
| oos.writeObject(mi);
| oos.flush();
| }
| catch (ObjectStreamException e)
| {
| // This generally represents a programming/deployment error,
| // not a communication problem
| throw new InvocationException(e);
| }
|
| // Get the response MarshalledValue object
| InputStream is = conn.getInputStream();
| ObjectInputStream ois = new ObjectInputStream(is);
| MarshalledValue mv = (MarshalledValue) ois.readObject();
| // A hack for jsse connection pooling (see patch ).
| ois.read();
| ois.close();
| oos.close();
|
| // If the encoded value is an exception throw it
| Object value = mv.get();
| if( value instanceof Exception )
| {
| throw (Exception) value;
| }
|
| return value;
| }
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3963909#3963909
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3963909
More information about the jboss-user
mailing list