[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wsf-java-dev
Subject:    [wsf-java-dev] svn commit r5884 - in
From:       svn () wso2 ! org (svn () wso2 ! org)
Date:       2007-07-25 3:59:18
Message-ID: E1IDeaL-0000Em-5D () wso2 ! org
[Download RAW message or body]

Author: sandakith
Date: Wed Jul 25 03:58:57 2007
New Revision: 5884

Added:
   trunk/wsf/java/modules/eclipse-wtp-plugins/org.wso2.wsf.ide.wtp.ext/src/org/wso2/wsf/ide/wtp/ext/server/command/WSASDebugCommand.java
  trunk/wsf/java/modules/eclipse-wtp-plugins/org.wso2.wsf.ide.wtp.ext/src/org/wso2/wsf/ide/wtp/ext/server/ui/WSASDebugDelegate.java
  trunk/wsf/java/modules/eclipse-wtp-plugins/org.wso2.wsf.ide.wtp.ext/src/org/wso2/wsf/ide/wtp/ext/server/ui/WSASDebugMenuDelegate.java
 Modified:
   trunk/wsf/java/modules/eclipse-wtp-plugins/org.wso2.wsf.ide.core/src/org/wso2/wsf/ide/core/context/PersistentWSASEmitterContext.java
  trunk/wsf/java/modules/eclipse-wtp-plugins/org.wso2.wsf.ide.core/src/org/wso2/wsf/ide/core/context/WSASEmitterDefaults.java
  trunk/wsf/java/modules/eclipse-wtp-plugins/org.wso2.wsf.ide.core/src/org/wso2/wsf/ide/core/plugin/messages/WSASCoreUIMessages.java
  trunk/wsf/java/modules/eclipse-wtp-plugins/org.wso2.wsf.ide.wtp.ext/resources/plugin.xml
  trunk/wsf/java/modules/eclipse-wtp-plugins/org.wso2.wsf.ide.wtp.ext/src/org/wso2/wsf/ide/wtp/ext/server/bean/WSASConfigurationBean.java
 Log:
UI features for server debug 
Added the default persistence for debug



Modified: trunk/wsf/java/modules/eclipse-wtp-plugins/org.wso2.wsf.ide.core/src/org/wso2/wsf/ide/core/context/PersistentWSASEmitterContext.java
 ==============================================================================
--- trunk/wsf/java/modules/eclipse-wtp-plugins/org.wso2.wsf.ide.core/src/org/wso2/wsf/ide/core/context/PersistentWSASEmitterContext.java	(original)
                
+++ trunk/wsf/java/modules/eclipse-wtp-plugins/org.wso2.wsf.ide.core/src/org/wso2/wsf/ide/core/context/PersistentWSASEmitterContext.java	Wed \
Jul 25 03:58:57 2007 @@ -35,6 +35,7 @@
 	public void load(){
 		setDefault(PREFERENCE_WSAS_RUNTIME_LOCATION, \
WSASEmitterDefaults.getWSASRuntimeLocation());  \
setDefault(PREFERENCE_WSAS_RUNTIME_SET, \
WSASEmitterDefaults.getWSASRuntimeLocationSet()); \
+		setDefault(PREFERENCE_DEBUG_PORT, WSASEmitterDefaults.getDebugPort());  
 		setDefault(PREFERENCE_SERVICE_DATABINDING, \
WSASEmitterDefaults.getServiceDatabinding());  \
setDefault(PREFERENCE_SERVICE_INTERFACE_SKELETON, \
WSASEmitterDefaults.isServiceInterfaceSkeleton());

Modified: trunk/wsf/java/modules/eclipse-wtp-plugins/org.wso2.wsf.ide.core/src/org/wso2/wsf/ide/core/context/WSASEmitterDefaults.java
 ==============================================================================
--- trunk/wsf/java/modules/eclipse-wtp-plugins/org.wso2.wsf.ide.core/src/org/wso2/wsf/ide/core/context/WSASEmitterDefaults.java	(original)
                
+++ trunk/wsf/java/modules/eclipse-wtp-plugins/org.wso2.wsf.ide.core/src/org/wso2/wsf/ide/core/context/WSASEmitterDefaults.java	Wed \
Jul 25 03:58:57 2007 @@ -21,6 +21,7 @@
 
 	public static final String PREFERENCE_WSAS_RUNTIME_LOCATION_DEFAULT = "";
 	public static final boolean PREFERENCE_WSAS_RUNTIME_SET_DEFAULT = false;
+	public static final String PREFERENCE_WSAS_DEBUG_PORT_DEFAULT = "8088";
 	
 	//Axis2 Preferences
 	//Service Code generation Options
@@ -89,5 +90,9 @@
 		return PREFERENCE_AAR_EXTENTION_DEFAULT;
 	}
 
+	public static String getDebugPort() {
+		return PREFERENCE_WSAS_DEBUG_PORT_DEFAULT;
+	}
+
 
 }

