Java Doc for HttpInvokerServiceExporter.java in  » J2EE » spring-framework-2.5 » 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.5 » org.springframework.remoting.httpinvoker 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.springframework.remoting.support.RemoteInvocationBasedExporter
   org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter

HttpInvokerServiceExporter
public class HttpInvokerServiceExporter extends RemoteInvocationBasedExporter implements HttpRequestHandler,InitializingBean(Code)
HTTP request handler that exports the specified service bean as HTTP invoker service endpoint, accessible via an HTTP invoker proxy.

Deserializes remote invocation objects and serializes remote invocation result objects. Uses Java serialization just like RMI, but provides the same ease of setup as Caucho's HTTP-based Hessian and Burlap protocols.

HTTP invoker is the recommended protocol for Java-to-Java remoting. It is more powerful and more extensible than Hessian and Burlap, at the expense of being tied to Java. Nevertheless, it is as easy to set up as Hessian and Burlap, which is its main advantage compared to RMI.
author:
   Juergen Hoeller
since:
   1.1
See Also:   HttpInvokerClientInterceptor
See Also:   HttpInvokerProxyFactoryBean
See Also:   org.springframework.remoting.rmi.RmiServiceExporter
See Also:   org.springframework.remoting.caucho.HessianServiceExporter
See Also:   org.springframework.remoting.caucho.BurlapServiceExporter



Field Summary
final public static  StringCONTENT_TYPE_SERIALIZED_OBJECT
    


Method Summary
public  voidafterPropertiesSet()
    
protected  ObjectInputStreamcreateObjectInputStream(InputStream is)
     Create an ObjectInputStream for the given InputStream.
protected  ObjectOutputStreamcreateObjectOutputStream(OutputStream os)
     Create an ObjectOutputStream for the given OutputStream.
protected  InputStreamdecorateInputStream(HttpServletRequest request, InputStream is)
     Return the InputStream to use for reading remote invocations, potentially decorating the given original InputStream.
protected  OutputStreamdecorateOutputStream(HttpServletRequest request, HttpServletResponse response, OutputStream os)
     Return the OutputStream to use for writing remote invocation results, potentially decorating the given original OutputStream.
protected  RemoteInvocationdoReadRemoteInvocation(ObjectInputStream ois)
     Perform the actual reading of an invocation result object from the given ObjectInputStream.
protected  voiddoWriteRemoteInvocationResult(RemoteInvocationResult result, ObjectOutputStream oos)
     Perform the actual writing of the given invocation result object to the given ObjectOutputStream.
public  StringgetContentType()
     Return the content type to use for sending HTTP invoker responses.
public  voidhandleRequest(HttpServletRequest request, HttpServletResponse response)
     Reads a remote invocation from the request, executes it, and writes the remote invocation result to the response.
public  voidprepare()
     Initialize this service exporter.
protected  RemoteInvocationreadRemoteInvocation(HttpServletRequest request)
     Read a RemoteInvocation from the given HTTP request.
protected  RemoteInvocationreadRemoteInvocation(HttpServletRequest request, InputStream is)
     Deserialize a RemoteInvocation object from the given InputStream.

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

public  voidsetContentType(String contentType)
     Specify the content type to use for sending HTTP invoker responses.
protected  voidwriteRemoteInvocationResult(HttpServletRequest request, HttpServletResponse response, RemoteInvocationResult result)
     Write the given RemoteInvocationResult to the given HTTP response.
