You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by an...@apache.org on 2005/05/20 16:44:04 UTC
svn commit: r171123 -
/lenya/trunk/src/java/org/apache/lenya/cms/repository/SourceNode.java
Author: andreas
Date: Fri May 20 07:44:03 2005
New Revision: 171123
URL: http://svn.apache.org/viewcvs?rev=171123&view=rev
Log:
SourceNode: synchronizing critical methods (avoids 'invalid UTF-8' problem)
Modified:
lenya/trunk/src/java/org/apache/lenya/cms/repository/SourceNode.java
Modified: lenya/trunk/src/java/org/apache/lenya/cms/repository/SourceNode.java
URL: http://svn.apache.org/viewcvs/lenya/trunk/src/java/org/apache/lenya/cms/repository/SourceNode.java?rev=171123&r1=171122&r2=171123&view=diff
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/cms/repository/SourceNode.java (original)
+++ lenya/trunk/src/java/org/apache/lenya/cms/repository/SourceNode.java Fri May 20 07:44:03 2005
@@ -220,7 +220,7 @@
/**
* @see org.apache.lenya.transaction.Transactionable#saveTransactionable()
*/
- public void saveTransactionable() throws TransactionException {
+ public synchronized void saveTransactionable() throws TransactionException {
if (!isCheckedOut()) {
throw new TransactionException("Cannot save node [" + this.sourceURI
+ "]: not checked out!");
@@ -351,7 +351,7 @@
/**
* @see org.apache.lenya.cms.repository.Node#getInputStream()
*/
- public InputStream getInputStream() throws TransactionException {
+ public synchronized InputStream getInputStream() throws TransactionException {
if (!exists()) {
throw new RuntimeException(this + " does not exist!");
}
@@ -362,7 +362,7 @@
* Loads the data from the real source.
* @throws TransactionException if an error occurs.
*/
- protected void loadData() throws TransactionException {
+ protected synchronized void loadData() throws TransactionException {
if (this.data != null) {
return;
@@ -413,7 +413,7 @@
/**
* @see org.apache.lenya.cms.repository.Node#getOutputStream()
*/
- public OutputStream getOutputStream() throws TransactionException {
+ public synchronized OutputStream getOutputStream() throws TransactionException {
return new NodeOutputStream();
}
@@ -424,7 +424,7 @@
/**
* @see java.io.OutputStream#close()
*/
- public void close() throws IOException {
+ public synchronized void close() throws IOException {
SourceNode.this.data = super.toByteArray();
super.close();
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org