directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r981874 - in /directory/studio/trunk: ldapservers.apacheds.v156/ ldapservers.apacheds.v156/src/main/java/org/apache/directory/studio/ldapserver/apacheds/v156/ ldapservers/ ldapservers/src/main/java/org/apache/directory/studio/ldapservers/ l...
Date Tue, 03 Aug 2010 13:44:33 GMT
Author: pamarcelot
Date: Tue Aug  3 13:44:33 2010
New Revision: 981874

URL: http://svn.apache.org/viewvc?rev=981874&view=rev
Log:
Moved some of the code of the LDAP Server Adapter for ApacheDS 1.5.6 to the main LDAP Server
plugin in order to share this common code between various adapters.

Added:
    directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/LdapServersUtils.java
Modified:
    directory/studio/trunk/ldapservers.apacheds.v156/   (props changed)
    directory/studio/trunk/ldapservers.apacheds.v156/pom.xml
    directory/studio/trunk/ldapservers.apacheds.v156/src/main/java/org/apache/directory/studio/ldapserver/apacheds/v156/ApacheDS156LdapServerAdapter.java
    directory/studio/trunk/ldapservers/pom.xml
    directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/wizards/NewServerWizard.java

Propchange: directory/studio/trunk/ldapservers.apacheds.v156/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Tue Aug  3 13:44:33 2010
@@ -3,3 +3,4 @@
 .settings
 META-INF
 target
+lib

Modified: directory/studio/trunk/ldapservers.apacheds.v156/pom.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapservers.apacheds.v156/pom.xml?rev=981874&r1=981873&r2=981874&view=diff
==============================================================================
--- directory/studio/trunk/ldapservers.apacheds.v156/pom.xml (original)
+++ directory/studio/trunk/ldapservers.apacheds.v156/pom.xml Tue Aug  3 13:44:33 2010
@@ -128,10 +128,6 @@
  org.apache.directory.studio.jars,
  org.apache.directory.studio.ldapservers
             </Require-Bundle>
-            <Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>
-            <Embed-Directory>lib</Embed-Directory>
-            <Embed-StripGroup>true</Embed-StripGroup>
-            <Embed-Transitive>true</Embed-Transitive>
             <Export-Package>org.apache.directory.studio.*</Export-Package>
             <Import-Package>!</Import-Package>
             <Private-Package>!</Private-Package>
@@ -528,12 +524,6 @@
   </build>
 
   <dependencies>
-    <!-- Libraries dependencies -->
-    <dependency>
-      <groupId>org.apache.mina</groupId>
-      <artifactId>mina-core</artifactId>
-    </dependency>
-    
   	<!-- Apache Directory Studio plugins dependencies -->
     <dependency>
       <groupId>org.apache.directory.studio</groupId>

Modified: directory/studio/trunk/ldapservers.apacheds.v156/src/main/java/org/apache/directory/studio/ldapserver/apacheds/v156/ApacheDS156LdapServerAdapter.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapservers.apacheds.v156/src/main/java/org/apache/directory/studio/ldapserver/apacheds/v156/ApacheDS156LdapServerAdapter.java?rev=981874&r1=981873&r2=981874&view=diff
==============================================================================
--- directory/studio/trunk/ldapservers.apacheds.v156/src/main/java/org/apache/directory/studio/ldapserver/apacheds/v156/ApacheDS156LdapServerAdapter.java
(original)
+++ directory/studio/trunk/ldapservers.apacheds.v156/src/main/java/org/apache/directory/studio/ldapserver/apacheds/v156/ApacheDS156LdapServerAdapter.java
Tue Aug  3 13:44:33 2010
@@ -23,6 +23,7 @@ package org.apache.directory.studio.ldap
 
 import java.io.File;
 import java.io.FileInputStream;
