ABLE 2.3.0 07/13/2005 14:21:00

com.ibm.able
Class Able

java.lang.Object
  extended bycom.ibm.able.Able
All Implemented Interfaces:
java.io.Serializable

public class Able
extends java.lang.Object
implements java.io.Serializable

The Able class provides constants and class methods for the IBM Agent Building and Learning Environment (ABLE). It provides support for logging and tracing, preferences, asynchronous event queue posting and processing, directory settings, resource bundle access, trace string flavors used in the rule and data packages, and socket connection.

If the stored AblePreferences so indicate, threads are started for logging and tracing by a static initializer in this class.

See Also:
Serialized Form

Field Summary
static java.lang.String Copyright
          The ABLE package short copyright notice.
static java.lang.String Copyright_Long
          The ABLE package long copyright notice.
static boolean Debug
          A flag used to indicate development state which can include additional trace logic.
static java.lang.String GuiPropertiesFileName
          The name of the properties file containing GUI preferences.
static java.net.URL HomeUrl
          A URL of ProductDirectory, that can be used to create URLs to other bits of ABLE data and HTML files.
static int IndentLevel
          Current indentation level for traced messages.
static java.lang.String LS
          The system line separator, taken from the System property line.separator.
static AbleLogger MessageLog
          The Logger used to record locale-specific, translated messages.
static long MSG_ERROR
          Error message level includes translated messages about error conditions that caused a process to end abnormally.
static long MSG_INFO
          Informational message level includes translated messages about progress or object state changes.
static long MSG_NONE
          NONE message level excludes all message record types.
static long MSG_UNSPECIFIED
          Unspecified message level filters out all message record types.
static long MSG_WARNING
          Warning message level includes translated messages about error conditions that were handled or otherwise not significant enough to cause a process to end abnormally.
static java.lang.String PackageHomeProperty
          The name of the system property that contains this package's installation directory.
static AblePreferences Preferences
          The current set of preferences.
static int ProcessingDisabled_PostingDisabled
          Asynchronous Event Processing Flag: Event Processing is disabled; event Posting is disabled.
static int ProcessingDisabled_PostingEnabled
          Asynchronous Event Processing Flag: Event Processing is disabled; event Posting is enabled.
static int ProcessingEnabled_PostingDisabled
          Asynchronous Event Processing Flag: Event Processing is enabled; event Posting is disabled.
static int ProcessingEnabled_PostingEnabled
          Asynchronous Event Processing Flag: Event Processing is enabled; event Posting is enabled.
static java.lang.String ProductDirectory
          The directory where all this code is installed.
static java.lang.String PropertiesFileDirectoryProperty
          The name of the system property which provides the directory to contain the Able preferences properties file.
static java.lang.String PropertiesFileHeader
          The header to appear in the properties file.
static java.lang.String PropertiesFileName
          The name of the properties file containing runtime preferences.
static java.rmi.server.RMISocketFactory SocketFactory
          Either null or an instance of a socket factory.
static AbleLogger TraceLog
          The Logger used to record program trace and debug statements.
static int TraceStringFlavorArl
          Trace String Flavor; Arl - Able Rule Language.
static int TraceStringFlavorHigh
          Trace String Flavor; High.
static int TraceStringFlavorLow
          Trace String Flavor; Low.
static int TraceStringFlavorMedium
          Trace String Flavor; Medium.
static int TraceStringFlavorXml
          Trace String Flavor; Xml - eXtended Markup Language.
static long TRC_HIGH
          High trace level is the most detailed trace provided, and includes trace statements which are known to negatively impact performance.
static long TRC_HIGH_INFER
          Ruleset high inference tracing is inference engine output resulting from running an AbleRuleSet object.
static long TRC_LOW
          Low trace level includes only the most salient trace statements such as exception text and major milestones reached.
static long TRC_LOW_INFER
          Ruleset Low inference tracing is inference engine output resulting from running an AbleRuleSet object.
static long TRC_MEDIUM
          Medium trace level includes entry and exit trace for major methods such as init, reset, and process as well as any atypical exit points.
static long TRC_MEDIUM_INFER
          Ruleset Medium inference tracing is inference engine output resulting from running an AbleRuleSet object.
static long TRC_NONE
          The NONE trace level excludes all trace record types.
static java.lang.String UserHome
          The content of the system property "user.home", including the trailing file separator character.
static java.lang.String version
          The numeric ABLE package version.
static java.lang.String Version
          The descriptive ABLE package version.
 
Method Summary
static java.lang.Object addTraceConsoleHandler(AbleBean theBean, long level)
          Add the Able.TraceLog console handler to a bean's trace logger.
static java.lang.Object addTraceFileHandler(AbleBean theBean, long level, java.lang.String fileName)
          Adds a new file handler to a bean's trace logger.
static java.lang.String AgentAddr(java.lang.String theHostName)
          Generates an RMI agent address from the host on which the agent is currently running.
static java.lang.String AgentName(java.lang.String theBaseName, java.lang.String theHostName)
          Generate an RMI agent name from a base agent name and the host on which the agent is currently running.
static java.lang.String[] ClsDelim(java.lang.String theName)
          Return a pair of class delimiter strings based on the input class name.
static java.lang.String getLocalPath(java.lang.String path)
          Returns representation for a specific platform-dependent path from a serializable platform independent path.
static java.lang.String getLocalPathX(java.lang.String path)
          Returns a version of getLocalPath which traces but does not throw exceptions.
static java.lang.String getLocalRootPath(java.lang.String path)
          Returns the uppermost directory for a specific path.
static java.lang.String getRunPrefixForOS()
           
static java.lang.String getSerializablePath(java.lang.String path)
          Returns a specific path that can be serialized and used across platforms and between Able releases.
static java.rmi.server.RMISocketFactory GetSocketFactory()
          Get a socket factory as specified in ABLE preferences.
static java.lang.String getSystemDescription()
          Describe this systems name and versions.
static boolean hasTraceConsoleHandler(AbleLogger theLogger)
          Returns true if this logger has an active Console handler.
static boolean hasTraceFileHandler(AbleLogger theLogger)
          Returns true if this logger has an active File handler.
static void main(java.lang.String[] args)
          Load and Run a serialized Able agent.
static java.lang.String NlsMsg(java.lang.String theMsgKey)
          Returns a locale specific message by key.
static java.lang.String NlsMsg(java.lang.String theMsgKey, java.lang.Object[] theInserts)
          Returns a locale specific message by key and inserts text into the message.
static void removeTraceConsoleHandler(AbleBean theBean)
          Remove the Able.TraceLog console handler from a bean's trace logger.
static void removeTraceFileHandler(AbleBean theBean)
          Remove the Able.TraceLog file handler from a bean's trace logger.
static void run(java.lang.String theCommand)
          Run a command, prepending any required operating system commands to the command to run.
static void runOS(java.lang.String theCommand)
          Runs an operating system-specific command.
static void sendMail(java.lang.String theOriginator, java.lang.Object[] theRecipients, java.lang.String theSubject, java.lang.String theMailBody)
          Sends an e-mail to the specified recipients.
static void sendMail(java.lang.String theOriginator, java.lang.String theRecipient, java.lang.String theSubject, java.lang.String theMailBody)
          Sends an e-mail to the specified recipient.
static void setBeanTraceConsoleHandlerLevel(AbleBean theBean, long level)
          Set the trace level of a bean's console handler.
static void setBeanTraceFileHandlerLevel(AbleBean theBean, long level, java.lang.String fileName)
          Set the trace level of a bean's file handler.
static void setDefaultMessageAndTraceLogging()
          Set the message and trace levels to default values.
static void setMessageConsoleHandlerLevel(long level)
          Set the severity level of the Able.MessageLog console handler.
static void setMessageFileHandlerLevel(long level)
          Set the severity level of the Able.MessageLog file handler.
static void setMessageFileHandlerLevel(long level, java.lang.String fileName)
          Set the severity level of the Able.MessageLog file handler.
static void setTraceConsoleHandlerLevel(long level)
          Set the trace level of the Able.TraceLog console handler.
