BEA Systems, Inc.

com.beasys.commerce.axiom.reasoning.rules.util
Class LoaderContainer

java.lang.Object
  |
  +--com.sun.xml.tree.NodeBase
        |
        +--com.sun.xml.tree.ParentNode
              |
              +--com.sun.xml.tree.ElementNode
                    |
                    +--com.beasys.commerce.axiom.reasoning.rules.util.LoaderContainer

public class LoaderContainer
extends com.sun.xml.tree.ElementNode
implements Loader, ResultWriter

Implements a container for a loader


Field Summary
static java.lang.String ATTRIBUTE_NAME_CLASSNAME
          The name of the xml attribute for the contained task class name
static java.lang.String ATTRIBUTE_NAME_NAME
          The name of the xml attribute used generically to indicate a property name
static java.lang.String ATTRIBUTE_NAME_PATH
          The name of the xml attribute used to indicate an item path
static java.lang.String ATTRIBUTE_NAME_VALUE
          The name of the xml attribute used generically to indicate a property value
static java.lang.String METHOD_NAME_ADD_ITEM
          The name of the method used to add items to a load list
static java.lang.String METHOD_NAME_PREFIX_SETTER
          The prefix for property 'setter' methods
static java.lang.String TAG_NAME_ITEM
          The name of the xml tag for an item to be loaded
static java.lang.String TAG_NAME_MESSAGE
          The name of the xml tag which for a message
static java.lang.String TAG_NAME_PROPERTY
          The name of the xml tag which describes a property
static java.lang.String TAG_NAME_TOTAL_ITEMS_FAILED
          The name of the xml tag which for a total items failed result
static java.lang.String TAG_NAME_TOTAL_ITEMS_LOADED
          The name of the xml tag which for a total items loaded result
static java.lang.String TAG_NAME_TOTAL_TIME
          The name of the xml tag which for a total time result
 
Constructor Summary
LoaderContainer()
           
 
Method Summary
 void cleanup()
          Cleans up the loader
 long getNumberOfFailedItems()
          Gets the number of items which failed to load
 long getNumberOfItemsLoaded()
          Gets the number of items loaded
 void initialize()
          Initializes the loader
 void load()
          Loads items
 void setResultWriter(ResultWriter resultWriter)
          Sets the result writer
 void writeMessage(java.lang.String message)
          Writes a message result
 void writeTotalItemsFailed(long totalItemsFailed)
          Writes a total items failed result
 void writeTotalItemsLoaded(long totalItemsLoaded)
          Writes a total items loaded result
 void writeTotalTime(long totalTime)
          Writes a total time result
 
Methods inherited from class com.sun.xml.tree.ElementNode
cloneNode, getAttribute, getAttribute, getAttributeNode, getAttributeNode, getAttributes, getIdAttributeName, getLocalName, getNamespace, getNodeName, getNodeType, getPrefix, getTagName, getUserObject, normalize, removeAttribute, removeAttributeNode, removeWhiteSpaces, setAttribute, setAttributeNode, setIdAttributeName, setPrefix, setReadonly, setUserObject, toString, trimToSize, write, writeXml
 
Methods inherited from class com.sun.xml.tree.ParentNode
appendChild, doneChild, doneParse, getElementsByTagName, getFirstChild, getIndexOf, getLastChild, getLength, hasChildNodes, insertBefore, item, removeChild, replaceChild, startParse, writeChildrenXml
 
Methods inherited from class com.sun.xml.tree.NodeBase
getChildNodes, getInheritedAttribute, getInheritedAttribute, getLanguage, getNextSibling, getNodeValue, getOwnerDocument, getParentNode, getPreviousSibling, isReadonly, setNodeValue
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ATTRIBUTE_NAME_CLASSNAME

public static final java.lang.String ATTRIBUTE_NAME_CLASSNAME
The name of the xml attribute for the contained task class name

ATTRIBUTE_NAME_NAME

public static final java.lang.String ATTRIBUTE_NAME_NAME
The name of the xml attribute used generically to indicate a property name

ATTRIBUTE_NAME_PATH

public static final java.lang.String ATTRIBUTE_NAME_PATH
The name of the xml attribute used to indicate an item path

ATTRIBUTE_NAME_VALUE