+import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
@@ -38,17 +39,15 @@ import org.apache.directory.studio.apach
 import org.apache.directory.studio.common.core.jobs.StudioProgressMonitor;
 import org.apache.directory.studio.common.ui.CommonUiUtils;
 import org.apache.directory.studio.ldapservers.LdapServersManager;
+import org.apache.directory.studio.ldapservers.LdapServersUtils;
 import org.apache.directory.studio.ldapservers.model.LdapServer;
 import org.apache.directory.studio.ldapservers.model.LdapServerAdapter;
 import org.apache.directory.studio.ldapservers.model.LdapServerStatus;
-import org.apache.mina.util.AvailablePortFinder;
-import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.FileLocator;
 import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.NullProgressMonitor;
 import org.eclipse.core.runtime.Path;
 import org.eclipse.debug.core.DebugEvent;
-import org.eclipse.debug.core.DebugException;
 import org.eclipse.debug.core.DebugPlugin;
 import org.eclipse.debug.core.IDebugEventSetListener;
 import org.eclipse.debug.core.ILaunch;
@@ -72,6 +71,9 @@ import org.eclipse.osgi.util.NLS;
  */
 public class ApacheDS156LdapServerAdapter implements LdapServerAdapter
 {
+    /** The ID of the launch configuration custom object */
+    private static final String LAUNCH_CONFIGURATION_CUSTOM_OBJECT = "launchConfiguration";
+
     // Various strings constants used in paths
     private static final String SERVER_XML = "server.xml";
     private static final String LOG4J_PROPERTIES = "log4j.properties";
@@ -156,7 +158,7 @@ public class ApacheDS156LdapServerAdapte
         startTerminateListenerThread( server, launch );
 
         // Running the startup listener watchdog
-        runStartupListenerWatchdog( server );
+        LdapServersUtils.runStartupListenerWatchdog( server, getTestingPort( server ) );
     }
 
 
@@ -168,94 +170,82 @@ public class ApacheDS156LdapServerAdapte
      * @return
      *      the associated launch
      */
