|
ABLE 2.3.0 07/13/2005 14:21:00 | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||
java.lang.Objectcom.ibm.able.Able
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.
| 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 |
public static final java.lang.String Copyright
public static final java.lang.String Copyright_Long
public static final java.lang.String version
public static final java.lang.String Version
public static final boolean Debug
public static final java.lang.String PackageHomeProperty
-Dable.home=C:\able_2.1.0. If not defined when the
JVM is started, it defaults to the system property "user.home".
public static final java.lang.String UserHome
public static final java.lang.String PropertiesFileDirectoryProperty
-Dable.prefdir=C:\.
public static final java.lang.String PropertiesFileHeader
public static final java.lang.String PropertiesFileName
public static final java.lang.String GuiPropertiesFileName
public static final int ProcessingDisabled_PostingDisabled
public static final int ProcessingDisabled_PostingEnabled
public static final int ProcessingEnabled_PostingDisabled
public static final int ProcessingEnabled_PostingEnabled
public static java.lang.String LS
public static final AblePreferences Preferences
public static final long TRC_LOW
public static final long TRC_MEDIUM
public static final long TRC_HIGH
public static final long TRC_NONE
public static final long TRC_LOW_INFER
MSG_INFO. RuleSet and RuleBlock inputs and outputs would
typically use this level.
public static final long TRC_MEDIUM_INFER
MSG_INFO. Variable assignments and rule antecedant results
would typically use this level, as well as assertions and retractions
to working memory.
public static final long TRC_HIGH_INFER
MSG_INFO. Results at the clause level as well as strategic
working memory dumps
typically use this level.
public static final long MSG_INFO
public static final long MSG_WARNING
public static final long MSG_ERROR
public static final long MSG_NONE
public static final long MSG_UNSPECIFIED
public static transient AbleLogger MessageLog
MSG_ERROR on the console
and in a file prefixed
with AbleMsg, a datestamp, and an extension of .log.
Defaults are changed through AblePreferences.
public static transient AbleLogger TraceLog
AblePreferences.
public static java.lang.String ProductDirectory
public static java.net.URL HomeUrl
public static int IndentLevel
public static java.rmi.server.RMISocketFactory SocketFactory
AblePreferences.
public static final int TraceStringFlavorHigh
public static final int TraceStringFlavorMedium
public static final int TraceStringFlavorLow
public static final int TraceStringFlavorArl
public static final int TraceStringFlavorXml
| Method Detail |
public static java.lang.String NlsMsg(java.lang.String theMsgKey)
theMsgKey - A unique key identifying the message to be retrieved
from the package's MessageBundle.
public static java.lang.String NlsMsg(java.lang.String theMsgKey,
java.lang.Object[] theInserts)
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.
public static void startMessageAndTraceLogging()
AblePreferences which define the levels of interest for
console and file handlers.
setDefaultMessageAndTraceLogging(),
startMessageLogging(long, long, java.lang.String),
startTraceLogging(long, long, java.lang.String),
stopMessageAndTraceLogging()
public static void startMessageLogging(long conSeverity,
long fileSeverity,
java.lang.String filename)
MSG_NONE,
MSG_INFO, MSG_WARNING, and MSG_ERROR.
A handler will be removed if the severity specified is MSG_NONE.
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.
public static void startTraceLogging(long conLevel,
long fileLevel,
java.lang.String filename)
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.
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.public static void stopMessageAndTraceLogging()
startMessageAndTraceLogging()public static void stopMessageLogging()
startMessageAndTraceLogging()public static void stopTraceLogging()
startMessageAndTraceLogging()
public static AbleLogger startBeanTraceLogging(AbleBean theBean)
throws AbleException
theBean - The bean to be traced.
AbleException
public static void stopBeanTraceLogging(AbleBean theBean)
throws AbleException
theBean - The bean to stop tracing.
AbleException
public static java.lang.Object addTraceConsoleHandler(AbleBean theBean,
long level)
throws AbleException
theBean - An AbleBean whose trace output is to be sent to the console.level - The trace level to be used by the console handler.
AbleException
public static void removeTraceConsoleHandler(AbleBean theBean)
throws AbleException
theBean - An AbleBean whose trace output is no longer to be sent to the console.
AbleExceptionpublic static boolean hasTraceConsoleHandler(AbleLogger theLogger)
theLogger - The logger to be searched.
public static java.lang.Object addTraceFileHandler(AbleBean theBean,
long level,
java.lang.String fileName)
throws AbleException
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.
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.
AbleExceptionAbleTraceLogger.addFileHandler(AbleLogger, String, long, String)
public static void removeTraceFileHandler(AbleBean theBean)
throws AbleException
theBean - An AbleBean whose trace output is no longer to be filed.
AbleExceptionpublic static boolean hasTraceFileHandler(AbleLogger theLogger)
theLogger - The logger to be searched.public static void setDefaultMessageAndTraceLogging()
public static void setTraceConsoleHandlerLevel(long level)
level - A level from AbleTraceLogger.TraceLogLevelValuesVector.public static void setMessageConsoleHandlerLevel(long level)
level - A level from AbleTraceLogger.MessageLogSeverityValuesVector.public static void setTraceFileHandlerLevel(long level)
level - A level from AbleTraceLogger.TraceLogLevelValuesVector.public static void setMessageFileHandlerLevel(long level)
level - A level from AbleTraceLogger.MessageLogSeverityValuesVector.
public static void setTraceFileHandlerLevel(long level,
java.lang.String fileName)
level - A level from AbleTraceLogger.TraceLogLevelValuesVector.
public static void setMessageFileHandlerLevel(long level,
java.lang.String fileName)
level - A level from AbleTraceLogger.MessageLogSeverityValuesVector.
public static void setBeanTraceConsoleHandlerLevel(AbleBean theBean,
long level)
throws AbleException
theBean - An AbleBean whose console trace handler level is to be changed.level - A level from AbleTraceLogger.TraceLogLevelValuesVector.
AbleException
public static void setBeanTraceFileHandlerLevel(AbleBean theBean,
long level,
java.lang.String fileName)
throws AbleException
theBean - An AbleBean whose file trace handler level is to be changed.level - A level from AbleTraceLogger.TraceLogLevelValuesVector.
AbleExceptionpublic static java.lang.String AgentAddr(java.lang.String theHostName)
theHostName - The name of the host on which
the agent resides.
public static java.lang.String AgentName(java.lang.String theBaseName,
java.lang.String theHostName)
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.
public static java.rmi.server.RMISocketFactory GetSocketFactory()
public static java.lang.String[] ClsDelim(java.lang.String theName)
theName - The class name of any ABLE object, for example,
"AbleBooleanVariable".
public static java.lang.String getLocalPath(java.lang.String path)
throws java.io.IOException
getSerializablePath(java.lang.String).
path - The path and optionally a file name.
If null is provided, null is returned.
java.io.IOException - If the path could not be found.getSerializablePath(String)public static java.lang.String getLocalPathX(java.lang.String path)
path - The path and optionally a file name.
If null is provided, null is returned.
getLocalPath(String)
public static java.lang.String getSerializablePath(java.lang.String path)
throws java.io.IOException
Platform and release independent directories are identified in this order,
and with the keyword shown:
All keywords represent directories and include a trailing File.separator.
path - A String containing a path and optionally a file name.
If null is provided, null is returned.
java.io.IOException - If the path could not be found.getLocalPath(String)
public static java.lang.String getLocalRootPath(java.lang.String path)
throws java.io.IOException
path - The path and optionally a file name.
If null, the root for the user.home path is returned.
java.io.IOException - If the path could not be found.
public static void runOS(java.lang.String theCommand)
throws java.lang.Exception
theCommand - The exact operating system-dependent command to run.
An - exception if an error occurs when the command is run.
java.lang.Exception
public static void run(java.lang.String theCommand)
throws java.lang.Exception
theCommand - The command to run.
An - exception if an error occurs when the command is run.
java.lang.Exception
public static java.lang.String getRunPrefixForOS()
throws AbleException
AbleException
public static void sendMail(java.lang.String theOriginator,
java.lang.Object[] theRecipients,
java.lang.String theSubject,
java.lang.String theMailBody)
throws AbleException
mail.host
system property.
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.
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.
public static void sendMail(java.lang.String theOriginator,
java.lang.String theRecipient,
java.lang.String theSubject,
java.lang.String theMailBody)
throws AbleException
mail.host
system property.
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.
AbleException - If the e-mail could not be sent.public static java.lang.String getSystemDescription()
public static void main(java.lang.String[] args)
args - [0] is the path and name to the AbleDefaultAgent to reserialize and start.
|
ABLE 2.3.0 07/13/2005 14:21:00 | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||