org.apache.axis2.util
Class ObjectStateUtils

java.lang.Object
  extended byorg.apache.axis2.util.ObjectStateUtils

public class ObjectStateUtils
extends java.lang.Object

Provides functions for saving and restoring an object's state.


Field Summary
static boolean ACTIVE_OBJECT
           
static java.lang.String EMPTY_MARKER
           
static boolean EMPTY_OBJECT
           
static java.lang.String LAST_ENTRY
           
static java.util.Hashtable NotSerializableList
           
static java.lang.String NULL_OBJECT
           
static java.lang.String OBJ_RESTORE_PROBLEM
           
static java.lang.String OBJ_SAVE_PROBLEM
           
static java.lang.String UNSUPPORTED_REVID
           
static java.lang.String UNSUPPORTED_SUID
           
 
Constructor Summary
ObjectStateUtils()
           
 
Method Summary
static java.lang.Object findHandler(java.util.ArrayList existingHandlers, MetaDataEntry metaDataEntry)
          Find the Handler object that matches the criteria
static AxisMessage findMessage(AxisOperation op, java.lang.String msgName, java.lang.String msgElementName)
          Find the AxisMessage object that matches the criteria
static AxisOperation findOperation(AxisConfiguration axisConfig, java.lang.String opClassName, javax.xml.namespace.QName opQName)
          Find the AxisOperation object that matches the criteria
static AxisOperation findOperation(AxisService service, java.lang.String opClassName, javax.xml.namespace.QName opQName)
          Find the AxisOperation object that matches the criteria
static AxisService findService(AxisConfiguration axisConfig, java.lang.String serviceClassName, java.lang.String serviceName)
          Find the AxisService object that matches the criteria
static AxisServiceGroup findServiceGroup(AxisConfiguration axisConfig, java.lang.String serviceGrpClassName, java.lang.String serviceGrpName)
          Find the AxisServiceGroup object that matches the criteria

Note the saved service group meta information may not match up with any of the serviceGroups that are in the current AxisConfiguration object.

static TransportListener findTransportListener(AxisConfiguration axisConfig, java.lang.String listenerClassName)
          Find the TransportListener object that matches the criteria

Note the saved meta information may not match up with any of the objects that are in the current AxisConfiguration object.

static boolean isEquivalent(java.util.ArrayList a1, java.util.ArrayList a2, boolean strict)
          Compares the two collections to see if they are equivalent.
static boolean isEquivalent(java.util.LinkedList l1, java.util.LinkedList l2)
          Compares the two collections to see if they are equivalent.
static boolean isEquivalent(java.util.Map m1, java.util.Map m2, boolean strict)
          Compares the two collections to see if they are equivalent.
static java.util.ArrayList readArrayList(java.io.ObjectInput in, java.lang.String desc)
          Reads an array of objects from the specified input stream.
static java.util.HashMap readHashMap(java.io.ObjectInput in, java.lang.String desc)
          Read a hashmap of objects from the specified input stream.
static java.util.LinkedList readLinkedList(java.io.ObjectInput in, java.lang.String desc)
          Reads a linked list of objects from the specified input stream.
static java.lang.Object readObject(java.io.ObjectInput in, java.lang.String desc)
          Read an object from the specified input stream.
static java.lang.String readString(java.io.ObjectInput in, java.lang.String desc)
          Read a string from the specified input stream.
static void traceNotSerializable(java.lang.Object obj, java.io.NotSerializableException nse, java.lang.String objDesc, java.lang.String methodName, java.lang.String desc)
          Trace the NotSerializable exception for the specified object if this is the first time that the specified object has caused the exception.
static void writeArrayList(java.io.ObjectOutput out, java.util.ArrayList al, java.lang.String desc)
          Write an array of objects to the specified output stream.
static void writeHashMap(java.io.ObjectOutput out, java.util.HashMap map, java.lang.String desc)
          Write a hashmap of objects to the specified output stream.
static void writeLinkedList(java.io.ObjectOutput out, java.util.LinkedList objlist, java.lang.String desc)
          Write a linked list of objects to the specified output stream.
