org.jboss.remoting
Interface HandleableCloseable<T>

Type Parameters:
T - the type that is passed to the close handler
All Superinterfaces:
Closeable
All Known Subinterfaces:
AutoCloseable<T>, Client<I,O>, ClientContext, ClientSource<I,O>, Handle<T>, RequestHandler, RequestHandlerSource, ServiceContext, SimpleCloseable
All Known Implementing Classes:
AbstractAutoCloseable, AbstractHandleableCloseable, AbstractSimpleCloseable

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 close()
          Close, waiting for any outstanding processing to finish.
 

Method Detail

close

void close()
           throws IOException
Close, waiting for any outstanding processing to finish.

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

addCloseHandler

HandleableCloseable.Key addCloseHandler(CloseHandler<? super T> handler)
Add a handler that will be called upon close. The handler may be called before or after the close acutally takes place.

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


Copyright © 2008 JBoss, a division of Red Hat, Inc.