/[classpath]/classpath/java/nio/channels/spi/AbstractSelectableChannel.java
ViewVC logotype

Diff of /classpath/java/nio/channels/spi/AbstractSelectableChannel.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by egagnon, Sun Aug 11 20:08:43 2002 UTC revision 1.4 by mkoch, Mon Nov 11 14:25:46 2002 UTC
# Line 35  this exception to your version of the li Line 35  this exception to your version of the li
35  obligated to do so.  If you do not wish to do so, delete this  obligated to do so.  If you do not wish to do so, delete this
36  exception statement from your version. */  exception statement from your version. */
37    
   
38  package java.nio.channels.spi;  package java.nio.channels.spi;
39    
40  import java.io.*;  import java.io.IOException;
41  import java.util.*;  import java.nio.channels.SelectableChannel;
42  import java.nio.channels.*;  import java.nio.channels.ClosedChannelException;
43    import java.util.List;
44    
45  public abstract class AbstractSelectableChannel extends SelectableChannel  public abstract class AbstractSelectableChannel extends SelectableChannel
46  {  {
47      int registered;     int registered;
48      boolean blocking = true;      boolean blocking = true;
49      Object LOCK = new Object();      Object LOCK = new Object();
50      SelectorProvider sprovider;      SelectorProvider sprovider;
# Line 54  public abstract class AbstractSelectable Line 54  public abstract class AbstractSelectable
54      protected abstract  void implCloseSelectableChannel();      protected abstract  void implCloseSelectableChannel();
55      protected abstract  void implConfigureBlocking(boolean block);      protected abstract  void implConfigureBlocking(boolean block);
56    
57        public final Object blockingLock()
     public Object blockingLock()  
58      {      {
59          return LOCK;          return LOCK;
60          //Retrieves the object upon which the configureBlocking and register methods synchronize.          //Retrieves the object upon which the configureBlocking and register methods synchronize.
61      }      }
62            
63      public SelectableChannel configureBlocking(boolean block)      public final SelectableChannel configureBlocking(boolean block)
64      {      {
65          synchronized(LOCK)          synchronized(LOCK)
66              {              {
# Line 72  public abstract class AbstractSelectable Line 71  public abstract class AbstractSelectable
71          return this;          return this;
72      }      }
73    
74      protected  void implCloseChannel()      protected final void implCloseChannel()
75      {      {
76          //     Closes this channel.          //     Closes this channel.
77          implCloseSelectableChannel();          implCloseSelectableChannel();
78      }      }
79    
80    
81      public boolean isBlocking()      public final boolean isBlocking()
82      {      {
83          return blocking;          return blocking;
84          //Tells whether or not every I/O operation on this channel will block until it completes.            //Tells whether or not every I/O operation on this channel will block until it completes.  
85      }      }
86    
87    
88      public boolean isRegistered()      public final boolean isRegistered()
89      {      {
90          //Tells whether or not this channel is currently registered with any selectors.          //Tells whether or not this channel is currently registered with any selectors.
91          return registered > 0;          return registered > 0;
# Line 102  public abstract class AbstractSelectable Line 101  public abstract class AbstractSelectable
101          }          }
102      }      }
103    
104      public SelectorProvider provider()      public final SelectorProvider provider()
105      {      {
106          //     Returns the provider that created this channel.            //     Returns the provider that created this channel.  
107          return sprovider;          return sprovider;
# Line 133  public abstract class AbstractSelectable Line 132  public abstract class AbstractSelectable
132          keys.add(k);          keys.add(k);
133      }      }
134    
135      public SelectionKey register(Selector selin,      public final SelectionKey register(Selector selin, int ops, Object att) throws ClosedChannelException
                                  int ops,  
                                  Object att) throws java.nio.channels.ClosedChannelException  
   
   
136      {      {
137          if (!isOpen())          if (!isOpen())
138              {              {

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26