if (object instanceof ManagedDataSource) {
((ManagedDataSource) object).clean();
}
} else if (object instanceof ConnectorReference) {
final ConnectorReference cr = (ConnectorReference) object;
try {
final ConnectionManager cm = cr.getConnectionManager();
if (cm != null && cm instanceof AbstractConnectionManager) {
((AbstractConnectionManager) cm).doStop();
}
} catch (final Exception e) {
logger.debug("Not processing resource on destroy: " + className, e);