|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.csc.phynixx.tutorial.UTFWriterImpl
public class UTFWriterImpl
Implements an quit simple an cooperating lock. To have acces to write to the file, you have to aquire a lock. If the lock is successful, you gain an lockToken. This token identifies the lock and this token enables you to release the token. If the file is lock all method to write/rad the file are unsynchronized to improve performance.
| Constructor Summary | |
|---|---|
UTFWriterImpl(File file)
|
|
| Method Summary | |
|---|---|
void |
close()
Schliesst die Datei und den FileChannel |
String |
getFilename()
|
boolean |
isClosed()
zeigt an, ob die Instanz geschlossen ist |
String |
lock()
|
long |
position()
|
List<String> |
readContent()
reads the content |
void |
resetContent()
resets the content of the file associated with die current transaction |
void |
restoreSize(long filePosition)
|
long |
size()
|
String |
toString()
|
void |
unlock(String lockToken)
|
long |
write(String value)
writes a string to file |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public UTFWriterImpl(File file)
| Method Detail |
|---|
public String lock()
throws InterruptedException
lock in interface UTFWriterInterruptedExceptionpublic void unlock(String lockToken)
unlock in interface UTFWriterlockToken - identifing the lockpublic void close()
close in interface UTFWriter
public String getFilename()
throws IOException
getFilename in interface UTFWriterIOExceptionpublic boolean isClosed()
isClosed in interface UTFWriter
public void resetContent()
throws IOException
UTFWriter
resetContent in interface UTFWriterIOException
public long write(String value)
throws IOException
UTFWriter
write in interface UTFWriterIOException
public List<String> readContent()
throws IOException
UTFWriter
readContent in interface UTFWriterIOException
public long size()
throws IOException
size in interface UTFWriterIOException
public void restoreSize(long filePosition)
throws IOException
restoreSize in interface UTFWriterIOException
public long position()
throws IOException
position in interface UTFWriterIOExceptionpublic String toString()
toString in class Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||