Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.9.0)

E52944-01


oracle.jdeveloper.db
Interface DisconnectListener


public interface DisconnectListener

Interface for a listener interested in connection disconnect events. A disconnect event is fired when either disconnect() or remove() is called on a DatabaseConnections object. When this happens all registered DisconnectListeners will be asked whether we can disconnect, and if we can the process will proceed.

When disconnect or remove is fired (because the user has either selected disconnect or delete for that connection) we will by default disconnect all live connections to the database that have been created with the DatabaseConnections layer.

The user must have requested a disconnect/remove in the first place for this to be called so in general disconnect should always be allowed.

In cases where the disconnect will cause errors, the user should be prompted to terminate whatever is running (e.g. a sql script or debug session) and, only if they say no should the disconnect be blocked.

Since:
11

Method Summary
 boolean canDisconnect(ConnectionsEvent event)
          This allows a listener to veto a disconnect by returning false.
 void connectionDisconnected(ConnectionsEvent event)
          This is called on all listeners after a succesful disconnect of the connection.

 

Method Detail

canDisconnect

boolean canDisconnect(ConnectionsEvent event)
This allows a listener to veto a disconnect by returning false. As a result of a veto the API will just stop the operation. It will not prompt the user in any way. Before returning false it is the listener's job to make sure the user has explicitly requested a block on this disconnect (e.g. because they're debugging and want to continue).
Parameters:
name - the name of the connection we're about to disconnect
props - the properties for the connection we're about to disconnect
Returns:
false if and only if the user explictly wants to block this disconnect.

connectionDisconnected

void connectionDisconnected(ConnectionsEvent event)
This is called on all listeners after a succesful disconnect of the connection.
Parameters:
name - the name of the connection we have disconnected
props - the properties of the connection we have disconnected

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.9.0)

E52944-01


Copyright © 1997, 2015, Oracle. All rights reserved.