JBoss Remoting 3.0.0.Beta2

org.jboss.remoting.spi
Interface Handle<T>

All Superinterfaces:
Closeable, HandleableCloseable<Handle<T>>

public interface Handle<T>
extends HandleableCloseable<Handle<T>>

A handle to a reference-counted AutoCloseable resource.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.jboss.remoting.HandleableCloseable
HandleableCloseable.Key
 
Method Summary
 HandleableCloseable.Key addCloseHandler(CloseHandler<? super Handle<T>> handler)
          Add a handler that is invoked when this handle is closed.
 void close()
          Close this handle.
 T getResource()
          Get the resource.
 

Method Detail

getResource

T getResource()
Get the resource.

Returns:
the resource

close

void close()
           throws IOException
Close this handle. If this is the last handle to be closed, also close the resource (throwing any exception that may result).

Specified by:
close in interface Closeable
Specified by:
close in interface HandleableCloseable<Handle<T>>
Throws:
IOException - if the close failed

addCloseHandler

HandleableCloseable.Key addCloseHandler(CloseHandler<? super Handle<T>> handler)
Add a handler that is invoked when this handle is closed.

Specified by:
addCloseHandler in interface HandleableCloseable<Handle<T>>
Parameters:
handler - the handler
Returns:
a key which may be used to later remove this handler

JBoss Remoting 3.0.0.Beta2

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