[savara-commits] savara SVN: r351 - in trunk/tools/plugins: org.jboss.savara.tools.monitor and 6 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Mon Aug 16 11:23:44 EDT 2010


Author: objectiser
Date: 2010-08-16 11:23:43 -0400 (Mon, 16 Aug 2010)
New Revision: 351

Added:
   trunk/tools/plugins/org.jboss.savara.tools.monitor/src/java/org/jboss/savara/tools/monitor/preferences/
   trunk/tools/plugins/org.jboss.savara.tools.monitor/src/java/org/jboss/savara/tools/monitor/preferences/MonitorPreferencePage.java
   trunk/tools/plugins/org.jboss.savara.tools.monitor/src/java/org/jboss/savara/tools/monitor/preferences/MonitorPreferences.java
   trunk/tools/plugins/org.jboss.savara.tools.monitor/src/java/org/jboss/savara/tools/preferences/
   trunk/tools/plugins/org.jboss.savara.tools.monitor/src/java/org/jboss/savara/tools/preferences/SavaraPreferencePage.java
Removed:
   trunk/tools/plugins/org.jboss.savara.tools.monitor/lib/
Modified:
   trunk/tools/plugins/org.jboss.savara.tools.bpmn/META-INF/MANIFEST.MF
   trunk/tools/plugins/org.jboss.savara.tools.monitor/
   trunk/tools/plugins/org.jboss.savara.tools.monitor/.classpath
   trunk/tools/plugins/org.jboss.savara.tools.monitor/META-INF/MANIFEST.MF
   trunk/tools/plugins/org.jboss.savara.tools.monitor/build.properties
   trunk/tools/plugins/org.jboss.savara.tools.monitor/plugin.xml
   trunk/tools/plugins/org.jboss.savara.tools.monitor/src/java/org/jboss/savara/tools/monitor/eclipse/MonitorAction.java
   trunk/tools/plugins/org.jboss.savara.tools.monitor/src/java/org/jboss/savara/tools/monitor/eclipse/MonitorLauncher.java
Log:
SAVARA-119 - enable the user to setup the library path to use for JMS libraries. Allows flexibility in terms of JMS provider and version.

Modified: trunk/tools/plugins/org.jboss.savara.tools.bpmn/META-INF/MANIFEST.MF
===================================================================
--- trunk/tools/plugins/org.jboss.savara.tools.bpmn/META-INF/MANIFEST.MF	2010-08-16 10:29:56 UTC (rev 350)
+++ trunk/tools/plugins/org.jboss.savara.tools.bpmn/META-INF/MANIFEST.MF	2010-08-16 15:23:43 UTC (rev 351)
@@ -2,7 +2,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: JBoss SAVARA Tools BPMN Plug-in
 Bundle-SymbolicName: org.jboss.savara.tools.bpmn;singleton:=true
-Bundle-Version: 3.0.0.qualifier
+Bundle-Version: 1.1.0.qualifier
 Bundle-Activator: org.jboss.savara.tools.bpmn.eclipse.Activator
 Bundle-Vendor: www.jboss.org
 Bundle-Localization: plugin


Property changes on: trunk/tools/plugins/org.jboss.savara.tools.monitor
___________________________________________________________________
Name: svn:ignore
   + classes


Modified: trunk/tools/plugins/org.jboss.savara.tools.monitor/.classpath
===================================================================
--- trunk/tools/plugins/org.jboss.savara.tools.monitor/.classpath	2010-08-16 10:29:56 UTC (rev 350)
+++ trunk/tools/plugins/org.jboss.savara.tools.monitor/.classpath	2010-08-16 15:23:43 UTC (rev 351)
@@ -1,17 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
 	<classpathentry kind="src" path="src/java"/>
-	<classpathentry exported="true" kind="lib" path="lib/log4j.jar"/>
-	<classpathentry exported="true" kind="lib" path="lib/trove.jar"/>
-	<classpathentry kind="lib" path="lib/jboss-serialization.jar"/>
 	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
 	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