static void writeObject(java.io.ObjectOutput out, java.lang.Object obj, java.lang.String desc)
          Write an object to the specified output stream.
static void writeString(java.io.ObjectOutput out, java.lang.String str, java.lang.String desc)
          Write a string to the specified output stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY_OBJECT

public static boolean EMPTY_OBJECT

ACTIVE_OBJECT

public static boolean ACTIVE_OBJECT

LAST_ENTRY

public static java.lang.String LAST_ENTRY

EMPTY_MARKER

public static java.lang.String EMPTY_MARKER

NULL_OBJECT

public static java.lang.String NULL_OBJECT

UNSUPPORTED_SUID

public static final java.lang.String UNSUPPORTED_SUID
See Also:
Constant Field Values

UNSUPPORTED_REVID

public static final java.lang.String UNSUPPORTED_REVID
See Also:
Constant Field Values

OBJ_SAVE_PROBLEM

public static final java.lang.String OBJ_SAVE_PROBLEM
See Also:
Constant Field Values

OBJ_RESTORE_PROBLEM

public static final java.lang.String OBJ_RESTORE_PROBLEM
See Also:
Constant Field Values

NotSerializableList

public static java.util.Hashtable NotSerializableList
Constructor Detail

ObjectStateUtils

public ObjectStateUtils()
Method Detail

writeString

public static void writeString(java.io.ObjectOutput out,
                               java.lang.String str,
                               java.lang.String desc)
                        throws java.io.IOException
Write a string to the specified output stream.

