1 |
/* AbstractInterruptibleChannel.java |
/* AbstractInterruptibleChannel.java -- |
2 |
Copyright (C) 2002 Free Software Foundation, Inc. |
Copyright (C) 2002 Free Software Foundation, Inc. |
3 |
|
|
4 |
This file is part of GNU Classpath. |
This file is part of GNU Classpath. |
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.nio.channels.*; |
import java.io.IOException; |
41 |
import java.io.*; |
import java.nio.channels.Channel; |
42 |
|
import java.nio.channels.InterruptibleChannel; |
43 |
|
|
44 |
abstract public class AbstractInterruptibleChannel implements Channel, InterruptibleChannel |
public abstract class AbstractInterruptibleChannel |
45 |
|
implements Channel, InterruptibleChannel |
46 |
{ |
{ |
47 |
boolean opened = false; |
boolean opened = false; |
48 |
|
|
49 |
protected AbstractInterruptibleChannel() |
protected AbstractInterruptibleChannel() |
50 |
{ |
{ |
51 |
} |
} |
52 |
|
|
53 |
|
protected final void begin() |
54 |
protected void begin() |
{ |
55 |
{ |
// Marks the beginning of an I/O operation that might block indefinitely. |
56 |
// Marks the beginning of an I/O operation that might block indefinitely. |
} |
|
} |
|
57 |
|
|
58 |
public void close() throws IOException |
public final void close() throws IOException |
59 |
{ |
{ |
60 |
//Closes this channel. |
// Closes this channel. |
61 |
implCloseChannel(); |
implCloseChannel(); |
62 |
} |
} |
63 |
|
|
64 |
protected void end(boolean completed) |
protected final void end(boolean completed) |
65 |
{ |
{ |
66 |
//Marks the end of an I/O operation that might block indefinitely. |
// Marks the end of an I/O operation that might block indefinitely. |
67 |
} |
} |
68 |
|
|
69 |
protected abstract void implCloseChannel() throws IOException; |
protected abstract void implCloseChannel() throws IOException; |
70 |
|
|
71 |
public boolean isOpen() |
public final boolean isOpen() |
72 |
{ |
{ |
73 |
//Tells whether or not this channel is open. |
// Tells whether or not this channel is open. |
74 |
return opened; |
return opened; |
75 |
} |
} |
76 |
} |
} |
77 |
|
|