Groovy

Just another WordPress.com weblog

apache mina 2.x

Posted by groovy on 10월 14, 2011

3-layer

  • I/O Service - Performs actual I/O
  • I/O Filter Chain - Filters/Transforms bytes into desired Data Structures and vice-versa
  • I/O Handler - Here resides the actual business logic

create mina application process

  • Create I/O service - Choose from already available Services (*Acceptor) or create your own
  • Create Filter Chain - Choose from already existing Filters or create a custom Filter for transforming request/response
  • Create I/O Handler - Write business logic, on handling different messages
    Creating a MINA application is this simple

서버 및 클라이언트 아키텍쳐

Service

  •  Server - IoAcceptor implement
  • client -IoConnector implement

 

  Session

client 가  server 에 접속시 생성되며,  disconected 하기전까지 메모리에 상주한다.

  • Connected : the session has been created and is available
  • Idle : the session hasn’t processed any request for at least a period of time (this period is configurable)
    • Idle for read : no read has actually been made for a period of time
    • Idle for write : no write has actually been made for a period of time
    • Idle for both : no read nor write for a period of time
  • Closing : the session is being closed (the remaining messages are being flushed, cleaning up is not terminated)
  • Closed : The session is now closed, nothing else can be done to revive it.

IOBuffer

  •  Buffers are just buffers
  • ByteBuffer의 wrapper 객체인 IOBuffer는 3.x에 대폭 수정되거나,  deprecated 될것으로 보여진다.
  • Assuming that the MINA ByteBuffer is just a wrapper on top of NIO ByteBuffer, this can be a real problem when using direct buffers.

 

 

댓글 남기기

아래 항목을 채우거나 오른쪽 아이콘 중 하나를 클릭하여 로그 인 하세요:

WordPress.com 로고

WordPress.com의 계정을 사용하여 댓글을 남깁니다. Log Out / 변경 )

Twitter picture

Twitter의 계정을 사용하여 댓글을 남깁니다. Log Out / 변경 )

Facebook 사진

Facebook의 계정을 사용하여 댓글을 남깁니다. Log Out / 변경 )

%s에 연결하는 중

 
팔로우

Get every new post delivered to your Inbox.