Jumpi v1.2.0

org.jumpi.impl.transformer.serialization
Class SerializeTransformer

java.lang.Object
  |
  +--org.jumpi.impl.AbstractTransformer
        |
        +--org.jumpi.impl.transformer.serialization.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
SerializeTransformer()
           
 
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

SerializeTransformer

public SerializeTransformer()
Method Detail

transform

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
Parameters:
env - the Envelope containing data to transform and the result.
Throws:
java.lang.Exception - if a failure condition occcurs.

configure

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
Overrides:
configure in class AbstractTransformer
Parameters:
name - the fully qualified instance name.
props - the read-only properties to configure the instance with.
Throws:
java.lang.Exception - when configuration is unsuccessful.

Jumpi v1.2.0

Copyright © 2003, Peter Jonathan Klauser.