org.apache.tuscany.samples.sdo.specExampleSection
Class SerializingDesearializingADataObject

java.lang.Object
  extended by org.apache.tuscany.samples.sdo.specExampleSection.SerializingDesearializingADataObject

public class SerializingDesearializingADataObject
extends java.lang.Object

Demonstrates serializing and deserializing a DataObject to disk. The following sample is from the Apache Tuscany project. It was written to help users understand and experiement with SDO. It is based upon example code contained within, and is meant for use with, and reference to the SDO Specification. In general this sample attempts to use the code and comments contained within the specification, exceptions to this are noted in comments.

The following sample is based upon the 'Serializing/Deserializing a DataGraph or DataObject' example from the Examples section of the SDO specification.

The DataObject and DataGraph interfaces extend java.io.Serializable, so any DataObject or DataGraph be serialized. The following code serializes the company dataObject to a file of the user's choosing. The file is not deleted after execution.


Usage:
This sample can easily be run from within Eclipse as a Java Application if tuscany or the sample-sdo project is imported into Eclipse as an existing project.

If executing as a standalone application please do the following:

Author:
Robbie Minshall

Field Summary
static java.lang.String DEFAULT_FILE_NAME
          Default fileName to serialize DataObject to
 
Constructor Summary
SerializingDesearializingADataObject()
           
 
Method Summary
static void main(java.lang.String[] args)
          Execute this method in order to run the sample.
static void serializeDO(commonj.sdo.DataObject DataObject, java.lang.String fileName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_FILE_NAME

public static final java.lang.String DEFAULT_FILE_NAME
Default fileName to serialize DataObject to

See Also:
Constant Field Values
Constructor Detail

SerializingDesearializingADataObject

public SerializingDesearializingADataObject()
Method Detail

serializeDO

public static void serializeDO(commonj.sdo.DataObject DataObject,
                               java.lang.String fileName)
                        throws java.io.IOException
Throws:
java.io.IOException

main

public static void main(java.lang.String[] args)
Execute this method in order to run the sample.

Parameters:
args -


Copyright © 2007 Apache Software Foundation. All Rights Reserved.