java.lang.Objectjava.nio.channels.spi.AbstractInterruptibleChannel
public abstract class AbstractInterruptibleChannel
Base implementation class for interruptible channels.
This class encapsulates the low-level machinery required to implement
the asynchronous closing and interruption of channels. A concrete channel
class must invoke the The completed argument to the A concrete channel class must also implement the This class performs the synchronization required to implement the
begin and end methods
before and after, respectively, invoking an I/O operation that might block
indefinitely. In order to ensure that the end method is always
invoked, these methods should be used within a
try ... finally block:
end method tells
whether or not the I/O operation actually completed, that is, whether it had
any effect that would be visible to the invoker. In the case of an
operation that reads bytes, for example, this argument should be
true if, and only if, some bytes were actually transferred into the
invoker's target buffer.
implCloseChannel method in such a way that if it is
invoked while another thread is blocked in a native I/O operation upon the
channel then that operation will immediately return, either by throwing an
exception or by returning normally. If a thread is interrupted or the
channel upon which it is blocked is asynchronously closed then the channel's
end method will throw the appropriate exception.
Channel specification. Implementations of the implCloseChannel method need not synchronize against
other threads that might be attempting to close the channel.
| Constructor Summary | |
|---|---|
protected |
AbstractInterruptibleChannel()
Initializes a new instance of this class. |
| Method Summary | |
|---|---|
protected void |
begin()
Marks the beginning of an I/O operation that might block indefinitely. |
void |
close()
Closes this channel. |
protected void |
end(boolean completed)
Marks the end of an I/O operation that might block indefinitely. |
protected abstract void |
implCloseChannel()
Closes this channel. |
boolean |
isOpen()
Tells whether or not this channel is open. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected AbstractInterruptibleChannel()
| Method Detail |
|---|
public final void close()
throws IOException
If the channel has already been closed then this method returns
immediately. Otherwise it marks the channel as closed and then invokes
the implCloseChannel method in order to
complete the close operation.
IOException - If an I/O error occurs
protected abstract void implCloseChannel()
throws IOException
This method is invoked by the close 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.
IOException - If an I/O error occurs while closing the channelpublic final boolean isOpen()
Channel
protected final void begin()
This method should be invoked in tandem with the end
method, using a try ... finally block as
shown above, in order to implement asynchronous
closing and interruption for this channel.
protected final void end(boolean completed)
throws AsynchronousCloseException
This method should be invoked in tandem with the begin method, using a try ... finally block
as shown above, in order to implement asynchronous
closing and interruption for this channel.
completed - true if, and only if, the I/O operation completed
successfully, that is, had some effect that would be visible to
the operation's invoker
AsynchronousCloseException - If the channel was asynchronously closed
ClosedByInterruptException - If the thread blocked in the I/O operation was interruptedCes informations proviennent du site de http://java.sun.com
Le contenu de cette page provient du site de Sun, et est généré depuis un cache sur l'infobrol après certains traitements automatisés. La présentation peut donc différer du document original, mais le contenu aussi. Vous pouvez utiliser ce bouton pour afficher la page originale du site de Sun :
Maintenir les pages en cache sur différents sites peut offrir plus de disponibilité.
Chaque page est indexée dans la base de donnée, ce qui permet de retrouver facilement les informations, au moyen des sommaires, du moteur de recherche interne, etc.
Des facilités sont mises en place pour que les membres de l'infobrol puissent effectuer des traductions en français des différents documents. Ceci devrait permettre aux débutants en programmation Java de consulter les API en français s'ils maîtrisent moins bien la langue de Shakespeare. Dans le cas où une traduction a été soumise, elle est disponible au moyen d'un lien en bas de page. Si la traduction a été validée, la page s'affiche par défaut en français, et un lien en bas de page permet d'atteindre la version en anglais.
Le code sur l'infobrol est automatiquement coloré selon la syntaxe, et les différents mots clés sont transformés en liens pour accéder rapidement aux informations.
Vous avez la possibilité de partager vos expériences en proposant vos propres extraits de code en utilisant le bouton "ajouter un commentaire" en bas de page. Si vous visitez simplement l'infobrol, vous avez déjà accès à cette fonction, mais si vous étes membre du brol, vous pouvez en plus utiliser des boutons supplémentaires de mise en forme, dont la coloration automatique de vos extraits de codes.
Vous pouvez modifier vos préférences dans votre profil pour ne plus afficher les interactions avec les réseaux sociaux sur ces pages.
8 mots clés dont 0 définis manuellement (plus d'information...).
Avertissement
Cette page ne possède pas encore de mots clés manuels, ceci est donc un exemple automatique (les niveaux de pertinence sont fictifs, mais les liens sont valables). Pour tester le nuage avec une page qui contient des mots définis manuellement, vous pouvez cliquer ici.Vous pouvez modifier vos préférences dans votre profil pour ne plus afficher le nuage de mots clés.
Recherche (afficher)
Utilisateur (masquer)
Navigation (masquer)
Apparence (afficher)
Stats (afficher)
Citation (masquer)