borland Packages  Class Hierarchy  dbswing Package 

DBEventMonitor component

java.lang.Object
   +----com.borland.dbswing.DBEventMonitor

About the DBEventMonitor component

Constructors  Properties  Methods  

Implements AccessListener, ColumnChangeListener, ColumnPaintListener, DataChangeListener, Designable, EditListener, LoadListener, NavigationListener, OpenListener, StatusListener, ComponentListener, Serializable, EventListener

Note: This is a feature of JBuilder Professional and Enterprise.

DBEventMonitor is a non-visual component that listens for and sends DataSet event information to a PrintStream (by default, the stdout device). It is intended to be used as an unobtrusive debugging aid for applications which process DataSet events. It also provides a simple and interactive way to learn about the kinds of events generated by DataSets and when they are fired. A single DBEventMonitor can be used to display messages from several DataSets. You can selectively monitor events you are interested in by setting DBEventMonitor properties.

There are three ways to set up a DBEventMonitor for use in your application:

Monitoring for almost all the events is enabled by default. The exceptions are ColumnPaint and RowFilter, which produce considerable output that you aren't likely to find useful. Also CalcAggFields and CalcFields aren't monitored by default unless there is a CalcAggFields or CalcFields listener attached to the DataSet.

To prevent the monitoring of specific events, set the property that enables monitoring to false. For example, to prevent the monitoring of DataChangeEvents, set enableDataChangeListener to false.

Note that for some events, only a single event listener can be registered (for example, ColumnChangeListener). In these cases, if an event listener has already been registered and if it is possible to get a reference to the existing event listener, DBEventMonitor registers itself as the single event listener and forwards the event to the original event listener. Where it is not possible to get a reference to the existing event listener, DBEventMonitor cannot monitor the event and outputs a message indicating so. Setting the dataAwareComponentContainer or dataSetAwareComponents property to null removes DBEventMonitor from the event-listener chain and restores the original event listeners.

If you are debugging an application and it can't register its event listeners because DBEventMonitor has already registered itself as a listener, then you must arrange for the dataSetAwareComponents, dataAwareComponentContainer, or dataSets property to be set after all your listeners have been registered. In particular, to monitor CalcFields or CalcAggFields events, you must ensure that your listeners are already registered before DBEventMonitor, as DBEventMonitor doesn't register itself as a CalcFields or CalcAggFields listener unless another listener has already been registered.

When using the dataAwareComponentContainer property, note that DBEventMonitor waits until after the container and its contents have been realized before attaching itself as an event listener. By this time, any DataSets attached to data-aware components are already open, and DBEventMonitor has missed some events. If you need to monitor such events, use either the dataSets or dataSetAwareComponents properties.


DBEventMonitor constructors

DBEventMonitor properties

*Read-only properties **Write-only properties

Properties implemented in this class

Properties implemented in java.lang.Object

DBEventMonitor methods

Methods implemented in this class

Methods implemented in java.lang.Object


DBEventMonitor constructors

DBEventMonitor()

  public DBEventMonitor()
Creates a DBEventMonitor component.

DBEventMonitor properties

dataAwareComponentContainer

 public Container getDataAwareComponentContainer()
 public void setDataAwareComponentContainer(Container container)
Returns and sets the container of data-aware components that DBEventMonitor should monitor. If this property and either the dataAwareComponents or DataSets property are set simultaneously, the most recently set property takes precedence.

dataSetAwareComponents

 public DataSetAware[] getDataSetAwareComponents()
 public void setDataSetAwareComponents(DataSetAware[] dataAwareComponents)
Returns and sets the array of data-aware components that DBEventMonitor should monitor. If this property and either the dataAwareComponentContainer or DataSets property are set simultaneously, the most recently set property takes precedence.

dataSets

 public DataSet[] getDataSets()
 public void setDataSets(DataSet[] userSetDataSets)
Returns and sets the array of DataSets that DBEventMonitor should monitor. If this property and either the dataAwareComponents or dataAwareComponentContainer property are set simultaneously, the most recently set property takes precedence.

enableAccessListener

 public boolean isEnableAccessListener()
 public void setEnableAccessListener(boolean enableAccessListener)
Determines whether DBEventMonitor listens for AccessEvents; if enableAccessListener is true, it listens for the events.

enableCalcAggFieldsListener

 public boolean isEnableCalcAggFieldsListener()
 public void setEnableCalcAggFieldsListener(boolean enableCalcAggFieldsListener)
Determines whether DBEventMonitor is a listener for notification that rows in the DataSet having a calculation on an aggregate column have been added, deleted, or modified; if enableCalcAggFieldsListener is true, it listens for notifications.

enableCalcFieldsListener

 public boolean isEnableCalcFieldsListener()
 public void setEnableCalcFieldsListener(boolean enableCalcFieldsListener)
Determines whether DBEventMonitor is a listener for notification that rows in the DataSet having a calculation on a column have been added, deleted, or modified; if enableCalcFieldsListener is true, it listens for notifications.

enableColumnChangeListener

 public boolean isEnableColumnChangeListener()
 public void setEnableColumnChangeListener(boolean enableColumnChangeListener)
Determines whether DBEventMonitor is a listener for notification that data in a column has changed; if enableColumnChangeListener is true, it listens for notifications.

enableColumnPaintListener

 public boolean isEnableColumnPaintListener()
 public void setEnableColumnPaintListener(boolean enableColumnPaintListener)
Determines whether DBEventMonitor is a listener for notification of the painting of a value in a column; if enableColumnPaintListener is true, it listens for notifications.

enabled

 public boolean isEnabled()
 public void setEnabled(boolean enabled)
Returns and sets whether the event monitor is enabled. If enabled is true, the event monitor monitors most events by default. The exceptions are ColumnPaint and RowFilter, which produce considerable output that you aren't likely to find useful. Also CalcAggFields and CalcFields aren't monitored by default unless there is a CalcAggFields or CalcFields listener attached to the DataSet.

When enabled is set to false, all event monitoring ceases.

To prevent the monitoring of specific events, set the property that enables monitoring to false. For example, to prevent the monitoring of DataChangeEvents, set enableDataChangeListener to false.

enableDataChangeListener

 public boolean isEnableDataChangeListener()
 public void setEnableDataChangeListener(boolean enableDataChangeListener)
Determines whether DBEventMonitor listens for DataChangeEvents; if enableDataChangeListener is true, it listens for the events.

enableEditListener

 public boolean isEnableEditListener()
 public void setEnableEditListener(boolean enableEditListener)
Determines whether DBEventMonitor is a listener for notification of row editing in the DataSet; if enableEditListener is true, it listens for notifications.

enableLoadListener

 public boolean isEnableLoadListener()
 public void setEnableLoadListener(boolean enableLoadListener)
Determines whether DBEventMonitor is a listener for notification that a load operation on a StorageDataSet has been completed; if enableLoadListener is true, it listens for notifications.

enableNavigationListener

 public boolean isEnableNavigationListener()
 public void setEnableNavigationListener(boolean enableNavigationListener)
Determines whether DBEventMonitor listens for NavigationEvents; if enableNavigationListener is true, it listens for the events.

enableOpenListener

 public boolean isEnableOpenListener()
 public void setEnableOpenListener(boolean enableOpenListener)
Determines whether DBEventMonitor is a listener for notification that a DataSet has opened or closed; if enableOpenListener is true, it listens for notifications.

enableResolverListener

 public boolean isEnableResolverListener()
 public void setEnableResolverListener(boolean enableResolverListener)
Determines whether DBEventMonitor is a listener for notification before and after a StorageDataSet is resolved; if enableResolverListener is true, it listens for notifications.

enableRowFilterListener

 public boolean isEnableRowFilterListener()
 public void setEnableRowFilterListener(boolean enableRowFilterListener)
Determines whether DBEventMonitor is a listener for notification that a row is being added or updated; if enableRowFilterListener is true, it listens for notifications.

enableStatusListener

 public boolean isEnableStatusListener()
 public void setEnableStatusListener(boolean enableStatusListener)
Determines whether DBEventMonitor listens for StatusEvents; if enableStatusListener is true, it listens for the events.

printStream

 public PrintStream getPrintStream()
 public void setPrintStream(PrintStream out)
Returns and sets the PrintStream used for event output. By default, System.out is used.