-    private ILaunch launchApacheDS( LdapServer server )
+    private ILaunch launchApacheDS( LdapServer server ) throws Exception
     {
-        try
-        {
-            // Getting the default VM installation
-            IVMInstall vmInstall = JavaRuntime.getDefaultVMInstall();
-
-            // Creating a new editable launch configuration
-            ILaunchConfigurationType type = DebugPlugin.getDefault().getLaunchManager()
-                .getLaunchConfigurationType( IJavaLaunchConfigurationConstants.ID_JAVA_APPLICATION
);
-            ILaunchConfigurationWorkingCopy workingCopy = type.newInstance( null,
-                NLS.bind( "Starting {0}", new String[]
-                    { server.getName() } ) );
-
-            // Setting the JRE container path attribute
-            workingCopy.setAttribute( IJavaLaunchConfigurationConstants.ATTR_JRE_CONTAINER_PATH,
vmInstall
-                .getInstallLocation().toString() );
-
-            // Setting the main type attribute
-            workingCopy.setAttribute( IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME,
-                "org.apache.directory.studio.apacheds.Launcher" ); //$NON-NLS-1$
-
-            // Creating the classpath list
-            List<String> classpath = new ArrayList<String>();
-            IPath apacheDsLibrariesFolder = getServerLibrariesFolder();
-            for ( String library : libraries )
-            {
-                IRuntimeClasspathEntry libraryClasspathEntry = JavaRuntime
-                    .newArchiveRuntimeClasspathEntry( apacheDsLibrariesFolder.append( library
) );
-                libraryClasspathEntry.setClasspathProperty( IRuntimeClasspathEntry.USER_CLASSES
);
+        // Getting the default VM installation
+        IVMInstall vmInstall = JavaRuntime.getDefaultVMInstall();
 
-                classpath.add( libraryClasspathEntry.getMemento() );
-            }
+        // Creating a new editable launch configuration
+        ILaunchConfigurationType type = DebugPlugin.getDefault().getLaunchManager()
+            .getLaunchConfigurationType( IJavaLaunchConfigurationConstants.ID_JAVA_APPLICATION
);
+        ILaunchConfigurationWorkingCopy workingCopy = type.newInstance( null, NLS.bind( "Starting
{0}", new String[]
+            { server.getName() } ) );
+
+        // Setting the JRE container path attribute
+        workingCopy.setAttribute( IJavaLaunchConfigurationConstants.ATTR_JRE_CONTAINER_PATH,
vmInstall
+            .getInstallLocation().toString() );
+
+        // Setting the main type attribute
+        workingCopy.setAttribute( IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME,
+            "org.apache.directory.studio.apacheds.Launcher" ); //$NON-NLS-1$
+
+        // Creating the classpath list
+        List<String> classpath = new ArrayList<String>();
+        IPath apacheDsLibrariesFolder = getServerLibrariesFolder();
+        for ( String library : libraries )
+        {
+            IRuntimeClasspathEntry libraryClasspathEntry = JavaRuntime
+                .newArchiveRuntimeClasspathEntry( apacheDsLibrariesFolder.append( library
) );
+            libraryClasspathEntry.setClasspathProperty( IRuntimeClasspathEntry.USER_CLASSES
);
 
-            // Setting the classpath type attribute
-            workingCopy.setAttribute( IJavaLaunchConfigurationConstants.ATTR_CLASSPATH, classpath
);
+            classpath.add( libraryClasspathEntry.getMemento() );
+        }
 
-            // Setting the default classpath type attribute to false
-            workingCopy.setAttribute( IJavaLaunchConfigurationConstants.ATTR_DEFAULT_CLASSPATH,
false );
+        // Setting the classpath type attribute
+        workingCopy.setAttribute( IJavaLaunchConfigurationConstants.ATTR_CLASSPATH, classpath
);
 
-            // The server folder path
-            IPath serverFolderPath = LdapServersManager.getServerFolder( server );
+        // Setting the default classpath type attribute to false
+        workingCopy.setAttribute( IJavaLaunchConfigurationConstants.ATTR_DEFAULT_CLASSPATH,
false );
 
-            // Setting the program arguments attribute
-            workingCopy.setAttribute( IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS,
"\"" //$NON-NLS-1$
-                + serverFolderPath.toOSString() + "\"" ); //$NON-NLS-1$
+        // The server folder path
+        IPath serverFolderPath = LdapServersManager.getServerFolder( server );
 
-            // Creating the VM arguments string
-            StringBuffer vmArguments = new StringBuffer();
-            vmArguments.append( "-Dlog4j.configuration=file:\"" //$NON-NLS-1$
-                + serverFolderPath.append( "conf" ).append( "log4j.properties" ).toOSString()
+ "\"" ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-            vmArguments.append( " " ); //$NON-NLS-1$
-            vmArguments.append( "-Dapacheds.var.dir=\"" + serverFolderPath.toOSString() +
"\"" ); //$NON-NLS-1$ //$NON-NLS-2$
-            vmArguments.append( " " ); //$NON-NLS-1$
-            vmArguments.append( "-Dapacheds.log.dir=\"" + serverFolderPath.append( "log"
).toOSString() + "\"" ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-            vmArguments.append( " " ); //$NON-NLS-1$
-            vmArguments.append( "-Dapacheds.run.dir=\"" + serverFolderPath.append( "run"
).toOSString() + "\"" ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-            vmArguments.append( " " ); //$NON-NLS-1$
-            vmArguments.append( "-Dapacheds.instance=\"" + server.getName() + "\"" ); //$NON-NLS-1$
//$NON-NLS-2$
+        // Setting the program arguments attribute
+        workingCopy.setAttribute( IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS,
"\"" //$NON-NLS-1$
+            + serverFolderPath.toOSString() + "\"" ); //$NON-NLS-1$
 
-            // Setting the VM arguments attribute
-            workingCopy.setAttribute( IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS,
vmArguments.toString() );
+        // Creating the VM arguments string
+        StringBuffer vmArguments = new StringBuffer();
+        vmArguments.append( "-Dlog4j.configuration=file:\"" //$NON-NLS-1$
+            + serverFolderPath.append( "conf" ).append( "log4j.properties" ).toOSString()
+ "\"" ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+        vmArguments.append( " " ); //$NON-NLS-1$
+        vmArguments.append( "-Dapacheds.var.dir=\"" + serverFolderPath.toOSString() + "\""
); //$NON-NLS-1$ //$NON-NLS-2$
+        vmArguments.append( " " ); //$NON-NLS-1$
+        vmArguments.append( "-Dapacheds.log.dir=\"" + serverFolderPath.append( "log" ).toOSString()
+ "\"" ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+        vmArguments.append( " " ); //$NON-NLS-1$
+        vmArguments.append( "-Dapacheds.run.dir=\"" + serverFolderPath.append( "run" ).toOSString()
+ "\"" ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+        vmArguments.append( " " ); //$NON-NLS-1$
+        vmArguments.append( "-Dapacheds.instance=\"" + server.getName() + "\"" ); //$NON-NLS-1$
//$NON-NLS-2$
 
-            // Setting the launch configuration as private
-            workingCopy.setAttribute( IDebugUIConstants.ATTR_PRIVATE, true );
+        // Setting the VM arguments attribute
+        workingCopy.setAttribute( IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS, vmArguments.toString()
);
 
-            // Indicating that we don't want any console to show up
-            workingCopy.setAttribute( DebugPlugin.ATTR_CAPTURE_OUTPUT, false );
+        // Setting the launch configuration as private
+        workingCopy.setAttribute( IDebugUIConstants.ATTR_PRIVATE, true );
 
-            // Saving the launch configuration
-            ILaunchConfiguration configuration = workingCopy.doSave();
+        // Indicating that we don't want any console to show up
+        workingCopy.setAttribute( DebugPlugin.ATTR_CAPTURE_OUTPUT, false );
 
-            // Launching the launch configuration
-            ILaunch launch = configuration.launch( ILaunchManager.RUN_MODE, new NullProgressMonitor()
);
+        // Saving the launch configuration
+        ILaunchConfiguration configuration = workingCopy.doSave();
 
-            // Storing the launch configuration as a custom object in the LDAP Server for
later use
-            server.putCustomObject( "launchConfiguration", launch );
+        // Launching the launch configuration
+        ILaunch launch = configuration.launch( ILaunchManager.RUN_MODE, new NullProgressMonitor()
);
 
-            return launch;
-        }
-        catch ( CoreException e )
-        {
-            CommonUiUtils.reportError( NLS.bind( "An error occurred when launching the server.\n\n{0}",
new String[]
-                { e.getMessage() } ) );
-            // TODO use the monitor to report the error.
-        }
+        // Storing the launch configuration as a custom object in the LDAP Server for later
use
+        server.putCustomObject( LAUNCH_CONFIGURATION_CUSTOM_OBJECT, launch );
 
-        return null;
+        return launch;
     }
 
 
@@ -265,24 +255,15 @@ public class ApacheDS156LdapServerAdapte
     public void stop( LdapServer server, StudioProgressMonitor monitor ) throws Exception
     {
         // Getting the launch
-        ILaunch launch = ( ILaunch ) server.getCustomObject( "launchConfiguration" );
+        ILaunch launch = ( ILaunch ) server.removeCustomObject( LAUNCH_CONFIGURATION_CUSTOM_OBJECT
);
         if ( ( launch != null ) && ( !launch.isTerminated() ) )
         {
             // Terminating the launch
-            try
-            {
-                launch.terminate();
-            }
-            catch ( DebugException e )
-            {
-                CommonUiUtils.reportError( NLS.bind( "An error occurred when stopping the
server.\n\n{0}", new String[]
-                    { e.getMessage() } ) );
-                // TODO use the monitor to report the error.
-            }
+            launch.terminate();
         }
         else
         {
-            // TODO throw an error
+            throw new Exception( "The associated launch configuration could not be found
or is already terminated." );
         }
     }
 
@@ -337,73 +318,6 @@ public class ApacheDS156LdapServerAdapte
 
 
     /**
-     * Runs the startup listener watchdog.
-     */
-    private void runStartupListenerWatchdog( LdapServer server )
-    {
-        // Getting the current time
-        long startTime = System.currentTimeMillis();
-
-        // Calculating the watch dog time
-        final long watchDog = startTime + ( 1000 * 60 * 3 ); // 3 minutes
-
-        // Looping until the end of the watchdog if the server is still 'starting'
-        while ( ( System.currentTimeMillis() < watchDog ) && ( LdapServerStatus.STARTING
== server.getStatus() ) )
-        {
-            try
-            {
-                // Getting the port to test
-                int port = getTestingPort( server );
-
-                // If no protocol is enabled, we pass this and 
-                // declare the server as started
-                if ( port != 0 )
-                {
-                    // Trying to see if the port is available
-                    if ( AvailablePortFinder.available( port ) )
-                    {
-                        // The port is still available
-                        throw new Exception();
-                    }
-                }
-
-                // If we pass the creation of the context, it means
-                // the server is correctly started
-
-                // We set the state of the server to 'started'...
-                server.setStatus( LdapServerStatus.STARTED );
-
-                // ... and we exit the thread
-                return;
-            }
-            catch ( Exception e )
-            {
-                // If we get an exception,it means the server is not 
-                // yet started
-
-                // We just wait one second before starting the test once
-                // again
-                try
-                {
-                    Thread.sleep( 1000 );
-                }
-                catch ( InterruptedException e1 )
-                {
-                    // Nothing to do...
-                }
-            }
-        }
-
-        // If, at the end of the watch dog, the state of the server is
-        // still 'starting' then, we declare the server as 'stopped'
-        if ( LdapServerStatus.STARTING == server.getStatus() )
-        {
-            server.setStatus( LdapServerStatus.STOPPED );
-        }
-    }
-
-
-    /**
     * Gets the server configuration.
     *
     * @param server
@@ -411,13 +325,13 @@ public class ApacheDS156LdapServerAdapte
     * @return
     *      the associated server configuration
     * @throws ServerXmlIOException 
-    * @throws ServerXmlIOException
-    * @throws IOException 
+    * @throws FileNotFoundException 
     */
-    private ServerConfiguration getServerConfiguration( LdapServer server ) throws ServerXmlIOException,
IOException
+    private ServerConfiguration getServerConfiguration( LdapServer server ) throws ServerXmlIOException,
+        FileNotFoundException
     {
-        InputStream fis = new FileInputStream( new File( LdapServersManager.getServerFolder(
server ).append( "conf" )
-            .append( "server.xml" ).toOSString() ) );
+        InputStream fis = new FileInputStream( LdapServersManager.getServerFolder( server
).append( "conf" )
+            .append( "server.xml" ).toFile() );
 
         ServerXmlIOV156 serverXmlIOV156 = new ServerXmlIOV156();
         return serverXmlIOV156.parse( fis );

Modified: directory/studio/trunk/ldapservers/pom.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapservers/pom.xml?rev=981874&r1=981873&r2=981874&view=diff
==============================================================================
--- directory/studio/trunk/ldapservers/pom.xml (original)
+++ directory/studio/trunk/ldapservers/pom.xml Tue Aug  3 13:44:33 2010
@@ -122,6 +122,10 @@
  org.apache.directory.studio.common.ui,
  org.apache.directory.studio.jars
             </Require-Bundle>
+            <Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>
+            <Embed-Directory>lib</Embed-Directory>
+            <Embed-StripGroup>true</Embed-StripGroup>
+            <Embed-Transitive>true</Embed-Transitive>
             <Export-Package>org.apache.directory.studio.*</Export-Package>
             <Import-Package>!</Import-Package>
             <Private-Package>!</Private-Package>
@@ -149,6 +153,12 @@
   </build>
 
   <dependencies>
+    <!-- Libraries dependencies -->
+    <dependency>
+      <groupId>org.apache.mina</groupId>
+      <artifactId>mina-core</artifactId>
+    </dependency>
+    
   	<!-- Apache Directory Studio plugins dependencies -->
     <dependency>
       <groupId>org.apache.directory.studio</groupId>

Added: directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/LdapServersUtils.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/LdapServersUtils.java?rev=981874&view=auto
==============================================================================
--- directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/LdapServersUtils.java
(added)
+++ directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/LdapServersUtils.java
Tue Aug  3 13:44:33 2010
@@ -0,0 +1,103 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+
+package org.apache.directory.studio.ldapservers;
+
+
+import org.apache.directory.studio.ldapservers.model.LdapServer;
+import org.apache.directory.studio.ldapservers.model.LdapServerStatus;
+import org.apache.mina.util.AvailablePortFinder;
+
+
+/**
+ * The helper class defines various utility methods for the LDAP Servers plugin.
+ */
+public class LdapServersUtils
+{
+    /**
+     * Runs the startup listener watchdog.
+     *
+     * @param server
+     *      the server
+     * @param port
+     *      the port
+     * @throws Exception
+     */
+    public static void runStartupListenerWatchdog( LdapServer server, int port ) throws Exception
+    {
+        // Getting the current time
+        long startTime = System.currentTimeMillis();
+
+        // Calculating the watch dog time
+        final long watchDog = startTime + ( 1000 * 60 * 3 ); // 3 minutes
+
+        // Looping until the end of the watchdog if the server is still 'starting'
+        while ( ( System.currentTimeMillis() < watchDog ) && ( LdapServerStatus.STARTING
== server.getStatus() ) )
+        {
+            // Getting the port to test
+            try
+            {
+                // If no protocol is enabled, we pass this and 
+                // declare the server as started
+                if ( port != 0 )
+                {
+                    // Trying to see if the port is available
+                    if ( AvailablePortFinder.available( port ) )
+                    {
+                        // The port is still available
+                        throw new Exception();
+                    }
+                }
+
+                // If we pass the creation of the context, it means
+                // the server is correctly started
+
+                // We set the state of the server to 'started'...
+                server.setStatus( LdapServerStatus.STARTED );
+
+                // ... and we exit the thread
+                return;
+            }
+            catch ( Exception e )
+            {
+                // If we get an exception, it means the server is not 
+                // yet started
+
+                // We just wait one second before starting the test once
+                // again
+                try
+                {
+                    Thread.sleep( 1000 );
+                }
+                catch ( InterruptedException e1 )
+                {
+                    // Nothing to do...
+                }
+            }
+        }
+
+        // If, at the end of the watch dog, the state of the server is
+        // still 'starting' then, we declare the server as 'stopped'
+        if ( LdapServerStatus.STARTING == server.getStatus() )
+        {
+            server.setStatus( LdapServerStatus.STOPPED );
+        }
+    }
+}

Modified: directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/wizards/NewServerWizard.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/wizards/NewServerWizard.java?rev=981874&r1=981873&r2=981874&view=diff
==============================================================================
--- directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/wizards/NewServerWizard.java
(original)
+++ directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/wizards/NewServerWizard.java
Tue Aug  3 13:44:33 2010
@@ -104,8 +104,7 @@ public class NewServerWizard extends Wiz
         }
         catch ( Exception e )
         {
-            // TODO Auto-generated catch block
-            e.printStackTrace();
+            // Will never occur
         }
 
         return true;



Mime
View raw message