com.rhi.architecture.batch
Class BatchApplication

java.lang.Object
  extended bycom.rhi.architecture.batch.AbstractApplication
      extended bycom.rhi.architecture.batch.BatchApplication
All Implemented Interfaces:
Application
Direct Known Subclasses:
PARCApplication, PBApplication

public abstract class BatchApplication
extends AbstractApplication

A BatchApplication adds audit and configuration capabilities to the standard application. It requires the following properties to be set:
AuditAgent - This should be assigned to a concrete AuditAgent class that should be used to perform auditing of the batch process. ConfigMixin# - Any number of ConfigMixin's can be loaded by the BatchApplication. However they need to follow these guidelines: 1) implement the ConfigMixin interface, 2) be listed in the order required, where ConfigMixin0 is loaded first, and each increasing number is loaded in order until a number is missing at which point all Mixin's are assumed to be loaded, and the initialization process continues.

Since:
1.0
Author:
Pete McKinstry

Field Summary
 
Fields inherited from interface com.rhi.architecture.batch.Application
FATAL_EXCEPTION, SUCCESS, SUCCESS_WITH_EXCEPTION
 
Constructor Summary
BatchApplication()
          default constructor
 
Method Summary
 void cleanup()
          Perform any cleanup required by the application framework.
protected abstract  void doCleanup()
          The doCleanup() method is expected to be overriden by concrete application classes to perform any required cleanup facilitating a graceful application shutdown.
protected abstract  void doInit()
          The doInit() method is expected to be overriden by concrete application classes to perform any required initialization.
 AuditAgent getAuditAgent()
          Return the audit agent to be used to perform audits.
protected  java.util.Properties getProperties()
          Return the configuration information for this application as a Properties object.
protected  void init(java.lang.String[] args)
          Perform BatchApplication initialization.
protected  boolean isAuditEnabled()
          returns true if the batch application should initialize the audit agent class.
 
Methods inherited from class com.rhi.architecture.batch.AbstractApplication
execute, log, run
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BatchApplication

public BatchApplication()
default constructor

Since:
1.0
Method Detail

getAuditAgent

public final AuditAgent getAuditAgent()
Return the audit agent to be used to perform audits. Note: this method is declared final because the audit agent is created dynamically based on a property file setting, thereby making it possible to override the type w/o modifying this method. (Also the reason that there is no setAuditAgent() method.

Returns:
AuditAgent concrete instance, potentially specific to this application.
Since:
1.0

init

protected final void init(java.lang.String[] args)
                   throws InitializationException
Perform BatchApplication initialization. 1. Loads configuration information. a) command line arguments are loaded w/ property names of arg0, arg1, arg2, etc... 2. Initializes audit agent 3. Calls doInit() to allow sub-classes to perform any required initialization _after_ this method is complete. Note: sub-classes can override properties by loading an already existing property name. Last defined value wins.

Specified by:
init in class AbstractApplication
Parameters:
args - the commandline arguments. usually used for configuration options.
Throws:
InitializationException - thrown when their is a problem configuring the application
Since:
1.0

getProperties

protected java.util.Properties getProperties()
Return the configuration information for this application as a Properties object. Sub-classes will use this method to retrieve the configuration information.

Returns:
Properties - the configuration data for this interface.
Since:
1.0

cleanup

public final void cleanup()
Perform any cleanup required by the application framework. This method will also call the doCleanup() abstract method to allow concrete application classes to shutdown gracefully.

Specified by:
cleanup in class AbstractApplication
Since:
1.0

doInit

protected abstract void doInit()
                        throws InitializationException
The doInit() method is expected to be overriden by concrete application classes to perform any required initialization.

Throws:
InitializationException - thrown if a problem occuring in the init method of a sub-class.
Since:
1.0

doCleanup

protected abstract void doCleanup()
The doCleanup() method is expected to be overriden by concrete application classes to perform any required cleanup facilitating a graceful application shutdown.

Since:
1.0

isAuditEnabled

protected boolean isAuditEnabled()
returns true if the batch application should initialize the audit agent class. Otherwise returns false. To maintain backward compatibility, it always returns true unless overridden by a sub-class.

Returns:
boolean
Since:
2.0


Copyright © 2002-2004 Robert Half International. All Rights Reserved.