[exo-jcr-commits] exo-jcr SVN: r1410 - in jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow: persistent and 1 other directory.
do-not-reply at jboss.org
do-not-reply at jboss.org
Fri Jan 15 09:26:44 EST 2010
Author: areshetnyak
Date: 2010-01-15 09:26:43 -0500 (Fri, 15 Jan 2010)
New Revision: 1410
Modified:
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/AbstractPersistedValueData.java
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/ByteArrayPersistedValueData.java
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CleanableFilePersistedValueData.java
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/FilePersistedValueData.java
Log:
EXOJCR-404 : The serializatio to AbstractPersistedValueData, FilePersistentValueData, CleanableFilePersistedValuData was changed.
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/AbstractPersistedValueData.java
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/AbstractPersistedValueData.java 2010-01-15 13:08:01 UTC (rev 1409)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/AbstractPersistedValueData.java 2010-01-15 14:26:43 UTC (rev 1410)
@@ -18,41 +18,36 @@
*/
package org.exoplatform.services.jcr.impl.dataflow;
-import java.io.Externalizable;
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
+import javax.jcr.RepositoryException;
import org.exoplatform.services.jcr.datamodel.ValueData;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
-import javax.jcr.RepositoryException;
-
/**
* @author <a href="mailto:peter.nedonosko at exoplatform.com">Peter Nedonosko</a>
* @version $Id$
*/
-public abstract class AbstractPersistedValueData implements ValueData, Externalizable
+public abstract class AbstractPersistedValueData implements ValueData
{
protected final static Log LOG = ExoLogger.getLogger("jcr.PersistedValueData");
protected int orderNumber;
+ /**
+ * The empty constructor to serialization.
+ */
+ protected AbstractPersistedValueData()
+ {
+ }
+
protected AbstractPersistedValueData(int orderNumber)
{
this.orderNumber = orderNumber;
}
/**
- * Empty constructor to serialization.
- */
- protected AbstractPersistedValueData()
- {
- }
-
- /**
* {@inheritDoc}
*/
public final int getOrderNumber()
@@ -82,13 +77,4 @@
*/
public abstract TransientValueData createTransientCopy() throws RepositoryException;
- public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
- {
- orderNumber = in.readInt();
- }
-
- public void writeExternal(ObjectOutput out) throws IOException
- {
- out.writeInt(orderNumber);
- }
}
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/ByteArrayPersistedValueData.java
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/ByteArrayPersistedValueData.java 2010-01-15 13:08:01 UTC (rev 1409)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/ByteArrayPersistedValueData.java 2010-01-15 14:26:43 UTC (rev 1410)
@@ -46,6 +46,7 @@
* The serialVersionUID.
*/
private static final long serialVersionUID = -9131328056670315388L;
+
protected byte[] data;
/**
@@ -160,6 +161,9 @@
return new TransientValueData(orderNumber, data);
}
+ /**
+ * {@inheritDoc}
+ */
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
{
orderNumber = in.readInt();
@@ -168,6 +172,9 @@
in.readFully(data);
}
+ /**
+ * {@inheritDoc}
+ */
public void writeExternal(ObjectOutput out) throws IOException
{
out.writeInt(orderNumber);
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CleanableFilePersistedValueData.java
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CleanableFilePersistedValueData.java 2010-01-15 13:08:01 UTC (rev 1409)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CleanableFilePersistedValueData.java 2010-01-15 14:26:43 UTC (rev 1410)
@@ -84,14 +84,14 @@
//TODO FileCleaner maybe null.
if (cleaner != null)
{
- cleaner.addFile(file);
-
- if (LOG.isDebugEnabled())
- {
- LOG.debug("Could not remove temporary file on finalize: inUse=" + (((SwapFile)file).inUse()) + ", "
- + file.getAbsolutePath());
- }
+ cleaner.addFile(file);
+
+ if (LOG.isDebugEnabled())
+ {
+ LOG.debug("Could not remove temporary file on finalize: inUse=" + (((SwapFile)file).inUse()) + ", "
+ + file.getAbsolutePath());
}
+ }
}
}
finally
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/FilePersistedValueData.java
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/FilePersistedValueData.java 2010-01-15 13:08:01 UTC (rev 1409)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/FilePersistedValueData.java 2010-01-15 14:26:43 UTC (rev 1410)
@@ -46,9 +46,12 @@
* @version $Id$
*/
-public class FilePersistedValueData extends AbstractPersistedValueData
+public class FilePersistedValueData extends AbstractPersistedValueData implements Externalizable
{
+ /**
+ * The serialVersionUID.
+ */
private static final long serialVersionUID = -8183328056670315388L;
protected File file;
@@ -60,6 +63,7 @@
*/
public FilePersistedValueData()
{
+ super();
}
/**
@@ -227,19 +231,26 @@
}
}
+ /**
+ * {@inheritDoc}
+ */
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
{
- super.readExternal(in);
+ orderNumber = in.readInt();
// read canonical file path
byte[] buf = new byte[in.readInt()];
+ in.readFully(buf);
file = new File(new String(buf, "UTF-8"));
}
+ /**
+ * {@inheritDoc}
+ */
public void writeExternal(ObjectOutput out) throws IOException
{
- super.writeExternal(out);
+ out.writeInt(orderNumber);
// write canonical file path
byte[] buf = file.getCanonicalPath().getBytes("UTF-8");
More information about the exo-jcr-commits
mailing list