de.netseeker.ejoe.adapter
Class JavaBeansXmlAdapter

java.lang.Object
  extended by de.netseeker.ejoe.adapter.BaseAdapter
      extended by de.netseeker.ejoe.adapter.JavaBeansXmlAdapter
All Implemented Interfaces:
SerializeAdapter, java.beans.ExceptionListener, java.io.Serializable

public class JavaBeansXmlAdapter
extends BaseAdapter
implements java.beans.ExceptionListener

Simple SerializeAdapter implementation using the XmlEncoder/XmlDecoder classes of the Java Beans API

Author:
netseeker
See Also:
Serialized Form

Constructor Summary
JavaBeansXmlAdapter()
           
 
Method Summary
 void exceptionThrown(java.lang.Exception e)
           
 java.lang.String getContentType()
           
 boolean isSelfBuffered()
          Indicates that the adapter uses a StreamBuffer mechanism and doesn't require a buffered input stream
 java.lang.Object read(java.io.InputStream in)
          Deserializes an object out of an given InputStream
 boolean requiresCustomEOFHandling()
          Signals if this adapter has problems with EJOE's UncloseableInputStreams and requires a really closed Stream (which EJOE prevents to ensure that an adapter can not close the underlying socket unintentionally).
 void write(java.lang.Object obj, java.io.OutputStream out)
          Serializes an object into an output stream
 
Methods inherited from class de.netseeker.ejoe.adapter.BaseAdapter
handleClassLoaderChange
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaBeansXmlAdapter

public JavaBeansXmlAdapter()
Method Detail

read

public java.lang.Object read(java.io.InputStream in)
                      throws java.lang.Exception
Description copied from interface: SerializeAdapter
Deserializes an object out of an given InputStream

Specified by:
read in interface SerializeAdapter
Parameters:
in - the input stream to use for deserialization
Returns:
a deserialized object instance
Throws:
java.lang.Exception

write

public void write(java.lang.Object obj,
                  java.io.OutputStream out)
           throws java.lang.Exception
Description copied from interface: SerializeAdapter
Serializes an object into an output stream

Specified by:
write in interface SerializeAdapter
Parameters:
obj - object that should get serialized
out - the outputstream into which the object should serialized
Throws:
java.lang.Exception

exceptionThrown

public void exceptionThrown(java.lang.Exception e)
Specified by:
exceptionThrown in interface java.beans.ExceptionListener

requiresCustomEOFHandling

public boolean requiresCustomEOFHandling()
Description copied from interface: SerializeAdapter
Signals if this adapter has problems with EJOE's UncloseableInputStreams and requires a really closed Stream (which EJOE prevents to ensure that an adapter can not close the underlying socket unintentionally). If the adapter requires closed streams, EJOE will append a custom EOF signature at the end of the stream and return -1 in Inputstream#read when EOF is reached.

Specified by:
requiresCustomEOFHandling in interface SerializeAdapter
Overrides:
requiresCustomEOFHandling in class BaseAdapter
Returns:
true if the adapter requires EOF to detect the end of the stream
See Also:
XMLEncoder/Decoder over sockets

isSelfBuffered

public boolean isSelfBuffered()
Description copied from interface: SerializeAdapter
Indicates that the adapter uses a StreamBuffer mechanism and doesn't require a buffered input stream

Specified by:
isSelfBuffered in interface SerializeAdapter
Overrides:
isSelfBuffered in class BaseAdapter
Returns:
true if the adapter doesn't require a buffered inputstream, otherwise false

getContentType

public java.lang.String getContentType()
Specified by:
getContentType in interface SerializeAdapter
Overrides:
getContentType in class BaseAdapter
Returns:
A recognized mime type
See Also:
mime type list of IANA


Copyright © 2005-2007 netseeker. All Rights Reserved.