static void setTraceFileHandlerLevel(long level)
          Set the trace level of the Able.TraceLog file handler.
static void setTraceFileHandlerLevel(long level, java.lang.String fileName)
          Set the trace level of the Able.TraceLog file handler.
static AbleLogger startBeanTraceLogging(AbleBean theBean)
          Create a trace logger for a bean and copy any handlers from the static Able.TraceLog logger.
static void startMessageAndTraceLogging()
          Start the Able.TraceLog logger and the Able.MessageLog logger based on stored AblePreferences which define the levels of interest for console and file handlers.
static void startMessageLogging(long conSeverity, long fileSeverity, java.lang.String filename)
          Start the Able.MessageLog logger by adding the desired console and file handlers.
static void startTraceLogging(long conLevel, long fileLevel, java.lang.String filename)
          Start the Able.TraceLog logger by adding the desired console and file handlers.
static void stopBeanTraceLogging(AbleBean theBean)
          Stop tracing of a bean.
static void stopMessageAndTraceLogging()
          Stop the global Able.MessageLog and Able.TraceLog loggers.
static void stopMessageLogging()
          Stop the global Able.MessageLog logger.
static void stopTraceLogging()
          Stop the global Able.TraceLog logger.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

Copyright

public static final java.lang.String Copyright
The ABLE package short copyright notice.

See Also:
Constant Field Values

Copyright_Long

public static final java.lang.String Copyright_Long
The ABLE package long copyright notice.

See Also:
Constant Field Values

version

public static final java.lang.String version
The numeric ABLE package version.

See Also:
Constant Field Values

Version

public static final java.lang.String Version
The descriptive ABLE package version.

See Also:
Constant Field Values

Debug

public static final boolean Debug
A flag used to indicate development state which can include additional trace logic.

See Also:
Constant Field Values

PackageHomeProperty

public static final java.lang.String PackageHomeProperty
The name of the system property that contains this package's installation directory. For example, -Dable.home=C:\able_2.1.0. If not defined when the JVM is started, it defaults to the system property "user.home".

See Also:
Constant Field Values

UserHome

public static final java.lang.String UserHome
The content of the system property "user.home", including the trailing file separator character.


PropertiesFileDirectoryProperty

public static final java.lang.String PropertiesFileDirectoryProperty
The name of the system property which provides the directory to contain the Able preferences properties file. Set this value with a property definition when starting the JVM. For example, -Dable.prefdir=C:\.

See Also:
Constant Field Values

PropertiesFileHeader

public static final java.lang.String PropertiesFileHeader
The header to appear in the properties file.

See Also:
Constant Field Values

PropertiesFileName

public static final java.lang.String PropertiesFileName
The name of the properties file containing runtime preferences.

See Also:
Constant Field Values

GuiPropertiesFileName

public static final java.lang.String GuiPropertiesFileName
The name of the properties file containing GUI preferences.

See Also:
Constant Field Values

ProcessingDisabled_PostingDisabled

public static final int ProcessingDisabled_PostingDisabled
Asynchronous Event Processing Flag: Event Processing is disabled; event Posting is disabled. Events on the event queue remain there, unprocessed; other objects may not add new events to the event queue; the queue neither shrinks nor grows.

See Also:
Constant Field Values

ProcessingDisabled_PostingEnabled

public static final int ProcessingDisabled_PostingEnabled
Asynchronous Event Processing Flag: Event Processing is disabled; event Posting is enabled. Events on the event queue remain there, unprocessed; other objects may add additional events to the event queue; the queue can grow.

See Also:
Constant Field Values

ProcessingEnabled_PostingDisabled

public static final int ProcessingEnabled_PostingDisabled
Asynchronous Event Processing Flag: Event Processing is enabled; event Posting is disabled. Events are removed from the event queue and processed; other objects may not add new events to the event queue; the queue shrinks as events are processed until it is empty.

See Also:
Constant Field Values

ProcessingEnabled_PostingEnabled

public static final int ProcessingEnabled_PostingEnabled
Asynchronous Event Processing Flag: Event Processing is enabled; event Posting is enabled. Events are removed from the event queue and processed; other objects may add additional events to the event queue; the queue grows and shrinks as events come in and are processed.