-	<classpathentry kind="lib" path="lib/jboss-client.jar"/>
-	<classpathentry kind="lib" path="lib/jboss-javaee.jar"/>
-	<classpathentry kind="lib" path="lib/jnp-client.jar"/>
-	<classpathentry kind="lib" path="lib/jboss-logging-spi.jar"/>
-	<classpathentry kind="lib" path="lib/jboss-messaging-client.jar"/>
-	<classpathentry kind="lib" path="lib/jboss-aop-client.jar"/>
-	<classpathentry kind="lib" path="lib/jboss-mdr.jar"/>
 	<classpathentry kind="output" path="classes"/>
 </classpath>

Modified: trunk/tools/plugins/org.jboss.savara.tools.monitor/META-INF/MANIFEST.MF
===================================================================
--- trunk/tools/plugins/org.jboss.savara.tools.monitor/META-INF/MANIFEST.MF	2010-08-16 10:29:56 UTC (rev 350)
+++ trunk/tools/plugins/org.jboss.savara.tools.monitor/META-INF/MANIFEST.MF	2010-08-16 15:23:43 UTC (rev 351)
@@ -2,7 +2,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: JBoss SAVARA Tools Monitor Plug-in
 Bundle-SymbolicName: org.jboss.savara.tools.monitor;singleton:=true
-Bundle-Version: 3.0.0.qualifier
+Bundle-Version: 1.1.0.qualifier
 Bundle-Activator: org.jboss.savara.tools.monitor.eclipse.Activator
 Bundle-Vendor: www.jboss.org
 Require-Bundle: org.eclipse.ui,
@@ -21,21 +21,10 @@
  org.eclipse.ui,
  org.eclipse.jdt.core,
  org.eclipse.emf.ecore,
- org.pi4soa.common
+ org.pi4soa.common,
+ org.eclipse.wst.server.core,
+ org.eclipse.jst.server.core,
+ org.eclipse.jst.server.generic.core
 Eclipse-LazyStart: true
-Bundle-ClassPath: .,
- lib/concurrent.jar,
- lib/javassist.jar,
- lib/jboss-aop-client.jar,
- lib/jboss-client.jar,
- lib/jboss-common-core.jar,
- lib/jboss-javaee.jar,
- lib/jboss-logging-spi.jar,
- lib/jboss-mdr.jar,
- lib/jboss-messaging-client.jar,
- lib/jboss-remoting.jar,
- lib/jnp-client.jar,
- lib/log4j.jar,
- lib/trove.jar,
- lib/jboss-serialization.jar
+Bundle-ClassPath: .
 Bundle-RequiredExecutionEnvironment: JavaSE-1.6

Modified: trunk/tools/plugins/org.jboss.savara.tools.monitor/build.properties
===================================================================
--- trunk/tools/plugins/org.jboss.savara.tools.monitor/build.properties	2010-08-16 10:29:56 UTC (rev 350)
+++ trunk/tools/plugins/org.jboss.savara.tools.monitor/build.properties	2010-08-16 15:23:43 UTC (rev 351)
@@ -3,27 +3,11 @@
 bin.includes = META-INF/,\
                .,\
                plugin.xml,\
-               LICENSE.txt,\
-               lib/,\
-               lib/concurrent.jar,\
-               lib/javassist.jar,\
-               lib/jboss-aop-client.jar,\
-               lib/jboss-client.jar,\
-               lib/jboss-common-core.jar,\
-               lib/jboss-javaee.jar,\
-               lib/jboss-logging-spi.jar,\
-               lib/jboss-mdr.jar,\
-               lib/jboss-messaging-client.jar,\
-               lib/jboss-remoting.jar,\
-               lib/jnp-client.jar,\
-               lib/log4j.jar,\
-               lib/trove.jar,\
-               lib/jboss-serialization.jar
+               LICENSE.txt
 src.includes = .classpath,\
                .project,\
                LICENSE.txt,\
                META-INF/,\
                build.properties,\
                plugin.xml,\
-               src/,\
-               lib/
+               src/

