Java Doc for LazyStreamBasedMessage.java in  » 6.0-JDK-Modules-com.sun » wsit » com » sun » xml » ws » message » stream » 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 » 6.0 JDK Modules com.sun » wsit » com.sun.xml.ws.message.stream 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


com.sun.xml.ws.message.stream.LazyStreamBasedMessage

LazyStreamBasedMessage
public class LazyStreamBasedMessage extends Message (Code)

author:
   K.Venugopal@sun.com


Field Summary
final protected static  Loggerlogger
    

Constructor Summary
public  LazyStreamBasedMessage(XMLStreamReader message, StreamSOAPCodec codec)
    

Method Summary
public  Messagecopy()
     Creates a copy of a Message .

This method creates a new Message whose header/payload/attachments/properties are identical to this Message .

public  AttachmentSetgetAttachments()
    
public  StreamSOAPCodecgetCodec()
    
public  HeaderListgetHeaders()
     Gets all the headers of this message.

Implementation Note

Message implementation is allowed to defer the construction of HeaderList object.

public  StringgetPayloadLocalPart()
     Gets the local name of the payload element.
public  StringgetPayloadNamespaceURI()
     Gets the namespace URI of the payload element.
public  booleanhasHeaders()
     Returns true if headers are present in the message.
public  booleanhasPayload()
     Returns true if a Message has a payload.
public  booleanisFault()
     Returns true if this message is a fault.
public  booleanisOneWay(WSDLPort port)
     Returns true if this message is a request message for a one way operation according to the given WSDL.
public  voidprint()
    
public  SOAPMessagereadAsSOAPMessage()
     Creates the equivalent SOAPMessage from this message.
public  SourcereadEnvelopeAsSource()
     Consumes this message including the envelope.
public  XMLStreamReaderreadMessage()
    
public  XMLStreamReaderreadPayload()
     Reads the payload as a XMLStreamReader This consumes the message.
public  TreadPayloadAsJAXB(Unmarshaller unmarshaller)
     Reads the payload as a JAXB object by using the given unmarshaller.
public  TreadPayloadAsJAXB(Bridge<T> bridge)
     Reads the payload as a JAXB object according to the given Bridge .
public  SourcereadPayloadAsSource()
     Returns the payload as a Source object.
public  voidwritePayloadTo(XMLStreamWriter sw)
     Writes the payload to StAX.
public  voidwriteTo(XMLStreamWriter sw)
     Writes the whole SOAP message (but not attachments) to the given writer.
public  voidwriteTo(ContentHandler contentHandler, ErrorHandler errorHandler)
     Writes the whole SOAP envelope as SAX events.

This consumes the message.
Parameters:
  contentHandler - must not be nulll.
Parameters:
  errorHandler - must not be null.any error encountered during the SAX event production must befirst reported to this error handler.


Field Detail
logger
final protected static Logger logger(Code)




Constructor Detail
LazyStreamBasedMessage
public LazyStreamBasedMessage(XMLStreamReader message, StreamSOAPCodec codec)(Code)
Creates a new instance of StreamMessage




Method Detail
copy
public Message copy()(Code)
Creates a copy of a Message .

This method creates a new Message whose header/payload/attachments/properties are identical to this Message . Once created, the created Message and the original Message behaves independently --- adding header/ attachment to one Message doesn't affect another Message at all.

This method does NOT consume a message.

To enable efficient copy operations, there's a few restrictions on how copied message can be used.

  1. The original and the copy may not be used concurrently by two threads (this allows two Message s to share some internal resources, such as JAXB marshallers.) Note that it's OK for the original and the copy to be processed by two threads, as long as they are not concurrent.
  2. The copy has the same 'life scope' as the original (this allows shallower copy, such as JAXB beans wrapped in JAXBMessage .)

A 'life scope' of a message created during a message processing in a pipeline is until a pipeline processes the next message. A message cannot be kept beyond its life scope. (This experimental design is to allow message objects to be reused --- feedback appreciated.)

Design Rationale

Since a Message body is read-once, sometimes (such as when you do fail-over, or WS-RM) you need to create an idential copy of a Message .

The actual copy operation depends on the layout of the data in memory, hence it's best to be done by the Message implementation itself.

The restrictions placed on the use of copied Message can be relaxed if necessary, but it will make the copy method more expensive.




getAttachments
public AttachmentSet getAttachments()(Code)
Gets the attachments of this message (attachments live outside a message.)



getCodec
public StreamSOAPCodec getCodec()(Code)