The format of the information written to the output stream is: Non-Null String

  • UTF - class name string
  • boolean - active flag
  • int - number of string sections
  • int - byte buffer size
  • bytes(UTF) - string data

    Null String

  • UTF - description
  • boolean - empty flag

    Parameters:
    out - The output stream
    str - The string to write
    desc - A text description to use for logging
    Throws:
    java.io.IOException - Exception

  • readString

    public static java.lang.String readString(java.io.ObjectInput in,
                                              java.lang.String desc)
                                       throws java.io.IOException,
                                              java.lang.ClassNotFoundException
    Read a string from the specified input stream. Returns null if no string is available.

    The format of the information to be read from the input stream should be Non-Null String

  • UTF - class name string
  • boolean - active flag
  • int - number of string sections
  • int - byte buffer size
  • bytes(UTF) - string data

    Null String

  • UTF - description
  • boolean - empty flag

    Parameters:
    in - The input stream
    desc - A text description to use for logging
    Returns:
    The string or null, if not available
    Throws:
    java.io.IOException
    java.lang.ClassNotFoundException

  • writeObject

    public static void writeObject(java.io.ObjectOutput out,
                                   java.lang.Object obj,
                                   java.lang.String desc)
                            throws java.io.IOException
    Write an object to the specified output stream.

    The format of the information written to the output stream is

    Non-Null Object

  • UTF - class name string
  • boolean - active flag
  • object - object if no error
  • LAST_ENTRY marker

    Null Object

  • UTF - description
  • boolean - empty flag

    Parameters:
    out - The output stream
    obj - The object to write
    desc - A text description to use for logging
    Throws:
    java.io.IOException - Exception

  • readObject

    public static java.lang.Object readObject(java.io.ObjectInput in,
                                              java.lang.String desc)
                                       throws java.io.IOException,
                                              java.lang.ClassNotFoundException
    Read an object from the specified input stream. Returns null if no object is available.

    The format of the information to be read from the input stream should be Non-Null Object

  • UTF - class name string
  • boolean - active flag
  • object - object if no error
  • LAST_ENTRY marker

    Null Object

  • UTF - description
  • boolean - empty flag

    Parameters:
    in - The input stream
    desc - A text description to use for logging
    Returns:
    The object or null, if not available
    Throws:
    java.io.IOException
    java.lang.ClassNotFoundException

  • writeArrayList

    public static void writeArrayList(java.io.ObjectOutput out,
                                      java.util.ArrayList al,
                                      java.lang.String desc)
                               throws java.io.IOException
    Write an array of objects to the specified output stream.

    The format of the information written to the output stream is

  • class name of the array
  • active or empty
  • data

    NOTE: each object in the array should implement either java.io.Serializable or java.io.Externalizable in order to be saved

    Parameters:
    out - The output stream
    al - The ArrayList to write
    desc - A text description to use for logging
    Throws:
    java.io.IOException - Exception

  • readArrayList

    public static java.util.ArrayList readArrayList(java.io.ObjectInput in,
                                                    java.lang.String desc)
                                             throws java.io.IOException
    Reads an array of objects from the specified input stream. Returns null if no array is available.

    The format of the information to be read from the input stream should be

  • class name
  • active or empty
  • data

    NOTE: each object in the array should implement either java.io.Serializable or java.io.Externalizable in order to be saved

    Parameters:
    in - The input stream
    desc - A text description to use for logging
    Returns:
    The ArrayList or null, if not available
    Throws:
    java.io.IOException
    java.lang.ClassNotFoundException

  • writeHashMap

    public static void writeHashMap(java.io.ObjectOutput out,
                                    java.util.HashMap map,
                                    java.lang.String desc)
                             throws java.io.IOException
    Write a hashmap of objects to the specified output stream.

    The format of the information written to the output stream is

  • class name of the array
  • active or empty
  • data

    NOTE: each object in the map should implement either java.io.Serializable or java.io.Externalizable in order to be saved

    Parameters:
    out - The output stream
    map - The HashMap to write
    desc - A text description to use for logging
    Throws:
    java.io.IOException - Exception

  • readHashMap

    public static java.util.HashMap readHashMap(java.io.ObjectInput in,
                                                java.lang.String desc)
                                         throws java.io.IOException
    Read a hashmap of objects from the specified input stream. Returns null if no hashmap is available.

    The format of the information to be read from the input stream should be

  • class name
  • active or empty
  • data

    NOTE: each object in the array should implement either java.io.Serializable or java.io.Externalizable in order to be saved

    Parameters:
    in - The input stream
    desc - A text description to use for logging
    Returns:
    The HashMap or null, if not available
    Throws:
    java.io.IOException
    java.lang.ClassNotFoundException

  • writeLinkedList

    public static void writeLinkedList(java.io.ObjectOutput out,
                                       java.util.LinkedList objlist,
                                       java.lang.String desc)
                                throws java.io.IOException
    Write a linked list of objects to the specified output stream.

    The format of the information written to the output stream is

  • class name of the array
  • active or empty
  • data

    NOTE: each object in the array should implement either java.io.Serializable or java.io.Externalizable in order to be saved

    Parameters:
    out - The output stream
    desc - A text description to use for logging
    Throws:
    java.io.IOException - Exception

  • readLinkedList

    public static java.util.LinkedList readLinkedList(java.io.ObjectInput in,
                                                      java.lang.String desc)
                                               throws java.io.IOException
    Reads a linked list of objects from the specified input stream. Returns null if no array is available.

    The format of the information to be read from the input stream should be

  • class name
  • active or empty
  • data

    NOTE: each object in the array should implement either java.io.Serializable or java.io.Externalizable in order to be saved

    Parameters:
    in - The input stream
    desc - A text description to use for logging
    Returns:
    The linked list or null, if not available
    Throws:
    java.io.IOException
    java.lang.ClassNotFoundException

  • findOperation

    public static AxisOperation findOperation(AxisConfiguration axisConfig,
                                              java.lang.String opClassName,
                                              javax.xml.namespace.QName opQName)
    Find the AxisOperation object that matches the criteria

    Parameters:
    axisConfig - The AxisConfiguration object
    opClassName - the class name string for the target object (could be a derived class)
    opQName - the name associated with the operation
    Returns:
    the AxisOperation object that matches the given criteria

    findOperation

    public static AxisOperation findOperation(AxisService service,
                                              java.lang.String opClassName,
                                              javax.xml.namespace.QName opQName)
    Find the AxisOperation object that matches the criteria

    Parameters:
    service - The AxisService object
    opClassName - The class name string for the target object (could be a derived class)
    opQName - the name associated with the operation
    Returns:
    the AxisOperation object that matches the given criteria

    findService

    public static AxisService findService(AxisConfiguration axisConfig,
                                          java.lang.String serviceClassName,
                                          java.lang.String serviceName)
    Find the AxisService object that matches the criteria

    Parameters:
    axisConfig - The AxisConfiguration object
    serviceClassName - the class name string for the target object (could be a derived class)
    serviceName - the name associated with the service
    Returns:
    the AxisService object that matches the criteria

    findServiceGroup

    public static AxisServiceGroup findServiceGroup(AxisConfiguration axisConfig,
                                                    java.lang.String serviceGrpClassName,
                                                    java.lang.String serviceGrpName)
    Find the AxisServiceGroup object that matches the criteria

    Note the saved service group meta information may not match up with any of the serviceGroups that are in the current AxisConfiguration object.

    Parameters:
    axisConfig - The AxisConfiguration object
    serviceGrpClassName - the class name string for the target object (could be a derived class)
    serviceGrpName - the name associated with the service group
    Returns:
    the AxisServiceGroup object that matches the criteria

    findMessage

    public static AxisMessage findMessage(AxisOperation op,
                                          java.lang.String msgName,
                                          java.lang.String msgElementName)
    Find the AxisMessage object that matches the criteria

    Parameters:
    op - The AxisOperation object
    msgName - The name associated with the message
    msgElementName - The name associated with the message element
    Returns:
    the AxisMessage object that matches the given criteria

    findHandler

    public static java.lang.Object findHandler(java.util.ArrayList existingHandlers,
                                               MetaDataEntry metaDataEntry)
    Find the Handler object that matches the criteria

    Parameters:
    existingHandlers - The list of existing handlers and phases
    Returns:
    the Handler object that matches the criteria

    findTransportListener

    public static TransportListener findTransportListener(AxisConfiguration axisConfig,
                                                          java.lang.String listenerClassName)
    Find the TransportListener object that matches the criteria

    Note the saved meta information may not match up with any of the objects that are in the current AxisConfiguration object.

    Parameters:
    axisConfig - The AxisConfiguration object
    listenerClassName - the class name string for the target object (could be a derived class)
    Returns:
    the TransportListener object that matches the criteria

    isEquivalent

    public static boolean isEquivalent(java.util.ArrayList a1,
                                       java.util.ArrayList a2,
                                       boolean strict)
    Compares the two collections to see if they are equivalent.

    Parameters:
    a1 - The first collection
    a2 - The second collection
    strict - Indicates whether strict checking is required. Strict checking means that the two collections must have the same elements in the same order. Non-strict checking means that the two collections must have the same elements, but the order is not significant.
    Returns:
    TRUE if the two collections are equivalent FALSE, otherwise

    isEquivalent

    public static boolean isEquivalent(java.util.Map m1,
                                       java.util.Map m2,
                                       boolean strict)
    Compares the two collections to see if they are equivalent.

    Parameters:
    m1 - The first collection
    m2 - The second collection
    strict - Indicates whether strict checking is required. Strict checking means that the two collections must have the same mappings. Non-strict checking means that the two collections must have the same keys. In both cases, the order is not significant.
    Returns:
    TRUE if the two collections are equivalent FALSE, otherwise

    isEquivalent

    public static boolean isEquivalent(java.util.LinkedList l1,
                                       java.util.LinkedList l2)
    Compares the two collections to see if they are equivalent.

    Parameters:
    l1 - The first collection
    l2 - The second collection
    Returns:
    TRUE if the two collections are equivalent FALSE, otherwise

    traceNotSerializable

    public static void traceNotSerializable(java.lang.Object obj,
                                            java.io.NotSerializableException nse,
                                            java.lang.String objDesc,
                                            java.lang.String methodName,
                                            java.lang.String desc)
    Trace the NotSerializable exception for the specified object if this is the first time that the specified object has caused the exception.

    Parameters:
    obj - The object being saved or restored
    nse - The exception object with the details of the error
    objDesc - The description of the object, eg, like the field name where it is being used
    methodName - The method name which encountered the exception
    desc - Text to be used for tracing


    Copyright © 2004-2007 Apache Software Foundation. All Rights Reserved.