From scm-return-45570-apmail-geronimo-scm-archive=geronimo.apache.org@geronimo.apache.org Tue Feb 15 02:02:00 2011 Return-Path: Delivered-To: apmail-geronimo-scm-archive@www.apache.org Received: (qmail 45290 invoked from network); 15 Feb 2011 02:02:00 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 15 Feb 2011 02:02:00 -0000 Received: (qmail 16328 invoked by uid 500); 15 Feb 2011 02:02:00 -0000 Delivered-To: apmail-geronimo-scm-archive@geronimo.apache.org Received: (qmail 16246 invoked by uid 500); 15 Feb 2011 02:01:59 -0000 Mailing-List: contact scm-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list scm@geronimo.apache.org Received: (qmail 16239 invoked by uid 99); 15 Feb 2011 02:01:59 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Feb 2011 02:01:59 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Feb 2011 02:01:53 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 44F8523888CB; Tue, 15 Feb 2011 02:01:31 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1070749 - in /geronimo/devtools/eclipse-plugin/trunk/plugins: org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/commands/ org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/ org.apache.geronimo.st... Date: Tue, 15 Feb 2011 02:01:31 -0000 To: scm@geronimo.apache.org From: tkirby@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110215020131.44F8523888CB@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: tkirby Date: Tue Feb 15 02:01:30 2011 New Revision: 1070749 URL: http://svn.apache.org/viewvc?rev=1070749&view=rev Log: GERONIMODEVTOOLS-706 Enable Karaf shell in Eclipse console window Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetKarafShellCommand.java (with props) geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/sections/ServerEditorKarafShellSection.java (with props) Removed: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/commands/SetVMArgsCommand.java geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetVMArgsCommand.java Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServer.java geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerBehaviourDelegate.java geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerDelegate.java geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/plugin.xml geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetCleanOSGiBundleCacheCommand.java geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/internal/GeronimoLaunchConfigurationTabGroup.java geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/internal/Messages.java geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/internal/Messages.properties geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/sections/ServerEditorCleanOSGiBundleCacheSection.java geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/sections/ServerEditorLogLevelSection.java Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServer.java URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServer.java?rev=1070749&r1=1070748&r2=1070749&view=diff ============================================================================== --- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServer.java (original) +++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServer.java Tue Feb 15 02:01:30 2011 @@ -24,16 +24,13 @@ import javax.enterprise.deploy.spi.facto import org.apache.geronimo.deployment.plugin.factories.DeploymentFactoryImpl; import org.apache.geronimo.deployment.plugin.jmx.JMXDeploymentManager; -import org.apache.geronimo.st.v30.core.GeronimoRuntimeDelegate; -import org.apache.geronimo.st.v30.core.GeronimoServerDelegate; -import org.apache.geronimo.st.v30.core.IGeronimoVersionHandler; +import org.apache.geronimo.st.v30.core.internal.Trace; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.jdt.launching.IVMInstall; import org.eclipse.jdt.launching.JavaRuntime; import org.eclipse.jdt.launching.LibraryLocation; -import org.eclipse.wst.server.core.IModule; import org.eclipse.wst.server.core.util.SocketUtil; /** @@ -92,35 +89,73 @@ public class GeronimoServer extends Gero } } - String cp = System.getProperty("path.separator"); + StringBuilder args = new StringBuilder(); - //-javaagent:"GERONIMO_BASE/bin/jpa.jar" - String javaagent = ""; + // -javaagent:"GERONIMO_BASE/bin/jpa.jar" File agentJar = new File(runtimeLocation + "/lib/agent/transformer.jar"); if (agentJar.exists()) { - javaagent = "-javaagent:\"" + agentJar.getAbsolutePath() + "\""; + addParm(args, "-javaagent:\"", agentJar.getAbsolutePath(), "\""); } + String pS = System.getProperty("path.separator"); + //-Djava.ext.dirs="GERONIMO_BASE/lib/ext;JRE_HOME/lib/ext" - String javaExtDirs = "-Djava.ext.dirs=\"" + runtimeLocation + "/lib/ext" + cp + vmLibDir.append("ext").toOSString() + "\""; + addParm(args, "-Djava.ext.dirs=\"", runtimeLocation, "/lib/ext", pS, vmLibDir.append("ext").toOSString(), "\""); //-Djava.endorsed.dirs="GERONIMO_BASE/lib/endorsed;JRE_HOME/lib/endorsed" - String javaEndorsedDirs = "-Djava.endorsed.dirs=\"" + runtimeLocation + "/lib/endorsed" + cp + vmLibDir.append("endorsed").toOSString() + "\""; + addParm(args, "-Djava.endorsed.dirs=\"", runtimeLocation, "/lib/endorsed", pS, vmLibDir.append("endorsed").toOSString(), "\""); // Specify the minimum memory options for the Geronimo server - String memoryOpts = "-Xms256m -Xmx512m -XX:MaxPermSize=128m"; + addParm(args, "-Xms256m -Xmx512m -XX:MaxPermSize=128m"); // Specify GERONIMO_BASE - String homeDirectory = "-Dorg.apache.geronimo.home.dir=\"" + runtimeLocation + "\""; + addParm(args, "-Dorg.apache.geronimo.home.dir=\"", runtimeLocation, "\""); // Karaf arguments + addParm(args, getKarafShellArgs()); + addParm(args, "-Dkaraf.startRemoteShell=true"); String serverLocation = getServer().getRuntime().getLocation().toOSString(); - String karafArgs = "-Dkaraf.startLocalConsole=false -Dkaraf.startRemoteShell=true " + MessageFormat.format("-Dorg.apache.geronimo.home.dir=\"{0}\" -Dkaraf.home=\"{0}\" -Dkaraf.base=\"{0}\" -Djava.util.logging.config.file={0}/etc/java.util.logging.properties", serverLocation); + addParm(args, + MessageFormat + .format("-Dorg.apache.geronimo.home.dir=\"{0}\" -Dkaraf.home=\"{0}\" -Dkaraf.base=\"{0}\" -Djava.util.logging.config.file={0}/etc/java.util.logging.properties", + serverLocation)); - StringBuilder vmArgs = new StringBuilder(javaagent); - vmArgs.append(" ").append(javaExtDirs).append(" ").append(javaEndorsedDirs).append(" ").append(memoryOpts).append(" ").append(homeDirectory).append(" ").append(karafArgs); + String vmArgs = args.toString(); + + Trace.tracePoint("Exit", "GeronimoServer.getVMArgs", vmArgs); + + return vmArgs; + } + + void addParm(StringBuilder sb, Object... args) { + if (sb.length() > 0) { + sb.append(" "); + } + for (Object arg : args) { + sb.append(arg); + } + } + + + public String getProgramArgs() { + String superVMArgs = super.getProgramArgs(); + if (superVMArgs != null && superVMArgs.trim().length() > 0) { + return superVMArgs; + } + + StringBuilder args = new StringBuilder(); + + addParm(args, getConsoleLogLevel()); + + if (isCleanOSGiBundleCache()) { + addParm(args, getCleanOSGiBundleCacheArgs()); + } + + String programArgs = args.toString(); + + Trace.tracePoint("Exit", "GeronimoServer.getProgramArgs", programArgs); - return vmArgs.toString(); + return programArgs; } /* Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerBehaviourDelegate.java URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerBehaviourDelegate.java?rev=1070749&r1=1070748&r2=1070749&view=diff ============================================================================== --- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerBehaviourDelegate.java (original) +++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerBehaviourDelegate.java Tue Feb 15 02:01:30 2011 @@ -125,9 +125,11 @@ abstract public class GeronimoServerBeha GeronimoRuntimeDelegate runtime = getRuntimeDelegate(); IVMInstall vmInstall = runtime.getVMInstall(); - if (vmInstall != null) - wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_JRE_CONTAINER_PATH, JavaRuntime.newJREContainerPath(vmInstall).toPortableString()); - + if (vmInstall != null) { + wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_JRE_CONTAINER_PATH, + JavaRuntime.newJREContainerPath(vmInstall).toPortableString()); + } + String existingProgArgs = null; wc.setAttribute(ERROR_SETUP_LAUNCH_CONFIGURATION, (String)null); @@ -143,62 +145,23 @@ abstract public class GeronimoServerBeha // exactly what we want the GEP user to see. wc.setAttribute(ERROR_SETUP_LAUNCH_CONFIGURATION, e.getMessage()); } - String serverProgramArgs = getServerProgramArgs(existingProgArgs, getServerDelegate()); + GeronimoServerDelegate gsd = getServerDelegate(); + String programArgs = gsd.getProgramArgs(); + Trace.tracePoint("GeronimoServerBehaviourDelegate.v30", "setupLaunchConfiguration serverProgramArgs", programArgs); + wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, programArgs); + + /* + programArgs = getServerProgramArgs(existingProgArgs, getServerDelegate()); Trace.tracePoint("GeronimoServerBehaviourDelegate.v30", "setupLaunchConfiguration serverProgramArgs", - serverProgramArgs); - wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, serverProgramArgs); + programArgs); + wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, programArgs); + */ - String vmArgs = getServerDelegate().getVMArgs(); + String vmArgs = gsd.getVMArgs(); Trace.tracePoint("GeronimoServerBehaviourDelegate.v30", "setupLaunchConfiguration serverVMArgs", vmArgs); wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS, vmArgs); } - /** - * remove args no longer specified, add newly specified args, and only specify them once. - * @param existingProgArgs - * @param serverDelegate - * @return - */ - private String getServerProgramArgs(String existingProgArgs, GeronimoServerDelegate serverDelegate) { - Set parmsSet = serverDelegate.getProgramArgs(); - Set parmsNotSet = serverDelegate.getProgramArgsNotSet(); - Set parmsSeen = new HashSet(parmsSet.size()); - List parms; - if (existingProgArgs == null) { - parms = new ArrayList(parmsSet.size()); - } else { - parms = new ArrayList(Arrays.asList(existingProgArgs.split("\\s+"))); - } - // remove notSet and duplicate set paramaters from the list - for(ListIterator iterator = parms.listIterator(); iterator.hasNext();) { - String parm = iterator.next(); - if (parmsNotSet.contains(parm) || parmsSeen.contains(parm)) { - iterator.remove(); - continue; - } - if (parmsSet.contains(parm)) { - parmsSet.remove(parm); - parmsSeen.add(parm); - } - } - StringBuffer sb = new StringBuffer(); - // add new parms to front - for (String parm : parmsSet) { - if (sb.length() > 0) { - sb.append(" "); - } - sb.append(parm); - } - // valid existing parms - for (String parm : parms) { - if (sb.length() > 0) { - sb.append(" "); - } - sb.append(parm); - } - return sb.toString(); - } - /** * @param launch Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerDelegate.java URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerDelegate.java?rev=1070749&r1=1070748&r2=1070749&view=diff ============================================================================== --- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerDelegate.java (original) +++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerDelegate.java Tue Feb 15 02:01:30 2011 @@ -19,16 +19,19 @@ package org.apache.geronimo.st.v30.core; import java.io.IOException; import java.net.URL; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; import java.util.List; +import java.util.ListIterator; import java.util.Map; import java.util.Set; import java.util.jar.Attributes; import java.util.jar.JarFile; import java.util.jar.Manifest; +import java.util.regex.Matcher; +import java.util.regex.Pattern; -import org.apache.geronimo.st.v30.core.GeronimoUtils; import org.apache.geronimo.st.v30.core.internal.Trace; import org.apache.geronimo.st.v30.core.osgi.AriesHelper; import org.apache.geronimo.st.v30.core.osgi.OsgiConstants; @@ -75,6 +78,10 @@ abstract public class GeronimoServerDele public static final String PROPERTY_LOG_LEVEL = "logLevel"; + public static final String PROPERTY_KARAF_SHELL = "karafShell"; + + public static final String PROPERTY_PROGRAM_ARGS = "ProgramArgs"; + public static final String PROPERTY_VM_ARGS = "VMArgs"; public static final String PROPERTY_PING_DELAY = "pingDelay"; @@ -100,6 +107,15 @@ abstract public class GeronimoServerDele public static final String CONSOLE_DEBUG = "-vv"; public static final String CLEAN_OSGI_BUNDLE_CACHE = "--clean"; + + public static final String DISABLE_KARAF_SHELL = "-Dkaraf.startLocalConsole=false"; + + public static final String ENABLE_KARAF_SHELL = "-Dkaraf.startLocalConsole=true"; + + // required to avoid error start, and work nicely on windows, when Karaf shell is enabled. + public static final String JLINE_UNSUPPORTED_TERMINAL = "-Djline.terminal=jline.UnsupportedTerminal"; + + private boolean suspendArgUpdates; /** * Determines whether the specified module modifications can be made to the server at this time @@ -321,12 +337,15 @@ abstract public class GeronimoServerDele * @see org.eclipse.wst.server.core.model.ServerDelegate#setDefaults(org.eclipse.core.runtime.IProgressMonitor) */ public void setDefaults(IProgressMonitor monitor) { + Trace.tracePoint("Entry", "GeronimoServerDelegate.setDefaults", monitor); + suspendArgUpdates(); setAdminID("system"); setAdminPassword("manager"); setHTTPPort("8080"); setRMINamingPort("1099"); setConsoleLogLevel(CONSOLE_INFO); - setCleanOSGiBundleCache(""); + setCleanOSGiBundleCache(false); + setKarafShell(false); setPingDelay(new Integer(10000)); setMaxPings(new Integer(40)); setPingInterval(new Integer(5000)); @@ -334,8 +353,18 @@ abstract public class GeronimoServerDele setInPlaceSharedLib(false); setRunFromWorkspace(false); setSelectClasspathContainers(false); + resumeArgUpdates(); + Trace.tracePoint("Exit", "GeronimoServerDelegate.setDefaults", monitor); } + + + @Override + public void saveConfiguration(IProgressMonitor monitor) throws CoreException { + Trace.tracePoint("Enter", "GeronimoServerDelegate.saveConfiguration", monitor); + super.saveConfiguration(monitor); + Trace.tracePoint("Leave", "GeronimoServerDelegate.saveConfiguration", monitor); + } // // PROPERTY_ADMIN_ID @@ -389,23 +418,260 @@ abstract public class GeronimoServerDele } public void setConsoleLogLevel(String value) { setInstanceProperty(PROPERTY_LOG_LEVEL, value); + updateProgramArgsFromProperties(); + } + + + // + // CLEAR_OSGI_BUNDLE_CACHE + // + public boolean isCleanOSGiBundleCache() { + String enable = getInstanceProperty(PROPERTY_CLEAN_OSGI_BUNDLE_CACHE); + return Boolean.valueOf(enable); + } + + public void setCleanOSGiBundleCache(boolean value) { + setInstanceProperty(PROPERTY_CLEAN_OSGI_BUNDLE_CACHE, Boolean.toString(value)); + updateProgramArgsFromProperties(); } - public String getCleanOSGiBundleCache() { - return getInstanceProperty(PROPERTY_CLEAN_OSGI_BUNDLE_CACHE); + /** + * remove args no longer specified, add newly specified args, and only specify them once. + */ + private void updateProgramArgsFromProperties() { + if (isSuspendArgUpdates()) { + return; + } + Set parmsSet = getProgramArgsSet(); + Set parmsNotSet = getProgramArgsNotSet(); + String existingProgArgs = getProgramArgs(); + + String programArgs = updateProgramArgsFromProperties(existingProgArgs, parmsSet, parmsNotSet); + + Trace.tracePoint("Exit", "GeronimoServerDelegate.updateProgramArgsFromProperties", programArgs); + + setProgramArgs(programArgs); } + + + /** + * remove args no longer specified, add newly specified args, and only specify them once. + */ + private void updateVMArgsFromProperties() { + if (isSuspendArgUpdates()) { + return; + } + Set parmsSet = getVMArgsSet(); + Set parmsNotSet = getVMArgsNotSet(); + String existingVMArgs = getVMArgs(); + + String vmArgs = updateVMArgsFromProperties(existingVMArgs, parmsSet, parmsNotSet); + + Trace.tracePoint("Exit", "GeronimoServerDelegate.updateVMArgsFromProperties", vmArgs); - public void setCleanOSGiBundleCache(String value) { - setInstanceProperty(PROPERTY_CLEAN_OSGI_BUNDLE_CACHE, value); + setVMArgs(vmArgs); } - public Set getProgramArgs() { + private String updateProgramArgsFromProperties(String existingProgramArgs, Set parmsSet, Set parmsNotSet) { + Set parmsSeen = new HashSet(parmsSet.size()); + List parms; + if (existingProgramArgs == null) { + parms = new ArrayList(parmsSet.size()); + } else { + parms = new ArrayList(Arrays.asList(existingProgramArgs.split("\\s+"))); + } + // remove notSet and duplicate set parameters from the list + for (ListIterator iterator = parms.listIterator(); iterator.hasNext();) { + String parm = iterator.next(); + if (parmsNotSet.contains(parm) || parmsSeen.contains(parm)) { + iterator.remove(); + continue; + } + if (parmsSet.contains(parm)) { + parmsSet.remove(parm); + parmsSeen.add(parm); + } + } + StringBuilder sb = new StringBuilder(); + // add new parms to front + for (String parm : parmsSet) { + addParm(sb, parm); + } + // valid existing parms + for (String parm : parms) { + addParm(sb, parm); + } + return sb.toString(); + } + + public void updatePropertiesFromProgramArgs(String existingProgramArgs) { + boolean cleanOSGiCache = false; + boolean infoConsole = false; + boolean debugConsole = false; + List parms; + if (existingProgramArgs == null) { + parms = new ArrayList(0); + } else { + parms = new ArrayList(Arrays.asList(existingProgramArgs.split("\\s+"))); + } + for (String parm : parms) { + if (parm.equals(CLEAN_OSGI_BUNDLE_CACHE)) { + cleanOSGiCache = true; + } + if (parm.equals(CONSOLE_DEBUG)) { + debugConsole = true; + } + if (parm.equals(CONSOLE_INFO)) { + infoConsole = true; + } + } + suspendArgUpdates(); + setCleanOSGiBundleCache(cleanOSGiCache); + if (debugConsole) { + setConsoleLogLevel(CONSOLE_DEBUG); + } else { + if (infoConsole) { + setConsoleLogLevel(CONSOLE_INFO); + } else { + setConsoleLogLevel(""); + } + } + resumeArgUpdates(); + } + + private void suspendArgUpdates() { + suspendArgUpdates = true; + } + + private void resumeArgUpdates() { + suspendArgUpdates = false; + } + + private boolean isSuspendArgUpdates() { + return suspendArgUpdates; + } + + /** + * A parameter. can include spaces inside single or double quotes. + */ + static final Pattern PARAMETER_PATTERN = Pattern.compile("(?:\"[^\"]*\"|'[^']*'|\\S)+"); + + private String updateVMArgsFromProperties(String existingVMArgs, Set parmsSet, Set parmsNotSet) { + Set parmsSeen = new HashSet(parmsSet.size()); + List parms = new ArrayList(parmsSet.size()); + int lastSystemPropertyFoundIndex = -1; + if (existingVMArgs == null) { + // TODO could be a problem + } else { + // deal with quoted parms that may contain spaces + // the regex for a parameter is: (?:"[^"]*"|'[^']*'|\S)+ + // TODO what if there is an unmatched quote?? + Matcher matcher = PARAMETER_PATTERN.matcher(existingVMArgs); + while (matcher.find()) { + String parm = matcher.group(); + if (parmsNotSet.contains(parm) || parmsSeen.contains(parm)) { + // ignore this parm + continue; + } + parms.add(parm); + if (parm.startsWith("-D")) { + lastSystemPropertyFoundIndex = parms.size(); + } + if (parmsSet.contains(parm)) { + parmsSet.remove(parm); + parmsSeen.add(parm); + } + } + } + if (lastSystemPropertyFoundIndex < 0) { + lastSystemPropertyFoundIndex = parms.size(); + } + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < parms.size(); i++) { + addParm(sb, parms.get(i)); + if (i > lastSystemPropertyFoundIndex) { + // add new parms here after last -D parm + for (String parm : parmsSet) { + addParm(sb, parm); + } + lastSystemPropertyFoundIndex = -1; + } + } + if (lastSystemPropertyFoundIndex >= 0) { + // add new parms to end + for (String parm : parmsSet) { + addParm(sb, parm); + } + } + return sb.toString(); + } + + public void updatePropertiesFromVMArgs(String existingVMArgs) { + boolean karafShell = false; + if (existingVMArgs == null) { + // TODO could be a problem + } else { + // deal with quoted parms that may contain spaces + // the regex for a parameter is: (?:\S|"[^"]*"|'[^']*')+ + // TODO what if there is an umatched quote?? + Matcher matcher = PARAMETER_PATTERN.matcher(existingVMArgs); + while (matcher.find()) { + String parm = matcher.group(); + if (parm.equals(ENABLE_KARAF_SHELL)) { + karafShell = true; + } + } + } + suspendArgUpdates(); + setKarafShell(karafShell); + resumeArgUpdates(); + } + + private void addParm(StringBuilder sb, String parm) { + if (sb.length() > 0) { + sb.append(" "); + } + sb.append(parm); + } + + public String getCleanOSGiBundleCacheArgs() { + return isCleanOSGiBundleCache() ? CLEAN_OSGI_BUNDLE_CACHE : ""; + } + + + + // + // PROPERTY_KARAF_SHELL + // + public boolean isKarafShell() { + return getAttribute(PROPERTY_KARAF_SHELL, false); + } + public void setKarafShell(boolean enable) { + setAttribute(PROPERTY_KARAF_SHELL, enable); + updateVMArgsFromProperties(); + } + + public List getKarafShellArgs(boolean enable) { + if (enable) + return Arrays.asList(ENABLE_KARAF_SHELL, JLINE_UNSUPPORTED_TERMINAL); + else + return Arrays.asList(DISABLE_KARAF_SHELL); + } + + public String getKarafShellArgs() { + StringBuilder sb = new StringBuilder(); + for (String parm : getKarafShellArgs(isKarafShell())) { + addParm(sb, parm); + } + return sb.toString(); + } + + public Set getProgramArgsSet() { Set parms = new HashSet(2); parms.add(getConsoleLogLevel()); - String clean = getCleanOSGiBundleCache(); - if (clean.length() > 0) { - parms.add(clean); + if (isCleanOSGiBundleCache()) { + parms.add(CLEAN_OSGI_BUNDLE_CACHE); } return parms; } @@ -418,8 +684,8 @@ abstract public class GeronimoServerDele } else { notParms.add(CONSOLE_INFO); } - String clean = getCleanOSGiBundleCache(); - if (clean.equals("")) { + if (isCleanOSGiBundleCache()) { + } else { notParms.add(CLEAN_OSGI_BUNDLE_CACHE); } return notParms; @@ -432,8 +698,40 @@ abstract public class GeronimoServerDele return getInstanceProperty(PROPERTY_VM_ARGS); } public void setVMArgs(String value) { + Trace.tracePoint("Entry", "GeronimoServerDelegate.getVMArgs", value); setInstanceProperty(PROPERTY_VM_ARGS, value); } + + public Set getVMArgsSet() { + boolean karafShell = isKarafShell(); + List parmStrings = getKarafShellArgs(karafShell); + Set parms = new HashSet(parmStrings.size()); + for (String parm : parmStrings) { + parms.add(parm); + } + return parms; + } + + public Set getVMArgsNotSet() { + boolean karafShell = isKarafShell(); + List parmStrings = getKarafShellArgs(!karafShell); + Set notParms = new HashSet(parmStrings.size()); + for (String parm : parmStrings) { + notParms.add(parm); + } + return notParms; + } + + // + // PROPERTY_PROGRAM_ARGS + // + public String getProgramArgs() { + return getInstanceProperty(PROPERTY_PROGRAM_ARGS); + } + public void setProgramArgs(String value) { + Trace.tracePoint("Entry", "GeronimoServerDelegate.getProgramArgs", value); + setInstanceProperty(PROPERTY_PROGRAM_ARGS, value); + } // @@ -558,7 +856,15 @@ abstract public class GeronimoServerDele public void setInstanceProperty(String name, String value) { Map map = getServerInstanceProperties(); map.put(name, value); - setServerInstanceProperties(map); + try { + setServerInstanceProperties(map); + } catch (Exception e) { + // TODO WTF? Need to figure out why this fails... seems to fail before setDefaults is called. + Trace.trace(Trace.INFO, "GeronimoServerDelegate.setInstanceProperty(name = " + name + ", value = " + value + + " )", e); + int a = 1; + a++; + } } public Map getServerInstanceProperties() { Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/plugin.xml URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/plugin.xml?rev=1070749&r1=1070748&r2=1070749&view=diff ============================================================================== --- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/plugin.xml (original) +++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/plugin.xml Tue Feb 15 02:01:30 2011 @@ -150,7 +150,15 @@ -
+
+
+ + +
Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetCleanOSGiBundleCacheCommand.java URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetCleanOSGiBundleCacheCommand.java?rev=1070749&r1=1070748&r2=1070749&view=diff ============================================================================== --- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetCleanOSGiBundleCacheCommand.java (original) +++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetCleanOSGiBundleCacheCommand.java Tue Feb 15 02:01:30 2011 @@ -25,15 +25,15 @@ import org.eclipse.wst.server.core.IServ */ public class SetCleanOSGiBundleCacheCommand extends ServerCommand { - String value; + boolean value; - String oldValue; + boolean oldValue; /** * @param server * @param name */ - public SetCleanOSGiBundleCacheCommand(IServerWorkingCopy server, String value) { + public SetCleanOSGiBundleCacheCommand(IServerWorkingCopy server, boolean value) { super(server, "SetCleanOSGiBundleCacheCommand"); this.value = value; } @@ -45,7 +45,7 @@ public class SetCleanOSGiBundleCacheComm */ public void execute() { GeronimoServerDelegate gs = getGeronimoServer(); - oldValue = gs.getCleanOSGiBundleCache(); + oldValue = gs.isCleanOSGiBundleCache(); gs.setCleanOSGiBundleCache(value); } Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetKarafShellCommand.java URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetKarafShellCommand.java?rev=1070749&view=auto ============================================================================== --- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetKarafShellCommand.java (added) +++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetKarafShellCommand.java Tue Feb 15 02:01:30 2011 @@ -0,0 +1,61 @@ +/* + * 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.geronimo.st.v30.ui.commands; + +import org.apache.geronimo.st.v30.core.GeronimoServerDelegate; +import org.eclipse.wst.server.core.IServerWorkingCopy; + +/** + * @version $Rev$ $Date$ + */ +public class SetKarafShellCommand extends ServerCommand { + + boolean value; + + boolean oldValue; + + /** + * @param server + * @param name + */ + public SetKarafShellCommand(IServerWorkingCopy server, boolean value) { + super(server, "SetKarafShellCommand"); + this.value = value; + } + + /* + * (non-Javadoc) + * + * @see org.apache.geronimo.st.v30.ui.commands.ServerCommand#execute() + */ + public void execute() { + GeronimoServerDelegate gs = (GeronimoServerDelegate) server.getAdapter(GeronimoServerDelegate.class); + oldValue = gs.isKarafShell(); + gs.setKarafShell(value); + } + + /* + * (non-Javadoc) + * + * @see org.apache.geronimo.st.v30.ui.commands.ServerCommand#undo() + */ + public void undo() { + GeronimoServerDelegate gs = (GeronimoServerDelegate) server.getAdapter(GeronimoServerDelegate.class); + gs.setKarafShell(oldValue); + } + +} Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetKarafShellCommand.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetKarafShellCommand.java ------------------------------------------------------------------------------ svn:keywords = Rev Date Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/internal/GeronimoLaunchConfigurationTabGroup.java URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/internal/GeronimoLaunchConfigurationTabGroup.java?rev=1070749&r1=1070748&r2=1070749&view=diff ============================================================================== --- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/internal/GeronimoLaunchConfigurationTabGroup.java (original) +++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/internal/GeronimoLaunchConfigurationTabGroup.java Tue Feb 15 02:01:30 2011 @@ -69,9 +69,16 @@ public class GeronimoLaunchConfiguration IServer server = ServerUtil.getServer(configuration); GeronimoServerDelegate sd = (GeronimoServerDelegate) server.getAdapter(GeronimoServerDelegate.class); - String oldValue = sd.getVMArgs(); - String newValue = configuration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS, oldValue); + + String oldValue = sd.getProgramArgs(); + String newValue = configuration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, oldValue); + sd.setProgramArgs(newValue); + //sd.updatePropertiesFromProgramArgs(newValue); + + oldValue = sd.getVMArgs(); + newValue = configuration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS, oldValue); sd.setVMArgs(newValue); + //sd.updatePropertiesFromVMArgs(newValue); } catch (CoreException e) { MessageDialog.openError(Display.getCurrent().getActiveShell(),"Error", e.getMessage()); Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/internal/Messages.java URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/internal/Messages.java?rev=1070749&r1=1070748&r2=1070749&view=diff ============================================================================== --- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/internal/Messages.java (original) +++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/internal/Messages.java Tue Feb 15 02:01:30 2011 @@ -46,6 +46,10 @@ public class Messages extends NLS { public static String editorSectionCleanOSGiBundleCacheTitle; public static String editorSectionCleanOSGiBundleCacheDescription; public static String cleanOSGiBundleCache; + + public static String editorSectionKarafShellTitle; + public static String editorSectionKarafShellDescription; + public static String enableKarafShell; public static String editorSectionTestEnvTitle; public static String editorSectionTestEnvDescription; Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/internal/Messages.properties URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/internal/Messages.properties?rev=1070749&r1=1070748&r2=1070749&view=diff ============================================================================== --- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/internal/Messages.properties (original) +++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/internal/Messages.properties Tue Feb 15 02:01:30 2011 @@ -94,6 +94,10 @@ editorSectionCleanOSGiBundleCacheTitle=C editorSectionCleanOSGiBundleCacheDescription=Select whether to clean the OSGi bundle cache. cleanOSGiBundleCache=Clean OSGi bundle cache. +editorSectionKarafShellTitle=Karaf shell in Eclipse console +editorSectionKarafShellDescription=Select whether to enable the Karaf shell in Eclipse console window. +enableKarafShell=Enable. + editorSectionVMArgsTitle=Server VM Arguments editorSectionVMArgsDescription=Specify the Java VM Arguments to be provided on server startup. Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/sections/ServerEditorCleanOSGiBundleCacheSection.java URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/sections/ServerEditorCleanOSGiBundleCacheSection.java?rev=1070749&r1=1070748&r2=1070749&view=diff ============================================================================== --- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/sections/ServerEditorCleanOSGiBundleCacheSection.java (original) +++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/sections/ServerEditorCleanOSGiBundleCacheSection.java Tue Feb 15 02:01:30 2011 @@ -68,16 +68,15 @@ public class ServerEditorCleanOSGiBundle cleanOGSiBundelCache = toolkit.createButton(composite, Messages.cleanOSGiBundleCache, SWT.CHECK); - String currentValue = ((GeronimoServerDelegate) server.getAdapter(GeronimoServerDelegate.class)) - .getCleanOSGiBundleCache(); - cleanOGSiBundelCache.setSelection(GeronimoServerDelegate.CLEAN_OSGI_BUNDLE_CACHE.equals(currentValue)); + GeronimoServerDelegate gsd = (GeronimoServerDelegate) server.getAdapter(GeronimoServerDelegate.class); + + boolean cleanCache = gsd.isCleanOSGiBundleCache(); + cleanOGSiBundelCache.setSelection(cleanCache); cleanOGSiBundelCache.addSelectionListener(new SelectionListener() { public void widgetSelected(SelectionEvent e) { - String value = cleanOGSiBundelCache.getSelection() ? GeronimoServerDelegate.CLEAN_OSGI_BUNDLE_CACHE - : ""; - execute(new SetCleanOSGiBundleCacheCommand(server, value)); + execute(new SetCleanOSGiBundleCacheCommand(server, cleanOGSiBundelCache.getSelection())); } public void widgetDefaultSelected(SelectionEvent e) { Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/sections/ServerEditorKarafShellSection.java URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/sections/ServerEditorKarafShellSection.java?rev=1070749&view=auto ============================================================================== --- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/sections/ServerEditorKarafShellSection.java (added) +++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/sections/ServerEditorKarafShellSection.java Tue Feb 15 02:01:30 2011 @@ -0,0 +1,87 @@ +/* + * 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.geronimo.st.v30.ui.sections; + +import org.apache.geronimo.st.v30.core.GeronimoServerDelegate; +import org.apache.geronimo.st.v30.ui.commands.SetKarafShellCommand; +import org.apache.geronimo.st.v30.ui.internal.Messages; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.SelectionListener; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.ui.forms.widgets.ExpandableComposite; +import org.eclipse.ui.forms.widgets.FormToolkit; +import org.eclipse.ui.forms.widgets.Section; + +/** + * @version $Rev$ $Date$ + */ +public class ServerEditorKarafShellSection extends AbstractServerEditorSection { + + Button enable; + + public ServerEditorKarafShellSection() { + super(); + } + + public void createSection(Composite parent) { + super.createSection(parent); + + FormToolkit toolkit = getFormToolkit(parent.getDisplay()); + + Section section = toolkit.createSection(parent, ExpandableComposite.TWISTIE + | ExpandableComposite.EXPANDED + | ExpandableComposite.TITLE_BAR + | Section.DESCRIPTION | ExpandableComposite.FOCUS_TITLE); + + section.setText(Messages.editorSectionKarafShellTitle); + section.setDescription(Messages.editorSectionKarafShellDescription); + section.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false)); + + Composite composite = toolkit.createComposite(section); + GridLayout layout = new GridLayout(); + layout.numColumns = 1; + layout.marginHeight = 5; + layout.marginWidth = 10; + layout.verticalSpacing = 5; + layout.horizontalSpacing = 15; + composite.setLayout(layout); + composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); + section.setClient(composite); + + enable = toolkit.createButton(composite, Messages.enableKarafShell, SWT.CHECK); + + GeronimoServerDelegate gsd = (GeronimoServerDelegate) server.getAdapter(GeronimoServerDelegate.class); + + boolean karafShell = gsd.isKarafShell(); + enable.setSelection(karafShell); + + enable.addSelectionListener(new SelectionListener() { + + public void widgetSelected(SelectionEvent e) { + execute(new SetKarafShellCommand(server, enable.getSelection())); + } + + public void widgetDefaultSelected(SelectionEvent e) { + } + + }); + } +} Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/sections/ServerEditorKarafShellSection.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/sections/ServerEditorKarafShellSection.java ------------------------------------------------------------------------------ svn:keywords = Date Rev Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/sections/ServerEditorLogLevelSection.java URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/sections/ServerEditorLogLevelSection.java?rev=1070749&r1=1070748&r2=1070749&view=diff ============================================================================== --- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/sections/ServerEditorLogLevelSection.java (original) +++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/sections/ServerEditorLogLevelSection.java Tue Feb 15 02:01:30 2011 @@ -71,12 +71,12 @@ public class ServerEditorLogLevelSection info = toolkit.createButton(composite, Messages.info, SWT.RADIO); debug = toolkit.createButton(composite, Messages.debug, SWT.RADIO); - String currentValue = ((GeronimoServerDelegate)server.getAdapter(GeronimoServerDelegate.class)).getConsoleLogLevel(); - if(GeronimoServerDelegate.CONSOLE_DEBUG.equals(currentValue)) { - debug.setSelection(true); - } else { - info.setSelection(true); - } + String currentValue = ((GeronimoServerDelegate) server.getAdapter(GeronimoServerDelegate.class)) + .getConsoleLogLevel(); + + debug.setSelection(GeronimoServerDelegate.CONSOLE_DEBUG.equals(currentValue)); + + info.setSelection(GeronimoServerDelegate.CONSOLE_INFO.equals(currentValue)); info.addSelectionListener(new SelectionListener() {