Java Doc for AbstractHttpInvokerRequestExecutor.java in  » J2EE » spring-framework-2.0.6 » org » springframework » remoting » httpinvoker » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » J2EE » spring framework 2.0.6 » org.springframework.remoting.httpinvoker 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.springframework.remoting.httpinvoker.AbstractHttpInvokerRequestExecutor

All known Subclasses:   org.springframework.remoting.httpinvoker.SimpleHttpInvokerRequestExecutor,  org.springframework.remoting.httpinvoker.CommonsHttpInvokerRequestExecutor,
AbstractHttpInvokerRequestExecutor
abstract public class AbstractHttpInvokerRequestExecutor implements HttpInvokerRequestExecutor,BeanClassLoaderAware(Code)
Abstract base implementation of the HttpInvokerRequestExecutor interface.

Pre-implements serialization of RemoteInvocation objects and deserialization of RemoteInvocationResults objects.
author:
   Juergen Hoeller
since:
   1.1
See Also:   AbstractHttpInvokerRequestExecutor.doExecuteRequest



Field Summary
final public static  StringCONTENT_TYPE_SERIALIZED_OBJECT
    
final protected static  StringENCODING_GZIP
    
final protected static  StringHTTP_HEADER_ACCEPT_ENCODING
    
final protected static  StringHTTP_HEADER_CONTENT_ENCODING
    
final protected static  StringHTTP_HEADER_CONTENT_LENGTH
    
final protected static  StringHTTP_HEADER_CONTENT_TYPE
    
final protected static  StringHTTP_METHOD_POST
    
final protected  Loglogger
    


Method Summary
protected  ObjectInputStreamcreateObjectInputStream(InputStream is, String codebaseUrl)
     Create an ObjectInputStream for the given InputStream and codebase. The default implementation creates a CodebaseAwareObjectInputStream.

Spring's CodebaseAwareObjectInputStream is not only used for loading from a specified codebase, but also to explicitly resolve primitive class names.

protected  InputStreamdecorateInputStream(InputStream is)
     Return the InputStream to use for reading remote invocation results, potentially decorating the given original InputStream.
protected  OutputStreamdecorateOutputStream(OutputStream os)
     Return the OutputStream to use for writing remote invocations, potentially decorating the given original OutputStream.
abstract protected  RemoteInvocationResultdoExecuteRequest(HttpInvokerClientConfiguration config, ByteArrayOutputStream baos)
     Execute a request to send the given serialized remote invocation.
protected  RemoteInvocationResultdoReadRemoteInvocationResult(ObjectInputStream ois)
     Perform the actual reading of an invocation object from the given ObjectInputStream.
protected  voiddoWriteRemoteInvocation(RemoteInvocation invocation, ObjectOutputStream oos)
     Perform the actual writing of the given invocation object to the given ObjectOutputStream.
final public  RemoteInvocationResultexecuteRequest(HttpInvokerClientConfiguration config, RemoteInvocation invocation)
    
protected  ClassLoadergetBeanClassLoader()
     Return the bean ClassLoader that this executor is supposed to use.
protected  ByteArrayOutputStreamgetByteArrayOutputStream(RemoteInvocation invocation)
     Serialize the given RemoteInvocation into a ByteArrayOutputStream.
public  StringgetContentType()
     Return the content type to use for sending HTTP invoker requests.
public  booleanisAcceptGzipEncoding()
     Return whether to accept GZIP encoding, that is, whether to send the HTTP "Accept-Encoding" header with "gzip" as value.
protected  RemoteInvocationResultreadRemoteInvocationResult(InputStream is, String codebaseUrl)
     Deserialize a RemoteInvocationResult object from the given InputStream.

Gives decorateInputStream a chance to decorate the stream first (for example, for custom encryption or compression).

public  voidsetAcceptGzipEncoding(boolean acceptGzipEncoding)
     Set whether to accept GZIP encoding, that is, whether to send the HTTP "Accept-Encoding" header with "gzip" as value.

Default is "true".

public  voidsetBeanClassLoader(ClassLoader classLoader)
    
