org.infinispan.marshall.jboss
Interface Externalizer
- All Superinterfaces:
- org.jboss.marshalling.ObjectTable.Writer
- All Known Implementing Classes:
- ArrayListExternalizer, BucketExternalizer, DeltaAwareExternalizer, ExceptionResponseExternalizer, ExtendedResponseExternalizer, GlobalTransactionExternalizer, ImmortalCacheEntryExternalizer, ImmortalCacheValueExternalizer, ImmutableMapExternalizer, JGroupsAddressExternalizer, LinkedListExternalizer, MapExternalizer, MarshalledValueExternalizer, MortalCacheEntryExternalizer, MortalCacheValueExternalizer, ReplicableCommandExternalizer, SetExternalizer, SingletonListExternalizer, StateTransferControlCommandExternalizer, SuccessfulResponseExternalizer, TransactionLogExternalizer, TransientCacheEntryExternalizer, TransientCacheValueExternalizer, TransientMortalCacheEntryExternalizer, TransientMortalCacheValueExternalizer
public interface Externalizer
- extends org.jboss.marshalling.ObjectTable.Writer
Extended interface that extends capabilities of writing predefined objects
with the possibility of reading them. Any new externalizer implementations
should implement this interface.
Optionally, Externalizer implementations should implement
ClassTable.ClassReadWritable
when they want to add class information to the
marshalled payload. This is useful in cases where ReadWriter implementations
will create, upon read, new instances using reflection.
To add a new non-user Externalizer, follow these steps:
1. Create an implementation of Externalizer.
2. Add Class to Externalizer mapping to ConstantObjectTable.EXTERNALIZERS
3. (Optional) If Externalizer implementation instantiates instances using reflection,
like ReplicableCommandExternalizer, you need to do these further steps on top:
3.1. You need to write class information to the stream and read it when unmarshalling
so that this information can be using during reflection. So, Externalizer implementations
need to implement ClassExternalizer.ClassWritable so that the corresponding ClassExternalizer
is injected.
3.2 Add Externalizer implementation to the NumberClassExternalizer.MAGIC_NUMBERS list.
- Since:
- 4.0
- Author:
- Galder ZamarreƱo
Method Summary |
Object |
readObject(org.jboss.marshalling.Unmarshaller unmarshaller)
Read an instance from the stream. |
Methods inherited from interface org.jboss.marshalling.ObjectTable.Writer |
writeObject |
readObject
Object readObject(org.jboss.marshalling.Unmarshaller unmarshaller)
throws IOException,
ClassNotFoundException
- Read an instance from the stream. The instance will have been written by the
#writeObject(Object)
method.
- Parameters:
unmarshaller
- the unmarshaller to read from
- Returns:
- the object instance
- Throws:
IOException
- if an I/O error occurs
ClassNotFoundException
- if a class could not be found
Copyright © 2009 JBoss, a division of Red Hat. All Rights Reserved.