Modified: trunk/wsf/java/modules/eclipse-wtp-plugins/org.wso2.wsf.ide.core/src/org/wso2/wsf/ide/core/plugin/messages/WSASCoreUIMessages.java
 ==============================================================================
--- trunk/wsf/java/modules/eclipse-wtp-plugins/org.wso2.wsf.ide.core/src/org/wso2/wsf/ide/core/plugin/messages/WSASCoreUIMessages.java	(original)
                
+++ trunk/wsf/java/modules/eclipse-wtp-plugins/org.wso2.wsf.ide.core/src/org/wso2/wsf/ide/core/plugin/messages/WSASCoreUIMessages.java	Wed \
Jul 25 03:58:57 2007 @@ -43,7 +43,7 @@
 
 	public static final String WSAS_DEFAULT_DEBUG_HOST = "localhost" ; 		//$NON-NLS-1$
 	public static final String WSAS_DEFAULT_DEBUG_PORT = "8088" ; 			//$NON-NLS-1$
-	
+	public static final String WSAS_DEFAULT_DEBUG_APPENDER = " --debug " \
;	//$NON-NLS-1$  
 	
 	

Modified: trunk/wsf/java/modules/eclipse-wtp-plugins/org.wso2.wsf.ide.wtp.ext/resources/plugin.xml
 ==============================================================================
--- trunk/wsf/java/modules/eclipse-wtp-plugins/org.wso2.wsf.ide.wtp.ext/resources/plugin.xml	(original)
                
+++ trunk/wsf/java/modules/eclipse-wtp-plugins/org.wso2.wsf.ide.wtp.ext/resources/plugin.xml	Wed \
Jul 25 03:58:57 2007 @@ -14,6 +14,14 @@
            			<systemProperty name="WSASStartStatus" value="done"/> 
        			</enablement> 
 			</action>
+			<action id="org.wso2.wsf.ide.wtp.ext.server.ui.debug"
+                label="WSAS Debug" 
+                icon="icons/debug.gif" 
+                tooltip="WSAS Server Debug" 
+                toolbarPath="Normal/additions"
+                helpContextId="org.wso2.wsf.ide.wtp.ext.server.ui.debug.help"
+                class="org.wso2.wsf.ide.wtp.ext.server.ui.WSASDebugDelegate">
+            </action>
 			<action id="org.wso2.wsf.ide.wtp.ext.server.ui.start"
 				label="WSAS Start" 
 				icon="icons/start.gif" 
@@ -51,6 +59,13 @@
        			</enablement> 
 			</action>
 			<action
+                id="org.wso2.wsf.ide.wtp.ext.server.ui.menu.debug.action"
+                label="WSAS Debug" icon="icons/debug.gif"
+                tooltip="WSAS Server Debug"
+                menubarPath="org.wso2.wsf.ide.wtp.ext.server.ui.menu.topLevelMenu/WSASGroup"
 +                class="org.wso2.wsf.ide.wtp.ext.server.ui.WSASDebugMenuDelegate">
+            </action>
+			<action
 				id="org.wso2.wsf.ide.wtp.ext.server.ui.menu.stop.action"
 				label="WSAS Start" icon="icons/start.gif"
 				tooltip="WSAS Server Start"

Modified: trunk/wsf/java/modules/eclipse-wtp-plugins/org.wso2.wsf.ide.wtp.ext/src/org/wso2/wsf/ide/wtp/ext/server/bean/WSASConfigurationBean.java
 ==============================================================================
--- trunk/wsf/java/modules/eclipse-wtp-plugins/org.wso2.wsf.ide.wtp.ext/src/org/wso2/wsf/ide/wtp/ext/server/bean/WSASConfigurationBean.java	(original)
                
