|
JBoss Remoting 3.0.0.GA | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.remoting.spi.AbstractHandleableCloseable<T>
public abstract class AbstractHandleableCloseable<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.remoting.HandleableCloseable |
---|
HandleableCloseable.Key |
Field Summary | |
---|---|
protected Executor |
executor
|
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 |
close()
Close, waiting for any outstanding processing to finish. |
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 |
Field Detail |
---|
protected final Executor executor
Constructor Detail |
---|
protected AbstractHandleableCloseable(Executor executor)
executor
- the executor used to execute the close notification handlersMethod Detail |
---|
protected boolean isOpen()
true
.
true
if the resource is still openprotected void closeAction() throws IOException
close()
method is invoked; the actual close operation should take place here.
RemotingException
- if the close failed
IOException
public final void close() throws IOException
close
in interface Closeable
close
in interface HandleableCloseable<T>
IOException
- if the close failedpublic HandleableCloseable.Key addCloseHandler(CloseHandler<? super T> handler)
addCloseHandler
in interface HandleableCloseable<T>
handler
- the close handler
protected Executor getExecutor()
protected void finalize() throws Throwable
finalize
in class Object
Throwable
|
JBoss Remoting 3.0.0.GA | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |