SynSoft Java Standard Library

synsoft.org


org.synsoft.win32
Class Win32EventLog

java.lang.Object
  |
  +--org.synsoft.win32.Win32EventLog

public class Win32EventLog
extends java.lang.Object

This class provides access to the Win32 API event log functionality.


Field Summary
static int EVENTLOG_ERROR_TYPE
          Causes events to be reported as errors
static int EVENTLOG_INFORMATION_TYPE
          Causes events to be reported as informational
static int EVENTLOG_WARNING_TYPE
          Causes events to be reported as warnings
static Version scm_version
          Constant instance of version information for class.
 
Constructor Summary
Win32EventLog()
          Construction
Win32EventLog(java.lang.String eventSource)
           
 
Method Summary
 void close()
          Closes the event log.
protected  void finalize()
           
static boolean isEventSourceRegistered(java.lang.String eventSource)
          Determines whether the given event source is already registered in the system.
 void open(java.lang.String eventSource)
          Opens the event log with the given name.
static void registerResources(java.lang.String eventSource)
          Registers the module containing the native implementation as a Win32 event source.
 void reportEvent(int eventType, java.lang.String event)
           
 void reportEvent(java.lang.String event)
           
static void unregisterResources(java.lang.String eventSource)
          Deregisters the module containing the native implementation as a Win32 event source.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EVENTLOG_ERROR_TYPE

public static final int EVENTLOG_ERROR_TYPE
Causes events to be reported as errors

EVENTLOG_WARNING_TYPE

public static final int EVENTLOG_WARNING_TYPE
Causes events to be reported as warnings

EVENTLOG_INFORMATION_TYPE

public static final int EVENTLOG_INFORMATION_TYPE
Causes events to be reported as informational

scm_version

public static final Version scm_version
Constant instance of version information for class.
Constructor Detail

Win32EventLog

public Win32EventLog()
Construction

Win32EventLog

public Win32EventLog(java.lang.String eventSource)
              throws Win32EventLogException
Method Detail

finalize

protected void finalize()
Overrides:
finalize in class java.lang.Object

isEventSourceRegistered

public static boolean isEventSourceRegistered(java.lang.String eventSource)
Determines whether the given event source is already registered in the system. Note that this does not guarantee that the event source registration information maps to the current event source.
Returns:
boolean true if the source is registered, false if not

registerResources

public static void registerResources(java.lang.String eventSource)
                              throws Win32EventLogException
Registers the module containing the native implementation as a Win32 event source. Only needs to be called once per system, commonly during product registration.
Returns:
void

unregisterResources

public static void unregisterResources(java.lang.String eventSource)
                                throws Win32EventLogException
Deregisters the module containing the native implementation as a Win32 event source. Only needs to be called once per system, commonly during product deregistration.
Returns:
void

open

public void open(java.lang.String eventSource)
          throws Win32EventLogException
Opens the event log with the given name. Throws an InternalError if the system fails to open the requested event log.
Returns:
false if the event log is already open, true if successfully opened

close

public void close()
           throws Win32EventLogException
Closes the event log. Throws an InternalError exception if the system fails to close the event log.

reportEvent

public void reportEvent(java.lang.String event)

reportEvent

public void reportEvent(int eventType,
                        java.lang.String event)

version 2.0.1.231

Copyright © Synesis Software. Licensed according to the Synesis Software Standard Public License