+++ trunk/wsf/java/modules/eclipse-wtp-plugins/org.wso2.wsf.ide.wtp.ext/src/org/wso2/wsf/ide/wtp/ext/server/bean/WSASConfigurationBean.java	Wed \
Jul 25 03:58:57 2007 @@ -20,7 +20,8 @@
 
 public class WSASConfigurationBean {
 	
-    private static String wsasInstallationPath;
+	private static String wsasInstallationPath;
+    private static String wsasDebugPort;
     private static boolean wsasCorrectPathSet = false;
     private static boolean wsasStartStatus = false;
     private static boolean wsasAlreadyRunning = false;
@@ -30,6 +31,7 @@
     	context = WebServiceWSASCorePlugin.getDefault().getWSASEmitterContext();
     	wsasInstallationPath = context.getWSASRuntimeLocation();
     	wsasCorrectPathSet = context.isCorrectWSASPathSet();
+    	wsasDebugPort = context.getDebuPort();
     }
 
     public static boolean isWsasStartStatus() {
@@ -64,4 +66,12 @@
 		WSASConfigurationBean.wsasCorrectPathSet = wsasCorrectPathSet;
 	}
 
+	public static String getWsasDebugPort() {
+		return wsasDebugPort;
+	}
+
+	public static void setWsasDebugPort(String wsasDebugPort) {
+		WSASConfigurationBean.wsasDebugPort = wsasDebugPort;
+	}
+
 }

Added: trunk/wsf/java/modules/eclipse-wtp-plugins/org.wso2.wsf.ide.wtp.ext/src/org/wso2/wsf/ide/wtp/ext/server/command/WSASDebugCommand.java
 ==============================================================================
--- (empty file)
+++ trunk/wsf/java/modules/eclipse-wtp-plugins/org.wso2.wsf.ide.wtp.ext/src/org/wso2/wsf/ide/wtp/ext/server/command/WSASDebugCommand.java	Wed \
Jul 25 03:58:57 2007 @@ -0,0 +1,70 @@
+/*
+ * Copyright 2005,2006 WSO2, Inc. http://www.wso2.org
+ *
+ * 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.
+ */
+package org.wso2.wsf.ide.wtp.ext.server.command;
+
+import java.lang.reflect.InvocationTargetException;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.wso2.wsf.ide.core.plugin.messages.WSASCoreUIMessages;
+import org.wso2.wsf.ide.core.utils.FileUtils;
+import org.wso2.wsf.ide.wtp.ext.server.bean.WSASConfigurationBean;
+
+public class WSASDebugCommand {
+	
+    private static IStatus status;
+
+	public  static IStatus run() throws InvocationTargetException {
+		status = Status.OK_STATUS;
+		Process wsasProcess = null;
+		String pathNodesStopWin[] = {WSASCoreUIMessages.DIR_BIN, \
WSASCoreUIMessages.WSAS_START_BAT}; +		String pathNodesStopIx[] = \
{WSASCoreUIMessages.DIR_BIN, WSASCoreUIMessages.WSAS_START_SH}; +
+		if (WSASConfigurationBean.isWsasStartStatus()) {
+			status = new Status( \
IStatus.ERROR,"id",11,WSASCoreUIMessages.WSAS_ALREADY_RUNNING,null); \
+			WSASConfigurationBean.setWSASAlreadyRunning(true); +		}else{
+		
+				String wsasInstallationLocation = \
WSASConfigurationBean.getWsasInstallationPath(); +				try {
+					Runtime runtime = Runtime.getRuntime();
+					String OS = System.getProperty(WSASCoreUIMessages.PROPERTIES_OS_NAME).toLowerCase();
 +					String debugAppender = WSASCoreUIMessages.WSAS_DEFAULT_DEBUG_APPENDER +
+					                       WSASConfigurationBean.getWsasDebugPort();
+					if ((OS.indexOf(WSASCoreUIMessages.OS_WIN_9) > -1)
+							|| (OS.indexOf(WSASCoreUIMessages.OS_WIN_NT) > -1)
+							|| (OS.indexOf(WSASCoreUIMessages.OS_WIN_2000) > -1)
+							|| (OS.indexOf(WSASCoreUIMessages.OS_WIN_XP) > -1)) {
+						wsasProcess = runtime.exec(FileUtils.addNodesToPath(wsasInstallationLocation, 
+																			pathNodesStopWin) 
+																			+debugAppender);
+						wsasProcess.waitFor();
+					} else {
+						wsasProcess = runtime.exec(WSASCoreUIMessages.XTERM_EXEC + 
+							FileUtils.addNodesToPath(wsasInstallationLocation, pathNodesStopIx) 
+						              +debugAppender);
+					}
+				} catch (Exception e) {
+					e.printStackTrace();
+				}
+				
+				WSASConfigurationBean.setWSASAlreadyRunning(false);
+				
+		}
+		return status;
+	}
+
+}

Added: trunk/wsf/java/modules/eclipse-wtp-plugins/org.wso2.wsf.ide.wtp.ext/src/org/wso2/wsf/ide/wtp/ext/server/ui/WSASDebugDelegate.java
 ==============================================================================
--- (empty file)
+++ trunk/wsf/java/modules/eclipse-wtp-plugins/org.wso2.wsf.ide.wtp.ext/src/org/wso2/wsf/ide/wtp/ext/server/ui/WSASDebugDelegate.java	Wed \
Jul 25 03:58:57 2007 @@ -0,0 +1,111 @@
+/*
+ * Copyright 2005,2006 WSO2, Inc. http://www.wso2.org
+ *
+ * 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.
+ */
+package org.wso2.wsf.ide.wtp.ext.server.ui;
+
+import java.lang.reflect.InvocationTargetException;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.MessageBox;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.IWorkbenchWindowActionDelegate;
+import org.eclipse.ui.IWorkbenchWindowPulldownDelegate;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.actions.ActionDelegate;
+import org.wso2.wsf.ide.wtp.ext.server.bean.WSASConfigurationBean;
+import org.wso2.wsf.ide.wtp.ext.server.command.WSASDebugCommand;
+import org.wso2.wsf.ide.wtp.ext.server.command.WTPInternalBrowserCommand;
+import org.wso2.wsf.ide.wtp.ext.server.constant.WSASMessageConstant;
+import org.wso2.wsf.ide.wtp.ext.server.monitor.WSASUpMonitorThread;
+import org.wso2.wsf.ide.wtp.ext.server.util.WSASUtils;
+
+public class WSASDebugDelegate
+	extends ActionDelegate
+	implements IWorkbenchWindowPulldownDelegate {
+	
+	Shell shell = null;
+	
+    MessageBox box = new \
MessageBox(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell()); +    \
private IStatus status; +    private final long interval = 1000;
+	
+	/**
+	 * @see ActionDelegate#run(IAction)
+	 */
+	public void run(IAction action) {
+		//Init the Configuration Bean
+		WSASConfigurationBean.Init();
+		if (!WSASConfigurationBean.isWsasCorrectPathSet()) {
+			box.setMessage(WSASMessageConstant.WARNING_WSAS_PATH_NOT_SET);box.open();
+		}else{
+			try {
+				status = WSASDebugCommand.run();
+				if(status.getCode() == 11){
+					box.setMessage(status.getMessage());box.open();
+				}else{
+					WSASUpMonitorThread wsasMonitor = new WSASUpMonitorThread();
+					wsasMonitor.start();
+				}
+			} catch (InvocationTargetException e) {
+				status = new Status( IStatus.ERROR,"id",1,e.getMessage(),null );
+				box.setMessage(WSASMessageConstant.INFO_WSAS_START_FAIL+"Reason"+e.getMessage());box.open();
 +			}
+			System.setProperty("WSASStartStatus", "done");
+			while(!WSASConfigurationBean.isWsasStartStatus()){
+				try {
+					Thread.sleep(interval);
+				} catch (InterruptedException e) {
+					e.printStackTrace();
+				}
+			}
+			//Kill the WSAS Monitor Thread
+			WSASUpMonitorThread.setAlive(false);
+			if (!WSASConfigurationBean.isWSASAlreadyRunning()) {
+				box.setMessage(WSASMessageConstant.INFO_WSAS_START_SUCCESS);box.open();
+				//Pop up the browser with the url
+				WTPInternalBrowserCommand.popUpInrernalBrouwser(WSASUtils.getWSASHTTPSAddtess());
 +				shell.getParent().redraw();
+			}
+		}
+	}
+
+	/**
+	 * @see IWorkbenchWindowPulldownDelegate#getMenu(Control)
+	 */
+	public Menu getMenu(Control parent) {
+		return null;
+	}
+
+	/**
+	 * @see IWorkbenchWindowActionDelegate#dispose()
+	 */
+	public void dispose() {
+	}
+
+	/**
+	 * @see IWorkbenchWindowActionDelegate#init(IWorkbenchWindow)
+	 */	
+	public void init(IWorkbenchWindow window) {
+		shell = window.getShell();
+	}
+	
+
+}
+

Added: trunk/wsf/java/modules/eclipse-wtp-plugins/org.wso2.wsf.ide.wtp.ext/src/org/wso2/wsf/ide/wtp/ext/server/ui/WSASDebugMenuDelegate.java
 ==============================================================================
--- (empty file)
+++ trunk/wsf/java/modules/eclipse-wtp-plugins/org.wso2.wsf.ide.wtp.ext/src/org/wso2/wsf/ide/wtp/ext/server/ui/WSASDebugMenuDelegate.java	Wed \
Jul 25 03:58:57 2007 @@ -0,0 +1,109 @@
+/*
+ * Copyright 2005,2006 WSO2, Inc. http://www.wso2.org
+ *
+ * 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.
+ */
+package org.wso2.wsf.ide.wtp.ext.server.ui;
+
+import java.lang.reflect.InvocationTargetException;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.MessageBox;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.IWorkbenchWindowActionDelegate;
+import org.eclipse.ui.IWorkbenchWindowPulldownDelegate;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.actions.ActionDelegate;
+import org.wso2.wsf.ide.wtp.ext.server.bean.WSASConfigurationBean;
+import org.wso2.wsf.ide.wtp.ext.server.command.WSASDebugCommand;
+import org.wso2.wsf.ide.wtp.ext.server.command.WTPInternalBrowserCommand;
+import org.wso2.wsf.ide.wtp.ext.server.constant.WSASMessageConstant;
+import org.wso2.wsf.ide.wtp.ext.server.monitor.WSASUpMonitorThread;
+import org.wso2.wsf.ide.wtp.ext.server.util.WSASUtils;
+
+public class WSASDebugMenuDelegate
+	extends ActionDelegate
+	implements IWorkbenchWindowPulldownDelegate {
+
+    MessageBox box = new \
MessageBox(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell()); +    \
private IStatus status; +    private final long interval = 1000;
+    private Shell shell = null;
+    
+	/**
+	 * @see ActionDelegate#run(IAction)
+	 */
+	public void run(IAction action) {
+		//Init the Configuration Bean
+		WSASConfigurationBean.Init();
+		if (!WSASConfigurationBean.isWsasCorrectPathSet()) {
+			box.setMessage(WSASMessageConstant.WARNING_WSAS_PATH_NOT_SET);box.open();
+		}else{	
+			try {
+				status = WSASDebugCommand.run();
+				if(status.getCode() == 11){
+					box.setMessage(status.getMessage());box.open();
+				}else{
+					WSASUpMonitorThread wsasMonitor = new WSASUpMonitorThread();
+					wsasMonitor.start();
+				}
+			} catch (InvocationTargetException e) {
+				status = new Status( IStatus.ERROR,"id",1,e.getMessage(),null );
+				box.setMessage(WSASMessageConstant.INFO_WSAS_START_FAIL+"Reason"+e.getMessage());box.open();
 +			}
+			System.setProperty("WSASStartStatus", "done");
+			while(!WSASConfigurationBean.isWsasStartStatus()){
+				try {
+					Thread.sleep(interval);
+				} catch (InterruptedException e) {
+					e.printStackTrace();
+				}
+			}
+			//Kill the WSAS Monitor Thread
+			WSASUpMonitorThread.setAlive(false);
+			if (!WSASConfigurationBean.isWSASAlreadyRunning()) {
+				box.setMessage(WSASMessageConstant.INFO_WSAS_START_SUCCESS);box.open();
+				//Pop up the browser with the url
+				WTPInternalBrowserCommand.popUpInrernalBrouwser(WSASUtils.getWSASHTTPSAddtess());
 +				shell.getParent().redraw();
+			}
+		}
+	}
+
+	/**
+	 * @see IWorkbenchWindowPulldownDelegate#getMenu(Control)
+	 */
+	public Menu getMenu(Control parent) {
+		return null;
+	}
+
+	/**
+	 * @see IWorkbenchWindowActionDelegate#dispose()
+	 */
+	public void dispose() {
+	}
+
+	/**
+	 * @see IWorkbenchWindowActionDelegate#init(IWorkbenchWindow)
+	 */
+	public void init(IWorkbenchWindow window) {
+		shell = window.getShell();
+	}
+	
+}
+


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic