Programming Tutorials Browser Tutorials Articles Struts Tutorials Hibernate Tutorials

  Tutorial: Building Highly Scalable Servers with Java NIO

Building Highly Scalable Servers with Java NIO I/O Event Handling The I/O architecture of our router was strongly inspired by the Swing event-dispatch model. In Swing, events generated by the user interface are received by the JVM and stored in an even

Tutorial Details:

In our router, there is also an event dispatch thread, implemented in the class SelectorThread. As the name suggests, this class encapsulates a selector and a thread. The thread monitors the selector, waiting for incoming I/O events and dispatching them to the appropriate handlers.

The SelectorThread class generates four types of events, corresponding to the operations defined on java.nio.channels.SelectionKey: connect, accept, read, and write. Handlers register with the SelectorThread class to receive events. Depending on the type of events they are interested in, they must implement one of the following interfaces:

ConnectSelectorHandler: For establishing outgoing connections.
AcceptSelectorHandler: For receiving incoming connections.
ReadWriteSelectorHandler: For reading or writing data to a connection.


 

Read Tutorial at: Click here to view the tutorial

Rate Tutorial:
Building Highly Scalable Servers with Java NIO

View Tutorial:
Building Highly Scalable Servers with Java NIO

Related Tutorials:

Make room for JavaSpaces, Part 2 - JavaWorld January 2000
Make room for JavaSpaces, Part 2 - JavaWorld January 2000
 
JMS: An infrastructure for XML-based business-to-business communication - JavaWorld February 2000
JMS: An infrastructure for XML-based business-to-business communication - JavaWorld February 2000
 
Choosing an enterprise-wide standard Java IDE - JavaWorld March 2000
Choosing an enterprise-wide standard Java IDE - JavaWorld March 2000
 
J2SE 1.4 breathes new life into the CORBA community, Part 1
J2SE 1.4 breathes new life into the CORBA community, Part 1
 
Sun boosts
Sun boosts enterprise Java
 
Use select for high-speed networking
Use select for high-speed networking
 
Add concurrent processing with message-driven beans
Add concurrent processing with message-driven beans
 
NIO Tutorials
NIO Tutorials Introduction In the words of Gregory Pierce, "NIO is one of the most important but least understood APIs that came along for the ride with JDK1.4". Couldn't have put it better myself :). The aim of this series of articles is to help you
 
Servlet and JSP performance tuning
Servlet and JSP performance tuning This article describes performance-tuning techniques (PTT) for developing high performance and scalable JSP (JavaServer Pages) pages and servlets. That means building applications that are reasonably and consistently fa
 
Put JSF to work
Build a real-world Web application with JavaServer Faces, the Spring Framework, and Hibernate Summary Building a real-world Web application using JavaServer Faces is not a trivial task. This article shows you how to integrate JSF, the Spring Framewor
 
Turn EJB components into Web services
Summary Web services have become the de facto standard for communication among applications. J2EE 1.4 allows stateless Enterprise JavaBeans (EJB) components to be exposed as Web services via a JAX-RPC (Java API for XML Remote Procedure Call) endpoint, al
 
Building Highly Scalable Servers with Java NIO
Building Highly Scalable Servers with Java NIO I/O Event Handling The I/O architecture of our router was strongly inspired by the Swing event-dispatch model. In Swing, events generated by the user interface are received by the JVM and stored in an even
 
Use SWT Listener Classes Effectively for Responsive Java UIs
Use SWT Listener Classes Effectively for Responsive Java UIs Understanding the SWT listener classes and their usage is essential to building complex, highly responsive user interfaces for Java applications. The listener classes in SWT are classified into
 
Using SSL with Non-Blocking IO
Using SSL with Non-Blocking IO After the initial experiments with Java NIO, most developers start wondering about security; in particular, how to use SSL with Java NIO. With the traditional blocking sockets API, security is a simple issue: just set up an
 
Memory Contention in J2EE Applications for Multiprocessor Platforms
Memory Contention in J2EE Applications for Multiprocessor Platforms. With the need for highly scalable J2EE applications in the enterprise environment, parallel processing of threads is required on multi-processor platforms. The memory requirements in th
 
Lucene in Action
Lucene in Action Lucene is a gem in the open-source world--a highly scalable, fast search engine. It delivers performance and is disarmingly easy to use. Lucene in Action is the authoritative guide to Lucene. It describes how to index your data, includin
 
What is Persistence Framework?
What is Persistence Framework? What is Persistence Framework? A persistence framework moves the program data in its most natural form (in memory objects) to and from a permanent data store the database. The persistence framework manages the
 
Introduction To Enterprise Java Bean(EJB). WebLogic 6.0 Tutorial.
Introduction To Enterprise Java Bean(EJB). WebLogic 6.0 Tutorial. Welcome to EJB Section (Learn to Develop World Class Applications with Enterprise Java Beans) (Online WebLogic 6.0 Tutorial) Introduction To Enterprise Java Bean(EJB) Enterprise
 
Building Search Engine Applications Using Servlets !
Building Search Engine Applications Using Servlets ! Building Search Engine Applications Using Servlets Please visit http://www.webappcabaret.com/javadevelopers/search to see running copy of our search engine. Introduction This tutorial takes
 
News: World Records Broken with Sun Studio 10 Software and the Solaris 10 OS
Sun submits new performance world record for Sun Studio 10 compilers and the Solaris 10 operating system.
 
Site navigation
 

 

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2006. All rights reserved.