JBoss Remoting 3 3.2.0.Beta2-redhat-1

org.jboss.remoting3
Interface HandleableCloseable<T>

Type Parameters:
T - the type that is passed to the close handler
All Superinterfaces:
Closeable
All Known Subinterfaces:
Channel, Connection, ConnectionHandler, ConnectionProvider, Endpoint, Registration
All Known Implementing Classes:
AbstractHandleableCloseable

public interface HandleableCloseable<T>
extends Closeable

A Remoting resource that can be closed.


Nested Class Summary
static interface HandleableCloseable.Key
          A key which may be used to remove this handler.
 
Method Summary
 HandleableCloseable.Key addCloseHandler(CloseHandler<? super T> handler)
          Add a handler that will be called upon close.
 void awaitClosed()
          Wait for a resource close to complete.
 void awaitClosedUninterruptibly()
          Wait for a resource close to complete.
 void close()
          Close this resource.
 void closeAsync()
          Asynchronously close this resource.
 

Method Detail

close

void close()
           throws IOException
Close this resource. Call any registered close handlers. Calling this method more than once will not have any additional effect.

Specified by:
close in interface Closeable
Throws:
IOException - if the close failed

awaitClosed

void awaitClosed()
                 throws InterruptedException
Wait for a resource close to complete.

Throws:
InterruptedException - if the operation is interrupted

awaitClosedUninterruptibly

void awaitClosedUninterruptibly()
Wait for a resource close to complete.


closeAsync

void closeAsync()
Asynchronously close this resource. Returns immediately.


addCloseHandler

HandleableCloseable.Key addCloseHandler(CloseHandler<? super T> handler)
Add a handler that will be called upon close. If the resource is already closed, the handler will be called immediately.

Parameters:
handler - the close handler
Returns:
a key which may be used to later remove this handler

JBoss Remoting 3 3.2.0.Beta2-redhat-1

Copyright © 2011 JBoss, a division of Red Hat, Inc.. All Rights Reserved.