Modified: trunk/tools/plugins/org.jboss.savara.tools.monitor/plugin.xml
===================================================================
--- trunk/tools/plugins/org.jboss.savara.tools.monitor/plugin.xml	2010-08-16 10:29:56 UTC (rev 350)
+++ trunk/tools/plugins/org.jboss.savara.tools.monitor/plugin.xml	2010-08-16 15:23:43 UTC (rev 351)
@@ -39,5 +39,20 @@
      </action> 
     </objectContribution> 
   </extension>
- 
+
+  <extension
+        point="org.eclipse.ui.preferencePages">
+     <page
+           class="org.jboss.savara.tools.preferences.SavaraPreferencePage"
+           id="org.jboss.savara.tools.preferences.SavaraPreferencePage"
+           name="Savara">
+     </page>
+     <page
+           category="org.jboss.savara.tools.preferences.SavaraPreferencePage"
+           class="org.jboss.savara.tools.monitor.preferences.MonitorPreferencePage"
+           id="org.jboss.savara.tools.monitor.preferences.MonitorPreferencePage"
+           name="Monitor">
+     </page>
+  </extension>
+  
 </plugin>

Modified: trunk/tools/plugins/org.jboss.savara.tools.monitor/src/java/org/jboss/savara/tools/monitor/eclipse/MonitorAction.java
===================================================================
--- trunk/tools/plugins/org.jboss.savara.tools.monitor/src/java/org/jboss/savara/tools/monitor/eclipse/MonitorAction.java	2010-08-16 10:29:56 UTC (rev 350)
+++ trunk/tools/plugins/org.jboss.savara.tools.monitor/src/java/org/jboss/savara/tools/monitor/eclipse/MonitorAction.java	2010-08-16 15:23:43 UTC (rev 351)
@@ -36,6 +36,7 @@
 import org.eclipse.debug.core.ILaunchManager;
 import org.eclipse.debug.core.Launch;
 import org.eclipse.debug.core.DebugPlugin;
