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

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

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

revision 1.4 by mkoch, Mon Nov 11 16:19:30 2002 UTC revision 1.5 by mkoch, Wed Nov 13 07:27:52 2002 UTC
# Line 37  exception statement from your version. * Line 37  exception statement from your version. *
37    
38  package java.nio.channels.spi;  package java.nio.channels.spi;
39    
40    import java.io.IOException;
41  import java.nio.channels.SelectionKey;  import java.nio.channels.SelectionKey;
42  import java.nio.channels.Selector;  import java.nio.channels.Selector;
43  import java.util.List;  import java.util.List;
# Line 44  import java.util.Set; Line 45  import java.util.Set;
45    
46  public abstract class AbstractSelector extends Selector  public abstract class AbstractSelector extends Selector
47  {  {
48    boolean closed = true;    boolean closed = false;
49    SelectorProvider provider;    SelectorProvider provider;
50    
51      /**
52       * Initializes the slector.
53       */
54    protected AbstractSelector (SelectorProvider provider)    protected AbstractSelector (SelectorProvider provider)
55    {    {
56      this.provider = provider;      this.provider = provider;
57    }    }
58    
59      /**
60       * Marks the beginning of an I/O operation that might block indefinitely.
61       */
62    protected final void begin ()    protected final void begin ()
63    {    {
64    }    }
65    
66    public final void close ()    /**
67       * Closes the channel.
68       *
69       * @exception IOException If an error occurs
70       */
71      public final void close () throws IOException
72    {    {
73      if (closed)      if (closed)
74        return;        return;
75        
76      closed = true;      closed = true;
77      implCloseSelector ();      implCloseSelector ();
78    }    }
79    
80      /**
81       * Tells whether this channel is open or not.
82       */
83    public final boolean isOpen ()    public final boolean isOpen ()
84    {    {
85      return ! closed;      return ! closed;
# Line 88  public abstract class AbstractSelector e Line 104  public abstract class AbstractSelector e
104      return null;      return null;
105    }    }
106    
107    protected abstract void implCloseSelector ();    /**
108       * Closes the channel.
109       */
110      protected abstract void implCloseSelector () throws IOException;
111    
112    protected abstract SelectionKey register (AbstractSelectableChannel ch,    protected abstract SelectionKey register (AbstractSelectableChannel ch,
113                                              int ops, Object att);                                                int ops, Object att);  
114  }  }

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

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