borland Packages Class Hierarchy dbswing Package
java.lang.Object +----com.borland.dbswing.DBDisposeMonitor
Constructors Properties Methods
Implements Designable, ComponentListener, WindowListener, Serializable, EventListener
DBDisposeMonitor
is a utility component which helps ensure that DataSet
resources used by dbSwing data-aware controls are released when the Window containing the controls (usually a Frame
) is disposed. In particular, when the Window the DBDisposeMonitor
is monitoring is disposed (or, optionally, closed), DBDisposeMonitor
will search for all data-aware components in the Window and set their DataSet
property to null
.
DBDisposeMonitor
is also a useful monitoring tool when developing applications which use DataExpress DataStore
components. A DBDisposeMonitor
which has been assigned a container will automatically close any DataStores
it detects when the container is disposed. You can alter this behavior by setting the closeDataStores
property, which is true
by default.
There are two ways to set up a DBDisposeMonitor
for use in an application. The simplest way is to set the dataAwareComponentContainer
property to the container (usually a JFrame
, but could also be a JPanel
) to monitor. Alternatively, you can explicitly specify an array of data-aware components to monitor via the dataSetAwareComponents
property.
public DBDisposeMonitor()Constructs a
DBDisposeMonitor
component.
public boolean isCloseConnections() public void setCloseConnections(boolean closeConnections)Returns and sets whether the
DBDisposeMonitor
should automatically close any open database connections it finds when its container is disposed. This property is true
by default.
public boolean isCloseDataStores() public void setCloseDataStores(boolean closeDataStores)Returns and sets whether
DBDisposeMonitor
automatically detects and closes any DataStore
components when its container is disposed. This property is true
by default.
public Container getDataAwareComponentContainer() public void setDataAwareComponentContainer(Container container)Returns and sets the array of data-aware components which should be deregistered as
DataSet
listeners when DBDisposeMonitor
detects that a window is being disposed.
If set, this property overrides the dataSetAwareComponents
property.
dataAwareComponentContainer
public DataSetAware[] getDataSetAwareComponents() public void setDataSetAwareComponents(DataSetAware[] dataAwareComponents)Returns and sets the array of data-aware components which should be deregistered as
DataSet
listeners when DBDisposeMonitor
detects that a window is being disposed or closed.
The dataAwareComponentContainer
property has precedence over this property.
public boolean isExecuteOnWindowClosing() public void setExecuteOnWindowClosing(boolean doOnClosing)Determines whether
DBDisposeMonitor
will execute on Window.CLOSING
events as well as Window.CLOSE
(dispose) events.
This property is true
by default.