[jboss-cvs] JBossCache/src/org/jboss/cache/marshall ...
Manik Surtani
msurtani at jboss.com
Mon Nov 27 12:07:06 EST 2006
User: msurtani
Date: 06/11/27 12:07:06
Modified: src/org/jboss/cache/marshall VersionAwareMarshaller.java
Log:
Added marshaller to SPI
Revision Changes Path
1.11 +32 -6 JBossCache/src/org/jboss/cache/marshall/VersionAwareMarshaller.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: VersionAwareMarshaller.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/marshall/VersionAwareMarshaller.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- VersionAwareMarshaller.java 12 Oct 2006 23:03:57 -0000 1.10
+++ VersionAwareMarshaller.java 27 Nov 2006 17:07:06 -0000 1.11
@@ -8,7 +8,6 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.jboss.cache.CacheSPI;
import org.jboss.cache.RegionManager;
import org.jgroups.blocks.RpcDispatcher;
@@ -29,7 +28,6 @@
{
private RegionManager manager;
private boolean defaultInactive, useRegionBasedMarshalling;
- private CacheSPI cache;
private Log log = LogFactory.getLog(VersionAwareMarshaller.class);
Marshaller defaultMarshaller;
@@ -108,6 +106,14 @@
}
}
+ /**
+ * Marshals the object passed in to a byte buffer using an appropriate {@link Marshaller} based on
+ * the version information passed in to this instance upon construction (See {@link #VersionAwareMarshaller(org.jboss.cache.RegionManager,boolean,boolean,String)})
+ *
+ * @param obj
+ * @return a byte stream representing the object passed in.
+ * @throws Exception
+ */
public byte[] objectToByteBuffer(Object obj) throws Exception
{
ByteArrayOutputStream bos = new ByteArrayOutputStream();
@@ -125,6 +131,14 @@
return bos.toByteArray();
}
+ /**
+ * Creates an Object from the byte buffer passed in, using the appropriate {@link Marshaller} based
+ * on the version headers in the byte stream.
+ *
+ * @param buf
+ * @return Object from byte buffer passed in.
+ * @throws Exception
+ */
public Object objectFromByteBuffer(byte[] buf) throws Exception
{
Marshaller marshaller;
@@ -172,13 +186,25 @@
return marshaller;
}
- public boolean isInactive(String s)
+ /**
+ * Tests whether a particular Fqn passed in is inactive.
+ *
+ * @param fqn
+ * @return true if the fqn is inactive
+ */
+ public boolean isInactive(String fqn)
{
- return defaultMarshaller.isInactive(s);
+ return defaultMarshaller.isInactive(fqn);
}
- public ClassLoader getClassLoader(String fqnS)
+ /**
+ * Returns the class loader associated with a particular Fqn.
+ *
+ * @param fqn
+ * @return the context class loader associated with the Fqn passed in.
+ */
+ public ClassLoader getClassLoader(String fqn)
{
- return defaultMarshaller.getClassLoader(fqnS);
+ return defaultMarshaller.getClassLoader(fqn);
}
}
More information about the jboss-cvs-commits
mailing list