org.apache.mina.filter.codec

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 » Net » mina 2.0.0 M1 » org.apache.mina.filter.codec 
org.apache.mina.filter.codec
Filter implementations that helps you to implement complex protocols via 'codec' concept.
Java Source File NameTypeComment
AbstractProtocolDecoderOutput.javaClass A ProtocolDecoderOutput based on queue.
AbstractProtocolEncoderOutput.javaClass A ProtocolEncoderOutput based on queue.
CumulativeProtocolDecoder.javaClass A ProtocolDecoder that cumulates the content of received buffers to a cumulative buffer to help users implement decoders.

If the received IoBuffer is only a part of a message. decoders should cumulate received buffers to make a message complete or to postpone decoding until more buffers arrive.

Here is an example decoder that decodes CRLF terminated lines into Command objects:

 public class CrLfTerminatedCommandLineDecoder
 extends CumulativeProtocolDecoder {
 private Command parseCommand(IoBuffer in) {
 // Convert the bytes in the specified buffer to a
 // Command object.
 ...
 }
 protected boolean doDecode(
 IoSession session, IoBuffer in, ProtocolDecoderOutput out)
 throws Exception {
 // Remember the initial position.
 int start = in.position();
 // Now find the first CRLF in the buffer.
 byte previous = 0;
 while (in.hasRemaining()) {
 byte current = in.get();
 if (previous == '\r' && current == '\n') {
 // Remember the current position and limit.
 int position = in.position();
 int limit = in.limit();
 try {
 in.position(start);
 in.limit(position);
 // The bytes between in.position() and in.limit()
 // now contain a full CRLF terminated line.
 out.write(parseCommand(in.slice()));
 } finally {
 // Set the position to point right after the
 // detected line and set the limit to the old
 // one.
 in.position(position);
 in.limit(limit);
 }
 // Decoded one line; CumulativeProtocolDecoder will
 // call me again until I return false.
CumulativeProtocolDecoderTest.javaClass Tests CumulativeProtocolDecoder .
ProtocolCodecException.javaClass An exception that is thrown when ProtocolEncoder or ProtocolDecoder cannot understand or failed to validate data to process.
ProtocolCodecFactory.javaInterface Provides ProtocolEncoder and ProtocolDecoder which translates binary or protocol specific data into message object and vice versa.
ProtocolCodecFilter.javaClass An IoFilter which translates binary or protocol specific data into message object and vice versa using ProtocolCodecFactory , ProtocolEncoder , or ProtocolDecoder .
ProtocolCodecSession.javaClass A virtual IoSession that provides ProtocolEncoderOutput and ProtocolDecoderOutput .
ProtocolDecoder.javaInterface Decodes binary or protocol-specific data into higher-level message objects.
ProtocolDecoderAdapter.javaClass An abstract ProtocolDecoder implementation for those who don't need ProtocolDecoder.finishDecode(IoSessionProtocolDecoderOutput) nor ProtocolDecoder.dispose(IoSession) method.
ProtocolDecoderException.javaClass An exception that is thrown when ProtocolDecoder cannot understand or failed to validate the specified IoBuffer content.
ProtocolDecoderOutput.javaInterface Callback for ProtocolDecoder to generate decoded messages.
ProtocolEncoder.javaInterface Encodes higher-level message objects into binary or protocol-specific data.
ProtocolEncoderAdapter.javaClass An abstract ProtocolEncoder implementation for those who don't have any resources to dispose.
ProtocolEncoderException.javaClass An exception that is thrown when ProtocolEncoder cannot understand or failed to validate the specified message object.
ProtocolEncoderOutput.javaInterface Callback for ProtocolEncoder to generate encoded messages such as IoBuffer s.
RecoverableProtocolDecoderException.javaClass A special exception that tells the ProtocolDecoder can keep decoding even after this exception is thrown.
SynchronizedProtocolDecoder.javaClass A ProtocolDecoder implementation which decorates an existing decoder to be thread-safe.
SynchronizedProtocolEncoder.javaClass A ProtocolEncoder implementation which decorates an existing encoder to be thread-safe.
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.