See Also:
Constant Field Values

LS

public static java.lang.String LS
The system line separator, taken from the System property line.separator.


Preferences

public static final AblePreferences Preferences
The current set of preferences.


TRC_LOW

public static final long TRC_LOW
Low trace level includes only the most salient trace statements such as exception text and major milestones reached. Also known as LEVEL1 trace.

See Also:
Constant Field Values

TRC_MEDIUM

public static final long TRC_MEDIUM
Medium trace level includes entry and exit trace for major methods such as init, reset, and process as well as any atypical exit points. Exception stack traces should generally be Medium. Low trace level is also included. Also known as LEVEL2 trace.

See Also:
Constant Field Values

TRC_HIGH

public static final long TRC_HIGH
High trace level is the most detailed trace provided, and includes trace statements which are known to negatively impact performance. Low and medium trace levels are also included. Also known as LEVEL3 trace.

See Also:
Constant Field Values

TRC_NONE

public static final long TRC_NONE
The NONE trace level excludes all trace record types.

See Also:
Constant Field Values

TRC_LOW_INFER

public static final long TRC_LOW_INFER
Ruleset Low inference tracing is inference engine output resulting from running an AbleRuleSet object. Inference trace output is translatable and is a refinement of MSG_INFO. RuleSet and RuleBlock inputs and outputs would typically use this level.

See Also:
Constant Field Values

TRC_MEDIUM_INFER

public static final long TRC_MEDIUM_INFER
Ruleset Medium inference tracing is inference engine output resulting from running an AbleRuleSet object. Inference trace output is translatable and is a refinement of MSG_INFO. Variable assignments and rule antecedant results would typically use this level, as well as assertions and retractions to working memory.

See Also:
Constant Field Values

TRC_HIGH_INFER

public static final long TRC_HIGH_INFER
Ruleset high inference tracing is inference engine output resulting from running an AbleRuleSet object. Inference trace output is translatable and is a refinement of MSG_INFO. Results at the clause level as well as strategic working memory dumps typically use this level.

See Also:
Constant Field Values

MSG_INFO

public static final long MSG_INFO
Informational message level includes translated messages about progress or object state changes. Warning and Error severities are also included.

See Also:
Constant Field Values

MSG_WARNING

public static final long MSG_WARNING
Warning message level includes translated messages about error conditions that were handled or otherwise not significant enough to cause a process to end abnormally. Error messages are also included.

See Also:
Constant Field Values

MSG_ERROR

public static final long MSG_ERROR
Error message level includes translated messages about error conditions that caused a process to end abnormally.

See Also:
Constant Field Values

MSG_NONE

public static final long MSG_NONE
NONE message level excludes all message record types.

See Also:
Constant Field Values

MSG_UNSPECIFIED

public static final long MSG_UNSPECIFIED
Unspecified message level filters out all message record types.

See Also:
Constant Field Values

MessageLog

public static transient AbleLogger MessageLog
The Logger used to record locale-specific, translated messages. Its default behavior is to log messages sent as MSG_ERROR on the console and in a file prefixed with AbleMsg, a datestamp, and an extension of .log. Defaults are changed through AblePreferences.


TraceLog

public static transient AbleLogger TraceLog
The Logger used to record program trace and debug statements. Tracing is off by default and trace levels may be changed through AblePreferences.


ProductDirectory

public static java.lang.String ProductDirectory
The directory where all this code is installed. Note that the value has a File.separator character on the end!


HomeUrl

public static java.net.URL HomeUrl
A URL of ProductDirectory, that can be used to create URLs to other bits of ABLE data and HTML files. Note that the value has a File.separator character on the end!


IndentLevel

public static int IndentLevel
Current indentation level for traced messages.


SocketFactory

public static java.rmi.server.RMISocketFactory SocketFactory
Either null or an instance of a socket factory. The factory class is specified in AblePreferences.


TraceStringFlavorHigh

public static final int TraceStringFlavorHigh
Trace String Flavor; High.

See Also:
Constant Field Values

TraceStringFlavorMedium