public static final java.lang.String ATTRIBUTE_NAME_VALUE
The name of the xml attribute used generically to indicate a property value

METHOD_NAME_ADD_ITEM

public static final java.lang.String METHOD_NAME_ADD_ITEM
The name of the method used to add items to a load list

METHOD_NAME_PREFIX_SETTER

public static final java.lang.String METHOD_NAME_PREFIX_SETTER
The prefix for property 'setter' methods

TAG_NAME_ITEM

public static final java.lang.String TAG_NAME_ITEM
The name of the xml tag for an item to be loaded

TAG_NAME_MESSAGE

public static final java.lang.String TAG_NAME_MESSAGE
The name of the xml tag which for a message

TAG_NAME_PROPERTY

public static final java.lang.String TAG_NAME_PROPERTY
The name of the xml tag which describes a property

TAG_NAME_TOTAL_ITEMS_FAILED

public static final java.lang.String TAG_NAME_TOTAL_ITEMS_FAILED
The name of the xml tag which for a total items failed result

TAG_NAME_TOTAL_ITEMS_LOADED

public static final java.lang.String TAG_NAME_TOTAL_ITEMS_LOADED
The name of the xml tag which for a total items loaded result

TAG_NAME_TOTAL_TIME

public static final java.lang.String TAG_NAME_TOTAL_TIME
The name of the xml tag which for a total time result
Constructor Detail

LoaderContainer

public LoaderContainer()
Method Detail

cleanup

public void cleanup()
             throws java.lang.Exception
Cleans up the loader
Specified by:
cleanup in interface Loader
Throws:
java.lang.Exception - thrown if unable to cleanup the loader

getNumberOfFailedItems

public long getNumberOfFailedItems()
Gets the number of items which failed to load
Specified by:
getNumberOfFailedItems in interface Loader
Returns:
the number of items which failed to load

getNumberOfItemsLoaded

public long getNumberOfItemsLoaded()
Gets the number of items loaded
Specified by:
getNumberOfItemsLoaded in interface Loader
Returns:
The number of items loaded

initialize

public void initialize()
                throws java.lang.Exception
Initializes the loader
Specified by:
initialize in interface Loader
Throws:
java.lang.Exception - thrown if unable to initialize the loader

load

public void load()
          throws java.lang.Exception
Loads items
Specified by:
load in interface Loader
Throws:
java.lang.Exception - thrown if unable to load

setResultWriter

public void setResultWriter(ResultWriter resultWriter)
                     throws java.lang.Exception
Sets the result writer
Specified by:
setResultWriter in interface Loader
Parameters:
resultWriter - The result writer
Throws:
java.lang.IllegalArgumentException - Thrown if resultWriter is null

writeMessage

public void writeMessage(java.lang.String message)
                  throws java.lang.IllegalArgumentException
Writes a message result
Specified by:
writeMessage in interface ResultWriter
Parameters:
message - The result to write
Throws:
java.lang.IllegalArgumentException - Thrown if message is null

writeTotalItemsFailed

public void writeTotalItemsFailed(long totalItemsFailed)
                           throws java.lang.IllegalArgumentException
Writes a total items failed result
Specified by:
writeTotalItemsFailed in interface ResultWriter
Parameters:
totalItemsFailed - The total number of items that failed
Throws:
java.lang.IllegalArgumentException - Thrown if totalItemsFailed is negative

writeTotalItemsLoaded

public void writeTotalItemsLoaded(long totalItemsLoaded)
                           throws java.lang.IllegalArgumentException
Writes a total items loaded result
Specified by:
writeTotalItemsLoaded in interface ResultWriter
Parameters:
totalItemsLoaded - The total number of items loaded
Throws:
java.lang.IllegalArgumentException - Thrown if totalItemsLoaded is negative

writeTotalTime

public void writeTotalTime(long totalTime)
                    throws java.lang.IllegalArgumentException
Writes a total time result
Specified by:
writeTotalTime in interface ResultWriter
Parameters:
totalTime - The total time in milliseconds
Throws:
java.lang.IllegalArgumentException - Thrown if totalTime is negative

BEA Systems, Inc.

Copyright © 2000 BEA Systems, Inc. All Rights Reserved