|
ABLE 2.0.0 07/02/2003 10:25:01 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.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 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_HIGH_PARSE
Ruleset High parse tracing is trace level output resulting from parsing a ruleset by the AbleRuleSet object, which has its own trace logger object. |
static long |
TRC_HIGH_RLST
Ruleset High tracing is trace level output from an AbleRuleSet object, which has its own trace logger 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_LOW_PARSE
Ruleset Low parse tracing is trace level output resulting from parsing a ruleset by the AbleRuleSet object, which has its own trace logger object. |
static long |
TRC_LOW_RLST
Ruleset Low tracing is trace level output from an AbleRuleSet object, which has its own trace logger 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_MEDIUM_PARSE
Ruleset Medium parse tracing is trace level output resulting from parsing a ruleset by the AbleRuleSet object, which has its own trace logger object. |
static long |
TRC_MEDIUM_RLST
Ruleset Medium tracing is trace level output from an AbleRuleSet object, which has its own trace logger 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 ABLE package version. |
Method Summary | |
---|---|
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 |
Copyright()
Determine the copyright of this class. |
static java.lang.String |
getLocalPath(java.lang.String path)
Returns representation for a specific platform-dependant path from a serializable platform independant 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 |
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 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 |
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 |
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 Version
public static final boolean Debug
public static final java.lang.String PackageHomeProperty
-Dable.home=C:\able_2.0.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_RLST
public static final long TRC_MEDIUM_RLST
public static final long TRC_HIGH_RLST
public static final long TRC_LOW_PARSE
public static final long TRC_MEDIUM_PARSE
public static final long TRC_HIGH_PARSE
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 final 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.conSeverity
- A long indicating the level of tracing to be logged to the console.fileSeverity
- 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.public static void stopBeanTraceLogging(AbleBean theBean) throws AbleException
theBean
- The bean to stop tracing.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
.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
.public 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)
.java.io.IOException
- If the path could not be found.getSerializablePath(String)
public static java.lang.String getLocalPathX(java.lang.String path)
getLocalPath(String)
public static java.lang.String getSerializablePath(java.lang.String path) throws java.io.IOException
Platform and release independant directories are identified in this order,
and with the keyword shown:
All keywords represent directories and include a trailing File.separator.
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
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-dependant command to run.An
- exception if an error occurs when the command is run.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.public static java.lang.String Copyright()
public static void main(java.lang.String[] args)
args[0]
- The path and name to the AbleDefaultAgent to reserialize and start.
|
ABLE 2.0.0 07/02/2003 10:25:01 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |