|
TrueZIP Kernel 7.0-rc1 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectde.schlichtherle.truezip.entry.DecoratingEntryContainer<E,I>
de.schlichtherle.truezip.socket.DecoratingInputShop<E,InputShop<E>>
de.schlichtherle.truezip.socket.ConcurrentInputShop<E>
E - The type of the entries.@ThreadSafe public class ConcurrentInputShop<E extends Entry>
Decorates an InputShop to add accounting and multithreading
synchronization for all input streams or read only files created by the
decorated input shop.
ConcurrentOutputShop| Nested Class Summary | |
|---|---|
private class |
ConcurrentInputShop.ConcurrentInputStream
|
private class |
ConcurrentInputShop.ConcurrentReadOnlyFile
|
private class |
ConcurrentInputShop.SynchronizedConcurrentInputStream
|
private class |
ConcurrentInputShop.SynchronizedConcurrentReadOnlyFile
|
| Field Summary | |
|---|---|
private static String |
CLASS_NAME
|
private boolean |
closed
|
private static Logger |
logger
|
private Map<Closeable,Thread> |
threads
The pool of all open entry streams. |
| Fields inherited from class de.schlichtherle.truezip.entry.DecoratingEntryContainer |
|---|
delegate |
| Constructor Summary | |
|---|---|
ConcurrentInputShop(InputShop<E> input)
Constructs a concurrent input shop. |
|
| Method Summary | ||
|---|---|---|
private void |
assertNotShopClosed()
Needs to be externally synchronized! |
|
void |
close()
Closes this concurrent output shop. |
|
|
closeAll(ExceptionHandler<IOException,E> handler)
Closes and disconnects all entry input streams and read only file created by this concurrent input shop. |
|
InputSocket<? extends E> |
getInputSocket(String name)
Returns an input socket for read access to the given entry. |
|
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. |
|
| Methods inherited from class de.schlichtherle.truezip.entry.DecoratingEntryContainer |
|---|
getEntry, getSize, iterator, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface de.schlichtherle.truezip.entry.EntryContainer |
|---|
getEntry, getSize, iterator |
| Field Detail |
|---|
private static final String CLASS_NAME
private static final Logger logger
private final Map<Closeable,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
| Constructor Detail |
|---|
public ConcurrentInputShop(InputShop<E> input)
input - the shop to decorate.
NullPointerException - if input is null.| Method Detail |
|---|
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 <E extends Exception> void closeAll(ExceptionHandler<IOException,E> handler)
throws E extends Exception
IOException, with the exception of
their close() method.
E extends Exception
public final void close()
throws IOException
close in interface Closeableclose in class DecoratingInputShop<E extends Entry,InputShop<E extends Entry>>IllegalStateException - If any open input streams or read only
files are detected.
IOExceptioncloseAll(de.schlichtherle.truezip.util.ExceptionHandler)
private void assertNotShopClosed()
throws IOException
IOExceptionpublic final InputSocket<? extends E> getInputSocket(String name)
InputService
getInputSocket in interface InputService<E extends Entry>getInputSocket in class DecoratingInputShop<E extends Entry,InputShop<E extends Entry>>name - a non-null entry name.
|
TrueZIP Kernel 7.0-rc1 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||