E - The type of the entries.@ThreadSafe public class ConcurrentInputShop<E extends Entry> extends DecoratingInputShop<E,InputShop<E>>
ConcurrentOutputShop| Modifier and Type | Class and Description |
|---|---|
private class |
ConcurrentInputShop.ConcurrentInputStream |
private class |
ConcurrentInputShop.ConcurrentReadOnlyFile |
private class |
ConcurrentInputShop.SynchronizedConcurrentInputStream |
private class |
ConcurrentInputShop.SynchronizedConcurrentReadOnlyFile |
| Modifier and Type | Field and Description |
|---|---|
private static java.lang.String |
CLASS_NAME |
private boolean |
closed |
private static java.util.logging.Logger |
logger |
private java.util.Map<java.io.Closeable,java.lang.Thread> |
threads
The pool of all open entry streams.
|
delegate| Constructor and Description |
|---|
ConcurrentInputShop(InputShop<E> input)
Constructs a concurrent input shop.
|
| Modifier and Type | Method and Description |
|---|---|
private void |
assertNotShopClosed()
Needs to be externally synchronized!
|
void |
close()
Closes this concurrent output shop.
|
<X extends java.lang.Exception> |
closeAll(ExceptionHandler<java.io.IOException,X> handler)
Closes and disconnects all entry input streams and read only
file created by this concurrent input shop.
|
InputSocket<? extends E> |
getInputSocket(java.lang.String name)
Returns an input socket for reading from the entry with the given name.
|
private int |
threadStreams()
Returns the number of streams opened by the current thread.
|
int |
waitCloseOthers(long timeout)
Waits until all entry input streams and read only files which have been
opened by other threads get closed or a timeout occurs.
|
getEntry, getSize, iterator, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetEntry, getSize, iteratorprivate static final java.lang.String CLASS_NAME
private static final java.util.logging.Logger logger
private final java.util.Map<java.io.Closeable,java.lang.Thread> threads
InputBusyException
in case a sloppy client application has forgot to close a stream before
this input shop gets closed.private volatile boolean closed
public final int waitCloseOthers(long timeout)
java.util.logging and
this method returns.
Unless otherwise prevented, another thread could immediately open another stream upon return of this method. So there is actually no guarantee that really all streams are closed upon return of this method - use carefully!
private int threadStreams()
public final <X extends java.lang.Exception> void closeAll(ExceptionHandler<java.io.IOException,X> handler) throws X extends java.lang.Exception
IOException, with the exception of
their close() method.X extends java.lang.Exceptionpublic final void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class DecoratingInputShop<E extends Entry,InputShop<E extends Entry>>java.lang.IllegalStateException - If any open input streams or read only
files are detected.java.io.IOExceptioncloseAll(de.schlichtherle.truezip.util.ExceptionHandler<java.io.IOException, X>)private void assertNotShopClosed()
throws java.io.IOException
java.io.IOExceptionpublic final InputSocket<? extends E> getInputSocket(java.lang.String name)
InputServicegetInputSocket in interface InputService<E extends Entry>getInputSocket in class DecoratingInputShop<E extends Entry,InputShop<E extends Entry>>name - an entry name.Copyright © 2005-2011 Schlichtherle IT Services. All Rights Reserved.