directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r749146 - in /directory/studio/trunk: connection-core/src/main/java/org/apache/directory/studio/connection/core/jobs/StudioConnectionJob.java connection-ui/src/main/java/org/apache/directory/studio/connection/ui/RunnableContextRunner.java
Date Sun, 01 Mar 2009 22:55:35 GMT
Author: seelmann
Date: Sun Mar  1 22:55:35 2009
New Revision: 749146

URL: http://svn.apache.org/viewvc?rev=749146&view=rev
Log:
DIRSTUDIO-409: Exception handling in wizards

Modified:
    directory/studio/trunk/connection-core/src/main/java/org/apache/directory/studio/connection/core/jobs/StudioConnectionJob.java
    directory/studio/trunk/connection-ui/src/main/java/org/apache/directory/studio/connection/ui/RunnableContextRunner.java

Modified: directory/studio/trunk/connection-core/src/main/java/org/apache/directory/studio/connection/core/jobs/StudioConnectionJob.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/connection-core/src/main/java/org/apache/directory/studio/connection/core/jobs/StudioConnectionJob.java?rev=749146&r1=749145&r2=749146&view=diff
==============================================================================
--- directory/studio/trunk/connection-core/src/main/java/org/apache/directory/studio/connection/core/jobs/StudioConnectionJob.java
(original)
+++ directory/studio/trunk/connection-core/src/main/java/org/apache/directory/studio/connection/core/jobs/StudioConnectionJob.java
Sun Mar  1 22:55:35 2009
@@ -82,7 +82,10 @@
                     monitor.worked( 1 );
 
                     connection.getJNDIConnectionWrapper().connect( monitor );
-                    connection.getJNDIConnectionWrapper().bind( monitor );
+                    if ( connection.getJNDIConnectionWrapper().isConnected() )
+                    {
+                        connection.getJNDIConnectionWrapper().bind( monitor );
+                    }
 
                     if ( connection.getJNDIConnectionWrapper().isConnected() )
                     {

Modified: directory/studio/trunk/connection-ui/src/main/java/org/apache/directory/studio/connection/ui/RunnableContextRunner.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/connection-ui/src/main/java/org/apache/directory/studio/connection/ui/RunnableContextRunner.java?rev=749146&r1=749145&r2=749146&view=diff
==============================================================================
--- directory/studio/trunk/connection-ui/src/main/java/org/apache/directory/studio/connection/ui/RunnableContextRunner.java
(original)
+++ directory/studio/trunk/connection-ui/src/main/java/org/apache/directory/studio/connection/ui/RunnableContextRunner.java
Sun Mar  1 22:55:35 2009
@@ -83,7 +83,10 @@
                             spm[0].worked( 1 );
 
                             connection.getJNDIConnectionWrapper().connect( spm[0] );
-                            connection.getJNDIConnectionWrapper().bind( spm[0] );
+                            if ( connection.getJNDIConnectionWrapper().isConnected() )
+                            {
+                                connection.getJNDIConnectionWrapper().bind( spm[0] );
+                            }
 
                             if ( connection.getJNDIConnectionWrapper().isConnected() )
                             {
@@ -98,27 +101,39 @@
                     }
                 }
 
-                //runnable.run( spm[0] );
-                if ( runnable instanceof StudioBulkRunnableWithProgress )
+                if ( !spm[0].errorsReported() )
                 {
-                    StudioBulkRunnableWithProgress bulkRunnable = ( StudioBulkRunnableWithProgress
) runnable;
-                    ConnectionEventRegistry.suspendEventFireingInCurrentThread();
                     try
                     {
-                        bulkRunnable.run( spm[0] );
+                        if ( runnable instanceof StudioBulkRunnableWithProgress )
+                        {
+                            StudioBulkRunnableWithProgress bulkRunnable = ( StudioBulkRunnableWithProgress
) runnable;
+                            ConnectionEventRegistry.suspendEventFireingInCurrentThread();
+                            try
+                            {
+                                bulkRunnable.run( spm[0] );
+                            }
+                            finally
+                            {
+                                ConnectionEventRegistry.resumeEventFireingInCurrentThread();
+                            }
+                            bulkRunnable.runNotification();
+                        }
+                        else
+                        {
+                            runnable.run( spm[0] );
+                        }
+                    }
+                    catch ( Exception e )
+                    {
+                        spm[0].reportError( e );
                     }
                     finally
                     {
-                        ConnectionEventRegistry.resumeEventFireingInCurrentThread();
+                        spm[0].done();
+                        monitor.done();
                     }
-                    bulkRunnable.runNotification();
                 }
-                else
-                {
-                    runnable.run( spm[0] );
-                }
-
-                spm[0].done();
             }
         };
 



Mime
View raw message