Java Doc for RedeliveryHandlingParser.java in  » IDE-Netbeans » wsdlextensions.file » org » netbeans » modules » wsdlextensions » jms » validator » 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 » IDE Netbeans » wsdlextensions.file » org.netbeans.modules.wsdlextensions.jms.validator 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.netbeans.modules.wsdlextensions.jms.validator.RedeliveryHandlingParser

RedeliveryHandlingParser
public class RedeliveryHandlingParser (Code)
Is used to deal with "poisonous messages". A poison message is a message that fails to be processed time and time again, thereby stopping other messages from being processed. Is invoked for each message. Maintains a cache of msgids of messages that have the JMSRedelivered flag set, and keeps a count of these messages. Based on the number of times a message was redelivered, a particular Action can be invoked. Actions are delay, moving or deleting the message. The msgid cache is not persistent, nor is it shared between multiple activations. This means that if a message was seen 10 times with the redelivered flag set, and the project is undeployed, the redelivery count will be reset to zero. Also, if there are multiple application servers reading from the same queue, a message may be redelivered 10 times to one application server, and 10 times to the other application server, and both activations will see a count of 10 instead of 20. The msgid cache is limited to 5000 (check source); when this limit is reached, the oldest msgids are flushed from the cache. "Oldest" means least recently seen. Specification of the actions is done through a specially formatted string. The string has this format: format := entry[; entry]* entry := idx ":" action idx := number (denotes the n-th time a msg was seen) action := number (denotes delay in ms) | "delete" | "move"(args) move := "queue"|"topic" | "same" ":" destname destname := any string, may include "$" which will be replaced with the original destination name. Examples: 5:1000; 10:5000; 50:move(queue:mydlq) This causes no delay up to the 5th delivery; a 1000 ms delay is invoked when the message is seen the 5th, 6th, 7th, 8th, and 9th time. A 5 second delay is invoked when the msg is invoked the 10th, 11th, ..., 49th time. When the msg is seen the 50th time the msg is moved to a queue with the name "mydlq". If the messages were received from "Queue1" and if the string was specified as 5:1000; 10:5000; 50:move(queue:dlq$oops) the messages would be moved to the destination "dlqQueue1oops". Another example: 5:1000; 10:5000 This causes no delay up to the 5th delivery; a 1000 ms delay is invoked when the message is seen the 5th, 6th, 7th, 8th, and 9th time. A 5 second delay is invoked for each time the message is seen thereafter. Moving messages is done in the same transaction if the transaction is XA. Moving messages is done using auto-commit if the delivery is non-XA. Moving messages is done by creating a new message of the same type unless the property JMSJCA.redeliveryRedirect is set to true in which case the messages are simply redirected. In the first case, the payload of the new message is set as follows: - for a ObjectMessage this will be done through getObject(), setObject(); - for a StreamMessage through readObject/writeObject, - for a BytesMessage through readBytes() and writeBytes() (avoiding the getBodyLength() method new in JMS 1.1) Copying the payload of an ObjectMessage may cause classloader problems since the context classloader is not properly set. In this case the redelivery handler should be configured to redirect the message instead. The new message will have properties as follows: JMS properties - JMSCorrelationID: copied - JMSDestination: see above; set by JMS provider - JMSExpiration: copied through the send method - JMSMessageID: set by the JMS provider - JMSPriority: set by the JMS provider; propagated through the send() method - JMSRedelivered: NOT copied - JMSReplyTo: copied - JMSTimestamp: copied into the user property field JMSJCATimestamp - JMSType: copied - JMSDeliveryMode: set by the JMS provider; propagated through the send() method All user defined properties: copied Additional properties: - JMS_Sun-JMSJCA.RedeliveryCount: number of times the message was seen with the redelivered flag set by JMSJCA. Will accurately reflect the total number of redelivery attempts only if there's one instance of the inbound adapter, and the inbound adapter was not redeployed. - JMS_Sun-JMSJCA.OriginalDestinationName: name of the destination as specified in the activation spec - JMS_Sun-JMSJCA.OriginalDestinationType: either "javax.jms.Queue" or "javax.jms.Topic" - JMS_Sun-JMSJCA.SubscriberName: as specified in the activation spec - JMS_Sun-JMSJCA.ContextName: as specified in the activation spec Invoking a delay takes place by holding the processing thread occupied, that means that while the thread is sleeping, this thread will not be used to process any other messages. Undeployment interrupts threads that are delaying message delivery. If a msg delay is divisible by 1000, an INFO message is written to the log indicating that the thead is delaying message delivery. There is a default behavior for message redelivery handling: see source. Implementation notes: this class is made abstract to enhance testability.

Inner Class :abstract public static class Action
Inner Class :public static class VoidAction extends Action
Inner Class :public static class Delay extends Action
Inner Class :public static class Move extends Action
Inner Class :public static class Delete extends Action



Method Summary
public static  booleancheckValid(String actions)
    
public static  Action[]parse(String s, String destName, String destType)
     Parses an action string into separate actions and performs validations.



Method Detail
checkValid
public static boolean checkValid(String actions)(Code)

Parameters:
  actions - action string true if can be parsed properly



parse
public static Action[] parse(String s, String destName, String destType) throws Exception(Code)
Parses an action string into separate actions and performs validations. The returned action array is guaranteed to be ordered and without duplicates.
Parameters:
  s - string to be parsed
Parameters:
  destName - destination name being used (for dlq name construction)
Parameters:
  destType - type from activation spec (javax.jms.Queue or javax.jms.Topic) array of actions
throws:
  Exception - upon parsing failure



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.