|
|||||||||
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 UTFWriter
InterruptedException
public void unlock(String lockToken)
unlock
in interface UTFWriter
lockToken
- identifing the lockpublic void close()
close
in interface UTFWriter
public String getFilename() throws IOException
getFilename
in interface UTFWriter
IOException
public boolean isClosed()
isClosed
in interface UTFWriter
public void resetContent() throws IOException
UTFWriter
resetContent
in interface UTFWriter
IOException
public long write(String value) throws IOException
UTFWriter
write
in interface UTFWriter
IOException
public List<String> readContent() throws IOException
UTFWriter
readContent
in interface UTFWriter
IOException
public long size() throws IOException
size
in interface UTFWriter
IOException
public void restoreSize(long filePosition) throws IOException
restoreSize
in interface UTFWriter
IOException
public long position() throws IOException
position
in interface UTFWriter
IOException
public String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |