[savara-commits] savara SVN: r352 - in trunk/tools/plugins: org.jboss.savara.tools.bpmn and 4 other directories.
do-not-reply at jboss.org
do-not-reply at jboss.org
Mon Aug 16 13:53:32 EDT 2010
Author: objectiser
Date: 2010-08-16 13:53:31 -0400 (Mon, 16 Aug 2010)
New Revision: 352
Added:
trunk/tools/plugins/org.jboss.savara.tools.bpmn/pom.xml
trunk/tools/plugins/org.jboss.savara.tools.monitor/pom.xml
trunk/tools/plugins/org.jboss.savara.tools.monitor/src/java/org/jboss/savara/tools/monitor/preferences/PreferenceInitializer.java
Modified:
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/TxnMonitor.java
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/preferences/MonitorPreferencePage.java
trunk/tools/plugins/org.jboss.savara.tools.monitor/src/java/org/jboss/savara/tools/monitor/preferences/MonitorPreferences.java
trunk/tools/plugins/pom.xml
Log:
SAVARA-119 - added preference configuration for JNDI and JMS properties. No longer require Java project or pi4soa.xml within the user project.
Added: trunk/tools/plugins/org.jboss.savara.tools.bpmn/pom.xml
===================================================================
--- trunk/tools/plugins/org.jboss.savara.tools.bpmn/pom.xml (rev 0)
+++ trunk/tools/plugins/org.jboss.savara.tools.bpmn/pom.xml 2010-08-16 17:53:31 UTC (rev 352)
@@ -0,0 +1,16 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.jboss.savara.tools</groupId>
+ <artifactId>org.jboss.savara.tools.bpmn</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
+ <packaging>eclipse-plugin</packaging>
+ <name>Savara::Tools::Plugins::ToolsBPMN</name>
+
+ <parent>
+ <groupId>org.jboss.savara.tools</groupId>
+ <artifactId>plugins</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
+ </parent>
+
+</project>
Modified: trunk/tools/plugins/org.jboss.savara.tools.monitor/plugin.xml
===================================================================
--- trunk/tools/plugins/org.jboss.savara.tools.monitor/plugin.xml 2010-08-16 15:23:43 UTC (rev 351)
+++ trunk/tools/plugins/org.jboss.savara.tools.monitor/plugin.xml 2010-08-16 17:53:31 UTC (rev 352)
@@ -55,4 +55,10 @@
</page>
</extension>
+ <extension
+ point="org.eclipse.core.runtime.preferences">
+ <initializer
+ class="org.jboss.savara.tools.monitor.preferences.PreferenceInitializer">
+ </initializer>
+ </extension>
</plugin>
Added: trunk/tools/plugins/org.jboss.savara.tools.monitor/pom.xml
===================================================================
--- trunk/tools/plugins/org.jboss.savara.tools.monitor/pom.xml (rev 0)
+++ trunk/tools/plugins/org.jboss.savara.tools.monitor/pom.xml 2010-08-16 17:53:31 UTC (rev 352)
@@ -0,0 +1,16 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.jboss.savara.tools</groupId>
+ <artifactId>org.jboss.savara.tools.monitor</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
+ <packaging>eclipse-plugin</packaging>
+ <name>Savara::Tools::Plugins::ToolsMonitor</name>
+
+ <parent>
+ <groupId>org.jboss.savara.tools</groupId>
+ <artifactId>plugins</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
+ </parent>
+
+</project>
Modified: trunk/tools/plugins/org.jboss.savara.tools.monitor/src/java/org/jboss/savara/tools/monitor/TxnMonitor.java
===================================================================
--- trunk/tools/plugins/org.jboss.savara.tools.monitor/src/java/org/jboss/savara/tools/monitor/TxnMonitor.java 2010-08-16 15:23:43 UTC (rev 351)
+++ trunk/tools/plugins/org.jboss.savara.tools.monitor/src/java/org/jboss/savara/tools/monitor/TxnMonitor.java 2010-08-16 17:53:31 UTC (rev 352)
@@ -55,6 +55,28 @@
// Obtain service tracker client
m_trackerClient = new JMSServiceTrackerClient();
+ // Check if system properties have been provided for JNDI
+ if (System.getProperty("java.naming.factory.initial") != null) {
+ m_trackerClient.setJNDIInitialContextFactory(System.getProperty("java.naming.factory.initial"));
+ }
+
+ if (System.getProperty("java.naming.provider.url") != null) {
+ m_trackerClient.setJNDIProviderURL(System.getProperty("java.naming.provider.url"));
+ }
+
+ if (System.getProperty("java.naming.factory.url.pkgs") != null) {
+ m_trackerClient.setJNDIFactoryURLPackages(System.getProperty("java.naming.factory.url.pkgs"));
+ }
+
+ if (System.getProperty("java.messaging.factory") != null) {
+ m_trackerClient.setJMSConnectionFactory(System.getProperty("java.messaging.factory"));
+ }
+
+ if (System.getProperty("java.messaging.destination") != null) {
+ m_trackerClient.setJMSDestination(System.getProperty("java.messaging.destination"));
+ }
+
+ // Add correlator as listener to the tracker
m_trackerClient.addServiceTrackerListener(m_correlator);
//System.err.println("");
@@ -311,7 +333,7 @@
private static TxnMonitor m_instance=null;
private ServiceCorrelator m_correlator=null;
- private ServiceTrackerClient m_trackerClient=null;
+ private JMSServiceTrackerClient m_trackerClient=null;
private java.util.Hashtable m_eventLists=new java.util.Hashtable();
private java.util.Vector m_listeners=new java.util.Vector();
private String m_cdlFile = null;
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 15:23:43 UTC (rev 351)
+++ trunk/tools/plugins/org.jboss.savara.tools.monitor/src/java/org/jboss/savara/tools/monitor/eclipse/MonitorLauncher.java 2010-08-16 17:53:31 UTC (rev 352)
@@ -130,6 +130,19 @@
logger.fine("Launching monitor with args: "+pgmArgs);
String vmArgs = getVMArguments(configuration);
+
+ vmArgs += " -Djava.naming.factory.initial="+MonitorPreferences.getJNDIFactoryInitial();
+ vmArgs += " -Djava.naming.provider.url="+MonitorPreferences.getJNDIProviderURL();
+
+ String pkgs=MonitorPreferences.getJNDIFactoryInitial();
+
+ if (pkgs != null && pkgs.trim().length() > 0) {
+ vmArgs += " -Djava.naming.factory.url.pkgs="+MonitorPreferences.getJNDIFactoryURLPackages();
+ }
+
+ vmArgs += " -Djava.messaging.factory="+MonitorPreferences.getJMSFactory();
+ vmArgs += " -Djava.messaging.destination="+MonitorPreferences.getJMSDestination();
+
ExecutionArguments execArgs = new ExecutionArguments(vmArgs, pgmArgs);
// VM-specific attributes
Modified: 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 2010-08-16 15:23:43 UTC (rev 351)
+++ trunk/tools/plugins/org.jboss.savara.tools.monitor/src/java/org/jboss/savara/tools/monitor/preferences/MonitorPreferencePage.java 2010-08-16 17:53:31 UTC (rev 352)
@@ -57,6 +57,17 @@
addField(new PathEditor(
MonitorPreferences.MONITOR_LIBRARIES,
"&Library Paths", "Library paths required to monitor target platform", getFieldEditorParent()));
+
+ addField(new StringFieldEditor(MonitorPreferences.JNDI_FACTORY_INITIAL,
+ "JNDI Initial Context Factory", getFieldEditorParent()));
+ addField(new StringFieldEditor(MonitorPreferences.JNDI_PROVIDER_URL,
+ "JNDI Provider URL", getFieldEditorParent()));
+ addField(new StringFieldEditor(MonitorPreferences.JNDI_FACTORY_URL_PKGS,
+ "JNDI Factory URL Packages", getFieldEditorParent()));
+ addField(new StringFieldEditor(MonitorPreferences.JMS_FACTORY,
+ "JMS Connection Factory", getFieldEditorParent()));
+ addField(new StringFieldEditor(MonitorPreferences.JMS_DESTINATION,
+ "JMS Destination", getFieldEditorParent()));
}
/* (non-Javadoc)
Modified: 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 2010-08-16 15:23:43 UTC (rev 351)
+++ trunk/tools/plugins/org.jboss.savara.tools.monitor/src/java/org/jboss/savara/tools/monitor/preferences/MonitorPreferences.java 2010-08-16 17:53:31 UTC (rev 352)
@@ -26,6 +26,11 @@
public class MonitorPreferences {
public static final String MONITOR_LIBRARIES="savara.monitor.libraries";
+ public static final String JNDI_FACTORY_INITIAL="savara.monitor.jndi.factory.initial";
+ public static final String JNDI_PROVIDER_URL="savara.monitor.jndi.provider.url";
+ public static final String JNDI_FACTORY_URL_PKGS="savara.monitor.jndi.factory.url.pkgs";
+ public static final String JMS_FACTORY="savara.monitor.jms.factory";
+ public static final String JMS_DESTINATION="savara.monitor.jms.destination";
public static String getLibraryPaths() {
IPreferenceStore prefs=
@@ -48,4 +53,40 @@
return(ret);
}
+
+ public static String getJNDIFactoryInitial() {
+ IPreferenceStore prefs=
+ org.jboss.savara.tools.monitor.eclipse.Activator.getDefault().getPreferenceStore();
+
+ return(prefs.getString(JNDI_FACTORY_INITIAL));
+ }
+
+
+ public static String getJNDIProviderURL() {
+ IPreferenceStore prefs=
+ org.jboss.savara.tools.monitor.eclipse.Activator.getDefault().getPreferenceStore();
+
+ return(prefs.getString(JNDI_PROVIDER_URL));
+ }
+
+ public static String getJNDIFactoryURLPackages() {
+ IPreferenceStore prefs=
+ org.jboss.savara.tools.monitor.eclipse.Activator.getDefault().getPreferenceStore();
+
+ return(prefs.getString(JNDI_FACTORY_URL_PKGS));
+ }
+
+ public static String getJMSFactory() {
+ IPreferenceStore prefs=
+ org.jboss.savara.tools.monitor.eclipse.Activator.getDefault().getPreferenceStore();
+
+ return(prefs.getString(JMS_FACTORY));
+ }
+
+ public static String getJMSDestination() {
+ IPreferenceStore prefs=
+ org.jboss.savara.tools.monitor.eclipse.Activator.getDefault().getPreferenceStore();
+
+ return(prefs.getString(JMS_DESTINATION));
+ }
}
Added: trunk/tools/plugins/org.jboss.savara.tools.monitor/src/java/org/jboss/savara/tools/monitor/preferences/PreferenceInitializer.java
===================================================================
--- trunk/tools/plugins/org.jboss.savara.tools.monitor/src/java/org/jboss/savara/tools/monitor/preferences/PreferenceInitializer.java (rev 0)
+++ trunk/tools/plugins/org.jboss.savara.tools.monitor/src/java/org/jboss/savara/tools/monitor/preferences/PreferenceInitializer.java 2010-08-16 17:53:31 UTC (rev 352)
@@ -0,0 +1,46 @@
+/*
+ * 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.core.runtime.preferences.AbstractPreferenceInitializer;
+import org.eclipse.jface.preference.IPreferenceStore;
+
+/**
+ * Class used to initialize default preference values.
+ */
+public class PreferenceInitializer extends AbstractPreferenceInitializer {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
+ */
+ public void initializeDefaultPreferences() {
+ IPreferenceStore store = org.jboss.savara.tools.monitor.eclipse.Activator.getDefault().getPreferenceStore();
+ store.setDefault(MonitorPreferences.JNDI_FACTORY_INITIAL, "org.jnp.interfaces.NamingContextFactory");
+ store.setDefault(MonitorPreferences.JNDI_PROVIDER_URL, "jnp://localhost:1099");
+ store.setDefault(MonitorPreferences.JNDI_FACTORY_URL_PKGS, "org.jboss.naming:org.jnp.interfaces");
+ store.setDefault(MonitorPreferences.JMS_FACTORY, "ConnectionFactory");
+ store.setDefault(MonitorPreferences.JMS_DESTINATION, "topic/tracker");
+ }
+
+}
Modified: trunk/tools/plugins/pom.xml
===================================================================
--- trunk/tools/plugins/pom.xml 2010-08-16 15:23:43 UTC (rev 351)
+++ trunk/tools/plugins/pom.xml 2010-08-16 17:53:31 UTC (rev 352)
@@ -21,8 +21,8 @@
<module>org.jboss.savara.tools.bpel</module>
<module>org.jboss.savara.tools.validator</module>
<module>org.jboss.savara.tools.wsdl</module>
- <module>org.pi4soa.bpmn</module>
- <module>org.pi4soa.monitor</module>
+ <module>org.jboss.savara.tools.bpmn</module>
+ <module>org.jboss.savara.tools.monitor</module>
<module>org.scribble.conformance</module>
<module>org.scribble.conversation.comparator</module>
<module>org.scribble.conversation.eclipse</module>
More information about the savara-commits
mailing list