Java Doc for ConnectionTableNIO.java in  » Net » JGroups-2.4.1-sp3 » org » jgroups » blocks » 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 » Net » JGroups 2.4.1 sp3 » org.jgroups.blocks 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.jgroups.blocks.BasicConnectionTable
      org.jgroups.blocks.ConnectionTableNIO

All known Subclasses:   org.jgroups.tests.ConnectionTableDemo_NIO,
ConnectionTableNIO
public class ConnectionTableNIO extends BasicConnectionTable implements Runnable(Code)
Manages incoming and outgoing TCP connections. For each outgoing message to destination P, if there is not yet a connection for P, one will be created. Subsequent outgoing messages will use this connection. For incoming messages, one server socket is created at startup. For each new incoming client connecting, a new thread from a thread pool is allocated and listens for incoming messages until the socket is closed by the peer.
Sockets/threads with no activity will be killed after some time.

Incoming messages from any of the sockets can be received by setting the message listener. We currently require use_incoming_packet_handler=true (release 2.4 will support use_incoming_packet_handler=false due to threadless stack support).
author:
   Bela Ban, Scott Marlow, Alex Fu


Inner Class :class Connection extends ConnectionTable.Connection
Inner Class :public static class SelectorWriteHandler
Inner Class :public static class WriteRequest

Field Summary
final protected static  LogLOG
    

Constructor Summary
public  ConnectionTableNIO(int srv_port)
    
public  ConnectionTableNIO(int srv_port, long reaper_interval, long conn_expire_time)
    
public  ConnectionTableNIO(Receiver r, InetAddress bind_addr, InetAddress external_addr, int srv_port, int max_port)
    
public  ConnectionTableNIO(Receiver r, InetAddress bind_addr, InetAddress external_addr, int srv_port, int max_port, boolean doStart)
    
public  ConnectionTableNIO(Receiver r, InetAddress bind_addr, InetAddress external_addr, int srv_port, int max_port, long reaper_interval, long conn_expire_time)
    
public  ConnectionTableNIO(Receiver r, InetAddress bind_addr, InetAddress external_addr, int srv_port, int max_port, long reaper_interval, long conn_expire_time, boolean doStart)
    

Method Summary
protected  ServerSocketcreateServerSocket(int start_port, int end_port)
     Finds first available port starting at start_port and returns server socket.
 ConnectionTable.ConnectiongetConnection(Address dest)
    
public  intgetProcessorKeepAliveTime()
    
public  intgetProcessorMaxThreads()
    
public  intgetProcessorMinThreads()
    
public  intgetProcessorQueueSize()
    
public  intgetProcessorThreads()
    
public  intgetReaderThreads()
    
public  intgetWriterThreads()
    
protected  voidinit()
    
public  voidrun()
     Acceptor thread.
protected  voidrunRequest(Address addr, ByteBuffer buf)
    
public  voidsetProcessorKeepAliveTime(int m_processor_keepAliveTime)
    
public  voidsetProcessorMaxThreads(int m_processor_maxThreads)
    
public  voidsetProcessorMinThreads(int m_processor_minThreads)
    
public  voidsetProcessorQueueSize(int m_processor_queueSize)
    
public  voidsetProcessorThreads(int m_processor_threads)
    
public  voidsetReaderThreads(int m_reader_threads)
    
public  voidsetWriterThreads(int m_writer_threads)
    
final public  voidstart()
    
public  voidstop()
    

Field Detail
LOG
final protected static Log LOG(Code)




Constructor Detail
ConnectionTableNIO
public ConnectionTableNIO(int srv_port) throws Exception(Code)

Parameters:
  srv_port -
throws:
  Exception -



ConnectionTableNIO
public ConnectionTableNIO(int srv_port, long reaper_interval, long conn_expire_time) throws Exception(Code)

Parameters:
  srv_port -
Parameters:
  reaper_interval -
Parameters:
  conn_expire_time -
throws:
  Exception -



ConnectionTableNIO
public ConnectionTableNIO(Receiver r, InetAddress bind_addr, InetAddress external_addr, int srv_port, int max_port) throws Exception(Code)

Parameters:
  r -
Parameters:
  bind_addr -
Parameters:
  external_addr -
Parameters:
  srv_port -
Parameters:
  max_port -
throws:
  Exception -



ConnectionTableNIO
public ConnectionTableNIO(Receiver r, InetAddress bind_addr, InetAddress external_addr, int srv_port, int max_port, boolean doStart) throws Exception(Code)



ConnectionTableNIO
public ConnectionTableNIO(Receiver r, InetAddress bind_addr, InetAddress external_addr, int srv_port, int max_port, long reaper_interval, long conn_expire_time) throws Exception(Code)

Parameters:
  r -
Parameters:
  bind_addr -
Parameters:
  external_addr -
Parameters:
  srv_port -
Parameters:
  max_port -
Parameters:
  reaper_interval -
Parameters:
  conn_expire_time -
throws:
  Exception -



ConnectionTableNIO
public ConnectionTableNIO(Receiver r, InetAddress bind_addr, InetAddress external_addr, int srv_port, int max_port, long reaper_interval, long conn_expire_time, boolean doStart) throws Exception(Code)




Method Detail
createServerSocket
protected ServerSocket createServerSocket(int start_port, int end_port) throws Exception(Code)
Finds first available port starting at start_port and returns server socket. Sets srv_port