protected  voidwriteRemoteInvocationResult(HttpServletRequest request, HttpServletResponse response, RemoteInvocationResult result, 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"





Method Detail
afterPropertiesSet
public void afterPropertiesSet()(Code)



createObjectInputStream
protected ObjectInputStream createObjectInputStream(InputStream is) throws IOException(Code)
Create an ObjectInputStream for the given InputStream.

The default implementation creates a Spring org.springframework.remoting.rmi.CodebaseAwareObjectInputStream .
Parameters:
  is - the InputStream to read from the new ObjectInputStream instance to use
throws:
  IOException - if creation of the ObjectInputStream failed




createObjectOutputStream
protected ObjectOutputStream createObjectOutputStream(OutputStream os) throws IOException(Code)
Create an ObjectOutputStream for the given OutputStream.

The default implementation creates a plain java.io.ObjectOutputStream .
Parameters:
  os - the OutputStream to write to the new ObjectOutputStream instance to use
throws:
  IOException - if creation of the ObjectOutputStream failed




decorateInputStream
protected InputStream decorateInputStream(HttpServletRequest request, InputStream is) throws IOException(Code)
Return the InputStream to use for reading remote invocations, 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:
  request - current HTTP request
Parameters:
  is - the original InputStream the potentially decorated InputStream
throws:
  IOException - in case of I/O failure




decorateOutputStream
protected OutputStream decorateOutputStream(HttpServletRequest request, HttpServletResponse response, OutputStream os) throws IOException(Code)
Return the OutputStream to use for writing remote invocation results, 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:
  request - current HTTP request
Parameters:
  response - current HTTP response
Parameters:
  os - the original OutputStream the potentially decorated OutputStream
throws:
  IOException - in case of I/O failure




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

The default implementation simply calls java.io.ObjectInputStream.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 - in case of I/O failure
throws:
  ClassNotFoundException - if case of a transferred class notbeing found in the local ClassLoader




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

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




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



handleRequest
public void handleRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException(Code)
Reads a remote invocation from the request, executes it, and writes the remote invocation result to the response.
See Also:   HttpInvokerServiceExporter.readRemoteInvocation(HttpServletRequest)
See Also:   HttpInvokerServiceExporter.invokeAndCreateResult(org.springframework.remoting.support.RemoteInvocation,Object)
See Also:   HttpInvokerServiceExporter.writeRemoteInvocationResult(HttpServletRequest,HttpServletResponse,RemoteInvocationResult)



prepare
public void prepare()(Code)
Initialize this service exporter.



readRemoteInvocation
protected RemoteInvocation readRemoteInvocation(HttpServletRequest request) throws IOException, ClassNotFoundException(Code)
Read a RemoteInvocation from the given HTTP request.

Delegates to HttpInvokerServiceExporter.readRemoteInvocation(javax.servlet.http.HttpServletRequest,java.io.InputStream) with the javax.servlet.ServletRequest.getInputStream servlet request's input stream .
Parameters:
  request - current HTTP request the RemoteInvocation object
throws:
  IOException - in case of I/O failure
throws:
  ClassNotFoundException - if thrown by deserialization




readRemoteInvocation
protected RemoteInvocation readRemoteInvocation(HttpServletRequest request, InputStream is) throws IOException, ClassNotFoundException(Code)
Deserialize a RemoteInvocation object from the given InputStream.

Gives HttpInvokerServiceExporter.decorateInputStream a chance to decorate the stream first (for example, for custom encryption or compression). Creates a org.springframework.remoting.rmi.CodebaseAwareObjectInputStream and calls HttpInvokerServiceExporter.doReadRemoteInvocation to actually read the object.

Can be overridden for custom serialization of the invocation.
Parameters:
  request - current HTTP request
Parameters:
  is - the InputStream to read from the RemoteInvocation object
throws:
  IOException - in case of I/O failure
throws:
  ClassNotFoundException - if thrown during deserialization




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

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




writeRemoteInvocationResult
protected void writeRemoteInvocationResult(HttpServletRequest request, HttpServletResponse response, RemoteInvocationResult result) throws IOException(Code)
Write the given RemoteInvocationResult to the given HTTP response.
Parameters:
  request - current HTTP request
Parameters:
  response - current HTTP response
Parameters:
  result - the RemoteInvocationResult object
throws:
  IOException - in case of I/O failure



writeRemoteInvocationResult
protected void writeRemoteInvocationResult(HttpServletRequest request, HttpServletResponse response, RemoteInvocationResult result, OutputStream os) throws IOException(Code)
Serialize the given RemoteInvocation to the given OutputStream.

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

Can be overridden for custom serialization of the invocation.
Parameters:
  request - current HTTP request
Parameters:
  response - current HTTP response
Parameters:
  result - the RemoteInvocationResult object
Parameters:
  os - the OutputStream to write to
throws:
  IOException - in case of I/O failure
See Also:   HttpInvokerServiceExporter.decorateOutputStream
See Also:   HttpInvokerServiceExporter.doWriteRemoteInvocationResult




Methods inherited from org.springframework.remoting.support.RemoteInvocationBasedExporter
public RemoteInvocationExecutor getRemoteInvocationExecutor()(Code)(Java Doc)
protected Object invoke(RemoteInvocation invocation, Object targetObject) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException(Code)(Java Doc)
protected RemoteInvocationResult invokeAndCreateResult(RemoteInvocation invocation, Object targetObject)(Code)(Java Doc)
public void setRemoteInvocationExecutor(RemoteInvocationExecutor remoteInvocationExecutor)(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.