getHeaders
public HeaderList getHeaders()(Code)
Gets all the headers of this message.

Implementation Note

Message implementation is allowed to defer the construction of HeaderList object. So if you only want to check for the existence of any header element, use LazyStreamBasedMessage.hasHeaders() . always return the same non-null object.




getPayloadLocalPart
public String getPayloadLocalPart()(Code)
Gets the local name of the payload element. null if a Message doesn't have any payload.



getPayloadNamespaceURI
public String getPayloadNamespaceURI()(Code)
Gets the namespace URI of the payload element. null if a Message doesn't have any payload.



hasHeaders
public boolean hasHeaders()(Code)
Returns true if headers are present in the message. true if headers are present.



hasPayload
public boolean hasPayload()(Code)
Returns true if a Message has a payload.

A message without a payload is a SOAP message that looks like:


 <S:Envelope>
 <S:Header>
 ...
 </S:Header>
 <S:Body />
 </S:Envelope>
 



isFault
public boolean isFault()(Code)
Returns true if this message is a fault.

Just a convenience method built on LazyStreamBasedMessage.getPayloadNamespaceURI() and LazyStreamBasedMessage.getPayloadLocalPart() .




isOneWay
public boolean isOneWay(WSDLPort port)(Code)
Returns true if this message is a request message for a one way operation according to the given WSDL. False otherwise.

This method is functionally equivalent as doing getOperation(port).getOperation().isOneWay() (with proper null check and all.) But this method can sometimes work faster than that (for example, on the client side when used with SEI.)
Parameters:
  port - Messages are always created under the context ofone WSDLPort and they never go outside that context.Pass in that "governing" WSDLPort object here.We chose to receive this as a parameter instead ofkeeping WSDLPort in a message, just to save the storage.

The implementation of this method involves caching the returnvalue, so the behavior is undefined if multiple callers providedifferent WSDLPort objects, which is a bug of the caller.




print
public void print() throws XMLStreamException(Code)



readAsSOAPMessage
public SOAPMessage readAsSOAPMessage() throws SOAPException(Code)
Creates the equivalent SOAPMessage from this message. This consumes the message.
throws:
  SOAPException - if there's any error while creating a SOAPMessage.



readEnvelopeAsSource
public Source readEnvelopeAsSource()(Code)
Consumes this message including the envelope. returns it as a Source object.



readMessage
public XMLStreamReader readMessage()(Code)



readPayload
public XMLStreamReader readPayload() throws XMLStreamException(Code)
Reads the payload as a XMLStreamReader This consumes the message. If there's no payload, this method returns null.Otherwise always non-null valid XMLStreamReader that points tothe payload tag name.



readPayloadAsJAXB
public T readPayloadAsJAXB(Unmarshaller unmarshaller) throws JAXBException(Code)
Reads the payload as a JAXB object by using the given unmarshaller. This consumes the message.
throws:
  JAXBException - If JAXB reports an error during the processing.



readPayloadAsJAXB
public T readPayloadAsJAXB(Bridge<T> bridge) throws JAXBException(Code)
Reads the payload as a JAXB object according to the given Bridge . This consumes the message.
throws:
  JAXBException - If JAXB reports an error during the processing.



readPayloadAsSource
public Source readPayloadAsSource()(Code)
Returns the payload as a Source object. This consumes the message. if there's no payload, this method returns null.



writePayloadTo
public void writePayloadTo(XMLStreamWriter sw) throws XMLStreamException(Code)
Writes the payload to StAX. This method writes just the payload of the message to the writer. This consumes the message. The implementation will not write XMLStreamWriter.writeStartDocument nor XMLStreamWriter.writeEndDocument

If there's no payload, this method is no-op.
throws:
  XMLStreamException - If the XMLStreamWriter reports an error,or some other errors happen during the processing.




writeTo
public void writeTo(XMLStreamWriter sw) throws XMLStreamException(Code)
Writes the whole SOAP message (but not attachments) to the given writer. This consumes the message.
throws:
  XMLStreamException - If the XMLStreamWriter reports an error,or some other errors happen during the processing.



writeTo
public void writeTo(ContentHandler contentHandler, ErrorHandler errorHandler) throws SAXException(Code)
Writes the whole SOAP envelope as SAX events.

This consumes the message.
Parameters:
  contentHandler - must not be nulll.
Parameters:
  errorHandler - must not be null.any error encountered during the SAX event production must befirst reported to this error handler. Fatal errors can be thenthrown as SAXParseException. SAXExceptions thrownfrom ErrorHandler should propagate directly through this method.




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