public static final int TraceStringFlavorMedium
Trace String Flavor; Medium.

See Also:
Constant Field Values

TraceStringFlavorLow

public static final int TraceStringFlavorLow
Trace String Flavor; Low.

See Also:
Constant Field Values

TraceStringFlavorArl

public static final int TraceStringFlavorArl
Trace String Flavor; Arl - Able Rule Language.

See Also:
Constant Field Values

TraceStringFlavorXml

public static final int TraceStringFlavorXml
Trace String Flavor; Xml - eXtended Markup Language.

See Also:
Constant Field Values
Method Detail

NlsMsg

public static java.lang.String NlsMsg(java.lang.String theMsgKey)
Returns a locale specific message by key. The message must not contain any insertion text.

Parameters:
theMsgKey - A unique key identifying the message to be retrieved from the package's MessageBundle.

Returns:
The requested message, or the key if the message is not found.


NlsMsg

public static java.lang.String NlsMsg(java.lang.String theMsgKey,
                                      java.lang.Object[] theInserts)
Returns a locale specific message by key and inserts text into the message.

Parameters:
theMsgKey - A unique key identifying the message to be retrieved from the package's MessageBundle.

theInserts - The objects to inserted into the message before it is returned.

Returns:
The requested message, or the key if the message is not found.


startMessageAndTraceLogging

public static void startMessageAndTraceLogging()
Start the Able.TraceLog logger and the Able.MessageLog logger based on stored AblePreferences which define the levels of interest for console and file handlers.

See Also:
setDefaultMessageAndTraceLogging(), startMessageLogging(long, long, java.lang.String), startTraceLogging(long, long, java.lang.String), stopMessageAndTraceLogging()

startMessageLogging

public static void startMessageLogging(long conSeverity,
                                       long fileSeverity,
                                       java.lang.String filename)
Start the Able.MessageLog logger by adding the desired console and file handlers. Message severity constants used by Able include MSG_NONE, MSG_INFO, MSG_WARNING, and MSG_ERROR. A handler will be removed if the severity specified is MSG_NONE.

Parameters:
conSeverity - A long indicating the severity of messages to be logged to the console.
fileSeverity - A long indicating the severity of messages to be logged to a file.
filename - A string containing the path and name of the log file.

startTraceLogging

public static void startTraceLogging(long conLevel,
                                     long fileLevel,
                                     java.lang.String filename)
Start the Able.TraceLog logger by adding the desired console and file handlers. Trace level constants used by Able include TRC_NONE, TRC_LOW, TRC_MEDIUM, and TRC_HIGH. A handler will be removed if the severity specified is TRC_NONE. Any beans with their own loggers will have the global console and file handlers copied.

Parameters:
conLevel - A long indicating the level of tracing to be logged to the console.
fileLevel - A long indicating the level of tracing to be logged to a file.
filename - A string containing the path and name of the log file.

stopMessageAndTraceLogging

public static void stopMessageAndTraceLogging()
Stop the global Able.MessageLog and Able.TraceLog loggers. All handler threads are stopped. All bean loggers are stopped.

See Also:
startMessageAndTraceLogging()

stopMessageLogging

public static void stopMessageLogging()
Stop the global Able.MessageLog logger. All handler threads are stopped. Logging is set off.

See Also:
startMessageAndTraceLogging()

stopTraceLogging

public static void stopTraceLogging()
Stop the global Able.TraceLog logger. All bean loggers are stopped. All handler threads are stopped. Logging is set off.

See Also:
startMessageAndTraceLogging()

startBeanTraceLogging

public static AbleLogger startBeanTraceLogging(AbleBean theBean)
                                        throws AbleException
Create a trace logger for a bean and copy any handlers from the static Able.TraceLog logger. The logger created is returned so additional handlers can be added.

Parameters:
theBean - The bean to be traced.
Returns:
The AbleLogger unique to this bean.
Throws:
AbleException

stopBeanTraceLogging

public static void stopBeanTraceLogging(AbleBean theBean)
                                 throws AbleException
