[infinispan-commits] Infinispan SVN: r479 - in trunk/core/src/main/java/org/infinispan/marshall: exts and 1 other directories.
infinispan-commits at lists.jboss.org
infinispan-commits at lists.jboss.org
Wed Jun 17 13:24:43 EDT 2009
Author: galder.zamarreno at jboss.com
Date: 2009-06-17 13:24:43 -0400 (Wed, 17 Jun 2009)
New Revision: 479
Added:
trunk/core/src/main/java/org/infinispan/marshall/exts/
trunk/core/src/main/java/org/infinispan/marshall/exts/ArrayListExternalizer.java
trunk/core/src/main/java/org/infinispan/marshall/exts/BucketExternalizer.java
trunk/core/src/main/java/org/infinispan/marshall/exts/DeltaAwareExternalizer.java
trunk/core/src/main/java/org/infinispan/marshall/exts/ExceptionResponseExternalizer.java
trunk/core/src/main/java/org/infinispan/marshall/exts/ExtendedResponseExternalizer.java
trunk/core/src/main/java/org/infinispan/marshall/exts/GlobalTransactionExternalizer.java
trunk/core/src/main/java/org/infinispan/marshall/exts/ImmortalCacheEntryExternalizer.java
trunk/core/src/main/java/org/infinispan/marshall/exts/ImmortalCacheValueExternalizer.java
trunk/core/src/main/java/org/infinispan/marshall/exts/ImmutableMapExternalizer.java
trunk/core/src/main/java/org/infinispan/marshall/exts/JGroupsAddressExternalizer.java
trunk/core/src/main/java/org/infinispan/marshall/exts/LinkedListExternalizer.java
trunk/core/src/main/java/org/infinispan/marshall/exts/MapExternalizer.java
trunk/core/src/main/java/org/infinispan/marshall/exts/MarshalledValueExternalizer.java
trunk/core/src/main/java/org/infinispan/marshall/exts/MortalCacheEntryExternalizer.java
trunk/core/src/main/java/org/infinispan/marshall/exts/MortalCacheValueExternalizer.java
trunk/core/src/main/java/org/infinispan/marshall/exts/ReplicableCommandExternalizer.java
trunk/core/src/main/java/org/infinispan/marshall/exts/SetExternalizer.java
trunk/core/src/main/java/org/infinispan/marshall/exts/SingletonListExternalizer.java
trunk/core/src/main/java/org/infinispan/marshall/exts/SuccessfulResponseExternalizer.java
trunk/core/src/main/java/org/infinispan/marshall/exts/TransactionLogExternalizer.java
trunk/core/src/main/java/org/infinispan/marshall/exts/TransientCacheEntryExternalizer.java
trunk/core/src/main/java/org/infinispan/marshall/exts/TransientCacheValueExternalizer.java
trunk/core/src/main/java/org/infinispan/marshall/exts/TransientMortalCacheEntryExternalizer.java
trunk/core/src/main/java/org/infinispan/marshall/exts/TransientMortalCacheValueExternalizer.java
Removed:
trunk/core/src/main/java/org/infinispan/marshall/exts/ArrayListExternalizer.java
trunk/core/src/main/java/org/infinispan/marshall/exts/BucketExternalizer.java
trunk/core/src/main/java/org/infinispan/marshall/exts/DeltaAwareExternalizer.java
trunk/core/src/main/java/org/infinispan/marshall/exts/ExceptionResponseExternalizer.java
trunk/core/src/main/java/org/infinispan/marshall/exts/ExtendedResponseExternalizer.java
trunk/core/src/main/java/org/infinispan/marshall/exts/GlobalTransactionExternalizer.java
trunk/core/src/main/java/org/infinispan/marshall/exts/ImmortalCacheEntryExternalizer.java
trunk/core/src/main/java/org/infinispan/marshall/exts/ImmortalCacheValueExternalizer.java
trunk/core/src/main/java/org/infinispan/marshall/exts/ImmutableMapExternalizer.java
trunk/core/src/main/java/org/infinispan/marshall/exts/JGroupsAddressExternalizer.java
trunk/core/src/main/java/org/infinispan/marshall/exts/LinkedListExternalizer.java
trunk/core/src/main/java/org/infinispan/marshall/exts/MapExternalizer.java
trunk/core/src/main/java/org/infinispan/marshall/exts/MarshalledValueExternalizer.java
trunk/core/src/main/java/org/infinispan/marshall/exts/MortalCacheEntryExternalizer.java
trunk/core/src/main/java/org/infinispan/marshall/exts/MortalCacheValueExternalizer.java
trunk/core/src/main/java/org/infinispan/marshall/exts/ReplicableCommandExternalizer.java
trunk/core/src/main/java/org/infinispan/marshall/exts/SetExternalizer.java
trunk/core/src/main/java/org/infinispan/marshall/exts/SingletonListExternalizer.java
trunk/core/src/main/java/org/infinispan/marshall/exts/SuccessfulResponseExternalizer.java
trunk/core/src/main/java/org/infinispan/marshall/exts/TransactionLogExternalizer.java
trunk/core/src/main/java/org/infinispan/marshall/exts/TransientCacheEntryExternalizer.java
trunk/core/src/main/java/org/infinispan/marshall/exts/TransientCacheValueExternalizer.java
trunk/core/src/main/java/org/infinispan/marshall/exts/TransientMortalCacheEntryExternalizer.java
trunk/core/src/main/java/org/infinispan/marshall/exts/TransientMortalCacheValueExternalizer.java
trunk/core/src/main/java/org/infinispan/marshall/jboss/externalizers/
Modified:
trunk/core/src/main/java/org/infinispan/marshall/jboss/ConstantObjectTable.java
Log:
Refactored externalizers into package not containing jboss since they're now not linked to org.jboss.marshalling API.
Copied: trunk/core/src/main/java/org/infinispan/marshall/exts (from rev 477, trunk/core/src/main/java/org/infinispan/marshall/jboss/externalizers)
Deleted: trunk/core/src/main/java/org/infinispan/marshall/exts/ArrayListExternalizer.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/marshall/jboss/externalizers/ArrayListExternalizer.java 2009-06-17 16:31:30 UTC (rev 477)
+++ trunk/core/src/main/java/org/infinispan/marshall/exts/ArrayListExternalizer.java 2009-06-17 17:24:43 UTC (rev 479)
@@ -1,56 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.infinispan.marshall.jboss.externalizers;
-
-import net.jcip.annotations.Immutable;
-import org.infinispan.marshall.jboss.MarshallUtil;
-import org.infinispan.marshall.jboss.Externalizer;
-import org.jboss.marshalling.Marshaller;
-import org.jboss.marshalling.Unmarshaller;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collection;
-
-/**
- * List externalizer dealing with ArrayList and LinkedList implementations.
- *
- * @author Galder Zamarreño
- * @since 4.0
- */
- at Immutable
-public class ArrayListExternalizer implements Externalizer {
- /** The serialVersionUID */
- private static final long serialVersionUID = 589638638644295615L;
-
- public void writeObject(Marshaller output, Object subject) throws IOException {
- MarshallUtil.marshallCollection((Collection) subject, output);
- }
-
- public Object readObject(Unmarshaller input) throws IOException, ClassNotFoundException {
- int size = MarshallUtil.readUnsignedInt(input);
- ArrayList l = new ArrayList(size);
- for (int i = 0; i < size; i++) l.add(input.readObject());
- return l;
- }
-
-}
Copied: trunk/core/src/main/java/org/infinispan/marshall/exts/ArrayListExternalizer.java (from rev 478, trunk/core/src/main/java/org/infinispan/marshall/jboss/externalizers/ArrayListExternalizer.java)
===================================================================
--- trunk/core/src/main/java/org/infinispan/marshall/exts/ArrayListExternalizer.java (rev 0)
+++ trunk/core/src/main/java/org/infinispan/marshall/exts/ArrayListExternalizer.java 2009-06-17 17:24:43 UTC (rev 479)
@@ -0,0 +1,56 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.infinispan.marshall.exts;
+
+import net.jcip.annotations.Immutable;
+
+import org.infinispan.io.UnsignedNumeric;
+import org.infinispan.marshall.jboss.MarshallUtil;
+import org.infinispan.marshall.jboss.Externalizer;
+
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import java.util.ArrayList;
+import java.util.Collection;
+
+/**
+ * List externalizer dealing with ArrayList and LinkedList implementations.
+ *
+ * @author Galder Zamarreño
+ * @since 4.0
+ */
+ at Immutable
+public class ArrayListExternalizer implements Externalizer {
+
+ public void writeObject(ObjectOutput output, Object subject) throws IOException {
+ MarshallUtil.marshallCollection((Collection) subject, output);
+ }
+
+ public Object readObject(ObjectInput input) throws IOException, ClassNotFoundException {
+ int size = UnsignedNumeric.readUnsignedInt(input);
+ ArrayList l = new ArrayList(size);
+ for (int i = 0; i < size; i++) l.add(input.readObject());
+ return l;
+ }
+
+}
Deleted: trunk/core/src/main/java/org/infinispan/marshall/exts/BucketExternalizer.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/marshall/jboss/externalizers/BucketExternalizer.java 2009-06-17 16:31:30 UTC (rev 477)
+++ trunk/core/src/main/java/org/infinispan/marshall/exts/BucketExternalizer.java 2009-06-17 17:24:43 UTC (rev 479)
@@ -1,58 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.infinispan.marshall.jboss.externalizers;
-
-import java.io.IOException;
-
-import net.jcip.annotations.Immutable;
-
-import org.infinispan.container.entries.InternalCacheEntry;
-
-import org.infinispan.io.UnsignedNumeric;
-import org.infinispan.loaders.bucket.Bucket;
-import org.infinispan.marshall.jboss.Externalizer;
-import org.jboss.marshalling.Marshaller;
-import org.jboss.marshalling.Unmarshaller;
-
-/**
- * BucketExternalizer.
- *
- * @author Galder Zamarreño
- * @since 4.0
- */
- at Immutable
-public class BucketExternalizer implements Externalizer {
-
- public void writeObject(Marshaller output, Object subject) throws IOException {
- Bucket b = (Bucket) subject;
- UnsignedNumeric.writeUnsignedInt(output, b.getNumEntries());
- for (InternalCacheEntry se : b.getEntries().values()) output.writeObject(se);
- }
-
- public Object readObject(Unmarshaller input) throws IOException, ClassNotFoundException {
- Bucket b = new Bucket();
- int numEntries = UnsignedNumeric.readUnsignedInt(input);
- for (int i = 0; i < numEntries; i++) b.addEntry((InternalCacheEntry) input.readObject());
- return b;
- }
-
-}
Copied: trunk/core/src/main/java/org/infinispan/marshall/exts/BucketExternalizer.java (from rev 478, trunk/core/src/main/java/org/infinispan/marshall/jboss/externalizers/BucketExternalizer.java)
===================================================================
--- trunk/core/src/main/java/org/infinispan/marshall/exts/BucketExternalizer.java (rev 0)
+++ trunk/core/src/main/java/org/infinispan/marshall/exts/BucketExternalizer.java 2009-06-17 17:24:43 UTC (rev 479)
@@ -0,0 +1,58 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.infinispan.marshall.exts;
+
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+
+import net.jcip.annotations.Immutable;
+
+import org.infinispan.container.entries.InternalCacheEntry;
+
+import org.infinispan.io.UnsignedNumeric;
+import org.infinispan.loaders.bucket.Bucket;
+import org.infinispan.marshall.jboss.Externalizer;
+
+/**
+ * BucketExternalizer.
+ *
+ * @author Galder Zamarreño
+ * @since 4.0
+ */
+ at Immutable
+public class BucketExternalizer implements Externalizer {
+
+ public void writeObject(ObjectOutput output, Object subject) throws IOException {
+ Bucket b = (Bucket) subject;
+ UnsignedNumeric.writeUnsignedInt(output, b.getNumEntries());
+ for (InternalCacheEntry se : b.getEntries().values()) output.writeObject(se);
+ }
+
+ public Object readObject(ObjectInput input) throws IOException, ClassNotFoundException {
+ Bucket b = new Bucket();
+ int numEntries = UnsignedNumeric.readUnsignedInt(input);
+ for (int i = 0; i < numEntries; i++) b.addEntry((InternalCacheEntry) input.readObject());
+ return b;
+ }
+
+}
Deleted: trunk/core/src/main/java/org/infinispan/marshall/exts/DeltaAwareExternalizer.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/marshall/jboss/externalizers/DeltaAwareExternalizer.java 2009-06-17 16:31:30 UTC (rev 477)
+++ trunk/core/src/main/java/org/infinispan/marshall/exts/DeltaAwareExternalizer.java 2009-06-17 17:24:43 UTC (rev 479)
@@ -1,50 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.infinispan.marshall.jboss.externalizers;
-
-import net.jcip.annotations.Immutable;
-import org.infinispan.atomic.DeltaAware;
-import org.infinispan.marshall.jboss.Externalizer;
-import org.jboss.marshalling.Marshaller;
-import org.jboss.marshalling.Unmarshaller;
-
-import java.io.IOException;
-
-/**
- * DeltaAwareExternalizer.
- *
- * @author Galder Zamarreño
- * @since 4.0
- */
- at Immutable
-public class DeltaAwareExternalizer implements Externalizer {
-
- public void writeObject(Marshaller output, Object subject) throws IOException {
- DeltaAware dw = (DeltaAware) subject;
- output.writeObject(dw.delta());
- }
-
- public Object readObject(Unmarshaller input) throws IOException, ClassNotFoundException {
- return input.readObject();
- }
-
-}
Copied: trunk/core/src/main/java/org/infinispan/marshall/exts/DeltaAwareExternalizer.java (from rev 478, trunk/core/src/main/java/org/infinispan/marshall/jboss/externalizers/DeltaAwareExternalizer.java)
===================================================================
--- trunk/core/src/main/java/org/infinispan/marshall/exts/DeltaAwareExternalizer.java (rev 0)
+++ trunk/core/src/main/java/org/infinispan/marshall/exts/DeltaAwareExternalizer.java 2009-06-17 17:24:43 UTC (rev 479)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.infinispan.marshall.exts;
+
+import net.jcip.annotations.Immutable;
+import org.infinispan.atomic.DeltaAware;
+import org.infinispan.marshall.jboss.Externalizer;
+
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+
+/**
+ * DeltaAwareExternalizer.
+ *
+ * @author Galder Zamarreño
+ * @since 4.0
+ */
+ at Immutable
+public class DeltaAwareExternalizer implements Externalizer {
+
+ public void writeObject(ObjectOutput output, Object subject) throws IOException {
+ DeltaAware dw = (DeltaAware) subject;
+ output.writeObject(dw.delta());
+ }
+
+ public Object readObject(ObjectInput input) throws IOException, ClassNotFoundException {
+ return input.readObject();
+ }
+
+}
Deleted: trunk/core/src/main/java/org/infinispan/marshall/exts/ExceptionResponseExternalizer.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/marshall/jboss/externalizers/ExceptionResponseExternalizer.java 2009-06-17 16:31:30 UTC (rev 477)
+++ trunk/core/src/main/java/org/infinispan/marshall/exts/ExceptionResponseExternalizer.java 2009-06-17 17:24:43 UTC (rev 479)
@@ -1,32 +0,0 @@
-package org.infinispan.marshall.jboss.externalizers;
-
-import net.jcip.annotations.Immutable;
-
-import org.infinispan.marshall.jboss.Externalizer;
-import org.infinispan.remoting.responses.ExceptionResponse;
-import org.jboss.marshalling.Marshaller;
-import org.jboss.marshalling.Unmarshaller;
-
-import java.io.IOException;
-
-/**
- * Externalizes an ExceptionResponse
- *
- * @author Manik Surtani
- * @since 4.0
- */
- at Immutable
-public class ExceptionResponseExternalizer implements Externalizer {
-
- public void writeObject(Marshaller output, Object subject) throws IOException {
- ExceptionResponse er = (ExceptionResponse) subject;
- output.writeObject(er.getException());
- }
-
- public Object readObject(Unmarshaller input) throws IOException, ClassNotFoundException {
- ExceptionResponse er = new ExceptionResponse();
- er.setException((Exception) input.readObject());
- return er;
- }
-
-}
Copied: trunk/core/src/main/java/org/infinispan/marshall/exts/ExceptionResponseExternalizer.java (from rev 478, trunk/core/src/main/java/org/infinispan/marshall/jboss/externalizers/ExceptionResponseExternalizer.java)
===================================================================
--- trunk/core/src/main/java/org/infinispan/marshall/exts/ExceptionResponseExternalizer.java (rev 0)
+++ trunk/core/src/main/java/org/infinispan/marshall/exts/ExceptionResponseExternalizer.java 2009-06-17 17:24:43 UTC (rev 479)
@@ -0,0 +1,32 @@
+package org.infinispan.marshall.exts;
+
+import net.jcip.annotations.Immutable;
+
+import org.infinispan.marshall.jboss.Externalizer;
+import org.infinispan.remoting.responses.ExceptionResponse;
+
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+
+/**
+ * Externalizes an ExceptionResponse
+ *
+ * @author Manik Surtani
+ * @since 4.0
+ */
+ at Immutable
+public class ExceptionResponseExternalizer implements Externalizer {
+
+ public void writeObject(ObjectOutput output, Object subject) throws IOException {
+ ExceptionResponse er = (ExceptionResponse) subject;
+ output.writeObject(er.getException());
+ }
+
+ public Object readObject(ObjectInput input) throws IOException, ClassNotFoundException {
+ ExceptionResponse er = new ExceptionResponse();
+ er.setException((Exception) input.readObject());
+ return er;
+ }
+
+}
Deleted: trunk/core/src/main/java/org/infinispan/marshall/exts/ExtendedResponseExternalizer.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/marshall/jboss/externalizers/ExtendedResponseExternalizer.java 2009-06-17 16:31:30 UTC (rev 477)
+++ trunk/core/src/main/java/org/infinispan/marshall/exts/ExtendedResponseExternalizer.java 2009-06-17 17:24:43 UTC (rev 479)
@@ -1,55 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.infinispan.marshall.jboss.externalizers;
-
- import net.jcip.annotations.Immutable;
-
-import org.infinispan.marshall.jboss.Externalizer;
-import org.infinispan.remoting.responses.ExtendedResponse;
-import org.infinispan.remoting.responses.Response;
-import org.jboss.marshalling.Marshaller;
-import org.jboss.marshalling.Unmarshaller;
-
-import java.io.IOException;
-
-/**
- * ExtendedResponseExternalizer.
- *
- * @author Galder Zamarreño
- * @since 4.0
- */
- at Immutable
-public class ExtendedResponseExternalizer implements Externalizer {
-
- public void writeObject(Marshaller output, Object subject) throws IOException {
- ExtendedResponse er = (ExtendedResponse) subject;
- output.writeBoolean(er.isReplayIgnoredRequests());
- output.writeObject(er.getResponse());
- }
-
- public Object readObject(Unmarshaller input) throws IOException, ClassNotFoundException {
- boolean replayIgnoredRequests = input.readBoolean();
- Response response = (Response) input.readObject();
- return new ExtendedResponse(response, replayIgnoredRequests);
- }
-
-}
Copied: trunk/core/src/main/java/org/infinispan/marshall/exts/ExtendedResponseExternalizer.java (from rev 478, trunk/core/src/main/java/org/infinispan/marshall/jboss/externalizers/ExtendedResponseExternalizer.java)
===================================================================
--- trunk/core/src/main/java/org/infinispan/marshall/exts/ExtendedResponseExternalizer.java (rev 0)
+++ trunk/core/src/main/java/org/infinispan/marshall/exts/ExtendedResponseExternalizer.java 2009-06-17 17:24:43 UTC (rev 479)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.infinispan.marshall.exts;
+
+ import net.jcip.annotations.Immutable;
+
+import org.infinispan.marshall.jboss.Externalizer;
+import org.infinispan.remoting.responses.ExtendedResponse;
+import org.infinispan.remoting.responses.Response;
+
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+
+/**
+ * ExtendedResponseExternalizer.
+ *
+ * @author Galder Zamarreño
+ * @since 4.0
+ */
+ at Immutable
+public class ExtendedResponseExternalizer implements Externalizer {
+
+ public void writeObject(ObjectOutput output, Object subject) throws IOException {
+ ExtendedResponse er = (ExtendedResponse) subject;
+ output.writeBoolean(er.isReplayIgnoredRequests());
+ output.writeObject(er.getResponse());
+ }
+
+ public Object readObject(ObjectInput input) throws IOException, ClassNotFoundException {
+ boolean replayIgnoredRequests = input.readBoolean();
+ Response response = (Response) input.readObject();
+ return new ExtendedResponse(response, replayIgnoredRequests);
+ }
+
+}
Deleted: trunk/core/src/main/java/org/infinispan/marshall/exts/GlobalTransactionExternalizer.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/marshall/jboss/externalizers/GlobalTransactionExternalizer.java 2009-06-17 16:31:30 UTC (rev 477)
+++ trunk/core/src/main/java/org/infinispan/marshall/exts/GlobalTransactionExternalizer.java 2009-06-17 17:24:43 UTC (rev 479)
@@ -1,58 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.infinispan.marshall.jboss.externalizers;
-
- import net.jcip.annotations.Immutable;
-
-import org.infinispan.marshall.jboss.Externalizer;
-import org.infinispan.remoting.transport.Address;
-import org.infinispan.transaction.xa.GlobalTransaction;
-import org.jboss.marshalling.Marshaller;
-import org.jboss.marshalling.Unmarshaller;
-
-import java.io.IOException;
-
-/**
- * GlobalTransactionExternalizer.
- *
- * @author Galder Zamarreño
- * @since 4.0
- */
- at Immutable
-public class GlobalTransactionExternalizer implements Externalizer {
-
- public void writeObject(Marshaller output, Object subject) throws IOException {
- GlobalTransaction gtx = (GlobalTransaction) subject;
- output.writeLong(gtx.getId());
- output.writeObject(gtx.getAddress());
- }
-
- public Object readObject(Unmarshaller input) throws IOException, ClassNotFoundException {
- GlobalTransaction gtx = new GlobalTransaction();
- long id = input.readLong();
- Object address = input.readObject();
- gtx.setId(id);
- gtx.setAddress((Address) address);
- return gtx;
- }
-
-}
Copied: trunk/core/src/main/java/org/infinispan/marshall/exts/GlobalTransactionExternalizer.java (from rev 478, trunk/core/src/main/java/org/infinispan/marshall/jboss/externalizers/GlobalTransactionExternalizer.java)
===================================================================
--- trunk/core/src/main/java/org/infinispan/marshall/exts/GlobalTransactionExternalizer.java (rev 0)
+++ trunk/core/src/main/java/org/infinispan/marshall/exts/GlobalTransactionExternalizer.java 2009-06-17 17:24:43 UTC (rev 479)
@@ -0,0 +1,58 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.infinispan.marshall.exts;
+
+ import net.jcip.annotations.Immutable;
+
+import org.infinispan.marshall.jboss.Externalizer;
+import org.infinispan.remoting.transport.Address;
+import org.infinispan.transaction.xa.GlobalTransaction;
+
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+
+/**
+ * GlobalTransactionExternalizer.
+ *
+ * @author Galder Zamarreño
+ * @since 4.0
+ */
+ at Immutable
+public class GlobalTransactionExternalizer implements Externalizer {
+
+ public void writeObject(ObjectOutput output, Object subject) throws IOException {
+ GlobalTransaction gtx = (GlobalTransaction) subject;
+ output.writeLong(gtx.getId());
+ output.writeObject(gtx.getAddress());
+ }
+
+ public Object readObject(ObjectInput input) throws IOException, ClassNotFoundException {
+ GlobalTransaction gtx = new GlobalTransaction();
+ long id = input.readLong();
+ Object address = input.readObject();
+ gtx.setId(id);
+ gtx.setAddress((Address) address);
+ return gtx;
+ }
+
+}
Deleted: trunk/core/src/main/java/org/infinispan/marshall/exts/ImmortalCacheEntryExternalizer.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/marshall/jboss/externalizers/ImmortalCacheEntryExternalizer.java 2009-06-17 16:31:30 UTC (rev 477)
+++ trunk/core/src/main/java/org/infinispan/marshall/exts/ImmortalCacheEntryExternalizer.java 2009-06-17 17:24:43 UTC (rev 479)
@@ -1,55 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.infinispan.marshall.jboss.externalizers;
-
-import java.io.IOException;
-
-import net.jcip.annotations.Immutable;
-
-import org.infinispan.container.entries.ImmortalCacheEntry;
-import org.infinispan.container.entries.InternalEntryFactory;
-import org.infinispan.marshall.jboss.Externalizer;
-import org.jboss.marshalling.Marshaller;
-import org.jboss.marshalling.Unmarshaller;
-
-/**
- * ImmortalCacheEntryExternalizer.
- *
- * @author Galder Zamarreño
- * @since 4.0
- */
- at Immutable
-public class ImmortalCacheEntryExternalizer implements Externalizer {
-
- public void writeObject(Marshaller output, Object subject) throws IOException {
- ImmortalCacheEntry ice = (ImmortalCacheEntry) subject;
- output.writeObject(ice.getKey());
- output.writeObject(ice.getValue());
- }
-
- public Object readObject(Unmarshaller input) throws IOException, ClassNotFoundException {
- Object k = input.readObject();
- Object v = input.readObject();
- return InternalEntryFactory.create(k, v);
- }
-
-}
Copied: trunk/core/src/main/java/org/infinispan/marshall/exts/ImmortalCacheEntryExternalizer.java (from rev 478, trunk/core/src/main/java/org/infinispan/marshall/jboss/externalizers/ImmortalCacheEntryExternalizer.java)
===================================================================
--- trunk/core/src/main/java/org/infinispan/marshall/exts/ImmortalCacheEntryExternalizer.java (rev 0)
+++ trunk/core/src/main/java/org/infinispan/marshall/exts/ImmortalCacheEntryExternalizer.java 2009-06-17 17:24:43 UTC (rev 479)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.infinispan.marshall.exts;
+
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+
+import net.jcip.annotations.Immutable;
+
+import org.infinispan.container.entries.ImmortalCacheEntry;
+import org.infinispan.container.entries.InternalEntryFactory;
+import org.infinispan.marshall.jboss.Externalizer;
+
+/**
+ * ImmortalCacheEntryExternalizer.
+ *
+ * @author Galder Zamarreño
+ * @since 4.0
+ */
+ at Immutable
+public class ImmortalCacheEntryExternalizer implements Externalizer {
+
+ public void writeObject(ObjectOutput output, Object subject) throws IOException {
+ ImmortalCacheEntry ice = (ImmortalCacheEntry) subject;
+ output.writeObject(ice.getKey());
+ output.writeObject(ice.getValue());
+ }
+
+ public Object readObject(ObjectInput input) throws IOException, ClassNotFoundException {
+ Object k = input.readObject();
+ Object v = input.readObject();
+ return InternalEntryFactory.create(k, v);
+ }
+
+}
Deleted: trunk/core/src/main/java/org/infinispan/marshall/exts/ImmortalCacheValueExternalizer.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/marshall/jboss/externalizers/ImmortalCacheValueExternalizer.java 2009-06-17 16:31:30 UTC (rev 477)
+++ trunk/core/src/main/java/org/infinispan/marshall/exts/ImmortalCacheValueExternalizer.java 2009-06-17 17:24:43 UTC (rev 479)
@@ -1,53 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.infinispan.marshall.jboss.externalizers;
-
-import java.io.IOException;
-
-import net.jcip.annotations.Immutable;
-
-import org.infinispan.container.entries.ImmortalCacheValue;
-import org.infinispan.container.entries.InternalEntryFactory;
-import org.infinispan.marshall.jboss.Externalizer;
-import org.jboss.marshalling.Marshaller;
-import org.jboss.marshalling.Unmarshaller;
-
-/**
- * ImmortalCacheValueExternalizer.
- *
- * @author Galder Zamarreño
- * @since 4.0
- */
- at Immutable
-public class ImmortalCacheValueExternalizer implements Externalizer {
-
- public void writeObject(Marshaller output, Object subject) throws IOException {
- ImmortalCacheValue icv = (ImmortalCacheValue) subject;
- output.writeObject(icv.getValue());
- }
-
- public Object readObject(Unmarshaller input) throws IOException, ClassNotFoundException {
- Object v = input.readObject();
- return InternalEntryFactory.createValue(v);
- }
-
-}
Copied: trunk/core/src/main/java/org/infinispan/marshall/exts/ImmortalCacheValueExternalizer.java (from rev 478, trunk/core/src/main/java/org/infinispan/marshall/jboss/externalizers/ImmortalCacheValueExternalizer.java)
===================================================================
--- trunk/core/src/main/java/org/infinispan/marshall/exts/ImmortalCacheValueExternalizer.java (rev 0)
+++ trunk/core/src/main/java/org/infinispan/marshall/exts/ImmortalCacheValueExternalizer.java 2009-06-17 17:24:43 UTC (rev 479)
@@ -0,0 +1,53 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.infinispan.marshall.exts;
+
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+
+import net.jcip.annotations.Immutable;
+
+import org.infinispan.container.entries.ImmortalCacheValue;
+import org.infinispan.container.entries.InternalEntryFactory;
+import org.infinispan.marshall.jboss.Externalizer;
+
+/**
+ * ImmortalCacheValueExternalizer.
+ *
+ * @author Galder Zamarreño
+ * @since 4.0
+ */
+ at Immutable
+public class ImmortalCacheValueExternalizer implements Externalizer {
+
+ public void writeObject(ObjectOutput output, Object subject) throws IOException {
+ ImmortalCacheValue icv = (ImmortalCacheValue) subject;
+ output.writeObject(icv.getValue());
+ }
+
+ public Object readObject(ObjectInput input) throws IOException, ClassNotFoundException {
+ Object v = input.readObject();
+ return InternalEntryFactory.createValue(v);
+ }
+
+}
Deleted: trunk/core/src/main/java/org/infinispan/marshall/exts/ImmutableMapExternalizer.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/marshall/jboss/externalizers/ImmutableMapExternalizer.java 2009-06-17 16:31:30 UTC (rev 477)
+++ trunk/core/src/main/java/org/infinispan/marshall/exts/ImmutableMapExternalizer.java 2009-06-17 17:24:43 UTC (rev 479)
@@ -1,54 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.infinispan.marshall.jboss.externalizers;
-
-import net.jcip.annotations.Immutable;
-import org.infinispan.marshall.jboss.MarshallUtil;
-import org.infinispan.marshall.jboss.Externalizer;
-import org.infinispan.util.Immutables;
-import org.jboss.marshalling.Marshaller;
-import org.jboss.marshalling.Unmarshaller;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * ImmutableExternalizer.
- *
- * @author Galder Zamarreño
- * @since 4.0
- */
- at Immutable
-public class ImmutableMapExternalizer implements Externalizer {
-
- public void writeObject(Marshaller output, Object subject) throws IOException {
- MarshallUtil.marshallMap((Map) subject, output);
- }
-
- public Object readObject(Unmarshaller input) throws IOException, ClassNotFoundException {
- Map map = new HashMap();
- MarshallUtil.unmarshallMap(map, input);
- return Immutables.immutableMapWrap(map);
- }
-
-}
Copied: trunk/core/src/main/java/org/infinispan/marshall/exts/ImmutableMapExternalizer.java (from rev 478, trunk/core/src/main/java/org/infinispan/marshall/jboss/externalizers/ImmutableMapExternalizer.java)
===================================================================
--- trunk/core/src/main/java/org/infinispan/marshall/exts/ImmutableMapExternalizer.java (rev 0)
+++ trunk/core/src/main/java/org/infinispan/marshall/exts/ImmutableMapExternalizer.java 2009-06-17 17:24:43 UTC (rev 479)
@@ -0,0 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.infinispan.marshall.exts;
+
+import net.jcip.annotations.Immutable;
+import org.infinispan.marshall.jboss.MarshallUtil;
+import org.infinispan.marshall.jboss.Externalizer;
+import org.infinispan.util.Immutables;
+
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * ImmutableExternalizer.
+ *
+ * @author Galder Zamarreño
+ * @since 4.0
+ */
+ at Immutable
+public class ImmutableMapExternalizer implements Externalizer {
+
+ public void writeObject(ObjectOutput output, Object subject) throws IOException {
+ MarshallUtil.marshallMap((Map) subject, output);
+ }
+
+ public Object readObject(ObjectInput input) throws IOException, ClassNotFoundException {
+ Map map = new HashMap();
+ MarshallUtil.unmarshallMap(map, input);
+ return Immutables.immutableMapWrap(map);
+ }
+
+}
Deleted: trunk/core/src/main/java/org/infinispan/marshall/exts/JGroupsAddressExternalizer.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/marshall/jboss/externalizers/JGroupsAddressExternalizer.java 2009-06-17 16:31:30 UTC (rev 477)
+++ trunk/core/src/main/java/org/infinispan/marshall/exts/JGroupsAddressExternalizer.java 2009-06-17 17:24:43 UTC (rev 479)
@@ -1,52 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.infinispan.marshall.jboss.externalizers;
-
-import net.jcip .annotations.Immutable;
-
-import org.infinispan.marshall.jboss.Externalizer;
-import org.infinispan.remoting.transport.jgroups.JGroupsAddress;
-import org.jboss.marshalling.Marshaller;
-import org.jboss.marshalling.Unmarshaller;
-
-import java.io.IOException;
-
-/**
- * JGroupsAddressExternalizer.
- *
- * @author Galder Zamarreño
- * @since 4.0
- */
- at Immutable
-public class JGroupsAddressExternalizer implements Externalizer {
-
- public void writeObject(Marshaller output, Object subject) throws IOException {
- JGroupsAddress address = (JGroupsAddress) subject;
- output.writeObject(address.getJGroupsAddress());
- }
-
- public Object readObject(Unmarshaller unmarshaller) throws IOException, ClassNotFoundException {
- JGroupsAddress address = new JGroupsAddress();
- address.setJGroupsAddress((org.jgroups.Address) unmarshaller.readObject());
- return address;
- }
-}
Copied: trunk/core/src/main/java/org/infinispan/marshall/exts/JGroupsAddressExternalizer.java (from rev 478, trunk/core/src/main/java/org/infinispan/marshall/jboss/externalizers/JGroupsAddressExternalizer.java)
===================================================================
--- trunk/core/src/main/java/org/infinispan/marshall/exts/JGroupsAddressExternalizer.java (rev 0)
+++ trunk/core/src/main/java/org/infinispan/marshall/exts/JGroupsAddressExternalizer.java 2009-06-17 17:24:43 UTC (rev 479)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.infinispan.marshall.exts;
+
+import net.jcip .annotations.Immutable;
+
+import org.infinispan.marshall.jboss.Externalizer;
+import org.infinispan.remoting.transport.jgroups.JGroupsAddress;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+
+/**
+ * JGroupsAddressExternalizer.
+ *
+ * @author Galder Zamarreño
+ * @since 4.0
+ */
+ at Immutable
+public class JGroupsAddressExternalizer implements Externalizer {
+
+ public void writeObject(ObjectOutput output, Object subject) throws IOException {
+ JGroupsAddress address = (JGroupsAddress) subject;
+ output.writeObject(address.getJGroupsAddress());
+ }
+
+ public Object readObject(ObjectInput unmarshaller) throws IOException, ClassNotFoundException {
+ JGroupsAddress address = new JGroupsAddress();
+ address.setJGroupsAddress((org.jgroups.Address) unmarshaller.readObject());
+ return address;
+ }
+}
Deleted: trunk/core/src/main/java/org/infinispan/marshall/exts/LinkedListExternalizer.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/marshall/jboss/externalizers/LinkedListExternalizer.java 2009-06-17 16:31:30 UTC (rev 477)
+++ trunk/core/src/main/java/org/infinispan/marshall/exts/LinkedListExternalizer.java 2009-06-17 17:24:43 UTC (rev 479)
@@ -1,54 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.infinispan.marshall.jboss.externalizers;
-
-import net.jcip.annotations.Immutable;
-import org.infinispan.marshall.jboss.MarshallUtil;
-import org.infinispan.marshall.jboss.Externalizer;
-import org.jboss.marshalling.Marshaller;
-import org.jboss.marshalling.Unmarshaller;
-
-import java.io.IOException;
-import java.util.Collection;
-import java.util.LinkedList;
-
-/**
- * LinkedListExternalizer.
- *
- * @author Galder Zamarreño
- * @since 4.0
- */
- at Immutable
-public class LinkedListExternalizer implements Externalizer {
-
- public void writeObject(Marshaller output, Object subject) throws IOException {
- MarshallUtil.marshallCollection((Collection) subject, output);
- }
-
- public Object readObject(Unmarshaller input) throws IOException, ClassNotFoundException {
- int size = MarshallUtil.readUnsignedInt(input);
- LinkedList l = new LinkedList();
- for (int i = 0; i < size; i++) l.add(input.readObject());
- return l;
- }
-
-}
Copied: trunk/core/src/main/java/org/infinispan/marshall/exts/LinkedListExternalizer.java (from rev 478, trunk/core/src/main/java/org/infinispan/marshall/jboss/externalizers/LinkedListExternalizer.java)
===================================================================
--- trunk/core/src/main/java/org/infinispan/marshall/exts/LinkedListExternalizer.java (rev 0)
+++ trunk/core/src/main/java/org/infinispan/marshall/exts/LinkedListExternalizer.java 2009-06-17 17:24:43 UTC (rev 479)
@@ -0,0 +1,56 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.infinispan.marshall.exts;
+
+import net.jcip.annotations.Immutable;
+
+import org.infinispan.io.UnsignedNumeric;
+import org.infinispan.marshall.jboss.MarshallUtil;
+import org.infinispan.marshall.jboss.Externalizer;
+
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import java.util.Collection;
+import java.util.LinkedList;
+
+/**
+ * LinkedListExternalizer.
+ *
+ * @author Galder Zamarreño
+ * @since 4.0
+ */
+ at Immutable
+public class LinkedListExternalizer implements Externalizer {
+
+ public void writeObject(ObjectOutput output, Object subject) throws IOException {
+ MarshallUtil.marshallCollection((Collection) subject, output);
+ }
+
+ public Object readObject(ObjectInput input) throws IOException, ClassNotFoundException {
+ int size = UnsignedNumeric.readUnsignedInt(input);
+ LinkedList l = new LinkedList();
+ for (int i = 0; i < size; i++) l.add(input.readObject());
+ return l;
+ }
+
+}
Deleted: trunk/core/src/main/java/org/infinispan/marshall/exts/MapExternalizer.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/marshall/jboss/externalizers/MapExternalizer.java 2009-06-17 16:31:30 UTC (rev 477)
+++ trunk/core/src/main/java/org/infinispan/marshall/exts/MapExternalizer.java 2009-06-17 17:24:43 UTC (rev 479)
@@ -1,78 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.infinispan.marshall.jboss.externalizers;
-
-import org.infinispan.marshall.jboss.MarshallUtil;
-import org.infinispan.marshall.jboss.Externalizer;
-import org.infinispan.util.FastCopyHashMap;
-import org.jboss.marshalling.Marshaller;
-import org.jboss.marshalling.Unmarshaller;
-import org.jboss.marshalling.util.IdentityIntMap;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.TreeMap;
-
-/**
- * Map externalizer for all map implementations except immutable maps and singleton maps, i.e. FastCopyHashMap, HashMap,
- * TreeMap.
- *
- * @author Galder Zamarreño
- * @since 4.0
- */
-public class MapExternalizer implements Externalizer {
- private static final int HASHMAP = 0;
- private static final int TREEMAP = 1;
- private static final int FASTCOPYHASHMAP = 2;
- private final IdentityIntMap<Class<?>> numbers = new IdentityIntMap<Class<?>>(3);
-
- public MapExternalizer() {
- numbers.put(HashMap.class, HASHMAP);
- numbers.put(TreeMap.class, TREEMAP);
- numbers.put(FastCopyHashMap.class, FASTCOPYHASHMAP);
- }
-
- public void writeObject(Marshaller output, Object subject) throws IOException {
- int number = numbers.get(subject.getClass(), -1);
- output.writeByte(number);
- MarshallUtil.marshallMap((Map) subject, output);
- }
-
- public Object readObject(Unmarshaller input) throws IOException, ClassNotFoundException {
- int magicNumber = input.readUnsignedByte();
- Map subject = null;
- switch (magicNumber) {
- case HASHMAP:
- subject = new HashMap();
- break;
- case TREEMAP:
- subject = new TreeMap();
- break;
- case FASTCOPYHASHMAP:
- subject = new FastCopyHashMap();
- break;
- }
- MarshallUtil.unmarshallMap(subject, input);
- return subject;
- }
-}
Copied: trunk/core/src/main/java/org/infinispan/marshall/exts/MapExternalizer.java (from rev 478, trunk/core/src/main/java/org/infinispan/marshall/jboss/externalizers/MapExternalizer.java)
===================================================================
--- trunk/core/src/main/java/org/infinispan/marshall/exts/MapExternalizer.java (rev 0)
+++ trunk/core/src/main/java/org/infinispan/marshall/exts/MapExternalizer.java 2009-06-17 17:24:43 UTC (rev 479)
@@ -0,0 +1,78 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.infinispan.marshall.exts;
+
+import org.infinispan.marshall.jboss.MarshallUtil;
+import org.infinispan.marshall.jboss.Externalizer;
+import org.infinispan.util.FastCopyHashMap;
+import org.jboss.marshalling.util.IdentityIntMap;
+
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.TreeMap;
+
+/**
+ * Map externalizer for all map implementations except immutable maps and singleton maps, i.e. FastCopyHashMap, HashMap,
+ * TreeMap.
+ *
+ * @author Galder Zamarreño
+ * @since 4.0
+ */
+public class MapExternalizer implements Externalizer {
+ private static final int HASHMAP = 0;
+ private static final int TREEMAP = 1;
+ private static final int FASTCOPYHASHMAP = 2;
+ private final IdentityIntMap<Class<?>> numbers = new IdentityIntMap<Class<?>>(3);
+
+ public MapExternalizer() {
+ numbers.put(HashMap.class, HASHMAP);
+ numbers.put(TreeMap.class, TREEMAP);
+ numbers.put(FastCopyHashMap.class, FASTCOPYHASHMAP);
+ }
+
+ public void writeObject(ObjectOutput output, Object subject) throws IOException {
+ int number = numbers.get(subject.getClass(), -1);
+ output.writeByte(number);
+ MarshallUtil.marshallMap((Map) subject, output);
+ }
+
+ public Object readObject(ObjectInput input) throws IOException, ClassNotFoundException {
+ int magicNumber = input.readUnsignedByte();
+ Map subject = null;
+ switch (magicNumber) {
+ case HASHMAP:
+ subject = new HashMap();
+ break;
+ case TREEMAP:
+ subject = new TreeMap();
+ break;
+ case FASTCOPYHASHMAP:
+ subject = new FastCopyHashMap();
+ break;
+ }
+ MarshallUtil.unmarshallMap(subject, input);
+ return subject;
+ }
+}
Deleted: trunk/core/src/main/java/org/infinispan/marshall/exts/MarshalledValueExternalizer.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/marshall/jboss/externalizers/MarshalledValueExternalizer.java 2009-06-17 16:31:30 UTC (rev 477)
+++ trunk/core/src/main/java/org/infinispan/marshall/exts/MarshalledValueExternalizer.java 2009-06-17 17:24:43 UTC (rev 479)
@@ -1,61 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.infinispan.marshall.jboss.externalizers;
-
-import org.infinispan.io.UnsignedNumeric;
-import org.infinispan.marshall.MarshalledValue;
-import org.infinispan.marshall.jboss.Externalizer;
-import org.jboss.marshalling.Marshaller;
-import org.jboss.marshalling.Unmarshaller;
-
-import java.io.IOException;
-
-/**
- * MarshalledValueExternalizer.
- *
- * @author Galder Zamarreño
- * @since 4.0
- */
-public class MarshalledValueExternalizer implements Externalizer {
- private org.infinispan.marshall.Marshaller ispnMarshaller;
-
- public void init(org.infinispan.marshall.Marshaller ispnMarshaller) {
- this.ispnMarshaller = ispnMarshaller;
- }
-
- public void writeObject(Marshaller output, Object subject) throws IOException {
- MarshalledValue mv = ((MarshalledValue) subject);
- byte[] raw = mv.getRaw();
- UnsignedNumeric.writeUnsignedInt(output, raw.length);
- output.write(raw);
- output.writeInt(mv.hashCode());
- }
-
- public Object readObject(Unmarshaller input) throws IOException, ClassNotFoundException {
- int length = UnsignedNumeric.readUnsignedInt(input);
- byte[] raw = new byte[length];
- input.readFully(raw);
- int hc = input.readInt();
- return new MarshalledValue(raw, hc, ispnMarshaller);
- }
-
-}
Copied: trunk/core/src/main/java/org/infinispan/marshall/exts/MarshalledValueExternalizer.java (from rev 478, trunk/core/src/main/java/org/infinispan/marshall/jboss/externalizers/MarshalledValueExternalizer.java)
===================================================================
--- trunk/core/src/main/java/org/infinispan/marshall/exts/MarshalledValueExternalizer.java (rev 0)
+++ trunk/core/src/main/java/org/infinispan/marshall/exts/MarshalledValueExternalizer.java 2009-06-17 17:24:43 UTC (rev 479)
@@ -0,0 +1,61 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.infinispan.marshall.exts;
+
+import org.infinispan.io.UnsignedNumeric;
+import org.infinispan.marshall.MarshalledValue;
+import org.infinispan.marshall.jboss.Externalizer;
+
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+
+/**
+ * MarshalledValueExternalizer.
+ *
+ * @author Galder Zamarreño
+ * @since 4.0
+ */
+public class MarshalledValueExternalizer implements Externalizer {
+ private org.infinispan.marshall.Marshaller ispnMarshaller;
+
+ public void init(org.infinispan.marshall.Marshaller ispnMarshaller) {
+ this.ispnMarshaller = ispnMarshaller;
+ }
+
+ public void writeObject(ObjectOutput output, Object subject) throws IOException {
+ MarshalledValue mv = ((MarshalledValue) subject);
+ byte[] raw = mv.getRaw();
+ UnsignedNumeric.writeUnsignedInt(output, raw.length);
+ output.write(raw);
+ output.writeInt(mv.hashCode());
+ }
+
+ public Object readObject(ObjectInput input) throws IOException, ClassNotFoundException {
+ int length = UnsignedNumeric.readUnsignedInt(input);
+ byte[] raw = new byte[length];
+ input.readFully(raw);
+ int hc = input.readInt();
+ return new MarshalledValue(raw, hc, ispnMarshaller);
+ }
+
+}
Deleted: trunk/core/src/main/java/org/infinispan/marshall/exts/MortalCacheEntryExternalizer.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/marshall/jboss/externalizers/MortalCacheEntryExternalizer.java 2009-06-17 16:31:30 UTC (rev 477)
+++ trunk/core/src/main/java/org/infinispan/marshall/exts/MortalCacheEntryExternalizer.java 2009-06-17 17:24:43 UTC (rev 479)
@@ -1,60 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.infinispan.marshall.jboss.externalizers;
-
-import java.io.IOException;
-
-import net.jcip.annotations.Immutable;
-
-import org.infinispan.container.entries.InternalEntryFactory;
-import org.infinispan.container.entries.MortalCacheEntry;
-import org.infinispan.io.UnsignedNumeric;
-import org.infinispan.marshall.jboss.Externalizer;
-import org.jboss.marshalling.Marshaller;
-import org.jboss.marshalling.Unmarshaller;
-
-/**
- * MortalCacheEntryExternalizer.
- *
- * @author Galder Zamarreño
- * @since 4.0
- */
- at Immutable
-public class MortalCacheEntryExternalizer implements Externalizer {
-
- public void writeObject(Marshaller output, Object subject) throws IOException {
- MortalCacheEntry ice = (MortalCacheEntry) subject;
- output.writeObject(ice.getKey());
- output.writeObject(ice.getValue());
- UnsignedNumeric.writeUnsignedLong(output, ice.getCreated());
- output.writeLong(ice.getLifespan()); // could be negative so should not use unsigned longs
- }
-
- public Object readObject(Unmarshaller input) throws IOException, ClassNotFoundException {
- Object k = input.readObject();
- Object v = input.readObject();
- long created = UnsignedNumeric.readUnsignedLong(input);
- Long lifespan = input.readLong();
- return InternalEntryFactory.create(k, v, created, lifespan, -1, -1);
- }
-
-}
Copied: trunk/core/src/main/java/org/infinispan/marshall/exts/MortalCacheEntryExternalizer.java (from rev 478, trunk/core/src/main/java/org/infinispan/marshall/jboss/externalizers/MortalCacheEntryExternalizer.java)
===================================================================
--- trunk/core/src/main/java/org/infinispan/marshall/exts/MortalCacheEntryExternalizer.java (rev 0)
+++ trunk/core/src/main/java/org/infinispan/marshall/exts/MortalCacheEntryExternalizer.java 2009-06-17 17:24:43 UTC (rev 479)
@@ -0,0 +1,60 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.infinispan.marshall.exts;
+
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+
+import net.jcip.annotations.Immutable;
+
+import org.infinispan.container.entries.InternalEntryFactory;
+import org.infinispan.container.entries.MortalCacheEntry;
+import org.infinispan.io.UnsignedNumeric;
+import org.infinispan.marshall.jboss.Externalizer;
+
+/**
+ * MortalCacheEntryExternalizer.
+ *
+ * @author Galder Zamarreño
+ * @since 4.0
+ */
+ at Immutable
+public class MortalCacheEntryExternalizer implements Externalizer {
+
+ public void writeObject(ObjectOutput output, Object subject) throws IOException {
+ MortalCacheEntry ice = (MortalCacheEntry) subject;
+ output.writeObject(ice.getKey());
+ output.writeObject(ice.getValue());
+ UnsignedNumeric.writeUnsignedLong(output, ice.getCreated());
+ output.writeLong(ice.getLifespan()); // could be negative so should not use unsigned longs
+ }
+
+ public Object readObject(ObjectInput input) throws IOException, ClassNotFoundException {
+ Object k = input.readObject();
+ Object v = input.readObject();
+ long created = UnsignedNumeric.readUnsignedLong(input);
+ Long lifespan = input.readLong();
+ return InternalEntryFactory.create(k, v, created, lifespan, -1, -1);
+ }
+
+}
Deleted: trunk/core/src/main/java/org/infinispan/marshall/exts/MortalCacheValueExternalizer.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/marshall/jboss/externalizers/MortalCacheValueExternalizer.java 2009-06-17 16:31:30 UTC (rev 477)
+++ trunk/core/src/main/java/org/infinispan/marshall/exts/MortalCacheValueExternalizer.java 2009-06-17 17:24:43 UTC (rev 479)
@@ -1,55 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.infinispan.marshall.jboss.externalizers;
-
-import java.io.IOException;
-
-import org.infinispan.container.entries.InternalEntryFactory;
-import org.infinispan.container.entries.MortalCacheValue;
-import org.infinispan.io.UnsignedNumeric;
-import org.infinispan.marshall.jboss.Externalizer;
-import org.jboss.marshalling.Marshaller;
-import org.jboss.marshalling.Unmarshaller;
-
-/**
- * MortalCacheValueExternalizer.
- *
- * @author Galder Zamarreño
- * @since 4.0
- */
-public class MortalCacheValueExternalizer implements Externalizer {
-
- public void writeObject(Marshaller output, Object subject) throws IOException {
- MortalCacheValue icv = (MortalCacheValue) subject;
- output.writeObject(icv.getValue());
- UnsignedNumeric.writeUnsignedLong(output, icv.getCreated());
- output.writeLong(icv.getLifespan()); // could be negative so should not use unsigned longs
- }
-
- public Object readObject(Unmarshaller input) throws IOException, ClassNotFoundException {
- Object v = input.readObject();
- long created = UnsignedNumeric.readUnsignedLong(input);
- Long lifespan = input.readLong();
- return InternalEntryFactory.createValue(v, created, lifespan, -1, -1);
- }
-
-}
Copied: trunk/core/src/main/java/org/infinispan/marshall/exts/MortalCacheValueExternalizer.java (from rev 478, trunk/core/src/main/java/org/infinispan/marshall/jboss/externalizers/MortalCacheValueExternalizer.java)
===================================================================
--- trunk/core/src/main/java/org/infinispan/marshall/exts/MortalCacheValueExternalizer.java (rev 0)
+++ trunk/core/src/main/java/org/infinispan/marshall/exts/MortalCacheValueExternalizer.java 2009-06-17 17:24:43 UTC (rev 479)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.infinispan.marshall.exts;
+
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+
+import org.infinispan.container.entries.InternalEntryFactory;
+import org.infinispan.container.entries.MortalCacheValue;
+import org.infinispan.io.UnsignedNumeric;
+import org.infinispan.marshall.jboss.Externalizer;
+
+/**
+ * MortalCacheValueExternalizer.
+ *
+ * @author Galder Zamarreño
+ * @since 4.0
+ */
+public class MortalCacheValueExternalizer implements Externalizer {
+
+ public void writeObject(ObjectOutput output, Object subject) throws IOException {
+ MortalCacheValue icv = (MortalCacheValue) subject;
+ output.writeObject(icv.getValue());
+ UnsignedNumeric.writeUnsignedLong(output, icv.getCreated());
+ output.writeLong(icv.getLifespan()); // could be negative so should not use unsigned longs
+ }
+
+ public Object readObject(ObjectInput input) throws IOException, ClassNotFoundException {
+ Object v = input.readObject();
+ long created = UnsignedNumeric.readUnsignedLong(input);
+ Long lifespan = input.readLong();
+ return InternalEntryFactory.createValue(v, created, lifespan, -1, -1);
+ }
+
+}
Deleted: trunk/core/src/main/java/org/infinispan/marshall/exts/ReplicableCommandExternalizer.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/marshall/jboss/externalizers/ReplicableCommandExternalizer.java 2009-06-17 16:31:30 UTC (rev 477)
+++ trunk/core/src/main/java/org/infinispan/marshall/exts/ReplicableCommandExternalizer.java 2009-06-17 17:24:43 UTC (rev 479)
@@ -1,66 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.infinispan.marshall.jboss.externalizers;
-
-import org.infinispan.commands.RemoteCommandFactory;
-import org.infinispan.commands.ReplicableCommand;
-import org.infinispan.marshall.jboss.Externalizer;
-import org.jboss.marshalling.Marshaller;
-import org.jboss.marshalling.Unmarshaller;
-
-import java.io.IOException;
-
-/**
- * ReplicableCommandExternalizer.
- *
- * @author Galder Zamarreño
- * @since 4.0
- */
-public class ReplicableCommandExternalizer implements Externalizer {
- private RemoteCommandFactory cmdFactory;
-
- public void init(RemoteCommandFactory cmdFactory) {
- this.cmdFactory = cmdFactory;
- }
-
- public void writeObject(Marshaller output, Object subject) throws IOException {
- ReplicableCommand command = (ReplicableCommand) subject;
- output.writeShort(command.getCommandId());
- Object[] args = command.getParameters();
- byte numArgs = (byte) (args == null ? 0 : args.length);
- output.writeByte(numArgs);
- for (int i = 0; i < numArgs; i++) {
- output.writeObject(args[i]);
- }
- }
-
- public Object readObject(Unmarshaller input) throws IOException, ClassNotFoundException {
- short methodId = input.readShort();
- byte numArgs = input.readByte();
- Object[] args = null;
- if (numArgs > 0) {
- args = new Object[numArgs];
- for (int i = 0; i < numArgs; i++) args[i] = input.readObject();
- }
- return cmdFactory.fromStream((byte) methodId, args);
- }
-}
\ No newline at end of file
Copied: trunk/core/src/main/java/org/infinispan/marshall/exts/ReplicableCommandExternalizer.java (from rev 478, trunk/core/src/main/java/org/infinispan/marshall/jboss/externalizers/ReplicableCommandExternalizer.java)
===================================================================
--- trunk/core/src/main/java/org/infinispan/marshall/exts/ReplicableCommandExternalizer.java (rev 0)
+++ trunk/core/src/main/java/org/infinispan/marshall/exts/ReplicableCommandExternalizer.java 2009-06-17 17:24:43 UTC (rev 479)
@@ -0,0 +1,66 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.infinispan.marshall.exts;
+
+import org.infinispan.commands.RemoteCommandFactory;
+import org.infinispan.commands.ReplicableCommand;
+import org.infinispan.marshall.jboss.Externalizer;
+
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+
+/**
+ * ReplicableCommandExternalizer.
+ *
+ * @author Galder Zamarreño
+ * @since 4.0
+ */
+public class ReplicableCommandExternalizer implements Externalizer {
+ private RemoteCommandFactory cmdFactory;
+
+ public void init(RemoteCommandFactory cmdFactory) {
+ this.cmdFactory = cmdFactory;
+ }
+
+ public void writeObject(ObjectOutput output, Object subject) throws IOException {
+ ReplicableCommand command = (ReplicableCommand) subject;
+ output.writeShort(command.getCommandId());
+ Object[] args = command.getParameters();
+ byte numArgs = (byte) (args == null ? 0 : args.length);
+ output.writeByte(numArgs);
+ for (int i = 0; i < numArgs; i++) {
+ output.writeObject(args[i]);
+ }
+ }
+
+ public Object readObject(ObjectInput input) throws IOException, ClassNotFoundException {
+ short methodId = input.readShort();
+ byte numArgs = input.readByte();
+ Object[] args = null;
+ if (numArgs > 0) {
+ args = new Object[numArgs];
+ for (int i = 0; i < numArgs; i++) args[i] = input.readObject();
+ }
+ return cmdFactory.fromStream((byte) methodId, args);
+ }
+}
\ No newline at end of file
Deleted: trunk/core/src/main/java/org/infinispan/marshall/exts/SetExternalizer.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/marshall/jboss/externalizers/SetExternalizer.java 2009-06-17 16:31:30 UTC (rev 477)
+++ trunk/core/src/main/java/org/infinispan/marshall/exts/SetExternalizer.java 2009-06-17 17:24:43 UTC (rev 479)
@@ -1,75 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.infinispan.marshall.jboss.externalizers;
-
-import net.jcip.annotations.Immutable;
-import org.infinispan.marshall.jboss.MarshallUtil;
-import org.infinispan.marshall.jboss.Externalizer;
-import org.jboss.marshalling.Marshaller;
-import org.jboss.marshalling.Unmarshaller;
-import org.jboss.marshalling.util.IdentityIntMap;
-
-import java.io.IOException;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Set;
-import java.util.TreeSet;
-
-/**
- * Set externalizer for all set implementations, i.e. HashSet and TreeSet
- *
- * @author Galder Zamarreño
- * @since 4.0
- */
- at Immutable
-public class SetExternalizer implements Externalizer {
- private static final int HASHSET = 0;
- private static final int TREESET = 1;
- private final IdentityIntMap<Class<?>> numbers = new IdentityIntMap<Class<?>>(2);
-
- public SetExternalizer() {
- numbers.put(HashSet.class, HASHSET);
- numbers.put(TreeSet.class, TREESET);
- }
-
- public void writeObject(Marshaller output, Object subject) throws IOException {
- int number = numbers.get(subject.getClass(), -1);
- output.writeByte(number);
- MarshallUtil.marshallCollection((Collection) subject, output);
- }
-
- public Object readObject(Unmarshaller input) throws IOException, ClassNotFoundException {
- int magicNumber = input.readUnsignedByte();
- Set subject = null;
- switch (magicNumber) {
- case HASHSET:
- subject = new HashSet();
- break;
- case TREESET:
- subject = new TreeSet();
- break;
- }
- int size = MarshallUtil.readUnsignedInt(input);
- for (int i = 0; i < size; i++) subject.add(input.readObject());
- return subject;
- }
-}
\ No newline at end of file
Copied: trunk/core/src/main/java/org/infinispan/marshall/exts/SetExternalizer.java (from rev 478, trunk/core/src/main/java/org/infinispan/marshall/jboss/externalizers/SetExternalizer.java)
===================================================================
--- trunk/core/src/main/java/org/infinispan/marshall/exts/SetExternalizer.java (rev 0)
+++ trunk/core/src/main/java/org/infinispan/marshall/exts/SetExternalizer.java 2009-06-17 17:24:43 UTC (rev 479)
@@ -0,0 +1,77 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.infinispan.marshall.exts;
+
+import net.jcip.annotations.Immutable;
+
+import org.infinispan.io.UnsignedNumeric;
+import org.infinispan.marshall.jboss.MarshallUtil;
+import org.infinispan.marshall.jboss.Externalizer;
+import org.jboss.marshalling.util.IdentityIntMap;
+
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.TreeSet;
+
+/**
+ * Set externalizer for all set implementations, i.e. HashSet and TreeSet
+ *
+ * @author Galder Zamarreño
+ * @since 4.0
+ */
+ at Immutable
+public class SetExternalizer implements Externalizer {
+ private static final int HASHSET = 0;
+ private static final int TREESET = 1;
+ private final IdentityIntMap<Class<?>> numbers = new IdentityIntMap<Class<?>>(2);
+
+ public SetExternalizer() {
+ numbers.put(HashSet.class, HASHSET);
+ numbers.put(TreeSet.class, TREESET);
+ }
+
+ public void writeObject(ObjectOutput output, Object subject) throws IOException {
+ int number = numbers.get(subject.getClass(), -1);
+ output.writeByte(number);
+ MarshallUtil.marshallCollection((Collection) subject, output);
+ }
+
+ public Object readObject(ObjectInput input) throws IOException, ClassNotFoundException {
+ int magicNumber = input.readUnsignedByte();
+ Set subject = null;
+ switch (magicNumber) {
+ case HASHSET:
+ subject = new HashSet();
+ break;
+ case TREESET:
+ subject = new TreeSet();
+ break;
+ }
+ int size = UnsignedNumeric.readUnsignedInt(input);
+ for (int i = 0; i < size; i++) subject.add(input.readObject());
+ return subject;
+ }
+}
\ No newline at end of file
Deleted: trunk/core/src/main/java/org/infinispan/marshall/exts/SingletonListExternalizer.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/marshall/jboss/externalizers/SingletonListExternalizer.java 2009-06-17 16:31:30 UTC (rev 477)
+++ trunk/core/src/main/java/org/infinispan/marshall/exts/SingletonListExternalizer.java 2009-06-17 17:24:43 UTC (rev 479)
@@ -1,51 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.infinispan.marshall.jboss.externalizers;
-
-import net.jcip.annotations.Immutable;
-
-import org.infinispan.marshall.jboss.Externalizer;
-import org.jboss.marshalling.Marshaller;
-import org.jboss.marshalling.Unmarshaller;
-
-import java.io.IOException;
-import java.util.Collections;
-import java.util.List;
-
-/**
- * SingletonListExternalizer.
- *
- * @author Galder Zamarreño
- * @since 4.0
- */
- at Immutable
-public class SingletonListExternalizer implements Externalizer {
-
- public void writeObject(Marshaller output, Object subject) throws IOException {
- output.writeObject(((List) subject).get(0));
- }
-
- public Object readObject(Unmarshaller input) throws IOException, ClassNotFoundException {
- return Collections.singletonList(input.readObject());
- }
-
-}
Copied: trunk/core/src/main/java/org/infinispan/marshall/exts/SingletonListExternalizer.java (from rev 478, trunk/core/src/main/java/org/infinispan/marshall/jboss/externalizers/SingletonListExternalizer.java)
===================================================================
--- trunk/core/src/main/java/org/infinispan/marshall/exts/SingletonListExternalizer.java (rev 0)
+++ trunk/core/src/main/java/org/infinispan/marshall/exts/SingletonListExternalizer.java 2009-06-17 17:24:43 UTC (rev 479)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.infinispan.marshall.exts;
+
+import net.jcip.annotations.Immutable;
+
+import org.infinispan.marshall.jboss.Externalizer;
+
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * SingletonListExternalizer.
+ *
+ * @author Galder Zamarreño
+ * @since 4.0
+ */
+ at Immutable
+public class SingletonListExternalizer implements Externalizer {
+
+ public void writeObject(ObjectOutput output, Object subject) throws IOException {
+ output.writeObject(((List) subject).get(0));
+ }
+
+ public Object readObject(ObjectInput input) throws IOException, ClassNotFoundException {
+ return Collections.singletonList(input.readObject());
+ }
+
+}
Deleted: trunk/core/src/main/java/org/infinispan/marshall/exts/SuccessfulResponseExternalizer.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/marshall/jboss/externalizers/SuccessfulResponseExternalizer.java 2009-06-17 16:31:30 UTC (rev 477)
+++ trunk/core/src/main/java/org/infinispan/marshall/exts/SuccessfulResponseExternalizer.java 2009-06-17 17:24:43 UTC (rev 479)
@@ -1,32 +0,0 @@
-package org.infinispan.marshall.jboss.externalizers;
-
-import net.jcip.annotations.Immutable;
-
-import org.infinispan.marshall.jboss.Externalizer;
-import org.infinispan.remoting.responses.SuccessfulResponse;
-import org.jboss.marshalling.Marshaller;
-import org.jboss.marshalling.Unmarshaller;
-
-import java.io.IOException;
-
-/**
- * Externalizes a SuccessfulResponse
- *
- * @author Manik Surtani
- * @since 4.0
- */
- at Immutable
-public class SuccessfulResponseExternalizer implements Externalizer {
-
- public void writeObject(Marshaller output, Object subject) throws IOException {
- SuccessfulResponse sr = (SuccessfulResponse) subject;
- output.writeObject(sr.getResponseValue());
- }
-
- public Object readObject(Unmarshaller input) throws IOException, ClassNotFoundException {
- SuccessfulResponse sr = new SuccessfulResponse();
- sr.setResponseValue(input.readObject());
- return sr;
- }
-
-}
Copied: trunk/core/src/main/java/org/infinispan/marshall/exts/SuccessfulResponseExternalizer.java (from rev 478, trunk/core/src/main/java/org/infinispan/marshall/jboss/externalizers/SuccessfulResponseExternalizer.java)
===================================================================
--- trunk/core/src/main/java/org/infinispan/marshall/exts/SuccessfulResponseExternalizer.java (rev 0)
+++ trunk/core/src/main/java/org/infinispan/marshall/exts/SuccessfulResponseExternalizer.java 2009-06-17 17:24:43 UTC (rev 479)
@@ -0,0 +1,32 @@
+package org.infinispan.marshall.exts;
+
+import net.jcip.annotations.Immutable;
+
+import org.infinispan.marshall.jboss.Externalizer;
+import org.infinispan.remoting.responses.SuccessfulResponse;
+
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+
+/**
+ * Externalizes a SuccessfulResponse
+ *
+ * @author Manik Surtani
+ * @since 4.0
+ */
+ at Immutable
+public class SuccessfulResponseExternalizer implements Externalizer {
+
+ public void writeObject(ObjectOutput output, Object subject) throws IOException {
+ SuccessfulResponse sr = (SuccessfulResponse) subject;
+ output.writeObject(sr.getResponseValue());
+ }
+
+ public Object readObject(ObjectInput input) throws IOException, ClassNotFoundException {
+ SuccessfulResponse sr = new SuccessfulResponse();
+ sr.setResponseValue(input.readObject());
+ return sr;
+ }
+
+}
Deleted: trunk/core/src/main/java/org/infinispan/marshall/exts/TransactionLogExternalizer.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/marshall/jboss/externalizers/TransactionLogExternalizer.java 2009-06-17 16:31:30 UTC (rev 477)
+++ trunk/core/src/main/java/org/infinispan/marshall/exts/TransactionLogExternalizer.java 2009-06-17 17:24:43 UTC (rev 479)
@@ -1,61 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.infinispan.marshall.jboss.externalizers;
-
-import net.jcip.annotations.Immutable;
-import org.infinispan.commands.write.WriteCommand;
-import org.infinispan.marshall.jboss.MarshallUtil;
-import org.infinispan.marshall.jboss.Externalizer;
-import org.infinispan.transaction.xa.GlobalTransaction;
-import org.infinispan.transaction.TransactionLog;
-import org.jboss.marshalling.Marshaller;
-import org.jboss.marshalling.Unmarshaller;
-
-import java.io.IOException;
-
-/**
- * TransactionLogExternalizer.
- *
- * @author Galder Zamarreño
- * @since 4.0
- */
- at Immutable
-public class TransactionLogExternalizer implements Externalizer {
-
- public void writeObject(Marshaller output, Object subject) throws IOException {
- TransactionLog.LogEntry le = (TransactionLog.LogEntry) subject;
- output.writeObject(le.getTransaction());
- WriteCommand[] cmds = le.getModifications();
- MarshallUtil.writeUnsignedInt(output, cmds.length);
- for (WriteCommand c : cmds)
- output.writeObject(c);
- }
-
- public Object readObject(Unmarshaller input) throws IOException, ClassNotFoundException {
- GlobalTransaction gtx = (GlobalTransaction) input.readObject();
- int numCommands = MarshallUtil.readUnsignedInt(input);
- WriteCommand[] cmds = new WriteCommand[numCommands];
- for (int i = 0; i < numCommands; i++) cmds[i] = (WriteCommand) input.readObject();
- return new TransactionLog.LogEntry(gtx, cmds);
- }
-
-}
Copied: trunk/core/src/main/java/org/infinispan/marshall/exts/TransactionLogExternalizer.java (from rev 478, trunk/core/src/main/java/org/infinispan/marshall/jboss/externalizers/TransactionLogExternalizer.java)
===================================================================
--- trunk/core/src/main/java/org/infinispan/marshall/exts/TransactionLogExternalizer.java (rev 0)
+++ trunk/core/src/main/java/org/infinispan/marshall/exts/TransactionLogExternalizer.java 2009-06-17 17:24:43 UTC (rev 479)
@@ -0,0 +1,61 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.infinispan.marshall.exts;
+
+import net.jcip.annotations.Immutable;
+import org.infinispan.commands.write.WriteCommand;
+import org.infinispan.io.UnsignedNumeric;
+import org.infinispan.marshall.jboss.Externalizer;
+import org.infinispan.transaction.xa.GlobalTransaction;
+import org.infinispan.transaction.TransactionLog;
+
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+
+/**
+ * TransactionLogExternalizer.
+ *
+ * @author Galder Zamarreño
+ * @since 4.0
+ */
+ at Immutable
+public class TransactionLogExternalizer implements Externalizer {
+
+ public void writeObject(ObjectOutput output, Object subject) throws IOException {
+ TransactionLog.LogEntry le = (TransactionLog.LogEntry) subject;
+ output.writeObject(le.getTransaction());
+ WriteCommand[] cmds = le.getModifications();
+ UnsignedNumeric.writeUnsignedInt(output, cmds.length);
+ for (WriteCommand c : cmds)
+ output.writeObject(c);
+ }
+
+ public Object readObject(ObjectInput input) throws IOException, ClassNotFoundException {
+ GlobalTransaction gtx = (GlobalTransaction) input.readObject();
+ int numCommands = UnsignedNumeric.readUnsignedInt(input);
+ WriteCommand[] cmds = new WriteCommand[numCommands];
+ for (int i = 0; i < numCommands; i++) cmds[i] = (WriteCommand) input.readObject();
+ return new TransactionLog.LogEntry(gtx, cmds);
+ }
+
+}
Deleted: trunk/core/src/main/java/org/infinispan/marshall/exts/TransientCacheEntryExternalizer.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/marshall/jboss/externalizers/TransientCacheEntryExternalizer.java 2009-06-17 16:31:30 UTC (rev 477)
+++ trunk/core/src/main/java/org/infinispan/marshall/exts/TransientCacheEntryExternalizer.java 2009-06-17 17:24:43 UTC (rev 479)
@@ -1,60 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.infinispan.marshall.jboss.externalizers;
-
-import java.io.IOException;
-
-import net.jcip.annotations.Immutable;
-
-import org.infinispan.container.entries.InternalEntryFactory;
-import org.infinispan.container.entries.TransientCacheEntry;
-import org.infinispan.io.UnsignedNumeric;
-import org.infinispan.marshall.jboss.Externalizer;
-import org.jboss.marshalling.Marshaller;
-import org.jboss.marshalling.Unmarshaller;
-
-/**
- * TransientCacheEntryExternalizer.
- *
- * @author Galder Zamarreño
- * @since 4.0
- */
- at Immutable
-public class TransientCacheEntryExternalizer implements Externalizer {
-
- public void writeObject(Marshaller output, Object subject) throws IOException {
- TransientCacheEntry ice = (TransientCacheEntry) subject;
- output.writeObject(ice.getKey());
- output.writeObject(ice.getValue());
- UnsignedNumeric.writeUnsignedLong(output, ice.getLastUsed());
- output.writeLong(ice.getMaxIdle()); // could be negative so should not use unsigned longs
- }
-
- public Object readObject(Unmarshaller input) throws IOException, ClassNotFoundException {
- Object k = input.readObject();
- Object v = input.readObject();
- long lastUsed = UnsignedNumeric.readUnsignedLong(input);
- Long maxIdle = input.readLong();
- return InternalEntryFactory.create(k, v, -1, -1, lastUsed, maxIdle);
- }
-
-}
Copied: trunk/core/src/main/java/org/infinispan/marshall/exts/TransientCacheEntryExternalizer.java (from rev 478, trunk/core/src/main/java/org/infinispan/marshall/jboss/externalizers/TransientCacheEntryExternalizer.java)
===================================================================
--- trunk/core/src/main/java/org/infinispan/marshall/exts/TransientCacheEntryExternalizer.java (rev 0)
+++ trunk/core/src/main/java/org/infinispan/marshall/exts/TransientCacheEntryExternalizer.java 2009-06-17 17:24:43 UTC (rev 479)
@@ -0,0 +1,60 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.infinispan.marshall.exts;
+
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+
+import net.jcip.annotations.Immutable;
+
+import org.infinispan.container.entries.InternalEntryFactory;
+import org.infinispan.container.entries.TransientCacheEntry;
+import org.infinispan.io.UnsignedNumeric;
+import org.infinispan.marshall.jboss.Externalizer;
+
+/**
+ * TransientCacheEntryExternalizer.
+ *
+ * @author Galder Zamarreño
+ * @since 4.0
+ */
+ at Immutable
+public class TransientCacheEntryExternalizer implements Externalizer {
+
+ public void writeObject(ObjectOutput output, Object subject) throws IOException {
+ TransientCacheEntry ice = (TransientCacheEntry) subject;
+ output.writeObject(ice.getKey());
+ output.writeObject(ice.getValue());
+ UnsignedNumeric.writeUnsignedLong(output, ice.getLastUsed());
+ output.writeLong(ice.getMaxIdle()); // could be negative so should not use unsigned longs
+ }
+
+ public Object readObject(ObjectInput input) throws IOException, ClassNotFoundException {
+ Object k = input.readObject();
+ Object v = input.readObject();
+ long lastUsed = UnsignedNumeric.readUnsignedLong(input);
+ Long maxIdle = input.readLong();
+ return InternalEntryFactory.create(k, v, -1, -1, lastUsed, maxIdle);
+ }
+
+}
Deleted: trunk/core/src/main/java/org/infinispan/marshall/exts/TransientCacheValueExternalizer.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/marshall/jboss/externalizers/TransientCacheValueExternalizer.java 2009-06-17 16:31:30 UTC (rev 477)
+++ trunk/core/src/main/java/org/infinispan/marshall/exts/TransientCacheValueExternalizer.java 2009-06-17 17:24:43 UTC (rev 479)
@@ -1,58 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.infinispan.marshall.jboss.externalizers;
-
-import java.io.IOException;
-
-import net.jcip.annotations.Immutable;
-
-import org.infinispan.container.entries.InternalEntryFactory;
-import org.infinispan.container.entries.TransientCacheValue;
-import org.infinispan.io.UnsignedNumeric;
-import org.infinispan.marshall.jboss.Externalizer;
-import org.jboss.marshalling.Marshaller;
-import org.jboss.marshalling.Unmarshaller;
-
-/**
- * TransientCacheValueExternalizer.
- *
- * @author Galder Zamarreño
- * @since 4.0
- */
- at Immutable
-public class TransientCacheValueExternalizer implements Externalizer {
-
- public void writeObject(Marshaller output, Object subject) throws IOException {
- TransientCacheValue icv = (TransientCacheValue) subject;
- output.writeObject(icv.getValue());
- UnsignedNumeric.writeUnsignedLong(output, icv.getLastUsed());
- output.writeLong(icv.getMaxIdle()); // could be negative so should not use unsigned longs
- }
-
- public Object readObject(Unmarshaller input) throws IOException, ClassNotFoundException {
- Object v = input.readObject();
- long lastUsed = UnsignedNumeric.readUnsignedLong(input);
- Long maxIdle = input.readLong();
- return InternalEntryFactory.createValue(v, -1, -1, lastUsed, maxIdle);
- }
-
-}
Copied: trunk/core/src/main/java/org/infinispan/marshall/exts/TransientCacheValueExternalizer.java (from rev 478, trunk/core/src/main/java/org/infinispan/marshall/jboss/externalizers/TransientCacheValueExternalizer.java)
===================================================================
--- trunk/core/src/main/java/org/infinispan/marshall/exts/TransientCacheValueExternalizer.java (rev 0)
+++ trunk/core/src/main/java/org/infinispan/marshall/exts/TransientCacheValueExternalizer.java 2009-06-17 17:24:43 UTC (rev 479)
@@ -0,0 +1,58 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.infinispan.marshall.exts;
+
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+
+import net.jcip.annotations.Immutable;
+
+import org.infinispan.container.entries.InternalEntryFactory;
+import org.infinispan.container.entries.TransientCacheValue;
+import org.infinispan.io.UnsignedNumeric;
+import org.infinispan.marshall.jboss.Externalizer;
+
+/**
+ * TransientCacheValueExternalizer.
+ *
+ * @author Galder Zamarreño
+ * @since 4.0
+ */
+ at Immutable
+public class TransientCacheValueExternalizer implements Externalizer {
+
+ public void writeObject(ObjectOutput output, Object subject) throws IOException {
+ TransientCacheValue icv = (TransientCacheValue) subject;
+ output.writeObject(icv.getValue());
+ UnsignedNumeric.writeUnsignedLong(output, icv.getLastUsed());
+ output.writeLong(icv.getMaxIdle()); // could be negative so should not use unsigned longs
+ }
+
+ public Object readObject(ObjectInput input) throws IOException, ClassNotFoundException {
+ Object v = input.readObject();
+ long lastUsed = UnsignedNumeric.readUnsignedLong(input);
+ Long maxIdle = input.readLong();
+ return InternalEntryFactory.createValue(v, -1, -1, lastUsed, maxIdle);
+ }
+
+}
Deleted: trunk/core/src/main/java/org/infinispan/marshall/exts/TransientMortalCacheEntryExternalizer.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/marshall/jboss/externalizers/TransientMortalCacheEntryExternalizer.java 2009-06-17 16:31:30 UTC (rev 477)
+++ trunk/core/src/main/java/org/infinispan/marshall/exts/TransientMortalCacheEntryExternalizer.java 2009-06-17 17:24:43 UTC (rev 479)
@@ -1,63 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.infinispan.marshall.jboss.externalizers;
-
-import java.io.IOException;
-
-import net.jcip.annotations.Immutable;
-
-import org.infinispan.container.entries.InternalEntryFactory;
-import org.infinispan.container.entries.TransientMortalCacheEntry;
-import org.infinispan.io.UnsignedNumeric;
-import org.infinispan.marshall.jboss.Externalizer;
-import org.jboss.marshalling.Marshaller;
-import org.jboss.marshalling.Unmarshaller;
-
-/**
- * TransientMortalCacheEntryExternalizer.
- *
- * @author Galder Zamarreño
- * @since 4.0
- */
- at Immutable
-public class TransientMortalCacheEntryExternalizer implements Externalizer {
-
- public void writeObject(Marshaller output, Object subject) throws IOException {
- TransientMortalCacheEntry ice = (TransientMortalCacheEntry) subject;
- output.writeObject(ice.getKey());
- output.writeObject(ice.getValue());
- UnsignedNumeric.writeUnsignedLong(output, ice.getCreated());
- output.writeLong(ice.getLifespan()); // could be negative so should not use unsigned longs
- UnsignedNumeric.writeUnsignedLong(output, ice.getLastUsed());
- output.writeLong(ice.getMaxIdle()); // could be negative so should not use unsigned longs
- }
-
- public Object readObject(Unmarshaller input) throws IOException, ClassNotFoundException {
- Object k = input.readObject();
- Object v = input.readObject();
- long created = UnsignedNumeric.readUnsignedLong(input);
- Long lifespan = input.readLong();
- long lastUsed = UnsignedNumeric.readUnsignedLong(input);
- Long maxIdle = input.readLong();
- return InternalEntryFactory.create(k, v, created, lifespan, lastUsed, maxIdle);
- }
-}
Copied: trunk/core/src/main/java/org/infinispan/marshall/exts/TransientMortalCacheEntryExternalizer.java (from rev 478, trunk/core/src/main/java/org/infinispan/marshall/jboss/externalizers/TransientMortalCacheEntryExternalizer.java)
===================================================================
--- trunk/core/src/main/java/org/infinispan/marshall/exts/TransientMortalCacheEntryExternalizer.java (rev 0)
+++ trunk/core/src/main/java/org/infinispan/marshall/exts/TransientMortalCacheEntryExternalizer.java 2009-06-17 17:24:43 UTC (rev 479)
@@ -0,0 +1,63 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.infinispan.marshall.exts;
+
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+
+import net.jcip.annotations.Immutable;
+
+import org.infinispan.container.entries.InternalEntryFactory;
+import org.infinispan.container.entries.TransientMortalCacheEntry;
+import org.infinispan.io.UnsignedNumeric;
+import org.infinispan.marshall.jboss.Externalizer;
+
+/**
+ * TransientMortalCacheEntryExternalizer.
+ *
+ * @author Galder Zamarreño
+ * @since 4.0
+ */
+ at Immutable
+public class TransientMortalCacheEntryExternalizer implements Externalizer {
+
+ public void writeObject(ObjectOutput output, Object subject) throws IOException {
+ TransientMortalCacheEntry ice = (TransientMortalCacheEntry) subject;
+ output.writeObject(ice.getKey());
+ output.writeObject(ice.getValue());
+ UnsignedNumeric.writeUnsignedLong(output, ice.getCreated());
+ output.writeLong(ice.getLifespan()); // could be negative so should not use unsigned longs
+ UnsignedNumeric.writeUnsignedLong(output, ice.getLastUsed());
+ output.writeLong(ice.getMaxIdle()); // could be negative so should not use unsigned longs
+ }
+
+ public Object readObject(ObjectInput input) throws IOException, ClassNotFoundException {
+ Object k = input.readObject();
+ Object v = input.readObject();
+ long created = UnsignedNumeric.readUnsignedLong(input);
+ Long lifespan = input.readLong();
+ long lastUsed = UnsignedNumeric.readUnsignedLong(input);
+ Long maxIdle = input.readLong();
+ return InternalEntryFactory.create(k, v, created, lifespan, lastUsed, maxIdle);
+ }
+}
Deleted: trunk/core/src/main/java/org/infinispan/marshall/exts/TransientMortalCacheValueExternalizer.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/marshall/jboss/externalizers/TransientMortalCacheValueExternalizer.java 2009-06-17 16:31:30 UTC (rev 477)
+++ trunk/core/src/main/java/org/infinispan/marshall/exts/TransientMortalCacheValueExternalizer.java 2009-06-17 17:24:43 UTC (rev 479)
@@ -1,61 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.infinispan.marshall.jboss.externalizers;
-
-import java.io.IOException;
-
-import net.jcip.annotations.Immutable;
-
-import org.infinispan.container.entries.InternalEntryFactory;
-import org.infinispan.container.entries.TransientMortalCacheValue;
-import org.infinispan.io.UnsignedNumeric;
-import org.infinispan.marshall.jboss.Externalizer;
-import org.jboss.marshalling.Marshaller;
-import org.jboss.marshalling.Unmarshaller;
-
-/**
- * TransientMortalCacheValueExternalizer.
- *
- * @author Galder Zamarreño
- * @since 4.0
- */
- at Immutable
-public class TransientMortalCacheValueExternalizer implements Externalizer {
-
- public void writeObject(Marshaller output, Object subject) throws IOException {
- TransientMortalCacheValue icv = (TransientMortalCacheValue) subject;
- output.writeObject(icv.getValue());
- UnsignedNumeric.writeUnsignedLong(output, icv.getCreated());
- output.writeLong(icv.getLifespan()); // could be negative so should not use unsigned longs
- UnsignedNumeric.writeUnsignedLong(output, icv.getLastUsed());
- output.writeLong(icv.getMaxIdle()); // could be negative so should not use unsigned longs
- }
-
- public Object readObject(Unmarshaller input) throws IOException, ClassNotFoundException {
- Object v = input.readObject();
- long created = UnsignedNumeric.readUnsignedLong(input);
- Long lifespan = input.readLong();
- long lastUsed = UnsignedNumeric.readUnsignedLong(input);
- Long maxIdle = input.readLong();
- return InternalEntryFactory.createValue(v, created, lifespan, lastUsed, maxIdle);
- }
-}
Copied: trunk/core/src/main/java/org/infinispan/marshall/exts/TransientMortalCacheValueExternalizer.java (from rev 478, trunk/core/src/main/java/org/infinispan/marshall/jboss/externalizers/TransientMortalCacheValueExternalizer.java)
===================================================================
--- trunk/core/src/main/java/org/infinispan/marshall/exts/TransientMortalCacheValueExternalizer.java (rev 0)
+++ trunk/core/src/main/java/org/infinispan/marshall/exts/TransientMortalCacheValueExternalizer.java 2009-06-17 17:24:43 UTC (rev 479)
@@ -0,0 +1,61 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.infinispan.marshall.exts;
+
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+
+import net.jcip.annotations.Immutable;
+
+import org.infinispan.container.entries.InternalEntryFactory;
+import org.infinispan.container.entries.TransientMortalCacheValue;
+import org.infinispan.io.UnsignedNumeric;
+import org.infinispan.marshall.jboss.Externalizer;
+
+/**
+ * TransientMortalCacheValueExternalizer.
+ *
+ * @author Galder Zamarreño
+ * @since 4.0
+ */
+ at Immutable
+public class TransientMortalCacheValueExternalizer implements Externalizer {
+
+ public void writeObject(ObjectOutput output, Object subject) throws IOException {
+ TransientMortalCacheValue icv = (TransientMortalCacheValue) subject;
+ output.writeObject(icv.getValue());
+ UnsignedNumeric.writeUnsignedLong(output, icv.getCreated());
+ output.writeLong(icv.getLifespan()); // could be negative so should not use unsigned longs
+ UnsignedNumeric.writeUnsignedLong(output, icv.getLastUsed());
+ output.writeLong(icv.getMaxIdle()); // could be negative so should not use unsigned longs
+ }
+
+ public Object readObject(ObjectInput input) throws IOException, ClassNotFoundException {
+ Object v = input.readObject();
+ long created = UnsignedNumeric.readUnsignedLong(input);
+ Long lifespan = input.readLong();
+ long lastUsed = UnsignedNumeric.readUnsignedLong(input);
+ Long maxIdle = input.readLong();
+ return InternalEntryFactory.createValue(v, created, lifespan, lastUsed, maxIdle);
+ }
+}
Modified: trunk/core/src/main/java/org/infinispan/marshall/jboss/ConstantObjectTable.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/marshall/jboss/ConstantObjectTable.java 2009-06-17 17:20:50 UTC (rev 478)
+++ trunk/core/src/main/java/org/infinispan/marshall/jboss/ConstantObjectTable.java 2009-06-17 17:24:43 UTC (rev 479)
@@ -52,30 +52,30 @@
import org.infinispan.factories.scopes.Scopes;
import org.infinispan.loaders.bucket.Bucket;
import org.infinispan.marshall.MarshalledValue;
-import org.infinispan.marshall.jboss.externalizers.ArrayListExternalizer;
-import org.infinispan.marshall.jboss.externalizers.BucketExternalizer;
-import org.infinispan.marshall.jboss.externalizers.DeltaAwareExternalizer;
-import org.infinispan.marshall.jboss.externalizers.ExceptionResponseExternalizer;
-import org.infinispan.marshall.jboss.externalizers.ExtendedResponseExternalizer;
-import org.infinispan.marshall.jboss.externalizers.GlobalTransactionExternalizer;
-import org.infinispan.marshall.jboss.externalizers.ImmortalCacheEntryExternalizer;
-import org.infinispan.marshall.jboss.externalizers.ImmortalCacheValueExternalizer;
-import org.infinispan.marshall.jboss.externalizers.ImmutableMapExternalizer;
-import org.infinispan.marshall.jboss.externalizers.JGroupsAddressExternalizer;
-import org.infinispan.marshall.jboss.externalizers.LinkedListExternalizer;
-import org.infinispan.marshall.jboss.externalizers.MapExternalizer;
-import org.infinispan.marshall.jboss.externalizers.MarshalledValueExternalizer;
-import org.infinispan.marshall.jboss.externalizers.MortalCacheEntryExternalizer;
-import org.infinispan.marshall.jboss.externalizers.MortalCacheValueExternalizer;
-import org.infinispan.marshall.jboss.externalizers.ReplicableCommandExternalizer;
-import org.infinispan.marshall.jboss.externalizers.SetExternalizer;
-import org.infinispan.marshall.jboss.externalizers.SingletonListExternalizer;
-import org.infinispan.marshall.jboss.externalizers.SuccessfulResponseExternalizer;
-import org.infinispan.marshall.jboss.externalizers.TransactionLogExternalizer;
-import org.infinispan.marshall.jboss.externalizers.TransientCacheEntryExternalizer;
-import org.infinispan.marshall.jboss.externalizers.TransientCacheValueExternalizer;
-import org.infinispan.marshall.jboss.externalizers.TransientMortalCacheEntryExternalizer;
-import org.infinispan.marshall.jboss.externalizers.TransientMortalCacheValueExternalizer;
+import org.infinispan.marshall.exts.ArrayListExternalizer;
+import org.infinispan.marshall.exts.BucketExternalizer;
+import org.infinispan.marshall.exts.DeltaAwareExternalizer;
+import org.infinispan.marshall.exts.ExceptionResponseExternalizer;
+import org.infinispan.marshall.exts.ExtendedResponseExternalizer;
+import org.infinispan.marshall.exts.GlobalTransactionExternalizer;
+import org.infinispan.marshall.exts.ImmortalCacheEntryExternalizer;
+import org.infinispan.marshall.exts.ImmortalCacheValueExternalizer;
+import org.infinispan.marshall.exts.ImmutableMapExternalizer;
+import org.infinispan.marshall.exts.JGroupsAddressExternalizer;
+import org.infinispan.marshall.exts.LinkedListExternalizer;
+import org.infinispan.marshall.exts.MapExternalizer;
+import org.infinispan.marshall.exts.MarshalledValueExternalizer;
+import org.infinispan.marshall.exts.MortalCacheEntryExternalizer;
+import org.infinispan.marshall.exts.MortalCacheValueExternalizer;
+import org.infinispan.marshall.exts.ReplicableCommandExternalizer;
+import org.infinispan.marshall.exts.SetExternalizer;
+import org.infinispan.marshall.exts.SingletonListExternalizer;
+import org.infinispan.marshall.exts.SuccessfulResponseExternalizer;
+import org.infinispan.marshall.exts.TransactionLogExternalizer;
+import org.infinispan.marshall.exts.TransientCacheEntryExternalizer;
+import org.infinispan.marshall.exts.TransientCacheValueExternalizer;
+import org.infinispan.marshall.exts.TransientMortalCacheEntryExternalizer;
+import org.infinispan.marshall.exts.TransientMortalCacheValueExternalizer;
import org.infinispan.remoting.responses.ExceptionResponse;
import org.infinispan.remoting.responses.ExtendedResponse;
import org.infinispan.remoting.responses.RequestIgnoredResponse;
More information about the infinispan-commits
mailing list