org.springframework.remoting.httpinvoker
Class SimpleHttpInvokerRequestExecutor

java.lang.Object
  extended byorg.springframework.remoting.httpinvoker.AbstractHttpInvokerRequestExecutor
      extended byorg.springframework.remoting.httpinvoker.SimpleHttpInvokerRequestExecutor
All Implemented Interfaces:
HttpInvokerRequestExecutor

public class SimpleHttpInvokerRequestExecutor
extends AbstractHttpInvokerRequestExecutor

HttpInvokerRequestExecutor implementation that uses J2SE facilities to execute POST requests, without support for HTTP authentication or advanced configuration options.

Consider CommonsHttpInvokerRequestExecutor for more sophisticated needs.

Since:
1.1
Author:
Juergen Hoeller
See Also:
CommonsHttpInvokerRequestExecutor

Field Summary
 
Fields inherited from class org.springframework.remoting.httpinvoker.AbstractHttpInvokerRequestExecutor
CONTENT_TYPE_SERIALIZED_OBJECT, HTTP_HEADER_CONTENT_LENGTH, HTTP_HEADER_CONTENT_TYPE, HTTP_METHOD_POST, logger
 
Constructor Summary
SimpleHttpInvokerRequestExecutor()
           
 
Method Summary
protected  RemoteInvocationResult doExecuteRequest(HttpInvokerClientConfiguration config, ByteArrayOutputStream baos)
          Execute a request to send the given serialized remote invocation.
protected  void prepareConnection(HttpURLConnection con, int contentLength)
          Prepare the given HTTP connection.
 
Methods inherited from class org.springframework.remoting.httpinvoker.AbstractHttpInvokerRequestExecutor
createObjectInputStream, decorateInputStream, decorateOutputStream, doReadRemoteInvocationResult, doWriteRemoteInvocation, executeRequest, getByteArrayOutputStream, readRemoteInvocationResult, readRemoteInvocationResult, writeRemoteInvocation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleHttpInvokerRequestExecutor

public SimpleHttpInvokerRequestExecutor()
Method Detail

doExecuteRequest

protected RemoteInvocationResult doExecuteRequest(HttpInvokerClientConfiguration config,
                                                  ByteArrayOutputStream baos)
                                           throws IOException,
                                                  ClassNotFoundException
Description copied from class: AbstractHttpInvokerRequestExecutor
Execute a request to send the given serialized remote invocation.

Implementations will usually call readRemoteInvocationResult to deserialize a returned RemoteInvocationResult object.

Specified by:
doExecuteRequest in class AbstractHttpInvokerRequestExecutor
Parameters:
config - the HTTP invoker configuration that specifies the target service
baos - the ByteArrayOutputStream that contains the serialized RemoteInvocation object
Returns:
the RemoteInvocationResult object
Throws:
ClassNotFoundException - if thrown during deserialization
IOException - if thrown by I/O operations
See Also:
AbstractHttpInvokerRequestExecutor.readRemoteInvocationResult(java.io.InputStream, String)

prepareConnection

protected void prepareConnection(HttpURLConnection con,
                                 int contentLength)
                          throws IOException
Prepare the given HTTP connection.

Default implementation specifies POST as method, "application/x-java-serialized-object" as "Content-Type" header, and the given content length as "Content-Length" header.

Parameters:
con - the HTTP connection to prepare
contentLength - the length of the content to send
Throws:
IOException - if thrown by HttpURLConnection methods


Copyright (C) 2003-2004 The Spring Framework Project.