Stop tracing of a bean. If the bean has its own trace logger, all handlers are removed. Any handlers which are not shared with the Able.TraceLog are stopped and closed. The bean's trace log is set back to Able.TraceLog.

Parameters:
theBean - The bean to stop tracing.
Throws:
AbleException

addTraceConsoleHandler

public static java.lang.Object addTraceConsoleHandler(AbleBean theBean,
                                                      long level)
                                               throws AbleException
Add the Able.TraceLog console handler to a bean's trace logger. If Able.TraceLog has no console handler, create a console handler for this bean. If the bean already has a console handler, return it at the level requested.

Parameters:
theBean - An AbleBean whose trace output is to be sent to the console.
level - The trace level to be used by the console handler.
Returns:
The Handler added.
Throws:
AbleException

removeTraceConsoleHandler

public static void removeTraceConsoleHandler(AbleBean theBean)
                                      throws AbleException
Remove the Able.TraceLog console handler from a bean's trace logger. No action is taken if the bean logger has no console handler. If Able.TraceLog has a console handler, add it to this bean logger.

Parameters:
theBean - An AbleBean whose trace output is no longer to be sent to the console.
Throws:
AbleException

hasTraceConsoleHandler

public static boolean hasTraceConsoleHandler(AbleLogger theLogger)
Returns true if this logger has an active Console handler.

Parameters:
theLogger - The logger to be searched.

addTraceFileHandler

public static java.lang.Object addTraceFileHandler(AbleBean theBean,
                                                   long level,
                                                   java.lang.String fileName)
                                            throws AbleException
Adds a new file handler to a bean's trace logger. The bean must be in bean logging mode - see startBeanTraceLogging(AbleBean) or no action will be taken. If the bean's logger already has a file handler, it is closed and a new handler with the specified filename is opened.

Parameters:
theBean - An AbleBean whose trace output is to be sent to a unique file.
level - A level from AbleTraceLogger.TraceLogLevelValuesVector used to calculate a mask.
fileName - The path and file name used to store the trace output.
Returns:
The Handler added; null returned if the bean trace logger is the global Able.TraceLog logger or adding a handler fails.
Throws:
AbleException
See Also:
AbleTraceLogger.addFileHandler(AbleLogger, String, long, String)

removeTraceFileHandler

public static void removeTraceFileHandler(AbleBean theBean)
                                   throws AbleException
Remove the Able.TraceLog file handler from a bean's trace logger. No action is taken if the bean logger has no file handler.

Parameters:
theBean - An AbleBean whose trace output is no longer to be filed.
Throws:
AbleException

hasTraceFileHandler

public static boolean hasTraceFileHandler(AbleLogger theLogger)
Returns true if this logger has an active File handler.

Parameters:
theLogger - The logger to be searched.

setDefaultMessageAndTraceLogging

public static void setDefaultMessageAndTraceLogging()
Set the message and trace levels to default values. of the Able.TraceLog console handler.


setTraceConsoleHandlerLevel

public static void setTraceConsoleHandlerLevel(long level)
Set the trace level of the Able.TraceLog console handler. No action taken if there is no handler.

Parameters:
level - A level from AbleTraceLogger.TraceLogLevelValuesVector.

setMessageConsoleHandlerLevel

public static void setMessageConsoleHandlerLevel(long level)
Set the severity level of the Able.MessageLog console handler. No action taken if there is no handler.

Parameters:
level - A level from AbleTraceLogger.MessageLogSeverityValuesVector.

setTraceFileHandlerLevel

public static void setTraceFileHandlerLevel(long level)
Set the trace level of the Able.TraceLog file handler. No action taken if there is no handler.

Parameters:
level - A level from AbleTraceLogger.TraceLogLevelValuesVector.

setMessageFileHandlerLevel

public static void setMessageFileHandlerLevel(long level)
Set the severity level of the Able.MessageLog file handler. No action taken if there is no handler.

Parameters:
level - A level from AbleTraceLogger.MessageLogSeverityValuesVector.

setTraceFileHandlerLevel

public static void setTraceFileHandlerLevel(long level,
                                            java.lang.String fileName)
Set the trace level of the Able.TraceLog file handler. No action taken if there is no handler.

