Jumpi v1.2.0

Class SerializeTransformer

All Implemented Interfaces:
Component, Configurable, Manageable, Transformer

public class SerializeTransformer
extends AbstractTransformer

Standard Java Serialization transformation from Serializable Object to byte[]. If a FastByteArrayOutputStream is provided on top of the Object, then the Object is serialized into the given OutputStream instead of using a temporary ObjectOutputStream. In this case, the resulting context stack contains the number of bytes of the resulting byte[] size, and then the byte[] itself. In the case of the FastByteArrayOutputStream, the byte[] is shared, not copied.

Field Summary
Fields inherited from class org.jumpi.impl.AbstractTransformer
exceptionOnMismatch_, jumpi_, name_, nextTransformer_, warnOnMismatch_
Constructor Summary
Method Summary
 void configure(java.lang.String name, Properties props)
           Configure the SerializableTransformer.
 void transform(Envelope env)
          Serialize an object.
Methods inherited from class org.jumpi.impl.AbstractTransformer
doNextTransformation, getName, manage
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public SerializeTransformer()
Method Detail


public void transform(Envelope env)
               throws java.lang.Exception
Serialize an object. The Envelope's context stack contains either a serializable object, or a FastByteArrayOutputStream and a serializable object ( in that order ) for serialization to be successful. The resulting byte[] is placed on the context stack.

Specified by:
transform in interface Transformer
Specified by:
transform in class AbstractTransformer
env - the Envelope containing data to transform and the result.
java.lang.Exception - if a failure condition occcurs.


public void configure(java.lang.String name,
                      Properties props)
               throws java.lang.Exception
Configure the SerializableTransformer.

The following configuration attributes are defined in addition to those of the superclass:

Specified by:
configure in interface Configurable
configure in class AbstractTransformer
name - the fully qualified instance name.
props - the read-only properties to configure the instance with.
java.lang.Exception - when configuration is unsuccessful.

Jumpi v1.2.0

Copyright 2003, Peter Jonathan Klauser.