Java Doc for AbstractSelectableChannel.java in  » 6.0-JDK-Core » io-nio » java » nio » channels » spi » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Home
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
26.ERP CRM Financial
27.ESB
28.Forum
29.Game
30.GIS
31.Graphic 3D
32.Graphic Library
33.Groupware
34.HTML Parser
35.IDE
36.IDE Eclipse
37.IDE Netbeans
38.Installer
39.Internationalization Localization
40.Inversion of Control
41.Issue Tracking
42.J2EE
43.J2ME
44.JBoss
45.JMS
46.JMX
47.Library
48.Mail Clients
49.Music
50.Net
51.Parser
52.PDF
53.Portal
54.Profiler
55.Project Management
56.Report
57.RSS RDF
58.Rule Engine
59.Science
60.Scripting
61.Search Engine
62.Security
63.Sevlet Container
64.Source Control
65.Swing Library
66.Template Engine
67.Test Coverage
68.Testing
69.UML
70.Web Crawler
71.Web Framework
72.Web Mail
73.Web Server
74.Web Services
75.Web Services apache cxf 2.2.6
76.Web Services AXIS2
77.Wiki Engine
78.Workflow Engines
79.XML
80.XML UI
Java Source Code / Java Documentation » 6.0 JDK Core » io nio » java.nio.channels.spi 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   java.nio.channels.spi.AbstractInterruptibleChannel
      java.nio.channels.SelectableChannel
         java.nio.channels.spi.AbstractSelectableChannel

All known Subclasses:   java.nio.channels.DatagramChannel,  java.nio.channels.SocketChannel,  java.nio.channels.ServerSocketChannel,
AbstractSelectableChannel
abstract public class AbstractSelectableChannel extends SelectableChannel (Code)
Base implementation class for selectable channels.

This class defines methods that handle the mechanics of channel registration, deregistration, and closing. It maintains the current blocking mode of this channel as well as its current set of selection keys. It performs all of the synchronization required to implement the java.nio.channels.SelectableChannel specification. Implementations of the abstract protected methods defined in this class need not synchronize against other threads that might be engaged in the same operations.


author:
   Mark Reinhold
author:
   Mike McCloskey
author:
   JSR-51 Expert Group
version:
   1.32, 07/05/05
since:
   1.4


Field Summary
 booleanblocking
    

Constructor Summary
protected  AbstractSelectableChannel(SelectorProvider provider)
     Initializes a new instance of this class.

Method Summary
final public  ObjectblockingLock()
    
final public  SelectableChannelconfigureBlocking(boolean block)
     Adjusts this channel's blocking mode.

If the given blocking mode is different from the current blocking mode then this method invokes the AbstractSelectableChannel.implConfigureBlockingimplConfigureBlocking method, while holding the appropriate locks, in order to change the mode.

final protected  voidimplCloseChannel()
     Closes this channel.

This method, which is specified in the AbstractInterruptibleChannel class and is invoked by the java.nio.channels.Channel.close close method, in turn invokes the AbstractSelectableChannel.implCloseSelectableChannel implCloseSelectableChannel method in order to perform the actual work of closing this channel.

abstract protected  voidimplCloseSelectableChannel()
     Closes this selectable channel.

This method is invoked by the java.nio.channels.Channel.closeclose method in order to perform the actual work of closing the channel.

abstract protected  voidimplConfigureBlocking(boolean block)
     Adjusts this channel's blocking mode.

This method is invoked by the AbstractSelectableChannel.configureBlockingconfigureBlocking method in order to perform the actual work of changing the blocking mode.

final public  booleanisBlocking()
    
final public  booleanisRegistered()
    
final public  SelectionKeykeyFor(Selector sel)
    
final public  SelectorProviderprovider()
     Returns the provider that created this channel.
final public  SelectionKeyregister(Selector sel, int ops, Object att)
     Registers this channel with the given selector, returning a selection key.

This method first verifies that this channel is open and that the given initial interest set is valid.

If this channel is already registered with the given selector then the selection key representing that registration is returned after setting its interest set to the given value.

