directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r650134 - in /directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations: ./ META-INF/ lib/ src/main/java/org/apache/directory/studio/apacheds/experimentations/ src/main/resources/
Date Mon, 21 Apr 2008 13:13:55 GMT
Author: pamarcelot
Date: Mon Apr 21 06:13:50 2008
New Revision: 650134

URL: http://svn.apache.org/viewvc?rev=650134&view=rev
Log:
Added experimental code for adding a launch configuration.

Added:
    directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/lib/apacheds-main.jar
  (with props)
    directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/src/main/resources/apacheds-main.jar
  (with props)
Modified:
    directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/.classpath
    directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/META-INF/MANIFEST.MF
    directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/src/main/java/org/apache/directory/studio/apacheds/experimentations/Activator.java

Modified: directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/.classpath
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/.classpath?rev=650134&r1=650133&r2=650134&view=diff
==============================================================================
--- directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/.classpath
(original)
+++ directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/.classpath
Mon Apr 21 06:13:50 2008
@@ -7,5 +7,6 @@
 	<classpathentry kind="lib" path="lib/log4j-1.2.14.jar"/>
 	<classpathentry kind="lib" path="lib/slf4j-api-1.4.3.jar"/>
 	<classpathentry kind="lib" path="lib/slf4j-log4j12-1.4.3.jar"/>
+	<classpathentry kind="lib" path="lib/apacheds-main.jar"/>
 	<classpathentry kind="output" path="target"/>
 </classpath>

Modified: directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/META-INF/MANIFEST.MF?rev=650134&r1=650133&r2=650134&view=diff
==============================================================================
--- directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/META-INF/MANIFEST.MF
(original)
+++ directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/META-INF/MANIFEST.MF
Mon Apr 21 06:13:50 2008
@@ -10,8 +10,10 @@
  org.eclipse.ui.console,
  org.eclipse.jface.text,
  org.eclipse.jdt.launching,
- org.eclipse.debug.core
+ org.eclipse.debug.core,
+ org.eclipse.debug.ui
 Eclipse-LazyStart: true
-Bundle-ClassPath: lib/log4j-1.2.14.jar,
+Bundle-ClassPath: lib/apacheds-main.jar,
+ lib/log4j-1.2.14.jar,
  lib/slf4j-api-1.4.3.jar,
  lib/slf4j-log4j12-1.4.3.jar

Added: directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/lib/apacheds-main.jar
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/lib/apacheds-main.jar?rev=650134&view=auto
==============================================================================
Binary file - no diff available.

Propchange: directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/lib/apacheds-main.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Modified: directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/src/main/java/org/apache/directory/studio/apacheds/experimentations/Activator.java
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/src/main/java/org/apache/directory/studio/apacheds/experimentations/Activator.java?rev=650134&r1=650133&r2=650134&view=diff
==============================================================================
--- directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/src/main/java/org/apache/directory/studio/apacheds/experimentations/Activator.java
(original)
+++ directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/src/main/java/org/apache/directory/studio/apacheds/experimentations/Activator.java
Mon Apr 21 06:13:50 2008
@@ -20,10 +20,23 @@
 package org.apache.directory.studio.apacheds.experimentations;
 
 
+import java.util.ArrayList;
+import java.util.List;
+
 import org.apache.log4j.Logger;
 import org.apache.log4j.PropertyConfigurator;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
 import org.eclipse.core.runtime.Platform;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationType;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
 import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.debug.ui.DebugUITools;
+import org.eclipse.debug.ui.IDebugUIConstants;
+import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
+import org.eclipse.jdt.launching.IRuntimeClasspathEntry;
 import org.eclipse.jdt.launching.IVMInstall;
 import org.eclipse.jdt.launching.IVMInstallType;
 import org.eclipse.jdt.launching.JavaRuntime;
@@ -67,36 +80,36 @@
         // Configuring Log4J
         PropertyConfigurator.configure( Platform.getBundle( PLUGIN_ID ).getResource( "log4j.properties"
) ); //$NON-NLS-1$
         logger.info( "Entering Apache Directory Studio." ); //$NON-NLS-1$
-
-        // Testing the Console capabilities
-        consoleDisplayMgr = new ConsoleDisplayMgr( "Testing Console..." );
-
-        consoleDisplayMgr.println( "MSG_INFORMATION", ConsoleDisplayMgr.MSG_INFORMATION );
-        consoleDisplayMgr.println( "MSG_WARNING", ConsoleDisplayMgr.MSG_WARNING );
-        consoleDisplayMgr.println( "MSG_ERROR", ConsoleDisplayMgr.MSG_ERROR );
-
-        IVMInstallType[] types = JavaRuntime.getVMInstallTypes();
-        for ( int i = 0; i < types.length; i++ )
-        {
-            IVMInstallType type = types[i];
-            IVMInstall[] jres = type.getVMInstalls();
-            for ( IVMInstall vmInstall : jres )
-            {
-                consoleDisplayMgr.println( vmInstall.getId(), ConsoleDisplayMgr.MSG_INFORMATION
);
-                consoleDisplayMgr.println( vmInstall.getName(), ConsoleDisplayMgr.MSG_INFORMATION
);
-                consoleDisplayMgr
-                    .println( vmInstall.getInstallLocation().toString(), ConsoleDisplayMgr.MSG_INFORMATION
);
-                consoleDisplayMgr.println( vmInstall.getVMInstallType().toString(), ConsoleDisplayMgr.MSG_INFORMATION
);
-                consoleDisplayMgr.println( vmInstall.getVMRunner( ILaunchManager.RUN_MODE
).toString(),
-                    ConsoleDisplayMgr.MSG_INFORMATION );
-                System.out.println( vmInstall.getName() );
-            }
-        }
-
-        System.out.println( "*****************" );
-
+        
+                // Testing the Console capabilities
+                consoleDisplayMgr = new ConsoleDisplayMgr( "Testing Console..." );
+        
+                consoleDisplayMgr.println( "MSG_INFORMATION", ConsoleDisplayMgr.MSG_INFORMATION
);
+                consoleDisplayMgr.println( "MSG_WARNING", ConsoleDisplayMgr.MSG_WARNING );
+                consoleDisplayMgr.println( "MSG_ERROR", ConsoleDisplayMgr.MSG_ERROR );
+        
+                IVMInstallType[] types = JavaRuntime.getVMInstallTypes();
+                for ( int i = 0; i < types.length; i++ )
+                {
+                    IVMInstallType type = types[i];
+                    IVMInstall[] jres = type.getVMInstalls();
+                    for ( IVMInstall vmInstall : jres )
+                    {
+                        consoleDisplayMgr.println( vmInstall.getId(), ConsoleDisplayMgr.MSG_INFORMATION
);
+                        consoleDisplayMgr.println( vmInstall.getName(), ConsoleDisplayMgr.MSG_INFORMATION
);
+                        consoleDisplayMgr
+                            .println( vmInstall.getInstallLocation().toString(), ConsoleDisplayMgr.MSG_INFORMATION
);
+                        consoleDisplayMgr.println( vmInstall.getVMInstallType().toString(),
ConsoleDisplayMgr.MSG_INFORMATION );
+                        consoleDisplayMgr.println( vmInstall.getVMRunner( ILaunchManager.RUN_MODE
).toString(),
+                            ConsoleDisplayMgr.MSG_INFORMATION );
+                        System.out.println( vmInstall.getName() );
+                    }
+                }
+        
+                System.out.println( "*****************" );
+        
         IVMInstall vmInstall = JavaRuntime.getDefaultVMInstall();
-        System.out.println( vmInstall.getId() );
+                System.out.println( vmInstall.getId() );
         System.out.println( vmInstall.getName() );
         System.out.println( vmInstall.getInstallLocation() );
         System.out.println( vmInstall.getVMArguments() );
@@ -122,8 +135,7 @@
                         // TODO Auto-generated catch block
                         e.printStackTrace();
                     }
-                    
-                    
+
                     LOGGER.info( "INFO" );
                     LOGGER.debug( "DEBUG" );
                     LOGGER.warn( "WARN" );
@@ -131,10 +143,34 @@
                     LOGGER.fatal( "FATAL" );
                 }
             }
-
         };
 
         thread.start();
+
+        // Testing the launch configuration
+        ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
+        ILaunchConfigurationType type = manager
+            .getLaunchConfigurationType( IJavaLaunchConfigurationConstants.ID_JAVA_APPLICATION
);
+        ILaunchConfigurationWorkingCopy workingCopy = type.newInstance( null, "Start ApacheDS"
);
+
+        workingCopy.setAttribute( IJavaLaunchConfigurationConstants.ATTR_JRE_CONTAINER_PATH,
vmInstall
+            .getInstallLocation().toString() );
+        workingCopy.setAttribute( IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME,
+            "org.apache.directory.server.Main" );
+        
+        IPath bootstrapPath = new Path( "/Users/pajbam/Desktop/apacheds-main.jar" );
+        IRuntimeClasspathEntry bootstrapEntry = JavaRuntime.newArchiveRuntimeClasspathEntry(
bootstrapPath );
+        bootstrapEntry.setClasspathProperty( IRuntimeClasspathEntry.USER_CLASSES );
+
+        List classpath = new ArrayList();
+        classpath.add( bootstrapEntry.getMemento() );
+        workingCopy.setAttribute( IJavaLaunchConfigurationConstants.ATTR_CLASSPATH, classpath
);
+        workingCopy.setAttribute( IJavaLaunchConfigurationConstants.ATTR_DEFAULT_CLASSPATH,
false );
+
+        workingCopy.setAttribute( IDebugUIConstants.ATTR_PRIVATE, true );
+
+        ILaunchConfiguration configuration = workingCopy.doSave();
+        DebugUITools.launch( configuration, ILaunchManager.RUN_MODE );
     }
 
 

Added: directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/src/main/resources/apacheds-main.jar
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/src/main/resources/apacheds-main.jar?rev=650134&view=auto
==============================================================================
Binary file - no diff available.

Propchange: directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/src/main/resources/apacheds-main.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream



Mime
View raw message