BEA Systems, Inc.

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

java.lang.Object
  |
  +--com.beasys.commerce.axiom.reasoning.rules.util.FileLoader

public class FileLoader
extends java.lang.Object
implements Loader

Implements a basic file loader


Field Summary
static java.lang.String MSG_FAILED
          The message indicating that an item failed to load
static java.lang.String MSG_LOADED
          The message indicating that an item was loaded
 
Constructor Summary
FileLoader()
          Constructor
 
Method Summary
 void addItem(java.lang.String itemName, java.lang.String itemPath)
          Adds a file to the list of files to be loaded
 void cleanup()
          Cleans up the loader
 long getNumberOfFailedItems()
          Gets the number of items which failed to load
 long getNumberOfItemsLoaded()
          Gets the number of items that were loaded
 void initialize()
          Initializes the loader
 void load()
          Loads files
 void setJNDIFactoryName(java.lang.String jndiFactoryName)
          Sets the jndi context factory class name
 void setJNDIProviderURL(java.lang.String jndiProviderURL)
          Sets the jndi provider url
 void setJNDISecurityCredentials(java.lang.String jndiSecurityCredentials)
          Sets the jndi security credentials
 void setJNDISecurityPrincipal(java.lang.String jndiSecurityPrincipal)
          Sets the jndi security principal
 void setResultWriter(ResultWriter resultWriter)
          Sets the result writer
 void setRuleSheetDefinitionHomeName(java.lang.String ruleSheetDefinitionHomeName)
          Sets the rulesheet definition home name
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MSG_LOADED

public static final java.lang.String MSG_LOADED
The message indicating that an item was loaded

MSG_FAILED

public static final java.lang.String MSG_FAILED
The message indicating that an item failed to load
Constructor Detail

FileLoader

public FileLoader()
Constructor
Method Detail

addItem

public void addItem(java.lang.String itemName,
                    java.lang.String itemPath)
             throws java.lang.IllegalArgumentException,
                    java.lang.Exception
Adds a file to the list of files to be loaded
Parameters:
itemName - The name to use when loading the file
itemPath - The fully qualified path to the file to be loaded
Throws:
java.lang.IllegalArgumentException - Thrown if itemName or itemPath is null or zero-length
java.lang.Exception - Thrown if unable to add the item to the list

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

getNumberOfItemsLoaded

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

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()
Loads files
Specified by:
load in interface Loader
Tags copied from interface: Loader
Throws:
java.lang.Exception - thrown if unable to load

setJNDIFactoryName

public void setJNDIFactoryName(java.lang.String jndiFactoryName)
                        throws java.lang.IllegalArgumentException
Sets the jndi context factory class name
Parameters:
jndiFactoryName - The jndi context factory class name
Throws:
java.lang.IllegalArgumentException - Thrown if jndiFactoryName is null or zero-length

setJNDIProviderURL

public void setJNDIProviderURL(java.lang.String jndiProviderURL)
                        throws java.lang.IllegalArgumentException
Sets the jndi provider url
Parameters:
jndiProviderURL - The jndi provider url
Throws:
java.lang.IllegalArgumentException - Thrown if jndiProviderURL is null or zero-length

setJNDISecurityCredentials

public void setJNDISecurityCredentials(java.lang.String jndiSecurityCredentials)
                                throws java.lang.IllegalArgumentException
Sets the jndi security credentials
Parameters:
jndiSecurityCredentials - The jndi security credentials
Throws:
java.lang.IllegalArgumentException - Thrown if jndiSecurityCredentials is null or zero-length

setJNDISecurityPrincipal

public void setJNDISecurityPrincipal(java.lang.String jndiSecurityPrincipal)
                              throws java.lang.IllegalArgumentException
Sets the jndi security principal
Parameters:
jndiSecurityPrincipal - The jndi security principal
Throws:
java.lang.IllegalArgumentException - Thrown if jndiSecurityPrincipal is null or zero-length

setResultWriter

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

setRuleSheetDefinitionHomeName

public void setRuleSheetDefinitionHomeName(java.lang.String ruleSheetDefinitionHomeName)
                                    throws java.lang.Exception
Sets the rulesheet definition home name
Parameters:
ruleSheetDefinitionHomeName - The name of the home
Throws:
java.lang.IllegalArgumentException - Thrown if ruleSheetDefinitionHomeName is null or zero-length

BEA Systems, Inc.

Copyright © 2000 BEA Systems, Inc. All Rights Reserved