Parameters:
level - A level from AbleTraceLogger.TraceLogLevelValuesVector.

setMessageFileHandlerLevel

public static void setMessageFileHandlerLevel(long level,
                                              java.lang.String fileName)
Set the severity level of the Able.MessageLog file handler. No action taken if there is no handler.

Parameters:
level - A level from AbleTraceLogger.MessageLogSeverityValuesVector.

setBeanTraceConsoleHandlerLevel

public static void setBeanTraceConsoleHandlerLevel(AbleBean theBean,
                                                   long level)
                                            throws AbleException
Set the trace level of a bean's console handler. No action taken if there is no handler.

Parameters:
theBean - An AbleBean whose console trace handler level is to be changed.
level - A level from AbleTraceLogger.TraceLogLevelValuesVector.
Throws:
AbleException

setBeanTraceFileHandlerLevel

public static void setBeanTraceFileHandlerLevel(AbleBean theBean,
                                                long level,
                                                java.lang.String fileName)
                                         throws AbleException
Set the trace level of a bean's file handler. No action taken if there is no handler.

Parameters:
theBean - An AbleBean whose file trace handler level is to be changed.
level - A level from AbleTraceLogger.TraceLogLevelValuesVector.
Throws:
AbleException

AgentAddr

public static java.lang.String AgentAddr(java.lang.String theHostName)
Generates an RMI agent address from the host on which the agent is currently running.

Parameters:
theHostName - The name of the host on which the agent resides.

Returns:
An RMI agent name.

AgentName

public static java.lang.String AgentName(java.lang.String theBaseName,
                                         java.lang.String theHostName)
Generate an RMI agent name from a base agent name and the host on which the agent is currently running.

Parameters:
theBaseName - A string representing the base part of the agent's name; that is, the part before the "@" symbol.

theHostName - A string representing the name of the host on which the agent resides.

Returns:
An RMI agent name.

GetSocketFactory

public static java.rmi.server.RMISocketFactory GetSocketFactory()
Get a socket factory as specified in ABLE preferences.

Returns:
null if no socket factory class is specified in the preferences, or it cannot be created; otherwise an instance of the specified class is returned.

ClsDelim

public static java.lang.String[] ClsDelim(java.lang.String theName)
Return a pair of class delimiter strings based on the input class name. The strings are used by most toString() methods in a certain programmer's code.

Parameters:
theName - The class name of any ABLE object, for example, "AbleBooleanVariable".

Returns:
A string array where the first element is a string of the form "ClassName---------------------" and the second element is a string of the form "--End ClassName---------------". The strings should be of equal length, as derived from the length of the specified name, the length of Delim and the current value of IndentLevel.

getLocalPath

public static java.lang.String getLocalPath(java.lang.String path)
                                     throws java.io.IOException
Returns representation for a specific platform-dependent path from a serializable platform independent path. This method reverses the processing performed by getSerializablePath(java.lang.String).

Parameters:
path - The path and optionally a file name. If null is provided, null is returned.
Returns:
The platform independent file specification.
Throws:
java.io.IOException - If the path could not be found.
See Also:
getSerializablePath(String)

getLocalPathX

public static java.lang.String getLocalPathX(java.lang.String path)
Returns a version of getLocalPath which traces but does not throw exceptions.

Parameters:
path - The path and optionally a file name. If null is provided, null is returned.
Returns:
A The local file specification. If an exception occurs, the path provided is returned and the exception is traced.
See Also:
getLocalPath(String)

getSerializablePath

public static java.lang.String getSerializablePath(java.lang.String path)
                                            throws java.io.IOException
Returns a specific path that can be serialized and used across platforms and between Able releases. If the path provided starts with a sequence designed to be platform or release independent, the path is replaced by a keyword string. Any '\' or '/' path or file separators in the String are replaced by the platform value for File.separator.