public  voidsetContentType(String contentType)
     Specify the content type to use for sending HTTP invoker requests.
protected  voidwriteRemoteInvocation(RemoteInvocation invocation, OutputStream os)
     Serialize the given RemoteInvocation to the given OutputStream.

Field Detail
CONTENT_TYPE_SERIALIZED_OBJECT
final public static String CONTENT_TYPE_SERIALIZED_OBJECT(Code)
Default content type: "application/x-java-serialized-object"



ENCODING_GZIP
final protected static String ENCODING_GZIP(Code)



HTTP_HEADER_ACCEPT_ENCODING
final protected static String HTTP_HEADER_ACCEPT_ENCODING(Code)



HTTP_HEADER_CONTENT_ENCODING
final protected static String HTTP_HEADER_CONTENT_ENCODING(Code)



HTTP_HEADER_CONTENT_LENGTH
final protected static String HTTP_HEADER_CONTENT_LENGTH(Code)



HTTP_HEADER_CONTENT_TYPE
final protected static String HTTP_HEADER_CONTENT_TYPE(Code)



HTTP_METHOD_POST
final protected static String HTTP_METHOD_POST(Code)



logger
final protected Log logger(Code)





Method Detail
createObjectInputStream
protected ObjectInputStream createObjectInputStream(InputStream is, String codebaseUrl) throws IOException(Code)
Create an ObjectInputStream for the given InputStream and codebase. The default implementation creates a CodebaseAwareObjectInputStream.

Spring's CodebaseAwareObjectInputStream is not only used for loading from a specified codebase, but also to explicitly resolve primitive class names. This is done by the standard ObjectInputStream on JDK 1.4+, but needs to be done explicitly on JDK 1.3.
Parameters:
  is - the InputStream to read from
Parameters:
  codebaseUrl - the codebase URL to load classes from if not found locally(can be null) the new ObjectInputStream instance to use
throws:
  IOException - if creation of the ObjectInputStream failed
See Also:   org.springframework.remoting.rmi.CodebaseAwareObjectInputStream




decorateInputStream
protected InputStream decorateInputStream(InputStream is) throws IOException(Code)
Return the InputStream to use for reading remote invocation results, potentially decorating the given original InputStream.

The default implementation returns the given stream as-is. Can be overridden, for example, for custom encryption or compression.
Parameters:
  is - the original InputStream the potentially decorated InputStream




decorateOutputStream
protected OutputStream decorateOutputStream(OutputStream os) throws IOException(Code)
Return the OutputStream to use for writing remote invocations, potentially decorating the given original OutputStream.

The default implementation returns the given stream as-is. Can be overridden, for example, for custom encryption or compression.
Parameters:
  os - the original OutputStream the potentially decorated OutputStream




doExecuteRequest
abstract protected RemoteInvocationResult doExecuteRequest(HttpInvokerClientConfiguration config, ByteArrayOutputStream baos) throws Exception(Code)
Execute a request to send the given serialized remote invocation.

Implementations will usually call readRemoteInvocationResult to deserialize a returned RemoteInvocationResult object.
Parameters:
  config - the HTTP invoker configuration that specifies thetarget service
Parameters:
  baos - the ByteArrayOutputStream that contains the serializedRemoteInvocation object the RemoteInvocationResult object
throws:
  IOException - if thrown by I/O operations
throws:
  ClassNotFoundException - if thrown during deserialization
throws:
  Exception - in case of general errors
See Also:   AbstractHttpInvokerRequestExecutor.readRemoteInvocationResult(java.io.InputStream,String)




doReadRemoteInvocationResult
protected RemoteInvocationResult doReadRemoteInvocationResult(ObjectInputStream ois) throws IOException, ClassNotFoundException(Code)
Perform the actual reading of an invocation object from the given ObjectInputStream.

The default implementation simply calls readObject. Can be overridden for deserialization of a custom wrapper object rather than the plain invocation, for example an encryption-aware holder.
Parameters:
  ois - the ObjectInputStream to read from the RemoteInvocationResult object
throws:
  IOException - if thrown by I/O methods