+import org.jboss.savara.tools.monitor.preferences.MonitorPreferences;
 
 /**
  * This class invokes the monitor action on the selected
@@ -44,6 +45,7 @@
  */
 public class MonitorAction implements IObjectActionDelegate {
 
+	private static final String SET_LIBRARY_PATHS = "Need to set library paths. See Window->Preferences->Savara->Monitor.";
 	/**
 	 * This method implements the action's run method.
 	 * 
@@ -60,8 +62,12 @@
             // with the resource
 			if (ResourceUtil.hasErrors(res) == false) {
 			
-				launch(res.getProject().getName(),
+				if (MonitorPreferences.isLibraryPathsDefined()) {
+					launch(res.getProject().getName(),
 							res.getProjectRelativePath().toString());
+				} else {
+					error(SET_LIBRARY_PATHS);
+				}
 							
 			} else {
 				error(ERRORS_NO_TEST);

Modified: trunk/tools/plugins/org.jboss.savara.tools.monitor/src/java/org/jboss/savara/tools/monitor/eclipse/MonitorLauncher.java
===================================================================
--- trunk/tools/plugins/org.jboss.savara.tools.monitor/src/java/org/jboss/savara/tools/monitor/eclipse/MonitorLauncher.java	2010-08-16 10:29:56 UTC (rev 350)
+++ trunk/tools/plugins/org.jboss.savara.tools.monitor/src/java/org/jboss/savara/tools/monitor/eclipse/MonitorLauncher.java	2010-08-16 15:23:43 UTC (rev 351)
@@ -45,8 +45,13 @@
 import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
 import org.eclipse.jdt.launching.IVMInstall;
 import org.eclipse.jdt.launching.IVMRunner;
+import org.eclipse.jdt.launching.JavaRuntime;
 import org.eclipse.jdt.launching.VMRunnerConfiguration;
+import org.eclipse.jst.server.core.internal.GenericRuntime;
+import org.eclipse.jst.server.generic.core.internal.GenericServerRuntime;
 import org.eclipse.osgi.util.ManifestElement;
+import org.eclipse.wst.server.core.IRuntime;
+import org.eclipse.wst.server.core.ServerCore;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.Constants;
 import org.pi4soa.common.eclipse.BundleUtil;
@@ -55,6 +60,7 @@
 import org.eclipse.core.resources.ResourcesPlugin;
 import org.eclipse.core.resources.IFile;
 import org.eclipse.core.runtime.Path;
+import org.jboss.savara.tools.monitor.preferences.MonitorPreferences;
 
 /**
  * This class is responsible for launching a monitor against
@@ -81,6 +87,7 @@
 	public void launch(ILaunchConfiguration configuration,
             String mode, ILaunch launch, IProgressMonitor monitor)
 						throws CoreException {
+		
 		if (monitor == null) {
 			monitor = new NullProgressMonitor();
 		}
@@ -337,6 +344,7 @@
 			
 		} catch(Exception e) {
 			// TODO: report error
+			//e.printStackTrace();
 		}
 		
 		buildClassPath("org.jboss.savara.tools.monitor", classpathEntries);
@@ -349,6 +357,25 @@
 		buildClassPath("org.apache.xalan", classpathEntries);
 		buildClassPath("org.apache.xml.serializer", classpathEntries);
 		
+		// Access library paths to include all found jars
+		String paths=MonitorPreferences.getLibraryPaths();
+		
+		java.util.StringTokenizer st=new java.util.StringTokenizer(paths, ":");
+		
+		while (st.hasMoreTokens()) {
+			String libpath=st.nextToken();
+			
+			java.io.File f=new java.io.File(libpath);
+			java.io.File[] childFiles=f.listFiles();
+			
+			for (int i=0; i < childFiles.length; i++) {
+				if (childFiles[i].isFile() && childFiles[i].getName().endsWith(".jar")) {
+					classpathEntries.add(childFiles[i].getAbsolutePath());
+				}
+			}
+		}
+
+		// Return entries as an array
 		ret = new String[classpathEntries.size()];
 		classpathEntries.copyInto(ret);
 		

Added: trunk/tools/plugins/org.jboss.savara.tools.monitor/src/java/org/jboss/savara/tools/monitor/preferences/MonitorPreferencePage.java
===================================================================
--- trunk/tools/plugins/org.jboss.savara.tools.monitor/src/java/org/jboss/savara/tools/monitor/preferences/MonitorPreferencePage.java	                        (rev 0)
+++ trunk/tools/plugins/org.jboss.savara.tools.monitor/src/java/org/jboss/savara/tools/monitor/preferences/MonitorPreferencePage.java	2010-08-16 15:23:43 UTC (rev 351)
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2005-10 Pi4 Technologies Ltd
+ *
+ * Licensed 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.
+ *
+ *
+ * Change History:
+ * 30 March 2010 : Initial version created by gary
+ */
+package org.jboss.savara.tools.monitor.preferences;
+
+import org.eclipse.jface.preference.*;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.eclipse.ui.IWorkbench;
+
+/**
+ * This class represents a preference page that
+ * is contributed to the Preferences dialog. By 
+ * subclassing <samp>FieldEditorPreferencePage</samp>, we
+ * can use the field support built into JFace that allows
+ * us to create a page that is small and knows how to 
+ * save, restore and apply itself.
+ * <p>
+ * This page is used to modify preferences only. They
+ * are stored in the preference store that belongs to
+ * the main plug-in class. That way, preferences can
+ * be accessed directly via the preference store.
+ */
+
+public class MonitorPreferencePage
+	extends FieldEditorPreferencePage
+	implements IWorkbenchPreferencePage {
+
+	public MonitorPreferencePage() {
+		super(GRID);
+		setPreferenceStore(org.jboss.savara.tools.monitor.eclipse.Activator.getDefault().getPreferenceStore());
+		setDescription("Preferences for the SAVARA Choreography Monitor");
+	}
+	
+	/**
+	 * Creates the field editors. Field editors are abstractions of
+	 * the common GUI blocks needed to manipulate various types
+	 * of preferences. Each field editor knows how to save and
+	 * restore itself.
+	 */
+	public void createFieldEditors() {
+		addField(new PathEditor(
+				MonitorPreferences.MONITOR_LIBRARIES,
+				"&Library Paths", "Library paths required to monitor target platform", getFieldEditorParent()));
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
+	 */
+	public void init(IWorkbench workbench) {
+	}
+	
+}
\ No newline at end of file

Added: trunk/tools/plugins/org.jboss.savara.tools.monitor/src/java/org/jboss/savara/tools/monitor/preferences/MonitorPreferences.java
===================================================================
--- trunk/tools/plugins/org.jboss.savara.tools.monitor/src/java/org/jboss/savara/tools/monitor/preferences/MonitorPreferences.java	                        (rev 0)
+++ trunk/tools/plugins/org.jboss.savara.tools.monitor/src/java/org/jboss/savara/tools/monitor/preferences/MonitorPreferences.java	2010-08-16 15:23:43 UTC (rev 351)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.savara.tools.monitor.preferences;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+
+public class MonitorPreferences {
+
+	public static final String MONITOR_LIBRARIES="savara.monitor.libraries";
+	
+	public static String getLibraryPaths() {
+		IPreferenceStore prefs=
+				org.jboss.savara.tools.monitor.eclipse.Activator.getDefault().getPreferenceStore();
+		
+		return(prefs.getString(MONITOR_LIBRARIES));
+	}
+	
+	public static boolean isLibraryPathsDefined() {
+		boolean ret=false;
+		
+		IPreferenceStore prefs=
+			org.jboss.savara.tools.monitor.eclipse.Activator.getDefault().getPreferenceStore();
+		
+		String paths=prefs.getString(MONITOR_LIBRARIES);
+		
+		if (paths != null && paths.length() > 0) {
+			ret = true;
+		}
+		
+		return(ret);
+	}
+}

Added: trunk/tools/plugins/org.jboss.savara.tools.monitor/src/java/org/jboss/savara/tools/preferences/SavaraPreferencePage.java
===================================================================
--- trunk/tools/plugins/org.jboss.savara.tools.monitor/src/java/org/jboss/savara/tools/preferences/SavaraPreferencePage.java	                        (rev 0)
+++ trunk/tools/plugins/org.jboss.savara.tools.monitor/src/java/org/jboss/savara/tools/preferences/SavaraPreferencePage.java	2010-08-16 15:23:43 UTC (rev 351)
@@ -0,0 +1,64 @@
+/*
+ * Copyright 2005-10 Pi4 Technologies Ltd
+ *
+ * Licensed 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.
+ *
+ *
+ * Change History:
+ * 30 March 2010 : Initial version created by gary
+ */
+package org.jboss.savara.tools.preferences;
+
+import org.eclipse.jface.preference.*;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.eclipse.ui.IWorkbench;
+
+/**
+ * This class represents a preference page that
+ * is contributed to the Preferences dialog. By 
+ * subclassing <samp>FieldEditorPreferencePage</samp>, we
+ * can use the field support built into JFace that allows
+ * us to create a page that is small and knows how to 
+ * save, restore and apply itself.
+ * <p>
+ * This page is used to modify preferences only. They
+ * are stored in the preference store that belongs to
+ * the main plug-in class. That way, preferences can
+ * be accessed directly via the preference store.
+ */
+
+public class SavaraPreferencePage
+	extends FieldEditorPreferencePage
+	implements IWorkbenchPreferencePage {
+
+	public SavaraPreferencePage() {
+		super(GRID);
+		setDescription("SAVARA Preferences");
+	}
+	
+	/**
+	 * Creates the field editors. Field editors are abstractions of
+	 * the common GUI blocks needed to manipulate various types
+	 * of preferences. Each field editor knows how to save and
+	 * restore itself.
+	 */
+	public void createFieldEditors() {
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
+	 */
+	public void init(IWorkbench workbench) {
+	}
+	
+}
\ No newline at end of file



More information about the savara-commits mailing list