Platform and release independent directories are identified in this order, and with the keyword shown:

  • The directory indicated by System property "user.home" uses "%user.home%".
  • The directory indicated by System property "user.dir" uses "%user.dir%".
  • The directory matching Able.ProductDirectory uses "%able.home%".
  • The directory matching the root directory of user.home uses "%root%".

    All keywords represent directories and include a trailing File.separator.

    Parameters:
    path - A String containing a path and optionally a file name. If null is provided, null is returned.
    Returns:
    The platform independent file specification.
    Throws:
    java.io.IOException - If the path could not be found.
    See Also:
    getLocalPath(String)

  • getLocalRootPath

    public static java.lang.String getLocalRootPath(java.lang.String path)
                                             throws java.io.IOException
    Returns the uppermost directory for a specific path.

    Parameters:
    path - The path and optionally a file name. If null, the root for the user.home path is returned.
    Returns:
    The root directory.
    Throws:
    java.io.IOException - If the path could not be found.

    runOS

    public static void runOS(java.lang.String theCommand)
                      throws java.lang.Exception
    Runs an operating system-specific command.

    Parameters:
    theCommand - The exact operating system-dependent command to run.
    Throws:
    An - exception if an error occurs when the command is run.
    java.lang.Exception

    run

    public static void run(java.lang.String theCommand)
                    throws java.lang.Exception
    Run a command, prepending any required operating system commands to the command to run.

    Parameters:
    theCommand - The command to run.
    Throws:
    An - exception if an error occurs when the command is run.
    java.lang.Exception

    getRunPrefixForOS

    public static java.lang.String getRunPrefixForOS()
                                              throws AbleException
    Throws:
    AbleException

    sendMail

    public static void sendMail(java.lang.String theOriginator,
                                java.lang.Object[] theRecipients,
                                java.lang.String theSubject,
                                java.lang.String theMailBody)
                         throws AbleException
    Sends an e-mail to the specified recipients. The mail is sent using the SMTP relay specified by the mail.host system property.

    Parameters:
    theOriginator - The e-mail address of the originator; for example, sender@some.company.com or "Sender" .
    theRecipients - The e-mail addresses of one or more recipients; each element of the array must be a String and the format of each address is the same as for theOriginator. This parameter must never be null.
    theSubject - The subject line of the e-mail.
    theMailBody - The content of the e-mail. This string should contain multiple lines of text separated with Line Separator characters. A BufferedReader(StringReader) is created over the specified string and the readLine() method is used to read each line to be sent.

    Note that if theMailBody is the empty string, no mail is sent; that is, this method quietly returns with no error indication.

    This parameter must not be null.

    Throws:
    AbleException - If an e-mail could not be sent. If an error occurs for any recipient in the list, the remaining recipients are ignored; that is, no e-mail is sent to any recipient after the one producing the error.

    sendMail

    public static void sendMail(java.lang.String theOriginator,
                                java.lang.String theRecipient,
                                java.lang.String theSubject,
                                java.lang.String theMailBody)
                         throws AbleException
    Sends an e-mail to the specified recipient. The mail is sent using the SMTP relay specified by the mail.host system property.

    Parameters:
    theOriginator - The e-mail address of the originator; for example, sender@some.company.com or "Sender" .
    theRecipient - The e-mail address of the recipient; the format is the same as for theOriginator.
    theSubject - The subject line of the e-mail.
    theMailBody - The content of the e-mail. This string should contain multiple lines of text separated with Line Separator characters. A BufferedReader(StringReader) is created over the specified string and the readLine() method is used to read each line to be sent.

    Note that if theMailBody is the empty string, no mail is sent; that is, this method quietly returns with no error indication.

    This parameter must not be null.

    Throws:
    AbleException - If the e-mail could not be sent.

    getSystemDescription

    public static java.lang.String getSystemDescription()
    Describe this systems name and versions.

    Returns:
    the hostname, address, operating system level, Java level, and ABLE level.

    main

    public static void main(java.lang.String[] args)
    Load and Run a serialized Able agent. Takes a single command line parameter: the file path to the serialized agent. Runs until the user cancels the process (Ctl-C).

    Parameters:
    args - [0] is the path and name to the AbleDefaultAgent to reserialize and start.

    ABLE 2.3.0 07/13/2005 14:21:00

    (C) Copyright IBM Corporation 1999, 2005