See Also:   java.io.ObjectOutputStream.writeObject




doWriteRemoteInvocation
protected void doWriteRemoteInvocation(RemoteInvocation invocation, ObjectOutputStream oos) throws IOException(Code)
Perform the actual writing of the given invocation object to the given ObjectOutputStream.

The default implementation simply calls writeObject. Can be overridden for serialization of a custom wrapper object rather than the plain invocation, for example an encryption-aware holder.
Parameters:
  invocation - the RemoteInvocation object
Parameters:
  oos - the ObjectOutputStream to write to
throws:
  IOException - if thrown by I/O methods
See Also:   java.io.ObjectOutputStream.writeObject




executeRequest
final public RemoteInvocationResult executeRequest(HttpInvokerClientConfiguration config, RemoteInvocation invocation) throws Exception(Code)



getBeanClassLoader
protected ClassLoader getBeanClassLoader()(Code)
Return the bean ClassLoader that this executor is supposed to use.



getByteArrayOutputStream
protected ByteArrayOutputStream getByteArrayOutputStream(RemoteInvocation invocation) throws IOException(Code)
Serialize the given RemoteInvocation into a ByteArrayOutputStream.
Parameters:
  invocation - the RemoteInvocation object a ByteArrayOutputStream with the serialized RemoteInvocation
throws:
  IOException - if thrown by I/O methods



getContentType
public String getContentType()(Code)
Return the content type to use for sending HTTP invoker requests.



isAcceptGzipEncoding
public boolean isAcceptGzipEncoding()(Code)
Return whether to accept GZIP encoding, that is, whether to send the HTTP "Accept-Encoding" header with "gzip" as value.



readRemoteInvocationResult
protected RemoteInvocationResult readRemoteInvocationResult(InputStream is, String codebaseUrl) throws IOException, ClassNotFoundException(Code)
Deserialize a RemoteInvocationResult object from the given InputStream.

Gives decorateInputStream a chance to decorate the stream first (for example, for custom encryption or compression). Creates an ObjectInputStream via createObjectInputStream and calls doReadRemoteInvocationResult to actually read the object.

Can be overridden for custom serialization of the invocation.
Parameters:
  is - the InputStream to read from
Parameters:
  codebaseUrl - the codebase URL to load classes from if not found locally the RemoteInvocationResult object
throws:
  IOException - if thrown by I/O methods
throws:
  ClassNotFoundException - if thrown during deserialization
See Also:   AbstractHttpInvokerRequestExecutor.decorateInputStream
See Also:   AbstractHttpInvokerRequestExecutor.createObjectInputStream
See Also:   AbstractHttpInvokerRequestExecutor.doReadRemoteInvocationResult




setAcceptGzipEncoding
public void setAcceptGzipEncoding(boolean acceptGzipEncoding)(Code)
Set whether to accept GZIP encoding, that is, whether to send the HTTP "Accept-Encoding" header with "gzip" as value.

Default is "true". Turn this flag off if you do not want GZIP response compression even if enabled on the HTTP server.




setBeanClassLoader
public void setBeanClassLoader(ClassLoader classLoader)(Code)



setContentType
public void setContentType(String contentType)(Code)
Specify the content type to use for sending HTTP invoker requests.

Default is "application/x-java-serialized-object".




writeRemoteInvocation
protected void writeRemoteInvocation(RemoteInvocation invocation, OutputStream os) throws IOException(Code)
Serialize the given RemoteInvocation to the given OutputStream.

The default implementation gives decorateOutputStream a chance to decorate the stream first (for example, for custom encryption or compression). Creates an ObjectOutputStream for the final stream and calls doWriteRemoteInvocation to actually write the object.

Can be overridden for custom serialization of the invocation.
Parameters:
  invocation - the RemoteInvocation object
Parameters:
  os - the OutputStream to write to
throws:
  IOException - if thrown by I/O methods
See Also:   AbstractHttpInvokerRequestExecutor.decorateOutputStream
See Also:   AbstractHttpInvokerRequestExecutor.doWriteRemoteInvocation




Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.