Author: xor
Date: 2008-11-17 00:35:21 +0000 (Mon, 17 Nov 2008)
New Revision: 23673
Modified:
trunk/plugins/WoT/OwnIdentity.java
Log:
Synchronization.
Modified: trunk/plugins/WoT/OwnIdentity.java
===================================================================
--- trunk/plugins/WoT/OwnIdentity.java 2008-11-17 00:32:54 UTC (rev 23672)
+++ trunk/plugins/WoT/OwnIdentity.java 2008-11-17 00:35:21 UTC (rev 23673)
@@ -185,7 +185,7 @@
* @throws DatabaseClosedException
* @throws InvalidParameterException
*/
- public void exportToXML(ObjectContainer db, OutputStream os) throws
ParserConfigurationException, TransformerConfigurationException,
TransformerException, FileNotFoundException, IOException, Db4oIOException,
DatabaseClosedException, InvalidParameterException {
+ public synchronized void exportToXML(ObjectContainer db, OutputStream
os) throws ParserConfigurationException, TransformerConfigurationException,
TransformerException, FileNotFoundException, IOException, Db4oIOException,
DatabaseClosedException, InvalidParameterException {
// Create the output file
StreamResult resultStream = new StreamResult(os);
@@ -246,7 +246,7 @@
serializer.transform(domSource, resultStream);
}
- public void exportIntroductionToXML(OutputStream os) throws
ParserConfigurationException, TransformerException {
+ public synchronized void exportIntroductionToXML(OutputStream os)
throws ParserConfigurationException, TransformerException {
StreamResult resultStream = new StreamResult(os);
// Create the XML document
@@ -279,14 +279,14 @@
* We insert OwnIdentities when they have been modified AND at least
once a week.
* @return Whether this OwnIdentity needs to be inserted or not
*/
- public boolean needsInsert() {
+ public synchronized boolean needsInsert() {
return (getLastChange().after(getLastInsert()) || (new
Date().getTime() - getLastInsert().getTime()) > 1000*60*60*24*7);
}
/**
* @return This OwnIdentity's insertURI
*/
- public FreenetURI getInsertURI() {
+ public synchronized FreenetURI getInsertURI() {
return insertURI;
}
@@ -304,7 +304,7 @@
this.insertURI = key;
}
- public void setEdition(long edition) throws InvalidParameterException {
+ public synchronized void setEdition(long edition) throws
InvalidParameterException {
setInsertURI(getInsertURI().setSuggestedEdition(edition));
setRequestURI(getRequestURI().setSuggestedEdition(edition));
}
@@ -312,7 +312,7 @@
/**
* @return Date of last insertion of this OwnIdentity in Freenet
*/
- public Date getLastInsert() {
+ public synchronized Date getLastInsert() {
return lastInsert;
}
@@ -321,7 +321,7 @@
*
* @param lastInsert last insertion date of this OwnIdentity in Freenet
*/
- public void setLastInsert(Date lastInsert) {
+ public synchronized void setLastInsert(Date lastInsert) {
this.lastInsert = lastInsert;
}
}
_______________________________________________
cvs mailing list
[email protected]
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs