mina 2.0.0 M1

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 
Apache MINA
License:
URL:http://mina.apache.org/
Description:Apache MINA is a network application framework which helps users develop high performance and high scalability network applications easily.
Package NameComment
org.apache.mina.common Common types required for users to use MINA.
org.apache.mina.example.chat Chat server which demonstates using the text line codec and Spring integration.
org.apache.mina.example.chat.client Swing based chat client.
org.apache.mina.example.echoserver Echo server which demonstates low-level I/O layer and SSL support.
org.apache.mina.example.echoserver.ssl SSL support classes.
org.apache.mina.example.imagine.step1
org.apache.mina.example.imagine.step1.client
org.apache.mina.example.imagine.step1.codec
org.apache.mina.example.imagine.step1.server
org.apache.mina.example.netcat NetCat client (Network + Unix cat command) which demonstates low-level I/O layer.
org.apache.mina.example.proxy A TCP/IP tunneling proxy example.
org.apache.mina.example.reverser Reverser server which reverses all text lines demonstating high-level protocol layer.
org.apache.mina.example.sumup SumUp Server and Client which sums up all ADD requests.
org.apache.mina.example.sumup.codec Protocol codec implementation for SumUp protocol.
org.apache.mina.example.sumup.message Protocol mmessage classes for SumUp protocol.
org.apache.mina.example.tapedeck
org.apache.mina.example.tennis Two tennis players play a game which demonstates in-VM pipes.
org.apache.mina.example.udp
org.apache.mina.example.udp.client
org.apache.mina.filter.codec Filter implementations that helps you to implement complex protocols via 'codec' concept.
org.apache.mina.filter.codec.demux Protocol codecs that helps you to implement even more complex protocols by splitting a codec into multiple sub-codecs.
org.apache.mina.filter.codec.netty Protocol codec which provides the integration with Netty2 messages.
org.apache.mina.filter.codec.prefixedstring
org.apache.mina.filter.codec.serialization Protocol codecs which uses Java object serilization and leads to rapid protocol implementation.
org.apache.mina.filter.codec.statemachine
org.apache.mina.filter.codec.textline A protocol codec for text-based protocols.
org.apache.mina.filter.compression
org.apache.mina.filter.errorgenerating An IoFilter that provides flexible error generation facilities.
org.apache.mina.filter.executor An IoFilter that provides flexible thread models
org.apache.mina.filter.firewall Classes that implement IoFilter and provide host blocking and throttling.
org.apache.mina.filter.keepalive IoFilter that provides the ability for connections to remain open when data is not being transferred.
org.apache.mina.filter.logging Classes that implement IoFilter and provide logging of the events and data that flows through a MINA-based system.
org.apache.mina.filter.reqres
org.apache.mina.filter.ssl Classes that implement IoFilter and provide Secure Sockets Layer functionality.
org.apache.mina.filter.statistic Classes that implement IoFilter and provide the ability for filters to be timed on their performance.
org.apache.mina.filter.stream Stream based IoFilter implementation.
org.apache.mina.filter.traffic IoFilter's which will provide functionality for shaping the traffic and preventing data flooding.
org.apache.mina.filter.util Utility classes for the MINA filtering portion of the library.
org.apache.mina.handler.chain A handler implementation that helps you implement sequentially layered protocols using Chains of Responsibility pattern.
org.apache.mina.handler.demux A handler implementation that helps you implement complex protocols by splitting messageReceived handlers into multiple sub-handlers.
org.apache.mina.handler.multiton Enables creating a handler per session instead of having one handler for many sessions, using Multiton pattern.
org.apache.mina.handler.stream
org.apache.mina.integration.beans
org.apache.mina.integration.jmx JMX (Java Management eXtension) integration.

Monitoring Your MINA Services and Sessions

Monitoring an IoService

acceptor = new SocketAcceptor();
       
try
{
    IoServiceManager iosm = new IoServiceManager(acceptor);
    MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();  
    ObjectName name = new ObjectName( "com.acme.test:type=IoServiceManager,name=MyMINAServer" );
    mbs.registerMBean( iosm, name );
}
catch( JMException e )
{
    logger.error( "JMX Exception: ", e );
}

Monitoring an IoSession

Each session is registered to MBean server individually.
acceptor.addListener( new IoServiceListener()
{
    public void serviceActivated( IoService service, SocketAddress serviceAddress, IoHandler handler, IoServiceConfig config )
    {
    }

    public void serviceDeactivated( IoService service, SocketAddress serviceAddress, IoHandler handler, IoServiceConfig config )
    {
    }

    public void sessionCreated( IoSession session )
    {
        try
        {
            IoSessionManager sessMgr = new IoSessionManager( session );
            MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();  
            ObjectName name = new ObjectName( "com.acme.test.session:type=IoSessionManager,name=" + session.getRemoteAddress().toString().replace( ':', '/' ) );
            mbs.registerMBean( sessMgr, name );
        }
        catch( JMException e )
        {
            logger.error( "JMX Exception: ", e );
        }      
    }

    public void sessionDestroyed( IoSession session )
    {
        try
        {
            ObjectName name = new ObjectName( "com.acme.test.session:type=IoSessionManager,name=" + session.getRemoteAddress().toString().replace( ':', '/' ) );
            ManagementFactory.getPlatformMBeanServer().unregisterMBean( name );
        }
        catch( JMException e )
        {
            logger.error( "JMX Exception: ", e );
        }      
    }
});
org.apache.mina.integration.ognl
org.apache.mina.statemachine
org.apache.mina.statemachine.annotation
org.apache.mina.statemachine.context
org.apache.mina.statemachine.event
org.apache.mina.statemachine.transition
org.apache.mina.transport
org.apache.mina.transport.socket
org.apache.mina.transport.socket.apr
org.apache.mina.transport.socket.nio Socket (TCP/IP) and Datagram (UDP/IP) support based on Java NIO (New I/O) API.

Configuring the number of NIO selector loops

You can specify the number of Socket I/O thread to utilize multi-processors efficiently by specifying the number of processing threads in the constructor. The default is 1

org.apache.mina.transport.vmpipe In-VM pipe support which removes the overhead of local loopback communication.

What is 'in-VM pipe'?

In-VM pipe is a direct event forwarding mechanism between two ProtocolHandlers in the same Java Virtual Machine. Using in-VM pipe, you can remove the overhead of encoding and decoding which is caused uselessly by local loopback network communication. Here are some useful situations possible:

  • SMTP server and SPAM filtering server,
  • web server and Servlet/JSP container.

Please refer to Tennis example.

org.apache.mina.util Miscellaneous utility classes
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.