|
JBoss Remoting 3.1.0.Beta1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jboss.remoting3.spi.AbstractHandleableCloseable<T>
public abstract class AbstractHandleableCloseable<T extends HandleableCloseable<T>>

A basic implementation of a closeable resource. Use as a convenient base class for your closeable resources.
Ensures that the close() method is idempotent; implements the registry of close handlers.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.jboss.remoting3.HandleableCloseable |
|---|
HandleableCloseable.Key |
| Constructor Summary | |
|---|---|
protected |
AbstractHandleableCloseable(Executor executor)
Basic constructor. |
| 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. |
protected void |
checkOpen()
Check if open, throwing an exception if it is not. |
void |
close()
Close this resource. |
protected void |
closeAction()
Called exactly once when the close() method is invoked; the actual close operation should take place here. |
protected void |
finalize()
Finalize this closeable instance. |
protected Executor |
getExecutor()
Get the executor to use for handler invocation. |
protected boolean |
isOpen()
Read the status of this resource. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected AbstractHandleableCloseable(Executor executor)
executor - the executor used to execute the close notification handlers| Method Detail |
|---|
protected boolean isOpen()
true.
true if the resource is still open
protected void closeAction()
throws IOException
close() method is invoked; the actual close operation should take place here.
RemotingException - if the close failed
IOException
public void close()
throws IOException
close in interface Closeableclose in interface HandleableCloseable<T extends HandleableCloseable<T>>IOException - if the close failed
public void awaitClosed()
throws InterruptedException
awaitClosed in interface HandleableCloseable<T extends HandleableCloseable<T>>InterruptedException - if the operation is interruptedpublic void awaitClosedUninterruptibly()
awaitClosedUninterruptibly in interface HandleableCloseable<T extends HandleableCloseable<T>>public HandleableCloseable.Key addCloseHandler(CloseHandler<? super T> handler)
addCloseHandler in interface HandleableCloseable<T extends HandleableCloseable<T>>handler - the close handler
protected Executor getExecutor()
protected void finalize()
throws Throwable
finalize in class ObjectThrowable
protected void checkOpen()
throws NotOpenException
NotOpenException - if not open
|
JBoss Remoting 3.1.0.Beta1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||