Otherwise this channel has not yet been registered with the given selector, so the AbstractSelector.register register method of the selector is invoked while holding the appropriate locks.

 voidremoveKey(SelectionKey k)
    

Field Detail
blocking
boolean blocking(Code)




Constructor Detail
AbstractSelectableChannel
protected AbstractSelectableChannel(SelectorProvider provider)(Code)
Initializes a new instance of this class.




Method Detail
blockingLock
final public Object blockingLock()(Code)



configureBlocking
final public SelectableChannel configureBlocking(boolean block) throws IOException(Code)
Adjusts this channel's blocking mode.

If the given blocking mode is different from the current blocking mode then this method invokes the AbstractSelectableChannel.implConfigureBlockingimplConfigureBlocking method, while holding the appropriate locks, in order to change the mode.




implCloseChannel
final protected void implCloseChannel() throws IOException(Code)
Closes this channel.

This method, which is specified in the AbstractInterruptibleChannel class and is invoked by the java.nio.channels.Channel.close close method, in turn invokes the AbstractSelectableChannel.implCloseSelectableChannel implCloseSelectableChannel method in order to perform the actual work of closing this channel. It then cancels all of this channel's keys.




implCloseSelectableChannel
abstract protected void implCloseSelectableChannel() throws IOException(Code)
Closes this selectable channel.

This method is invoked by the java.nio.channels.Channel.closeclose method in order to perform the actual work of closing the channel. This method is only invoked if the channel has not yet been closed, and it is never invoked more than once.

An implementation of this method must arrange for any other thread that is blocked in an I/O operation upon this channel to return immediately, either by throwing an exception or by returning normally.




implConfigureBlocking
abstract protected void implConfigureBlocking(boolean block) throws IOException(Code)
Adjusts this channel's blocking mode.

This method is invoked by the AbstractSelectableChannel.configureBlockingconfigureBlocking method in order to perform the actual work of changing the blocking mode. This method is only invoked if the new mode is different from the current mode.


throws:
  IOException - If an I/O error occurs



isBlocking
final public boolean isBlocking()(Code)



isRegistered
final public boolean isRegistered()(Code)



keyFor
final public SelectionKey keyFor(Selector sel)(Code)



provider
final public SelectorProvider provider()(Code)
Returns the provider that created this channel. The provider that created this channel



register
final public SelectionKey register(Selector sel, int ops, Object att) throws ClosedChannelException(Code)
Registers this channel with the given selector, returning a selection key.

This method first verifies that this channel is open and that the given initial interest set is valid.

If this channel is already registered with the given selector then the selection key representing that registration is returned after setting its interest set to the given value.

Otherwise this channel has not yet been registered with the given selector, so the AbstractSelector.register register method of the selector is invoked while holding the appropriate locks. The resulting key is added to this channel's key set before being returned.




removeKey
void removeKey(SelectionKey k)(Code)



Methods inherited from java.nio.channels.SelectableChannel
abstract public Object blockingLock()(Code)(Java Doc)
abstract public SelectableChannel configureBlocking(boolean block) throws IOException(Code)(Java Doc)
abstract public boolean isBlocking()(Code)(Java Doc)
abstract public boolean isRegistered()(Code)(Java Doc)
abstract public SelectionKey keyFor(Selector sel)(Code)(Java Doc)
abstract public SelectorProvider provider()(Code)(Java Doc)
abstract public SelectionKey register(Selector sel, int ops, Object att) throws ClosedChannelException(Code)(Java Doc)
final public SelectionKey register(Selector sel, int ops) throws ClosedChannelException(Code)(Java Doc)
abstract public int validOps()(Code)(Java Doc)

Methods inherited from java.nio.channels.spi.AbstractInterruptibleChannel
final protected void begin()(Code)(Java Doc)
static void blockedOn(Interruptible intr)(Code)(Java Doc)
final public void close() throws IOException(Code)(Java Doc)
final protected void end(boolean completed) throws AsynchronousCloseException(Code)(Java Doc)
abstract protected void implCloseChannel() throws IOException(Code)(Java Doc)
final public boolean isOpen()(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.