getConnection
ConnectionTable.Connection getConnection(Address dest) throws Exception(Code)
Try to obtain correct Connection (or create one if not yet existent)



getProcessorKeepAliveTime
public int getProcessorKeepAliveTime()(Code)



getProcessorMaxThreads
public int getProcessorMaxThreads()(Code)



getProcessorMinThreads
public int getProcessorMinThreads()(Code)



getProcessorQueueSize
public int getProcessorQueueSize()(Code)



getProcessorThreads
public int getProcessorThreads()(Code)



getReaderThreads
public int getReaderThreads()(Code)



getWriterThreads
public int getWriterThreads()(Code)



init
protected void init() throws Exception(Code)



run
public void run()(Code)
Acceptor thread. Continuously accept new connections and assign readhandler/writehandler to them.



runRequest
protected void runRequest(Address addr, ByteBuffer buf) throws InterruptedException(Code)



setProcessorKeepAliveTime
public void setProcessorKeepAliveTime(int m_processor_keepAliveTime)(Code)



setProcessorMaxThreads
public void setProcessorMaxThreads(int m_processor_maxThreads)(Code)



setProcessorMinThreads
public void setProcessorMinThreads(int m_processor_minThreads)(Code)



setProcessorQueueSize
public void setProcessorQueueSize(int m_processor_queueSize)(Code)



setProcessorThreads
public void setProcessorThreads(int m_processor_threads)(Code)



setReaderThreads
public void setReaderThreads(int m_reader_threads)(Code)



setWriterThreads
public void setWriterThreads(int m_writer_threads)(Code)



start
final public void start() throws Exception(Code)



stop
public void stop()(Code)
Closes all open sockets, the server socket and all threads waiting for incoming messages



Fields inherited from org.jgroups.blocks.BasicConnectionTable
final static long MAX_JOIN_TIMEOUT(Code)(Java Doc)
Thread acceptor(Code)(Java Doc)
final static int backlog(Code)(Java Doc)
InetAddress bind_addr(Code)(Java Doc)
long conn_expire_time(Code)(Java Doc)
final Vector conn_listeners(Code)(Java Doc)
final HashMap conns(Code)(Java Doc)
final byte[] cookie(Code)(Java Doc)
InetAddress external_addr(Code)(Java Doc)
int linger(Code)(Java Doc)
Address local_addr(Code)(Java Doc)
final protected Log log(Code)(Java Doc)
int max_port(Code)(Java Doc)
Reaper reaper(Code)(Java Doc)
long reaper_interval(Code)(Java Doc)
Receiver receiver(Code)(Java Doc)
int recv_buf_size(Code)(Java Doc)
final Object recv_mutex(Code)(Java Doc)
boolean reuse_addr(Code)(Java Doc)
boolean running(Code)(Java Doc)
int send_buf_size(Code)(Java Doc)
int sock_conn_timeout(Code)(Java Doc)
int srv_port(Code)(Java Doc)
ServerSocket srv_sock(Code)(Java Doc)
boolean tcp_nodelay(Code)(Java Doc)
ThreadGroup thread_group(Code)(Java Doc)
boolean use_reaper(Code)(Java Doc)
boolean use_send_queues(Code)(Java Doc)

Methods inherited from org.jgroups.blocks.BasicConnectionTable
void addConnection(Address peer, Connection c)(Code)(Java Doc)
public void addConnectionListener(ConnectionListener l)(Code)(Java Doc)
abstract Connection getConnection(Address dest) throws Exception(Code)(Java Doc)
public int getLinger()(Code)(Java Doc)
public Address getLocalAddress()(Code)(Java Doc)
public int getNumConnections()(Code)(Java Doc)
public int getReceiveBufferSize()(Code)(Java Doc)
public int getSendBufferSize()(Code)(Java Doc)
public int getSocketConnectionTimeout()(Code)(Java Doc)
public boolean getTcpNodelay()(Code)(Java Doc)
public boolean getUseSendQueues()(Code)(Java Doc)
void notifyConnectionClosed(Address peer)(Code)(Java Doc)
void notifyConnectionOpened(Address peer)(Code)(Java Doc)
public void receive(Address sender, byte[] data, int offset, int length)(Code)(Java Doc)
public void remove(Address addr)(Code)(Java Doc)
public void removeConnectionListener(ConnectionListener l)(Code)(Java Doc)
public void retainAll(Collection current_mbrs)(Code)(Java Doc)
public void send(Address dest, byte[] data, int offset, int length) throws Exception(Code)(Java Doc)
public void setLinger(int linger)(Code)(Java Doc)
public void setReceiveBufferSize(int recv_buf_size)(Code)(Java Doc)
final public void setReceiver(Receiver r)(Code)(Java Doc)
public void setSendBufferSize(int send_buf_size)(Code)(Java Doc)
public void setSocketConnectionTimeout(int sock_conn_timeout)(Code)(Java Doc)
public void setTcpNodelay(boolean tcp_nodelay)(Code)(Java Doc)
public void setUseSendQueues(boolean flag)(Code)(Java Doc)
public void start() throws Exception(Code)(Java Doc)
public void stop()(Code)(Java Doc)
public String toString()(Code)(Java Doc)

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.