public class FwkLibraryWriter extends Fwk implements FwkExceptionWriterInterface, FwkInterface
Under Windows NT it writes exceptions to the Windows NT EventLog. The generated event could be displayed with the EventView.
Inside the initializer the class tries to connect the err.dll.
Wasn't this step successfully executed the writer isn't alive and
could not be used.
The function isAlive
will return that state.
,
Serialized FormModifier and Type | Field and Description |
---|---|
protected static java.lang.Throwable |
exception
This is the exception thrown by the static block.
|
static java.lang.String |
version |
Constructor and Description |
---|
FwkLibraryWriter()
The private constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the communication to the event logger.
|
java.lang.Throwable |
getException()
Returns the exception that is occurred,
if the writer isn't alive.
|
java.lang.String |
getParams()
This function returns a string containing all parameters of the object.
|
java.lang.String |
getVersion()
Return the version string of the FWK component.
|
void |
init(java.lang.String program,
java.lang.String version,
java.lang.String[] args)
Initialize the communication to the event logger.
|
boolean |
isAlive()
Returns whether the writer could initialize the library.
|
boolean |
isError(int code)
Return true if event code signals an error.
|
boolean |
isInformation(int code)
Return true if event code signals an informational message.
|
boolean |
isOccurred()
Indicates whether an event is occurred.
|
boolean |
isWarning(int code)
Return true if event code signals a warning.
|
void |
put(FwkExceptionInterface exception)
Put an event to the event logger.
|
void |
put(int code,
java.lang.String className,
java.lang.String file,
java.lang.String revision,
java.lang.String lineIdent,
java.lang.String parameter)
Put an event to the event logger.
|
void |
reset()
Set there is no error occurred.
|
void |
setDefaults()
This method sets all internal states to the default.
|
java.lang.String |
toString()
This function returns a string containing the string representation of
the object.
|
getNiceVersion, release
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
release
public static final java.lang.String version
protected static java.lang.Throwable exception
public java.lang.String getVersion()
FwkInterface
getVersion
in interface FwkInterface
getVersion
in class Fwk
public boolean isAlive()
isAlive
in interface FwkExceptionWriterInterface
public java.lang.Throwable getException()
getException
in interface FwkExceptionWriterInterface
public void init(java.lang.String program, java.lang.String version, java.lang.String[] args)
init
in interface FwkExceptionWriterInterface
name
- Name of program.version
- Version of the program.args
- Main program parameters.public void put(int code, java.lang.String className, java.lang.String file, java.lang.String revision, java.lang.String lineIdent, java.lang.String parameter)
The compiler definition NOTRACE suppresses the message AO_EVENT. The message AO_EVENT is used to trace back the calling sequence of the function where the error occurs.
If this function is called an error is occurred and the flag is set.
put
in interface FwkExceptionWriterInterface
number
- Number of the event to report.class
- Name of the class that has thrown the exception.file
- Name of the sourcefile.revision
- Revision of the sourcefile.lineIdent
- Identification string for the line in the sourcefile.parameter
- Event parameter.public void put(FwkExceptionInterface exception)
The compiler definition NOTRACE suppresses the message AO_EVENT. The message AO_EVENT is used to trace back the calling sequence of the function where the error occurs.
If this function is called an error is occurred and the flag is set.
put
in interface FwkExceptionWriterInterface
exception
- The exception to be written.public void close()
close
in interface FwkExceptionWriterInterface
public boolean isError(int code)
isError
in interface FwkExceptionWriterInterface
code
- The event codeErrorNumber
public boolean isWarning(int code)
isWarning
in interface FwkExceptionWriterInterface
code
- The event codeErrorNumber
public boolean isInformation(int code)
isInformation
in interface FwkExceptionWriterInterface
code
- The event codeErrorNumber
public boolean isOccurred()
isOccurred
in interface FwkExceptionWriterInterface
public void reset()
reset
in interface FwkExceptionWriterInterface
public java.lang.String getParams()
toString
public java.lang.String toString()
"ObjectName["+getParams()+"]"
toString
in class java.lang.Object
getParams
public void setDefaults()