Java Doc for IoAcceptor.java in  » Net » mina-2.0.0-M1 » org » apache » mina » common » 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 » mina 2.0.0 M1 » org.apache.mina.common 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.apache.mina.common.IoAcceptor

All known Subclasses:   org.apache.mina.common.AbstractIoAcceptor,
IoAcceptor
public interface IoAcceptor extends IoService(Code)
Accepts incoming connection, communicates with clients, and fires events to IoHandler s.

Please refer to EchoServer example.

You should bind to the desired socket address to accept incoming connections, and then events for incoming connections will be sent to the specified default IoHandler .

Threads accept incoming connections start automatically when IoAcceptor.bind() is invoked, and stop when IoAcceptor.unbind() is invoked.
author:
   The Apache MINA Project (dev@mina.apache.org)
version:
   $Rev: 601229 $, $Date: 2007-12-05 00:13:18 -0700 (Wed, 05 Dec 2007) $





Method Summary
 voidbind()
     Binds to the default local address(es) and start to accept incoming connections.
 voidbind(SocketAddress localAddress)
     Binds to the specified local address and start to accept incoming connections.
 voidbind(SocketAddress firstLocalAddress, SocketAddress... otherLocalAddresses)
     Binds to the specified local addresses and start to accept incoming connections.
 voidbind(Iterable<? extends SocketAddress> localAddresses)
     Binds to the specified local addresses and start to accept incoming connections.
 SocketAddressgetDefaultLocalAddress()
     Returns the default local address to bind when no argument is specified in IoAcceptor.bind() method.
 List<SocketAddress>getDefaultLocalAddresses()
     Returns a List of the default local addresses to bind when no argument is specified in IoAcceptor.bind() method.
 SocketAddressgetLocalAddress()
     Returns the local address which is bound currently.
 Set<SocketAddress>getLocalAddresses()
     Returns a Set of the local addresses which are bound currently.
 booleanisCloseOnDeactivation()
     Returns true if and only if all clients are closed when this acceptor unbinds from all the related local address (i.e.
 IoSessionnewSession(SocketAddress remoteAddress, SocketAddress localAddress)
     (Optional) Returns an IoSession that is bound to the specified localAddress and the specified remoteAddress which reuses the local address that is already bound by this service.

This operation is optional.

 voidsetCloseOnDeactivation(boolean closeOnDeactivation)
     Sets whether all client sessions are closed when this acceptor unbinds from all the related local addresses (i.e.
 voidsetDefaultLocalAddress(SocketAddress localAddress)
     Sets the default local address to bind when no argument is specified in IoAcceptor.bind() method.
 voidsetDefaultLocalAddresses(SocketAddress firstLocalAddress, SocketAddress... otherLocalAddresses)
     Sets the default local addresses to bind when no argument is specified in IoAcceptor.bind() method.
 voidsetDefaultLocalAddresses(Iterable<? extends SocketAddress> localAddresses)
     Sets the default local addresses to bind when no argument is specified in IoAcceptor.bind() method.
 voidsetDefaultLocalAddresses(List<? extends SocketAddress> localAddresses)
     Sets the default local addresses to bind when no argument is specified in IoAcceptor.bind() method.
 voidunbind()
     Unbinds from all local addresses that this service is bound to and stops to accept incoming connections.
 voidunbind(SocketAddress localAddress)
     Unbinds from the specified local address and stop to accept incoming connections.
 voidunbind(SocketAddress firstLocalAddress, SocketAddress... otherLocalAddresses)
     Unbinds from the specified local addresses and stop to accept incoming connections.
 voidunbind(Iterable<? extends SocketAddress> localAddresses)
     Unbinds from the specified local addresses and stop to accept incoming connections.



Method Detail
bind
void bind() throws IOException(Code)
Binds to the default local address(es) and start to accept incoming connections.
throws:
  IOException - if failed to bind



bind
void bind(SocketAddress localAddress) throws IOException(Code)
Binds to the specified local address and start to accept incoming connections.
throws:
  IOException - if failed to bind



bind
void bind(SocketAddress firstLocalAddress, SocketAddress... otherLocalAddresses) throws IOException(Code)
Binds to the specified local addresses and start to accept incoming connections.
throws:
  IOException - if failed to bind



bind
void bind(Iterable<? extends SocketAddress> localAddresses) throws IOException(Code)
Binds to the specified local addresses and start to accept incoming connections.
throws:
  IOException - if failed to bind



getDefaultLocalAddress
SocketAddress getDefaultLocalAddress()(Code)
Returns the default local address to bind when no argument is specified in IoAcceptor.bind() method. Please note that the default will not be used if any local address is specified. If more than one address are set, only one of them will be returned, but it's not necessarily the firstly specified address in IoAcceptor.setDefaultLocalAddresses(List) .



getDefaultLocalAddresses
List<SocketAddress> getDefaultLocalAddresses()(Code)
Returns a List of the default local addresses to bind when no argument is specified in IoAcceptor.bind() method. Please note that the default will not be used if any local address is specified.



getLocalAddress
SocketAddress getLocalAddress()(Code)
Returns the local address which is bound currently. If more than one address are bound, only one of them will be returned, but it's not necessarily the firstly bound address.



getLocalAddresses
Set<SocketAddress> getLocalAddresses()(Code)
Returns a Set of the local addresses which are bound currently.



isCloseOnDeactivation
boolean isCloseOnDeactivation()(Code)
Returns true if and only if all clients are closed when this acceptor unbinds from all the related local address (i.e. when the service is deactivated).



newSession
IoSession newSession(SocketAddress remoteAddress, SocketAddress localAddress)(Code)
(Optional) Returns an IoSession that is bound to the specified localAddress and the specified remoteAddress which reuses the local address that is already bound by this service.

This operation is optional. Please throw UnsupportedOperationException if the transport type doesn't support this operation. This operation is usually implemented for connectionless transport types.
throws:
  UnsupportedOperationException - if this operation is not supported
throws:
  IllegalStateException - if this service is not running.
throws:
  IllegalArgumentException - if this service is not bound to thespecified localAddress.




setCloseOnDeactivation
void setCloseOnDeactivation(boolean closeOnDeactivation)(Code)
Sets whether all client sessions are closed when this acceptor unbinds from all the related local addresses (i.e. when the service is deactivated). The default value is true.



setDefaultLocalAddress
void setDefaultLocalAddress(SocketAddress localAddress)(Code)
Sets the default local address to bind when no argument is specified in IoAcceptor.bind() method. Please note that the default will not be used if any local address is specified.



setDefaultLocalAddresses
void setDefaultLocalAddresses(SocketAddress firstLocalAddress, SocketAddress... otherLocalAddresses)(Code)
Sets the default local addresses to bind when no argument is specified in IoAcceptor.bind() method. Please note that the default will not be used if any local address is specified.



setDefaultLocalAddresses
void setDefaultLocalAddresses(Iterable<? extends SocketAddress> localAddresses)(Code)
Sets the default local addresses to bind when no argument is specified in IoAcceptor.bind() method. Please note that the default will not be used if any local address is specified.



setDefaultLocalAddresses
void setDefaultLocalAddresses(List<? extends SocketAddress> localAddresses)(Code)
Sets the default local addresses to bind when no argument is specified in IoAcceptor.bind() method. Please note that the default will not be used if any local address is specified.



unbind
void unbind()(Code)
Unbinds from all local addresses that this service is bound to and stops to accept incoming connections. All managed connections will be closed if IoAcceptor.setCloseOnDeactivation(boolean) disconnectOnUnbind property is true. This method returns silently if no local address is bound yet.



unbind
void unbind(SocketAddress localAddress)(Code)
Unbinds from the specified local address and stop to accept incoming connections. All managed connections will be closed if IoAcceptor.setCloseOnDeactivation(boolean) disconnectOnUnbind property is true. This method returns silently if the default local address is not bound yet.



unbind
void unbind(SocketAddress firstLocalAddress, SocketAddress... otherLocalAddresses)(Code)
Unbinds from the specified local addresses and stop to accept incoming connections. All managed connections will be closed if IoAcceptor.setCloseOnDeactivation(boolean) disconnectOnUnbind property is true. This method returns silently if the default local addresses are not bound yet.



unbind
void unbind(Iterable<? extends SocketAddress> localAddresses)(Code)
Unbinds from the specified local addresses and stop to accept incoming connections. All managed connections will be closed if IoAcceptor.setCloseOnDeactivation(boolean) disconnectOnUnbind property is true. This method returns silently if the default local addresses are not bound yet.



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.