i-net Clear Reports

com.inet.report.schedule
Class ErrorAction

java.lang.Object
  extended by com.inet.report.schedule.ScheduleAction
      extended by com.inet.report.schedule.ErrorAction

public class ErrorAction
extends ScheduleAction

This class is an action class representing an action class which could not be loaded at startup of the i-net Scheduler. The class has not been in the class path. To prevent that the action will be lost an instance of this ErrorAction is created which saves all information about the action class which could not be loaded.
There is a special handling for this action during saving. The original definition will be restored out of the information in this class.

Since:
6.1

Field Summary
 
Fields inherited from class com.inet.report.schedule.ScheduleAction
TYPE_CACHE, TYPE_CUSTOM, TYPE_EMAIL, TYPE_FILE, TYPE_FTP, TYPE_PRINT
 
Constructor Summary
ErrorAction(ScheduleTask taskOfOriginalAndErrorAction)
          Creates an ErrorAction for an ScheduleAction of the provided task.
 
Method Summary
 void action(ExecutedTask executedTask)
          This method will simply do nothing except create a log message that a custom action should be executed but the class could not be found.
 java.util.Properties getActionProperties()
          This will return all the saved properties of the custom action which is saved in this ErrorAction.
 java.lang.String getClassPathEntry()
          Returns the class path entry where the custom action class represented by this ErrorAction should have been found.
 java.lang.String[] getErrorMessages()
          Returns the error messages for this action class.
 java.lang.String getOriginalActionClassName()
          This will return the class name of the custom action which could not be loaded and is now represented by thie ErrorAction.
 void setActionProperties(java.util.Properties newActionProperties)
          Sets the properties ot the custom action which will be represented by this ErrorAction.
 void setClassPathEntry(java.lang.String classPathEntry)
          This call will try to fix the problem that the custom action saved in this ErrorAction is not found.
 void setOriginalActionClassName(java.lang.String originalActionClassName)
          Sets the class name of the cutom action which could not be found and will be represented by this ErrorAction.
 
Methods inherited from class com.inet.report.schedule.ScheduleAction
getType, isValid, toString
 

Constructor Detail

ErrorAction

public ErrorAction(ScheduleTask taskOfOriginalAndErrorAction)
Creates an ErrorAction for an ScheduleAction of the provided task.

Parameters:
taskOfOriginalAndErrorAction - The task where the ErrorAction will be located.
Method Detail

getClassPathEntry

public java.lang.String getClassPathEntry()
Returns the class path entry where the custom action class represented by this ErrorAction should have been found.

Returns:
A call path entry e.g. a path to a jar file where the custom action should have been found.
Since:
6.1

setClassPathEntry

public void setClassPathEntry(java.lang.String classPathEntry)
This call will try to fix the problem that the custom action saved in this ErrorAction is not found. Therefore the given classPathEntry will be added to the current ClassLoaded and it will be tried to load the custom action class. If it is sucessful this ErrorAction will be removed from the associated task and the custom action will be added. If the method getErrorMessages() returns an empty array it was sucessful. Important: If you get an empty array from this method this means that the original custom action which should be saved by this error action could be loaded. So the custom action then will exist in the associated task. Then you should not use this object anymore because this could cause unpredictable side-effects.

Parameters:
classPathEntry - The new class path entry e.g. a path to a jar file where the custom action should be found. This class path entry will be added to the current class path.
Since:
6.1

action

public void action(ExecutedTask executedTask)
This method will simply do nothing except create a log message that a custom action should be executed but the class could not be found.

Specified by:
action in class ScheduleAction
Parameters:
executedTask - All information about the executed task.
Since:
6.1

getActionProperties

public java.util.Properties getActionProperties()
This will return all the saved properties of the custom action which is saved in this ErrorAction. Please note that any changes to the returned object will have no effect.

Returns:
The properties of the saved custom action.
Since:
6.1

setActionProperties

public void setActionProperties(java.util.Properties newActionProperties)
Sets the properties ot the custom action which will be represented by this ErrorAction.

Parameters:
newActionProperties - The properties of the custom action.

getOriginalActionClassName

public java.lang.String getOriginalActionClassName()
This will return the class name of the custom action which could not be loaded and is now represented by thie ErrorAction.

Returns:
The class name of the custom action.
Since:
6.1

setOriginalActionClassName

public void setOriginalActionClassName(java.lang.String originalActionClassName)
Sets the class name of the cutom action which could not be found and will be represented by this ErrorAction.

Parameters:
originalActionClassName - The class name of the custom action.

getErrorMessages

public java.lang.String[] getErrorMessages()
Returns the error messages for this action class. Usually you will get a message saying that the custom action could not be found in the class path.
After trying to fix this problem with setClassPathEntry(String) you could get either an empty array which means that the custom action could be found now or still an array containing the message that the class could not be found. You can also get an additional error message if the class could be found but the properties previously set to the custom action do not match the found class anymore.
Important: If you get an empty array from this method this means that the original custom action which should be saved by this error action could be loaded. So the custom action then will exist in the associated task. Then you should not use this object anymore because this could cause unpredictable side-effects.

Overrides:
getErrorMessages in class ScheduleAction
Returns:
An array of error messages or an empty array if there are no errors anymore.
Since:
6.1

i-net Clear Reports

Copyright © 1999-2011 by i-net software GmbH