JBoss Tools SVN: r36314 - workspace/snjeza.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2011-11-11 19:58:17 -0500 (Fri, 11 Nov 2011)
New Revision: 36314
Added:
workspace/snjeza/swt.win64.patch/
Log:
create folder for fixing JBDS-1648
13 years, 2 months
JBoss Tools SVN: r36313 - trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2011-11-11 19:46:30 -0500 (Fri, 11 Nov 2011)
New Revision: 36313
Modified:
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/FileUtil.java
Log:
https://issues.jboss.org/browse/JBIDE-10137 Close input and output stream in all places where it used
Modified: trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/FileUtil.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/FileUtil.java 2011-11-12 00:45:29 UTC (rev 36312)
+++ trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/FileUtil.java 2011-11-12 00:46:30 UTC (rev 36313)
@@ -13,7 +13,6 @@
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
-import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileFilter;
import java.io.FileInputStream;
@@ -23,7 +22,6 @@
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
-import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
@@ -184,9 +182,14 @@
if(l < 0) break;
sb.append(new String(b, 0, l));
}
- is.close();
} catch (IOException e) {
CommonPlugin.getPluginLog().logError(e);
+ } finally {
+ try {
+ is.close();
+ } catch (IOException e) {
+ // Ignore
+ }
}
return sb.toString();
}
@@ -222,10 +225,16 @@
if(l < 0) break;
sb.append(new String(b, 0, l, charset));
}
- is.close();
} catch (IOException e) {
CommonPlugin.getPluginLog().logError(e);
+ } finally {
+ try {
+ is.close();
+ } catch (IOException e) {
+ // Ignore
+ }
}
+
return sb.toString();
}
13 years, 2 months
JBoss Tools SVN: r36312 - in trunk/jsf/plugins/org.jboss.tools.jsf: src/org/jboss/tools/jsf/jsf2/model and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2011-11-11 19:45:29 -0500 (Fri, 11 Nov 2011)
New Revision: 36312
Removed:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/JSF2ComponentsValidator.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/JSF2SourceValidator.java
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf/plugin.xml
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/model/JSF2ComponentModelManager.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/project/JSF2Util.java
Log:
https://issues.jboss.org/browse/JBIDE-10137 Close input and output stream in all places where it used
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/plugin.xml
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/plugin.xml 2011-11-12 00:17:34 UTC (rev 36311)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/plugin.xml 2011-11-12 00:45:29 UTC (rev 36312)
@@ -545,207 +545,8 @@
<adapter type="org.eclipse.core.resources.IProject"/>
</factory>
</extension>
- <!--extension
- id="jsf2"
- name="%JSF2_ComponentsValidator.name"
- point="org.eclipse.wst.validation.validatorV2">
- <validator
- build="true"
- class="org.jboss.tools.jsf.web.validation.jsf2.JSF2ComponentsValidator"
- manual="true"
- markerId="org.jboss.tools.jsf.jsf2problemmarker"
- sourceid="org.eclipse.wst.xml.ui.internal.validation.DelegatingSourceValidatorForXML"
- version="4">
- <include>
- <rules>
- <contentType
- id="org.eclipse.wst.html.core.htmlsource">
- </contentType>
- <contentType
- id="org.eclipse.jst.jsp.core.jspfragmentsource">
- </contentType>
- <contentType
- id="org.eclipse.jst.jsp.core.tagsource">
- </contentType>
- <fileext
- caseSensitive="false"
- ext="xhtml">
- </fileext>
- <fileext
- caseSensitive="false"
- ext="jsp">
- </fileext>
- <contentType
- id="org.eclipse.jst.jsp.core.jspsource">
- </contentType>
- <contentType
- id="org.jboss.tools.jst.jsp.jspincludesource">
- </contentType>
- </rules>
- </include>
- </validator>
- </extension>
- <extension
- point="org.eclipse.ui.ide.markerResolution">
- <markerResolutionGenerator
- class="org.jboss.tools.jsf.web.validation.jsf2.action.JSF2ComponentResolutionGenerator"
- markerType="org.jboss.tools.jsf.jsf2problemmarker">
- </markerResolutionGenerator>
- </extension>
-
- <extension
- id="jsf2problemmarker"
- name="%JSF2ProblemName"
- point="org.eclipse.core.resources.markers">
- <super
- type="org.eclipse.core.resources.problemmarker">
- </super>
- <persistent
- value="true">
- </persistent>
- <attribute
- name="problemType">
- </attribute>
- <attribute
- name="baseElement">
- </attribute>
- <super
- type="org.eclipse.core.resources.textmarker">
- </super>
- </extension -->
-
- <!--extension
- point="org.eclipse.wst.sse.ui.sourcevalidation">
- <validator
- class="org.jboss.tools.jsf.web.validation.jsf2.JSF2SourceValidator"
- id="org.jboss.tools.jsf.jsf2sourcevalidator"
- scope="total">
- <contentTypeIdentifier
- id="jsf.facelet">
- <partitionType id="org.eclipse.wst.html.HTML_DEFAULT"/>
- </contentTypeIdentifier>
- <contentTypeIdentifier
- id="org.eclipse.wst.html.core.htmlsource">
- <partitionType id="org.eclipse.wst.html.HTML_DEFAULT"/>
- </contentTypeIdentifier>
- <contentTypeIdentifier
- id="org.eclipse.jst.jsp.core.jspsource">
- <partitionType id="org.eclipse.jst.jsp.DEFAULT_JSP"/>
- </contentTypeIdentifier>
- <contentTypeIdentifier
- id="org.jboss.tools.jst.jsp.jspincludesource">
- <partitionType id="org.eclipse.jst.jsp.DEFAULT_JSP"/>
- </contentTypeIdentifier>
- </validator>
- </extension-->
-<!--
- <extension
- point="org.eclipse.ui.ide.markerResolution">
- <markerResolutionGenerator
- class="org.jboss.tools.jsf.web.validation.i18n.I18nMarkerResolutionGenerator"
- markerType="org.jboss.tools.jsf.i18nproblemmarker">
- </markerResolutionGenerator>
- </extension>
-
- <extension
- id="i18nproblemmarker"
- name="%i18nProblemName"
- point="org.eclipse.core.resources.markers">
- <super
- type="org.eclipse.core.resources.problemmarker">
- </super>
- <persistent
- value="true">
- </persistent>
- <attribute
- name="problemType">
- </attribute>
- <attribute
- name="baseElement">
- </attribute>
- <super
- type="org.eclipse.core.resources.textmarker">
- </super>
- </extension>
-
<extension
- point="org.eclipse.wst.sse.ui.sourcevalidation">
- <validator
- class="org.jboss.tools.jsf.web.validation.i18n.I18nValidator"
- id="org.jboss.tools.jsf.externalize.source.validator"
- scope="total">
- <contentTypeIdentifier
- id="jsf.facelet">
- <partitionType id="org.eclipse.wst.html.HTML_DEFAULT"/>
- </contentTypeIdentifier>
- <contentTypeIdentifier
- id="org.eclipse.wst.html.core.htmlsource">
- <partitionType
- id="org.eclipse.wst.html.HTML_DEFAULT"/>
- </contentTypeIdentifier>
- <contentTypeIdentifier
- id="org.eclipse.jst.jsp.core.jspsource">
- <partitionType
- id="org.eclipse.wst.html.HTML_DEFAULT"/>
- </contentTypeIdentifier>
- <contentTypeIdentifier
- id="org.jboss.tools.jst.jsp.jspincludesource">
- <partitionType
- id="org.eclipse.wst.html.HTML_DEFAULT"/>
- </contentTypeIdentifier>
- </validator>
- </extension>
-
- <extension
- id="i18n"
- name="%I18nValidator.name"
- point="org.eclipse.wst.validation.validatorV2">
- <validator
- build="true"
- class="org.jboss.tools.jsf.web.validation.i18n.I18nValidator"
- manual="true"
- markerId="org.jboss.tools.jsf.i18nproblemmarker"
- sourceid="org.eclipse.wst.xml.ui.internal.validation.DelegatingSourceValidatorForXML"
- version="4">
- <include>
- <rules>
- <contentType
- id="org.eclipse.wst.html.core.htmlsource">
- </contentType>
- <contentType
- id="org.eclipse.jst.jsp.core.jspfragmentsource">
- </contentType>
- <contentType
- id="org.eclipse.jst.jsp.core.tagsource">
- </contentType>
- <fileext
- caseSensitive="false"
- ext="xhtml">
- </fileext>
- <fileext
- caseSensitive="false"
- ext="jsp">
- </fileext>
- <contentType
- id="org.eclipse.jst.jsp.core.jspsource">
- </contentType>
- <contentType
- id="org.jboss.tools.jst.jsp.jspincludesource">
- </contentType>
- </rules>
- </include>
- </validator>
- </extension>
--->
- <!--extension
- point="org.eclipse.wst.sse.ui.quickFixProcessor">
- <quickFixProcessor
- class="org.jboss.tools.jsf.web.validation.jsf2.action.JSF2QuickFixProcessor"
- problemType="org.jboss.tools.jsf.jsf2problemmarker">
- </quickFixProcessor>
- </extension-->
- <extension
point="org.eclipse.ui.editors.annotationTypes">
<type
markerSeverity="1"
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/model/JSF2ComponentModelManager.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/model/JSF2ComponentModelManager.java 2011-11-12 00:17:34 UTC (rev 36311)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/model/JSF2ComponentModelManager.java 2011-11-12 00:45:29 UTC (rev 36312)
@@ -313,7 +313,7 @@
public static IDOMDocument getReadableDOMDocument(JarEntryFile file) {
IDOMDocument document = null;
IStructuredModel model = null;
- InputStream inputStream;
+ InputStream inputStream = null;
try {
inputStream = file.getContents();
if (inputStream != null) {
@@ -333,6 +333,13 @@
} catch (CoreException e) {
JSFModelPlugin.getPluginLog().logError(e);
} finally {
+ if(inputStream!=null) {
+ try {
+ inputStream.close();
+ } catch (IOException e) {
+ // Ignore
+ }
+ }
model = null;
}
return document;
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/project/JSF2Util.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/project/JSF2Util.java 2011-11-12 00:17:34 UTC (rev 36311)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/project/JSF2Util.java 2011-11-12 00:45:29 UTC (rev 36312)
@@ -151,5 +151,4 @@
}
return false;
}
-
-}
+}
\ No newline at end of file
Deleted: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/JSF2ComponentsValidator.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/JSF2ComponentsValidator.java 2011-11-12 00:17:34 UTC (rev 36311)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/JSF2ComponentsValidator.java 2011-11-12 00:45:29 UTC (rev 36312)
@@ -1,149 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007-2010 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-
-package org.jboss.tools.jsf.web.validation.jsf2;
-
-import java.io.InputStream;
-import java.util.Scanner;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.wst.validation.ValidationResult;
-import org.eclipse.wst.validation.ValidationState;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.xml.core.internal.validation.core.NestedValidatorContext;
-import org.eclipse.wst.xml.core.internal.validation.core.ValidationMessage;
-import org.eclipse.wst.xml.core.internal.validation.core.ValidationReport;
-import org.eclipse.wst.xml.core.internal.validation.eclipse.Validator;
-import org.jboss.tools.jsf.JSFModelPlugin;
-import org.jboss.tools.jsf.jsf2.util.JSF2ResourceUtil;
-import org.jboss.tools.jsf.web.validation.jsf2.components.JSF2AttrTempComponent;
-import org.jboss.tools.jsf.web.validation.jsf2.components.JSF2CompositeTempComponent;
-import org.jboss.tools.jsf.web.validation.jsf2.components.JSF2URITempComponent;
-import org.jboss.tools.jsf.web.validation.jsf2.util.JSF2ValidatorConstants;
-import org.jboss.tools.jst.web.kb.IKbProject;
-import org.jboss.tools.jst.web.kb.KbProjectFactory;
-
-/**
- * Validates full file, when we click validate in Context menu
- *
- * @author yzhishko
- * @author mareshkau
- *
- */
-
-@SuppressWarnings("restriction")
-public class JSF2ComponentsValidator extends Validator {
-
- private IKbProject kbProject;
- private IFile file;
-
- @Override
- public ValidationResult validate(IResource resource, int kind,
- ValidationState state, IProgressMonitor monitor) {
- ValidationResult result = new ValidationResult();
- if (resource instanceof IFile) {
- IFile file = (IFile) resource;
- if (!isValidate(file)) {
- return result;
- }
- this.file = file;
- return super.validate(resource, kind, state, monitor);
- }
- return result;
- }
-
- @Override
- public ValidationReport validate(String uri, InputStream inputstream,
- NestedValidatorContext context, ValidationResult result) {
- JSF2XMLValidator validator = JSF2XMLValidator.getInstance();
- return validator.validate(file, uri);
- }
-
- protected boolean isValidate(IFile file) {
- if (!file.isAccessible() || !file.isSynchronized(IResource.DEPTH_ZERO) || file.getProject() == null
- || !file.getProject().isAccessible()) {
- return false;
- }
- IProject project = file.getProject();
- kbProject = KbProjectFactory.getKbProject(project, false);
- if (kbProject == null) {
- return false;
- }
- boolean isValidate = false;
- try {
- InputStream is = file.getContents();
- Scanner scanner = new Scanner(is);
- while (scanner.hasNextLine()) {
- if (scanner.nextLine()
- .indexOf(JSF2ResourceUtil.JSF2_URI_PREFIX) != -1) {
- isValidate = true;
- scanner.close();
- break;
- }
- }
- } catch (CoreException e) {
- JSFModelPlugin.getPluginLog().logError(e);
- return isValidate;
- }
- return isValidate;
- }
-
- @Override
- protected void addInfoToMessage(ValidationMessage validationMessage,
- IMessage message) {
- Object[] args = validationMessage.getMessageArguments();
- if (args == null) {
- return;
- }
- if (args[0] instanceof JSF2CompositeTempComponent) {
- JSF2CompositeTempComponent component = (JSF2CompositeTempComponent) args[0];
- message.setAttribute(JSF2ValidatorConstants.JSF2_TYPE_KEY,
- component.getType());
- message.setAttribute(JSF2ResourceUtil.COMPONENT_RESOURCE_PATH_KEY,
- component.getComponentResourceLocation());
- message.setAttribute(JSF2ResourceUtil.JSF2_COMPONENT_NAME, component.getElement().getLocalName());
- String[] attrNames = component.getAttrNames();
- if (attrNames != null) {
- for (int i = 0; i < attrNames.length; i++) {
- message.setAttribute(
- JSF2ValidatorConstants.JSF2_ATTR_NAME_KEY
- + String.valueOf(i), attrNames[i]);
- }
- }
- return;
- }
- if (args[0] instanceof JSF2AttrTempComponent) {
- JSF2AttrTempComponent component = (JSF2AttrTempComponent) args[0];
- message.setAttribute(JSF2ValidatorConstants.JSF2_TYPE_KEY,
- component.getType());
- message.setAttribute(JSF2ValidatorConstants.JSF2_ATTR_NAME_KEY,
- component.getName());
- message.setAttribute(JSF2ResourceUtil.COMPONENT_RESOURCE_PATH_KEY,
- component.getComponentResourceLocation());
- message.setAttribute(JSF2ResourceUtil.JSF2_COMPONENT_NAME, component.getElementName());
- return;
- }
- if (args[0] instanceof JSF2URITempComponent) {
- JSF2URITempComponent component = (JSF2URITempComponent) args[0];
- message.setAttribute(JSF2ValidatorConstants.JSF2_TYPE_KEY,
- JSF2ValidatorConstants.JSF2_URI_TYPE);
- message.setAttribute(JSF2ValidatorConstants.JSF2_URI_NAME_KEY,
- component.getURI());
- message.setAttribute(JSF2ResourceUtil.COMPONENT_RESOURCE_PATH_KEY,
- component.getResourcesFolder());
- }
- }
-
-}
Deleted: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/JSF2SourceValidator.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/JSF2SourceValidator.java 2011-11-12 00:17:34 UTC (rev 36311)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/JSF2SourceValidator.java 2011-11-12 00:45:29 UTC (rev 36312)
@@ -1,92 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007-2010 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-
-package org.jboss.tools.jsf.web.validation.jsf2;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.wst.sse.ui.internal.reconcile.validator.ISourceValidator;
-import org.eclipse.wst.validation.internal.core.Message;
-import org.eclipse.wst.validation.internal.core.ValidationException;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-import org.eclipse.wst.validation.internal.provisional.core.IValidationContext;
-import org.eclipse.wst.validation.internal.provisional.core.IValidator;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.jboss.tools.jsf.JSFModelPlugin;
-import org.jboss.tools.jsf.jsf2.model.JSF2ComponentModelManager;
-import org.jboss.tools.jsf.jsf2.util.JSF2ResourceUtil;
-import org.jboss.tools.jsf.web.validation.IJSFValidationComponent;
-import org.jboss.tools.jsf.web.validation.LocalizedMessage;
-
-/**
- * Validates when we change smth in file
- *
- * @author yzhishko
- * @author mareshkau
- *
- */
-
-@SuppressWarnings("restriction")
-public class JSF2SourceValidator implements IValidator, ISourceValidator {
-
- private IDOMDocument document;
- private IFile validateFile;
-
- public void cleanup(IReporter reporter) {
- }
-
- public void validate(IValidationContext helper, IReporter reporter)
- throws ValidationException {
- if (document != null) {
- IResource resource = JSF2ResourceUtil.getValidatingResource(helper);
- if (resource instanceof IFile) {
- validateFile = (IFile) resource;
- reportProblems(reporter,
- JSF2XMLValidator.getValidationComponents(document,
- (IFile) resource),resource);
- }
- }
- }
-
- public void connect(IDocument document) {
- this.document = JSF2ComponentModelManager
- .getReadableDOMDocument(document);
- }
-
- public void disconnect(IDocument document) {
- document = null;
- validateFile = null;
- }
-
- public void validate(IRegion dirtyRegion, IValidationContext helper,
- IReporter reporter) {
- }
-
- private void reportProblems(IReporter reporter,
- IJSFValidationComponent[] validationComponents,IResource resource) {
- try {
- resource.deleteMarkers(JSF2XMLValidator.JSF2_PROBLEM_ID, false, IResource.DEPTH_INFINITE);
- for (int i = 0; i < validationComponents.length; i++) {
- Message locMessage = LocalizedMessage.createJSF2LocalizedMessage(validationComponents[i], validateFile);
- reporter.addMessage(this, locMessage);
- IMarker marker = resource.createMarker(JSF2XMLValidator.JSF2_PROBLEM_ID);
- marker.setAttributes(locMessage.getAttributes());
- }
- } catch (CoreException e) {
- JSFModelPlugin.getPluginLog().logError(e);
- }
-
- }
-}
\ No newline at end of file
13 years, 2 months
JBoss Tools SVN: r36311 - in trunk/cdi/tests/org.jboss.tools.cdi.core.test: src/org/jboss/tools/cdi/core/test/tck/validation and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2011-11-11 19:17:34 -0500 (Fri, 11 Nov 2011)
New Revision: 36311
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/tck/JavaSource/META-INF/beans.xml
trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/tck/JavaSource/META-INF/beans.xml.with.alternative
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/BeansXmlValidationTest.java
Log:
https://issues.jboss.org/browse/JBIDE-10166 CDI Validator validates resources from output folder
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/tck/JavaSource/META-INF/beans.xml
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/tck/JavaSource/META-INF/beans.xml 2011-11-11 23:55:16 UTC (rev 36310)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/tck/JavaSource/META-INF/beans.xml 2011-11-12 00:17:34 UTC (rev 36311)
@@ -3,5 +3,6 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://jboss.org/schema/cdi/beans_1_0.xsd">
<alternatives>
<class>org.jboss.jsr299.tck.tests.jbt.validation.beansxml.incremental.Test1</class>
+ <class>cdi.test.alternative.Unxisting</class>
</alternatives>
</beans>
\ No newline at end of file
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/tck/JavaSource/META-INF/beans.xml.with.alternative
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/tck/JavaSource/META-INF/beans.xml.with.alternative 2011-11-11 23:55:16 UTC (rev 36310)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/tck/JavaSource/META-INF/beans.xml.with.alternative 2011-11-12 00:17:34 UTC (rev 36311)
@@ -3,5 +3,6 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://jboss.org/schema/cdi/beans_1_0.xsd">
<alternatives>
<class>org.jboss.jsr299.tck.tests.jbt.validation.beansxml.incremental.Test1</class>
+ <class>cdi.test.alternative.Unxisting</class>
</alternatives>
</beans>
\ No newline at end of file
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/BeansXmlValidationTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/BeansXmlValidationTest.java 2011-11-11 23:55:16 UTC (rev 36310)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/BeansXmlValidationTest.java 2011-11-12 00:17:34 UTC (rev 36311)
@@ -27,6 +27,13 @@
static int FORD_INTERCEPTOR_1_LINE = CAT_INTERCEPTOR_LINE + 3; // <class>org.jboss.jsr299.tck.tests.interceptors.definition.broken.sameClassListedTwiceInBeansXml.FordInterceptor</class>
static int FORD_INTERCEPTOR_2_LINE = FORD_INTERCEPTOR_1_LINE + 1; //
+ public void testBeansXMLInBin() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/META-INF/beans.xml");
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.UNKNOWN_ALTERNATIVE_BEAN_CLASS_NAME, false, 6);
+ file = tckProject.getFile("WebContent/WEB-INF/classes/META-INF/beans.xml");
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.UNKNOWN_ALTERNATIVE_BEAN_CLASS_NAME, 6);
+ }
+
/**
* 5.1.1. Declaring selected alternatives for a bean archive
* - Each child <class> element must specify the name of an alternative bean class. If there is no class with the specified
13 years, 2 months
JBoss Tools SVN: r36310 - trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2011-11-11 18:55:16 -0500 (Fri, 11 Nov 2011)
New Revision: 36310
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/CDISeamSolderDefaultBeanExtension.java
Log:
Removed System.out.print
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/CDISeamSolderDefaultBeanExtension.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/CDISeamSolderDefaultBeanExtension.java 2011-11-11 23:45:06 UTC (rev 36309)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/CDISeamSolderDefaultBeanExtension.java 2011-11-11 23:55:16 UTC (rev 36310)
@@ -193,7 +193,7 @@
for (IBean link: linked) {
if(link.getSourcePath() != null) {
validator.getValidationContext().addLinkedCoreResource(CDICoreValidator.SHORT_ID, key, link.getSourcePath(), true);
- System.out.println(key + ":" + link.getSourcePath());
+// System.out.println(key + ":" + link.getSourcePath());
}
}
}
13 years, 2 months
JBoss Tools SVN: r36309 - trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2011-11-11 18:45:06 -0500 (Fri, 11 Nov 2011)
New Revision: 36309
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
Log:
https://issues.jboss.org/browse/JBIDE-10166 CDI Validator validates resources from output folder
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2011-11-11 22:16:01 UTC (rev 36308)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2011-11-11 23:45:06 UTC (rev 36309)
@@ -116,6 +116,7 @@
IValidatingProjectTree projectTree;
IValidatingProjectSet projectSet;
Set<IFolder> sourceFolders;
+ List<IFile> allBeansXmls;
private BeansXmlValidationDelegate beansXmlValidator = new BeansXmlValidationDelegate(this);
private AnnotationValidationDelegate annotationValidator = new AnnotationValidationDelegate(this);
@@ -265,6 +266,7 @@
projectTree = validationHelper.getValidationContextManager().getValidatingProjectTree(this);
projectSet = projectTree.getBrunches().get(rootProject);
rootCdiProject = null;
+ allBeansXmls = null;
CDICoreNature nature = CDICorePlugin.getCDI(projectSet.getRootProject(), true);
if(nature!=null) {
rootCdiProject = nature.getDelegate();
@@ -495,8 +497,10 @@
CDIValidationContext context = getCDIContext(file);
ICDIProject cdiProject = context.getCdiProject();
if("beans.xml".equalsIgnoreCase(file.getName()) && CDIPreferences.shouldValidateBeansXml(file.getProject())) {
- // TODO should we check the path of the beans.xml? Or it's better to check the every beans.xml even if it is not in META-INF or WEB-INF.
- beansXmlValidator.validateBeansXml(context, file);
+ List<IFile> allBaensXmls = getAllBeansXmls();
+ if(allBaensXmls.contains(file)) { // See https://issues.jboss.org/browse/JBIDE-10166
+ beansXmlValidator.validateBeansXml(context, file);
+ }
} else {
Set<IBean> beans = cdiProject.getBeans(file.getFullPath());
for (IBean bean : beans) {
@@ -539,27 +543,29 @@
* @return
*/
private List<IFile> getAllBeansXmls() {
- List<IFile> beansXmls = new ArrayList<IFile>();
- // From source folders
- Set<IFolder> sourceFolders = getSourceFoldersForProjectsSet();
- for (IFolder source : sourceFolders) {
- IResource beansXml = source.findMember(new Path("/META-INF/beans.xml")); //$NON-NLS-1$
- if(beansXml!=null && beansXml instanceof IFile) {
- beansXmls.add((IFile)beansXml);
+ if(allBeansXmls==null) {
+ allBeansXmls = new ArrayList<IFile>();
+ // From source folders
+ Set<IFolder> sourceFolders = getSourceFoldersForProjectsSet();
+ for (IFolder source : sourceFolders) {
+ IResource beansXml = source.findMember(new Path("/META-INF/beans.xml")); //$NON-NLS-1$
+ if(beansXml!=null && beansXml instanceof IFile) {
+ allBeansXmls.add((IFile)beansXml);
+ }
}
- }
- Set<IProject> allProjects = projectSet.getAllProjects();
- for (IProject project : allProjects) {
- // From WEB-INF folder
- IVirtualComponent com = ComponentCore.createComponent(project);
- if(com!=null) {
- IVirtualFile beansXml = com.getRootFolder().getFile(new Path("/WEB-INF/beans.xml")); //$NON-NLS-1$
- if(beansXml!=null && beansXml.getUnderlyingFile().isAccessible()) {
- beansXmls.add(beansXml.getUnderlyingFile());
+ Set<IProject> allProjects = projectSet.getAllProjects();
+ for (IProject project : allProjects) {
+ // From WEB-INF folder
+ IVirtualComponent com = ComponentCore.createComponent(project);
+ if(com!=null) {
+ IVirtualFile beansXml = com.getRootFolder().getFile(new Path("/WEB-INF/beans.xml")); //$NON-NLS-1$
+ if(beansXml!=null && beansXml.getUnderlyingFile().isAccessible()) {
+ allBeansXmls.add(beansXml.getUnderlyingFile());
+ }
}
}
}
- return beansXmls;
+ return allBeansXmls;
}
/**
13 years, 2 months
JBoss Tools SVN: r36308 - in trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el: internal/core/parser and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-11-11 17:16:01 -0500 (Fri, 11 Nov 2011)
New Revision: 36308
Modified:
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ca/AbstractELCompletionEngine.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/ELParserImpl.java
Log:
JBIDE-10159
https://issues.jboss.org/browse/JBIDE-10159
Content assist outside expression in Java sources provided. White spaces after the last dot are included into expression to provide ca for members rather than beans in that region.
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ca/AbstractELCompletionEngine.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ca/AbstractELCompletionEngine.java 2011-11-11 22:11:35 UTC (rev 36307)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ca/AbstractELCompletionEngine.java 2011-11-11 22:16:01 UTC (rev 36308)
@@ -56,7 +56,9 @@
import org.jboss.tools.common.el.core.resolver.TypeInfoCollector.MemberInfo;
import org.jboss.tools.common.el.core.resolver.TypeInfoCollector.MemberPresentation;
import org.jboss.tools.common.el.core.resolver.Var;
+import org.jboss.tools.common.el.internal.core.model.ELPropertyInvocationImpl;
import org.jboss.tools.common.el.internal.core.parser.token.JavaNameTokenDescription;
+import org.jboss.tools.common.el.internal.core.parser.token.WhiteSpaceTokenDescription;
import org.jboss.tools.common.text.TextProposal;
public abstract class AbstractELCompletionEngine<V extends IVariable> implements ELResolver, ELCompletionEngine {
@@ -95,6 +97,25 @@
return getProposals(context, el, offset);
}
}
+ List<ELInstance> is = ref.getELModel().getInstances();
+ for (ELInstance i: is) {
+ ELExpression exp = i.getExpression();
+ if(exp == null || exp.getFirstToken() == null) {
+ continue;
+ }
+ LexicalToken b = exp.getFirstToken();
+ while(b.getPreviousToken() != null && b.getPreviousToken().getType() == WhiteSpaceTokenDescription.WHITESPACE) {
+ b = b.getPreviousToken();
+ }
+ LexicalToken e = exp.getLastToken();
+ if(e == null) e = b;
+ while(e.getNextToken() != null && e.getNextToken().getType() == WhiteSpaceTokenDescription.WHITESPACE) {
+ e = e.getNextToken();
+ }
+ if(exp != null && ref.getStartPosition() + b.getStart() <= offset && ref.getStartPosition() + e.getStart() + e.getLength() >= offset) {
+ return getProposals(context, "#{", offset);
+ }
+ }
}
return Collections.emptyList();
}
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/ELParserImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/ELParserImpl.java 2011-11-11 22:11:35 UTC (rev 36307)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/ELParserImpl.java 2011-11-11 22:16:01 UTC (rev 36308)
@@ -295,6 +295,10 @@
ELPropertyInvocationImpl incompleteProperty = new ELPropertyInvocationImpl();
incompleteProperty.setSeparator(dot);
incompleteProperty.setLastToken(dot);
+ LexicalToken n = dot.getNextToken();
+ if(n != null && n.getType() == WhiteSpaceTokenDescription.WHITESPACE) {
+ incompleteProperty.setLastToken(n);
+ }
incompleteProperty.setLeft(result);
incompleteProperty.setLeftIsFake(isLeftFake);
result = incompleteProperty;
13 years, 2 months
JBoss Tools SVN: r36307 - trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2Beans/src/test/beans.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-11-11 17:11:35 -0500 (Fri, 11 Nov 2011)
New Revision: 36307
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2Beans/src/test/beans/Bean1.java
Log:
JBIDE-10159
https://issues.jboss.org/browse/JBIDE-10159
Test added for content assist outside expression.
Modified: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2Beans/src/test/beans/Bean1.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2Beans/src/test/beans/Bean1.java 2011-11-11 22:11:17 UTC (rev 36306)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2Beans/src/test/beans/Bean1.java 2011-11-11 22:11:35 UTC (rev 36307)
@@ -8,4 +8,8 @@
return "#{}";
}
+ String s1 = "#{ mybean1}";
+ String s2 = "#{ mybean1. }";
+ String s3 = "#{ mybean1 }";
+
}
13 years, 2 months
JBoss Tools SVN: r36306 - trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/jsp/ca/test.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-11-11 17:11:17 -0500 (Fri, 11 Nov 2011)
New Revision: 36306
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/jsp/ca/test/CAForJSF2BeansInJavaTest.java
Log:
JBIDE-10159
https://issues.jboss.org/browse/JBIDE-10159
Test added for content assist outside expression.
Modified: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/jsp/ca/test/CAForJSF2BeansInJavaTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/jsp/ca/test/CAForJSF2BeansInJavaTest.java 2011-11-11 19:06:20 UTC (rev 36305)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/jsp/ca/test/CAForJSF2BeansInJavaTest.java 2011-11-11 22:11:17 UTC (rev 36306)
@@ -42,4 +42,27 @@
checkProposals(PAGE_NAME, "#{}", 2, proposals, false);
}
+
+ /**
+ * JBIDE-10159
+ */
+ public void testCAoutsideExpression(){
+ String[] proposals = {
+ "mybean1 : Bean1", "bean4 : Bean4", "bean5 : Bean5"
+ };
+
+ checkProposals(PAGE_NAME, "#{ mybean1}", 2, proposals, false);
+ checkProposals(PAGE_NAME, "#{ mybean1 }", 12, proposals, false);
+ }
+
+ /**
+ * JBIDE-10159
+ */
+ public void testCAMemberafterWhitespace(){
+ String[] proposals = {
+ "name : String - Bean1"
+ };
+
+ checkProposals(PAGE_NAME, "#{ mybean1. }", 13, proposals, true);
+ }
}
\ No newline at end of file
13 years, 2 months
JBoss Tools SVN: r36305 - in trunk/as/plugins: org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/configuration and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2011-11-11 14:06:20 -0500 (Fri, 11 Nov 2011)
New Revision: 36305
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7LaunchConfigProperties.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/AbstractJBossLaunchConfigType.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/LocalJBossStartLaunchDelegate.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/TwiddleLaunchConfiguration.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/configuration/AbstractLaunchConfigurator.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/configuration/AbstractStartLaunchConfigurator.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/configuration/JBossLaunchConfigProperties.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/configuration/LocalJBossStartLaunchConfigurator.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/configuration/LocalStopLaunchConfigurator.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7ServerRuntime.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7StartConfigurator.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/ArgsUtil.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IJBossRuntimeConstants.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IJBossRuntimeResourceConstants.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/LaunchConfigUtils.java
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEJBossStartLaunchDelegate.java
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSERemotePublishHandler.java
Log:
https://issues.jboss.org/browse/JBIDE-10113 big fix
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/AbstractJBossLaunchConfigType.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/AbstractJBossLaunchConfigType.java 2011-11-11 16:21:46 UTC (rev 36304)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/AbstractJBossLaunchConfigType.java 2011-11-11 19:06:20 UTC (rev 36305)
@@ -187,7 +187,7 @@
@Deprecated
public IVMInstall getVMInstall(ILaunchConfiguration configuration) throws CoreException {
- String serverId = JBossLaunchConfigProperties.getServerId(configuration);
+ String serverId = new JBossLaunchConfigProperties().getServerId(configuration);
JBossServer jbs = ServerConverter.findJBossServer(serverId);
IJBossServerRuntime runtime = RuntimeUtils.checkedGetJBossServerRuntime(jbs.getServer());
return runtime.getVM();
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/LocalJBossStartLaunchDelegate.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/LocalJBossStartLaunchDelegate.java 2011-11-11 16:21:46 UTC (rev 36304)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/LocalJBossStartLaunchDelegate.java 2011-11-11 19:06:20 UTC (rev 36305)
@@ -12,6 +12,7 @@
import java.util.ArrayList;
+import org.apache.tools.ant.property.GetProperty;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
@@ -78,7 +79,7 @@
public static class JBossServerDefaultClasspathProvider extends StandardClasspathProvider {
public IRuntimeClasspathEntry[] computeUnresolvedClasspath(ILaunchConfiguration configuration)
throws CoreException {
- if (JBossLaunchConfigProperties.isUseDefaultClasspath(configuration)) {
+ if (new JBossLaunchConfigProperties().isUseDefaultClasspath(configuration)) {
return defaultEntries(configuration);
}
return super.computeUnresolvedClasspath(configuration);
@@ -86,7 +87,7 @@
protected IRuntimeClasspathEntry[] defaultEntries(ILaunchConfiguration config) {
try {
- String server = JBossLaunchConfigProperties.getServerId(config);
+ String server = new JBossLaunchConfigProperties().getServerId(config);
IServer s = ServerCore.findServer(server);
AbstractLocalJBossServerRuntime ibjsrt = (AbstractLocalJBossServerRuntime)
s.getRuntime().loadAdapter(AbstractLocalJBossServerRuntime.class, new NullProgressMonitor());
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/TwiddleLaunchConfiguration.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/TwiddleLaunchConfiguration.java 2011-11-11 16:21:46 UTC (rev 36304)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/TwiddleLaunchConfiguration.java 2011-11-11 19:06:20 UTC (rev 36305)
@@ -63,10 +63,10 @@
String launchName = TwiddleLaunchConfiguration.class.getName();
launchName = launchManager.generateUniqueLaunchConfigurationNameFrom(launchName);
ILaunchConfigurationWorkingCopy wc = launchConfigType.newInstance(null, launchName);
- JBossLaunchConfigProperties.setProgramArguments(args, wc);
- JBossLaunchConfigProperties.setMainType(IJBossRuntimeConstants.TWIDDLE_MAIN_TYPE, wc);
- JBossLaunchConfigProperties.setWorkingDirectory(serverHome + Path.SEPARATOR + IJBossRuntimeResourceConstants.BIN, wc);
- JBossLaunchConfigProperties.setServerId(server.getId(), wc);
+ new JBossLaunchConfigProperties().setProgramArguments(args, wc);
+ new JBossLaunchConfigProperties().setMainType(IJBossRuntimeConstants.TWIDDLE_MAIN_TYPE, wc);
+ new JBossLaunchConfigProperties().setWorkingDirectory(serverHome + Path.SEPARATOR + IJBossRuntimeResourceConstants.BIN, wc);
+ new JBossLaunchConfigProperties().setServerId(server.getId(), wc);
ArrayList<IRuntimeClasspathEntry> classpath = new ArrayList<IRuntimeClasspathEntry>();
LaunchConfigUtils.addCPEntry(TWIDDLE_JAR_LOC, serverHome, classpath);
@@ -76,8 +76,8 @@
LaunchConfigUtils.addDirectory(serverHome, classpath, IJBossRuntimeResourceConstants.CLIENT);
LaunchConfigUtils.addJREEntry(jbrt.getVM(), classpath);
List<String> runtimeClassPaths = LaunchConfigUtils.toStrings(classpath);
- JBossLaunchConfigProperties.setClasspath(runtimeClassPaths, wc);
- JBossLaunchConfigProperties.setUseDefaultClassPath(false, wc);
+ new JBossLaunchConfigProperties().setClasspath(runtimeClassPaths, wc);
+ new JBossLaunchConfigProperties().setUseDefaultClassPath(false, wc);
return wc;
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/configuration/AbstractLaunchConfigurator.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/configuration/AbstractLaunchConfigurator.java 2011-11-11 16:21:46 UTC (rev 36304)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/configuration/AbstractLaunchConfigurator.java 2011-11-11 19:06:20 UTC (rev 36305)
@@ -39,11 +39,15 @@
if (!areDefaultsSet(launchConfig)) {
doConfigure(launchConfig, jbossServer, jbossRuntime);
setDefaultsSet(launchConfig);
+ } else {
+ doOverrides(launchConfig, jbossServer, jbossRuntime);
}
}
protected abstract void doConfigure(ILaunchConfigurationWorkingCopy launchConfig, JBossServer jbossServer, IJBossServerRuntime jbossRuntime) throws CoreException;
+ protected abstract void doOverrides (ILaunchConfigurationWorkingCopy launchConfig, JBossServer jbossServer, IJBossServerRuntime jbossRuntime) throws CoreException;
+
protected abstract String getDefaultProgramArguments(JBossServer server, IJBossServerRuntime runtime) throws CoreException;
protected abstract String getMainType();
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/configuration/AbstractStartLaunchConfigurator.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/configuration/AbstractStartLaunchConfigurator.java 2011-11-11 16:21:46 UTC (rev 36304)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/configuration/AbstractStartLaunchConfigurator.java 2011-11-11 19:06:20 UTC (rev 36305)
@@ -32,27 +32,54 @@
super(server);
}
+ private JBossLaunchConfigProperties properties = null;
+ protected JBossLaunchConfigProperties getProperties() {
+ if( properties == null )
+ properties = createProperties();
+ return properties;
+ }
+
+ protected JBossLaunchConfigProperties createProperties() {
+ return new JBossLaunchConfigProperties();
+ }
+
@Override
protected void doConfigure(ILaunchConfigurationWorkingCopy launchConfig, JBossServer jbossServer, IJBossServerRuntime jbossRuntime) throws CoreException {
- JBossLaunchConfigProperties.setProgramArguments(getDefaultProgramArguments(jbossServer, jbossRuntime), launchConfig);
- JBossLaunchConfigProperties.setHost(getHost(jbossServer, jbossRuntime), launchConfig);
- JBossLaunchConfigProperties.setConfig(getServerConfig(jbossRuntime), launchConfig);
- JBossLaunchConfigProperties.setServerHome(getServerHome(jbossRuntime), jbossRuntime, launchConfig);
- JBossLaunchConfigProperties.setVmArguments(getDefaultVMArguments(jbossRuntime), launchConfig);
- JBossLaunchConfigProperties.setJreContainer(getJreContainerPath(jbossRuntime), launchConfig);
- JBossLaunchConfigProperties.setEndorsedDir(getEndorsedDir(jbossRuntime), launchConfig);
- JBossLaunchConfigProperties.setMainType(getMainType(), launchConfig);
- JBossLaunchConfigProperties.setWorkingDirectory(getWorkingDirectory(jbossServer, jbossRuntime), launchConfig);
- JBossLaunchConfigProperties.setEnvironmentVariables(getEnvironmentVariables(jbossRuntime), launchConfig);
- JBossLaunchConfigProperties.setClasspathProvider(getClasspathProvider(), launchConfig);
- JBossLaunchConfigProperties.setClasspath(getClasspath(jbossServer, jbossRuntime, JBossLaunchConfigProperties.getClasspath(launchConfig)), launchConfig);
- JBossLaunchConfigProperties.setUseDefaultClassPath(isUseDefaultClasspath(), launchConfig);
- JBossLaunchConfigProperties.setServerId(getServerId(jbossServer), launchConfig);
+ getProperties().setProgramArguments(getDefaultProgramArguments(jbossServer, jbossRuntime), launchConfig);
+ getProperties().setHost(getHost(jbossServer, jbossRuntime), launchConfig);
+ getProperties().setConfig(getServerConfig(jbossRuntime), launchConfig);
+ getProperties().setServerHome(getServerHome(jbossRuntime), jbossRuntime, launchConfig);
+ getProperties().setVmArguments(getDefaultVMArguments(jbossRuntime), launchConfig);
+ getProperties().setJreContainer(getJreContainerPath(jbossRuntime), launchConfig);
+ getProperties().setEndorsedDir(getEndorsedDir(jbossRuntime), launchConfig);
+ getProperties().setMainType(getMainType(), launchConfig);
+ getProperties().setWorkingDirectory(getWorkingDirectory(jbossServer, jbossRuntime), launchConfig);
+ getProperties().setEnvironmentVariables(getEnvironmentVariables(jbossRuntime), launchConfig);
+ getProperties().setClasspathProvider(getClasspathProvider(), launchConfig);
+ getProperties().setClasspath(getClasspath(jbossServer, jbossRuntime, getProperties().getClasspath(launchConfig)), launchConfig);
+ getProperties().setUseDefaultClassPath(isUseDefaultClasspath(), launchConfig);
+ getProperties().setServerId(getServerId(jbossServer), launchConfig);
}
+ @Override
+ protected void doOverrides(ILaunchConfigurationWorkingCopy launchConfig, JBossServer jbossServer, IJBossServerRuntime jbossRuntime) throws CoreException {
+ getProperties().setHost(getHost(jbossServer, jbossRuntime), launchConfig);
+ getProperties().setConfig(getServerConfig(jbossRuntime), launchConfig);
+ getProperties().setServerHome(getServerHome(jbossRuntime), jbossRuntime, launchConfig);
+ getProperties().setJreContainer(getJreContainerPath(jbossRuntime), launchConfig);
+ getProperties().setEndorsedDir(getEndorsedDir(jbossRuntime), launchConfig);
+ getProperties().setJavaLibPath(getJavaLibraryPath(jbossRuntime), launchConfig);
+ getProperties().setWorkingDirectory(getWorkingDirectory(jbossServer, jbossRuntime), launchConfig);
+ getProperties().setClasspathProvider(getClasspathProvider(), launchConfig);
+ getProperties().setClasspath(getClasspath(jbossServer, jbossRuntime, getProperties().getClasspath(launchConfig)), launchConfig);
+ getProperties().setUseDefaultClassPath(isUseDefaultClasspath(), launchConfig);
+ getProperties().setServerId(getServerId(jbossServer), launchConfig);
+ }
protected abstract String getEndorsedDir(IJBossServerRuntime runtime);
+ protected abstract String getJavaLibraryPath(IJBossServerRuntime runtime);
+
protected abstract String getServerConfig(IJBossServerRuntime runtime);
protected abstract String getServerHome(IJBossServerRuntime runtime);
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/configuration/JBossLaunchConfigProperties.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/configuration/JBossLaunchConfigProperties.java 2011-11-11 16:21:46 UTC (rev 36304)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/configuration/JBossLaunchConfigProperties.java 2011-11-11 19:06:20 UTC (rev 36305)
@@ -30,71 +30,71 @@
private static final String SERVER_ID = "server-id"; //$NON-NLS-1$
- public static void setClasspath(List<String> entries, ILaunchConfigurationWorkingCopy launchConfig) {
+ public void setClasspath(List<String> entries, ILaunchConfigurationWorkingCopy launchConfig) {
if (isSet(entries)) {
launchConfig.setAttribute(
IJavaLaunchConfigurationConstants.ATTR_CLASSPATH, entries);
}
}
- public static boolean isClasspathSet(ILaunchConfiguration launchConfig) throws CoreException {
+ public boolean isClasspathSet(ILaunchConfiguration launchConfig) throws CoreException {
return launchConfig.hasAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH);
}
- public static void setUseDefaultClassPath(boolean useDefaultClassPath, ILaunchConfigurationWorkingCopy launchConfig) {
+ public void setUseDefaultClassPath(boolean useDefaultClassPath, ILaunchConfigurationWorkingCopy launchConfig) {
launchConfig.setAttribute(
IJavaLaunchConfigurationConstants.ATTR_DEFAULT_CLASSPATH, useDefaultClassPath);
}
- public static boolean isUseDefaultClasspath(ILaunchConfiguration launchConfig) throws CoreException {
+ public boolean isUseDefaultClasspath(ILaunchConfiguration launchConfig) throws CoreException {
return isUseDefaultClasspath(launchConfig, true);
}
- public static boolean isUseDefaultClasspath(ILaunchConfiguration launchConfig, boolean defaultValue) throws CoreException {
+ public boolean isUseDefaultClasspath(ILaunchConfiguration launchConfig, boolean defaultValue) throws CoreException {
return launchConfig.getAttribute(IJavaLaunchConfigurationConstants.ATTR_DEFAULT_CLASSPATH, defaultValue);
}
- public static boolean isUseDefaultClasspathSet(ILaunchConfiguration launchConfig) throws CoreException {
+ public boolean isUseDefaultClasspathSet(ILaunchConfiguration launchConfig) throws CoreException {
return launchConfig.hasAttribute(IJavaLaunchConfigurationConstants.ATTR_DEFAULT_CLASSPATH);
}
- public static void setMainType(String mainType, ILaunchConfigurationWorkingCopy launchConfig) {
+ public void setMainType(String mainType, ILaunchConfigurationWorkingCopy launchConfig) {
if (isSet(mainType)) {
launchConfig.setAttribute(
IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME, mainType);
}
}
- public static boolean isMainTypeSet(ILaunchConfigurationWorkingCopy launchConfig) throws CoreException {
+ public boolean isMainTypeSet(ILaunchConfigurationWorkingCopy launchConfig) throws CoreException {
return launchConfig.hasAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME);
}
- public static void setWorkingDirectory(String directory, ILaunchConfigurationWorkingCopy launchConfig) {
+ public void setWorkingDirectory(String directory, ILaunchConfigurationWorkingCopy launchConfig) {
if (isSet(directory)) {
launchConfig.setAttribute(
IJavaLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, directory);
}
}
- public static boolean isWorkingDirectorySet(ILaunchConfiguration launchConfig) throws CoreException {
+ public boolean isWorkingDirectorySet(ILaunchConfiguration launchConfig) throws CoreException {
return launchConfig.hasAttribute(IJavaLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY);
}
- public static void setServerId(String serverId, ILaunchConfigurationWorkingCopy launchConfig) {
+ public void setServerId(String serverId, ILaunchConfigurationWorkingCopy launchConfig) {
if (isSet(serverId)) {
launchConfig.setAttribute(SERVER_ID, serverId);
}
}
- public static String getServerId(ILaunchConfiguration launchConfig) throws CoreException {
+ public String getServerId(ILaunchConfiguration launchConfig) throws CoreException {
return launchConfig.getAttribute(SERVER_ID, (String) null);
}
- public static boolean isServerIdSet(ILaunchConfiguration launchConfig) throws CoreException {
+ public boolean isServerIdSet(ILaunchConfiguration launchConfig) throws CoreException {
return launchConfig.hasAttribute(SERVER_ID);
}
- public static void setHost(String host, ILaunchConfigurationWorkingCopy launchConfig) throws CoreException {
+ public void setHost(String host, ILaunchConfigurationWorkingCopy launchConfig) throws CoreException {
if (isSet(host)) {
String currentHost = getHost(launchConfig);
if (currentHost == null
@@ -109,40 +109,40 @@
}
}
- public static boolean isHostSet(ILaunchConfiguration launchConfig) throws CoreException {
+ public boolean isHostSet(ILaunchConfiguration launchConfig) throws CoreException {
String value = ArgsUtil.getValue(getProgramArguments(launchConfig),
IJBossRuntimeConstants.STARTUP_ARG_HOST_SHORT,
IJBossRuntimeConstants.STARTUP_ARG_HOST_LONG);
return value != null;
}
- public static void setProgramArguments(String programArguments, ILaunchConfigurationWorkingCopy launchConfig)
+ public void setProgramArguments(String programArguments, ILaunchConfigurationWorkingCopy launchConfig)
throws CoreException {
launchConfig.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, programArguments);
}
- public static String getProgramArguments(ILaunchConfiguration launchConfig) throws CoreException {
+ public String getProgramArguments(ILaunchConfiguration launchConfig) throws CoreException {
return launchConfig.getAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, ""); //$NON-NLS-1$;
}
- public static boolean areProgramArgumentsSet(ILaunchConfiguration launchConfig) throws CoreException {
+ public boolean areProgramArgumentsSet(ILaunchConfiguration launchConfig) throws CoreException {
return launchConfig.hasAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS);
}
- public static boolean isConfigSet(ILaunchConfiguration launchConfig) throws CoreException {
+ public boolean isConfigSet(ILaunchConfiguration launchConfig) throws CoreException {
String value = ArgsUtil.getValue(getProgramArguments(launchConfig),
IJBossRuntimeConstants.STARTUP_ARG_CONFIG_SHORT,
IJBossRuntimeConstants.STARTUP_ARG_CONFIG_LONG);
return value != null;
}
- public static String getHost(ILaunchConfiguration launchConfig) throws CoreException {
+ public String getHost(ILaunchConfiguration launchConfig) throws CoreException {
return ArgsUtil.getValue(getProgramArguments(launchConfig),
IJBossRuntimeConstants.STARTUP_ARG_HOST_SHORT,
IJBossRuntimeConstants.STARTUP_ARG_HOST_LONG);
}
- public static void setConfig(String config, ILaunchConfigurationWorkingCopy launchConfig) throws CoreException {
+ public void setConfig(String config, ILaunchConfigurationWorkingCopy launchConfig) throws CoreException {
if (isSet(config)) {
String programArguments = getProgramArguments(launchConfig);
programArguments = ArgsUtil.setArg(programArguments,
@@ -152,17 +152,17 @@
}
}
- public static void setJreContainer(String vmContainerPath, ILaunchConfigurationWorkingCopy launchConfig) {
+ public void setJreContainer(String vmContainerPath, ILaunchConfigurationWorkingCopy launchConfig) {
if (isSet(vmContainerPath)) {
launchConfig.setAttribute(IJavaLaunchConfigurationConstants.ATTR_JRE_CONTAINER_PATH, vmContainerPath);
}
}
- public static boolean isJreContainerSet(ILaunchConfiguration launchConfig) throws CoreException {
+ public boolean isJreContainerSet(ILaunchConfiguration launchConfig) throws CoreException {
return launchConfig.hasAttribute(IJavaLaunchConfigurationConstants.ATTR_JRE_CONTAINER_PATH);
}
- public static void setServerHome(String serverHome, IJBossServerRuntime runtime,
+ public void setServerHome(String serverHome, IJBossServerRuntime runtime,
ILaunchConfigurationWorkingCopy launchConfig) throws CoreException {
if (isSet(serverHome)) {
String programArguments = getProgramArguments(launchConfig);
@@ -174,24 +174,24 @@
}
}
- public static boolean isServerHomeSet(ILaunchConfigurationWorkingCopy launchConfig) throws CoreException {
+ public boolean isServerHomeSet(ILaunchConfigurationWorkingCopy launchConfig) throws CoreException {
String value = ArgsUtil.getValue(getProgramArguments(launchConfig),
null,
IJBossRuntimeConstants.SYSPROP + IJBossRuntimeConstants.JBOSS_SERVER_HOME_URL);
return value != null;
}
- public static void setClasspathProvider(String classpathProvider, ILaunchConfigurationWorkingCopy launchConfig) {
+ public void setClasspathProvider(String classpathProvider, ILaunchConfigurationWorkingCopy launchConfig) {
if (isSet(classpathProvider)) {
launchConfig.setAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH_PROVIDER, classpathProvider);
}
}
- public static boolean isClasspathProviderSet(ILaunchConfiguration launchConfig) throws CoreException {
+ public boolean isClasspathProviderSet(ILaunchConfiguration launchConfig) throws CoreException {
return launchConfig.hasAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH_PROVIDER);
}
- public static void setEndorsedDir(String endorsedDir, ILaunchConfigurationWorkingCopy launchConfig)
+ public void setEndorsedDir(String endorsedDir, ILaunchConfigurationWorkingCopy launchConfig)
throws CoreException {
if (isSet(endorsedDir)) {
String vmArguments = getVMArguments(launchConfig);
@@ -200,54 +200,66 @@
setVmArguments(vmArguments, launchConfig);
}
}
+
+ public void setJavaLibPath(String libPath, ILaunchConfigurationWorkingCopy launchConfig)
+ throws CoreException {
+ if (isSet(libPath)) {
+ String vmArguments = getVMArguments(launchConfig);
+ vmArguments = ArgsUtil.setArg(vmArguments,
+ null, IJBossRuntimeConstants.SYSPROP + IJBossRuntimeConstants.JAVA_LIB_PATH,
+ IJBossRuntimeConstants.QUOTE + libPath + IJBossRuntimeConstants.QUOTE);
+ setVmArguments(vmArguments, launchConfig);
+ }
+ }
- public static boolean isEndorsedDirSet(ILaunchConfiguration launchConfig) throws CoreException {
+
+ public boolean isEndorsedDirSet(ILaunchConfiguration launchConfig) throws CoreException {
String value = ArgsUtil.getValue(getVMArguments(launchConfig),
null,
IJBossRuntimeConstants.SYSPROP + IJBossRuntimeConstants.ENDORSED_DIRS);
return value != null;
}
- public static void setVmArguments(String vmArguments, ILaunchConfigurationWorkingCopy launchConfig) {
+ public void setVmArguments(String vmArguments, ILaunchConfigurationWorkingCopy launchConfig) {
if (isSet(vmArguments)) {
launchConfig.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS, vmArguments);
}
}
- public static String getVMArguments(ILaunchConfiguration launchConfig) throws CoreException {
+ public String getVMArguments(ILaunchConfiguration launchConfig) throws CoreException {
return launchConfig.getAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS, ""); //$NON-NLS-1$
}
- public static boolean areVMArgumentsSet(ILaunchConfigurationWorkingCopy launchConfig) throws CoreException {
+ public boolean areVMArgumentsSet(ILaunchConfigurationWorkingCopy launchConfig) throws CoreException {
return launchConfig.hasAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS);
}
- public static void setEnvironmentVariables(Map<String, String> environmentVariables,
+ public void setEnvironmentVariables(Map<String, String> environmentVariables,
ILaunchConfigurationWorkingCopy launchConfig) {
if (isSet(environmentVariables)) {
launchConfig.setAttribute(ILaunchManager.ATTR_ENVIRONMENT_VARIABLES, environmentVariables);
}
}
- public static boolean areEnvironmentVariablesSet(ILaunchConfiguration launchConfig) throws CoreException {
+ public boolean areEnvironmentVariablesSet(ILaunchConfiguration launchConfig) throws CoreException {
return launchConfig.hasAttribute(ILaunchManager.ATTR_ENVIRONMENT_VARIABLES);
}
@SuppressWarnings("unchecked")
- public static List<String> getClasspath(ILaunchConfiguration launchConfig) throws CoreException {
+ public List<String> getClasspath(ILaunchConfiguration launchConfig) throws CoreException {
return (List<String>) launchConfig.getAttribute(
IJavaLaunchConfigurationConstants.ATTR_CLASSPATH, new ArrayList<String>());
}
- private static boolean isSet(String value) {
+ protected boolean isSet(String value) {
return value != null && value.length() > 0;
}
- private static boolean isSet(List<String> list) {
+ protected boolean isSet(List<String> list) {
return list != null;
}
- private static boolean isSet(Map<String, String> map) {
+ protected boolean isSet(Map<String, String> map) {
return map != null;
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/configuration/LocalJBossStartLaunchConfigurator.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/configuration/LocalJBossStartLaunchConfigurator.java 2011-11-11 16:21:46 UTC (rev 36304)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/configuration/LocalJBossStartLaunchConfigurator.java 2011-11-11 19:06:20 UTC (rev 36305)
@@ -10,11 +10,15 @@
******************************************************************************/
package org.jboss.ide.eclipse.as.core.server.internal.launch.configuration;
+import static org.jboss.ide.eclipse.as.core.util.IJBossRuntimeResourceConstants.BIN;
+import static org.jboss.ide.eclipse.as.core.util.IJBossRuntimeResourceConstants.NATIVE;
+
import java.net.MalformedURLException;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.jdt.launching.IRuntimeClasspathEntry;
import org.eclipse.jdt.launching.IVMInstall;
@@ -120,4 +124,13 @@
protected String getDefaultVMArguments(IJBossServerRuntime runtime) {
return runtime.getDefaultRunVMArgs();
}
+
+ @Override
+ protected String getJavaLibraryPath(IJBossServerRuntime runtime) {
+ IPath serverHome = runtime.getRuntime().getLocation();
+ IPath p = serverHome.append(BIN).append(NATIVE);
+ if( p.toFile().exists() )
+ return p.toString();
+ return null;
+ }
}
\ No newline at end of file
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/configuration/LocalStopLaunchConfigurator.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/configuration/LocalStopLaunchConfigurator.java 2011-11-11 16:21:46 UTC (rev 36304)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/configuration/LocalStopLaunchConfigurator.java 2011-11-11 19:06:20 UTC (rev 36305)
@@ -35,15 +35,21 @@
}
@Override
+ protected void doOverrides(ILaunchConfigurationWorkingCopy launchConfig,
+ JBossServer jbossServer, IJBossServerRuntime jbossRuntime)
+ throws CoreException {
+ // Intentionally left blank
+ }
+
+ @Override
protected void doConfigure(ILaunchConfigurationWorkingCopy launchConfig, JBossServer jbossServer,
IJBossServerRuntime jbossRuntime) throws CoreException {
-
- JBossLaunchConfigProperties.setProgramArguments(getDefaultProgramArguments(jbossServer, jbossRuntime), launchConfig);
- JBossLaunchConfigProperties.setMainType(getMainType(), launchConfig);
- JBossLaunchConfigProperties.setWorkingDirectory(getWorkingDirectory(jbossServer, jbossRuntime), launchConfig);
- JBossLaunchConfigProperties.setClasspath(getClasspath(jbossServer, jbossRuntime, JBossLaunchConfigProperties.getClasspath(launchConfig)), launchConfig);
- JBossLaunchConfigProperties.setUseDefaultClassPath(isUseDefaultClasspath(), launchConfig);
- JBossLaunchConfigProperties.setServerId(getServerId(jbossServer), launchConfig);
+ new JBossLaunchConfigProperties().setProgramArguments(getDefaultProgramArguments(jbossServer, jbossRuntime), launchConfig);
+ new JBossLaunchConfigProperties().setMainType(getMainType(), launchConfig);
+ new JBossLaunchConfigProperties().setWorkingDirectory(getWorkingDirectory(jbossServer, jbossRuntime), launchConfig);
+ new JBossLaunchConfigProperties().setClasspath(getClasspath(jbossServer, jbossRuntime, new JBossLaunchConfigProperties().getClasspath(launchConfig)), launchConfig);
+ new JBossLaunchConfigProperties().setUseDefaultClassPath(isUseDefaultClasspath(), launchConfig);
+ new JBossLaunchConfigProperties().setServerId(getServerId(jbossServer), launchConfig);
}
@Override
@@ -70,4 +76,5 @@
LaunchConfigUtils.addJREEntry(runtime.getVM(), classpath);
return LaunchConfigUtils.toStrings(classpath);
}
+
}
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7LaunchConfigProperties.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7LaunchConfigProperties.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7LaunchConfigProperties.java 2011-11-11 19:06:20 UTC (rev 36305)
@@ -0,0 +1,63 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.ide.eclipse.as.core.server.internal.v7;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
+import org.jboss.ide.eclipse.as.core.server.internal.launch.configuration.JBossLaunchConfigProperties;
+import org.jboss.ide.eclipse.as.core.util.ArgsUtil;
+import org.jboss.ide.eclipse.as.core.util.IJBossRuntimeConstants;
+
+public class JBoss7LaunchConfigProperties extends JBossLaunchConfigProperties {
+ public void setModulesFolder(String mp, ILaunchConfigurationWorkingCopy launchConfig)
+ throws CoreException {
+ if (isSet(mp)) {
+ String progArgs = getProgramArguments(launchConfig);
+ progArgs = ArgsUtil.setArg(progArgs,
+ IJBossRuntimeConstants.DASH + IJBossRuntimeConstants.JB7_MP_ARG, null,
+ IJBossRuntimeConstants.QUOTE + mp + IJBossRuntimeConstants.QUOTE);
+ setProgramArguments(progArgs, launchConfig);
+ }
+ }
+
+ public void setBootLogFile(String blf, ILaunchConfigurationWorkingCopy launchConfig)
+ throws CoreException {
+ if (isSet(blf)) {
+ String vmArgs = getVMArguments(launchConfig);
+ vmArgs = ArgsUtil.setArg(vmArgs, null,
+ IJBossRuntimeConstants.SYSPROP + IJBossRuntimeConstants.JB7_BOOT_LOG_ARG, blf);
+ setVmArguments(vmArgs, launchConfig);
+ }
+ }
+
+ public void setLoggingConfigFile(String lcf, ILaunchConfigurationWorkingCopy launchConfig)
+ throws CoreException {
+ if (isSet(lcf)) {
+ String vmArgs = getVMArguments(launchConfig);
+ vmArgs = ArgsUtil.setArg(vmArgs, null,
+ IJBossRuntimeConstants.SYSPROP + IJBossRuntimeConstants.JB7_LOGGING_CONFIG_FILE, lcf);
+ setVmArguments(vmArgs, launchConfig);
+ }
+ }
+
+ public void setServerHome(String serverHome, IJBossServerRuntime runtime,
+ ILaunchConfigurationWorkingCopy launchConfig) throws CoreException {
+ if (isSet(serverHome)) {
+ String vmArguments = getVMArguments(launchConfig);
+ String arguments = ArgsUtil.setArg(vmArguments,
+ null,
+ IJBossRuntimeConstants.SYSPROP + IJBossRuntimeConstants.JBOSS_HOME_DIR,
+ serverHome);
+ setVmArguments(arguments, launchConfig);
+ }
+ }
+}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7ServerRuntime.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7ServerRuntime.java 2011-11-11 16:21:46 UTC (rev 36304)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7ServerRuntime.java 2011-11-11 19:06:20 UTC (rev 36305)
@@ -14,9 +14,13 @@
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.jboss.ide.eclipse.as.core.server.internal.LocalJBossServerRuntime;
+import org.jboss.ide.eclipse.as.core.util.IJBossRuntimeConstants;
+import org.jboss.ide.eclipse.as.core.util.IJBossRuntimeResourceConstants;
-public class LocalJBoss7ServerRuntime extends LocalJBossServerRuntime {
-
+public class LocalJBoss7ServerRuntime extends LocalJBossServerRuntime implements IJBossRuntimeConstants {
+
+
+
@Override
public IStatus validate() {
return Status.OK_STATUS;
@@ -25,21 +29,23 @@
@Override
public String getDefaultRunArgs() {
return getDefaultRunArgs(getRuntime().getLocation());
- }
+ }
@Override
public String getDefaultRunArgs(IPath serverHome) {
- return "-mp \"" + serverHome.append("modules").toString() + "\"" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- + " -logmodule org.jboss.logmanager" //$NON-NLS-1$
- + " -jaxpmodule javax.xml.jaxp-provider" //$NON-NLS-1$
- + " org.jboss.as.standalone"; //$NON-NLS-1$
+ return DASH + JB7_MP_ARG + SPACE + QUOTE
+ + serverHome.append(MODULES).toString() + QUOTE
+ + SPACE + DASH + JB7_LOGMODULE_ARG + SPACE + JB7_LOGMODULE_DEFAULT
+ + SPACE + DASH + JB7_JAXPMODULE + SPACE + JB7_JAXP_PROVIDER
+ + SPACE + JB7_STANDALONE_ARG;
}
@Override
public String getDefaultRunVMArgs(IPath serverHome) {
- IPath bootLog = serverHome.append("standalone").append("log").append("boot.log"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- IPath logConfig = serverHome.append("standalone").append("configuration").append("logging.properties"); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
- return "-server" //$NON-NLS-1$
+ IJBossRuntimeResourceConstants c = new IJBossRuntimeResourceConstants() {};
+ IPath bootLog = serverHome.append(c.AS7_STANDALONE).append(c.FOLDER_LOG).append(c.AS7_BOOT_LOG);
+ IPath logConfig = serverHome.append(c.AS7_STANDALONE).append(c.CONFIGURATION).append(c.LOGGING_PROPERTIES);
+ return SERVER_ARG
+ " -Xms64m" //$NON-NLS-1$
+ " -Xmx512m" //$NON-NLS-1$
+ " -XX:MaxPermSize=256m" //$NON-NLS-1$
@@ -47,26 +53,14 @@
+ " -Dorg.jboss.resolver.warning=true" //$NON-NLS-1$
+ " -Dsun.rmi.dgc.client.gcInterval=3600000" //$NON-NLS-1$
+ " -Dsun.rmi.dgc.server.gcInterval=3600000" //$NON-NLS-1$
- + " \"-Dorg.jboss.boot.log.file=" + bootLog.toString() + "\"" //$NON-NLS-1$ //$NON-NLS-2$
- + " \"-Dlogging.configuration=file:" + logConfig.toString() + "\"" //$NON-NLS-1$ //$NON-NLS-2$
- + " \"-Djboss.home.dir=" + serverHome.toString() + "\""; //$NON-NLS-1$ //$NON-NLS-2$"
+ + SPACE + QUOTE + SYSPROP + JB7_BOOT_LOG_ARG + EQ + bootLog.toString() + QUOTE
+ + SPACE + QUOTE + SYSPROP + JB7_LOGGING_CONFIG_FILE + EQ + "file:" + logConfig.toString() + QUOTE //$NON-NLS-1$
+ + SPACE + QUOTE + SYSPROP + JBOSS_HOME_DIR + EQ + serverHome.toString() + QUOTE;
}
@Override
public String getDefaultRunVMArgs() {
IPath loc = getRuntime().getLocation();
- IPath bootLog = loc.append("standalone").append("log").append("boot.log"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- IPath logConfig = loc.append("standalone").append("configuration").append("logging.properties"); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
- return "-server" //$NON-NLS-1$
- + " -Xms64m" //$NON-NLS-1$
- + " -Xmx512m" //$NON-NLS-1$
- + " -XX:MaxPermSize=256m" //$NON-NLS-1$
- + " -Djava.net.preferIPv4Stack=true" //$NON-NLS-1$
- + " -Dorg.jboss.resolver.warning=true" //$NON-NLS-1$
- + " -Dsun.rmi.dgc.client.gcInterval=3600000" //$NON-NLS-1$
- + " -Dsun.rmi.dgc.server.gcInterval=3600000" //$NON-NLS-1$
- + " \"-Dorg.jboss.boot.log.file=" + bootLog.toString() + "\"" //$NON-NLS-1$ //$NON-NLS-2$
- + " \"-Dlogging.configuration=file:" + logConfig.toString() + "\"" //$NON-NLS-1$ //$NON-NLS-2$
- + " \"-Djboss.home.dir=" + loc.toString() + "\""; //$NON-NLS-1$ //$NON-NLS-2$"
+ return getDefaultRunVMArgs(loc);
}
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7StartConfigurator.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7StartConfigurator.java 2011-11-11 16:21:46 UTC (rev 36304)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7StartConfigurator.java 2011-11-11 19:06:20 UTC (rev 36305)
@@ -10,10 +10,13 @@
******************************************************************************/
package org.jboss.ide.eclipse.as.core.server.internal.v7;
+import java.net.MalformedURLException;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.jdt.launching.IRuntimeClasspathEntry;
import org.eclipse.jdt.launching.IVMInstall;
import org.eclipse.wst.server.core.IServer;
@@ -29,8 +32,40 @@
public LocalJBoss7StartConfigurator(IServer server) throws CoreException {
super(server);
}
+
+ private JBoss7LaunchConfigProperties properties = null;
+
+ @Override
+ protected JBoss7LaunchConfigProperties getProperties() {
+ if( properties == null )
+ properties = createProperties();
+ return properties;
+ }
+ @Override
+ protected JBoss7LaunchConfigProperties createProperties() {
+ return new JBoss7LaunchConfigProperties();
+ }
+
+
@Override
+ protected void doOverrides(ILaunchConfigurationWorkingCopy launchConfig, JBossServer jbossServer, IJBossServerRuntime jbossRuntime) throws CoreException {
+ getProperties().setHost(getHost(jbossServer, jbossRuntime), launchConfig);
+ getProperties().setServerHome(getServerHome(jbossRuntime), jbossRuntime, launchConfig);
+ getProperties().setJreContainer(getJreContainerPath(jbossRuntime), launchConfig);
+ getProperties().setEndorsedDir(getEndorsedDir(jbossRuntime), launchConfig);
+ getProperties().setJavaLibPath(getJavaLibraryPath(jbossRuntime), launchConfig);
+ getProperties().setWorkingDirectory(getWorkingDirectory(jbossServer, jbossRuntime), launchConfig);
+ getProperties().setClasspathProvider(getClasspathProvider(), launchConfig);
+ getProperties().setClasspath(getClasspath(jbossServer, jbossRuntime, getProperties().getClasspath(launchConfig)), launchConfig);
+ getProperties().setUseDefaultClassPath(isUseDefaultClasspath(), launchConfig);
+ getProperties().setServerId(getServerId(jbossServer), launchConfig);
+ getProperties().setModulesFolder(getModulesFolder(jbossServer, jbossRuntime), launchConfig);
+ getProperties().setBootLogFile(getBootLogPath(jbossRuntime), launchConfig);
+ getProperties().setLoggingConfigFile(getLoggingConfigPath(jbossRuntime), launchConfig);
+ }
+
+ @Override
protected String getMainType() {
return IJBossRuntimeConstants.START7_MAIN_TYPE;
}
@@ -42,6 +77,10 @@
.toString();
}
+ protected String getModulesFolder(JBossServer server, IJBossServerRuntime runtime) throws CoreException {
+ return runtime.getRuntime().getLocation().append(IJBossRuntimeConstants.MODULES).toString();
+ }
+
@Override
protected List<String> getClasspath(JBossServer server, IJBossServerRuntime runtime, List<String> currentClasspath) throws CoreException {
IVMInstall vmInstall = runtime.getVM();
@@ -65,8 +104,7 @@
@Override
protected String getServerHome(IJBossServerRuntime runtime) {
- // not needed
- return null;
+ return runtime.getRuntime().getLocation().toString();
}
@Override
@@ -85,4 +123,31 @@
protected String getDefaultVMArguments(IJBossServerRuntime runtime) {
return runtime.getDefaultRunVMArgs();
}
+
+ @Override
+ protected String getJavaLibraryPath(IJBossServerRuntime runtime) {
+ // Intentionally empty
+ return null;
+ }
+
+ protected String getBootLogPath(IJBossServerRuntime runtime) {
+ IPath serverHome = runtime.getRuntime().getLocation();
+ IJBossRuntimeResourceConstants c = new IJBossRuntimeResourceConstants() {};
+ IPath bootLog = serverHome.append(c.AS7_STANDALONE).append(c.FOLDER_LOG).append(c.AS7_BOOT_LOG);
+ return bootLog.toString();
+ }
+
+ protected String getLoggingConfigPath(IJBossServerRuntime runtime) {
+ IJBossRuntimeResourceConstants c = new IJBossRuntimeResourceConstants() {};
+ IPath serverHome = runtime.getRuntime().getLocation();
+ IPath logConfigPath = serverHome.append(c.AS7_STANDALONE).append(c.CONFIGURATION).append(c.LOGGING_PROPERTIES);
+ String logConfigString = null;
+ try {
+ logConfigString = logConfigPath.toFile().toURL().toString();
+ } catch (MalformedURLException murle) {
+ }
+ return logConfigString;
+ }
+
+
}
\ No newline at end of file
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/ArgsUtil.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/ArgsUtil.java 2011-11-11 16:21:46 UTC (rev 36304)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/ArgsUtil.java 2011-11-11 19:06:20 UTC (rev 36305)
@@ -71,7 +71,8 @@
boolean done = false;
String tmp = EMPTY;
StringBuffer buf = new StringBuffer();
-
+ if( s.length() == 0 )
+ done = true;
while( !done ) {
switch(s.charAt(current)) {
case '"':
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IJBossRuntimeConstants.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IJBossRuntimeConstants.java 2011-11-11 16:21:46 UTC (rev 36304)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IJBossRuntimeConstants.java 2011-11-11 19:06:20 UTC (rev 36305)
@@ -13,6 +13,7 @@
public interface IJBossRuntimeConstants {
// Launch configuration constants / Command Line Args
public static final String SPACE = " ";//$NON-NLS-1$
+ public static final String DASH = "-"; //$NON-NLS-1$
public static final String SYSPROP = "-D";//$NON-NLS-1$
public static final String EQ = "="; //$NON-NLS-1$
public static final String QUOTE = "\""; //$NON-NLS-1$
@@ -45,6 +46,16 @@
public static final String JAVA_PREFER_IP4_ARG = "java.net.preferIPv4Stack"; //$NON-NLS-1$
public static final String PROGRAM_NAME_ARG = "program.name"; //$NON-NLS-1$
+ public static final String JB7_MP_ARG = "mp"; //$NON-NLS-1$
+ public static final String MODULES = "modules"; //$NON-NLS-1$
+ public static final String JB7_LOGMODULE_ARG = "logmodule"; //$NON-NLS-1$
+ public static final String JB7_LOGMODULE_DEFAULT = "org.jboss.logmanager"; //$NON-NLS-1$
+ public static final String JB7_JAXPMODULE = "jaxpmodule"; //$NON-NLS-1$
+ public static final String JB7_JAXP_PROVIDER = "javax.xml.jaxp-provider"; //$NON-NLS-1$
+ public static final String JB7_STANDALONE_ARG = "org.jboss.as.standalone"; //$NON-NLS-1$
+ public static final String JB7_BOOT_LOG_ARG = "org.jboss.boot.log.file"; //$NON-NLS-1$
+ public static final String JB7_LOGGING_CONFIG_FILE = "logging.configuration"; //$NON-NLS-1$
+
/* JBoss classes and methods for reflection */
public static final String TWIDDLE_MAIN_TYPE = "org.jboss.console.twiddle.Twiddle"; //$NON-NLS-1$
public static final String SHUTDOWN_MAIN_TYPE = "org.jboss.Shutdown"; //$NON-NLS-1$
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IJBossRuntimeResourceConstants.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IJBossRuntimeResourceConstants.java 2011-11-11 16:21:46 UTC (rev 36304)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IJBossRuntimeResourceConstants.java 2011-11-11 19:06:20 UTC (rev 36305)
@@ -33,7 +33,9 @@
public static final String NATIVE = "native"; //$NON-NLS-1$
public static final String AS7_STANDALONE = "standalone";//$NON-NLS-1$
public static final String AS7_DEPLOYMENTS = "deployments";//$NON-NLS-1$
+ public static final String CONFIGURATION = "configuration"; //$NON-NLS-1$
public static final String AS7_MODULES = "modules";//$NON-NLS-1$
+ public static final String AS7_BOOT_LOG = "boot.log"; //$NON-NLS-1$
public static final String JAVAX = "javax";//$NON-NLS-1$
public static final String[] JBOSS_TEMPORARY_FOLDERS = new String[] { WORK, DATA, FOLDER_TMP, FOLDER_LOG};
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/LaunchConfigUtils.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/LaunchConfigUtils.java 2011-11-11 16:21:46 UTC (rev 36304)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/LaunchConfigUtils.java 2011-11-11 19:06:20 UTC (rev 36305)
@@ -89,7 +89,7 @@
public static String classpathUserClassesToString(ILaunchConfiguration config) throws CoreException {
StringBuilder builder = new StringBuilder();
- List<String> classpath = JBossLaunchConfigProperties.getClasspath(config);
+ List<String> classpath = new JBossLaunchConfigProperties().getClasspath(config);
for(String entry : classpath) {
IRuntimeClasspathEntry runtimeEntry = JavaRuntime.newRuntimeClasspathEntry(entry);
int classpathProperty = runtimeEntry.getClasspathProperty();
@@ -159,7 +159,7 @@
}
public static IServer checkedGetServer(ILaunchConfiguration launchConfig) throws CoreException {
- String serverId = JBossLaunchConfigProperties.getServerId(launchConfig);
+ String serverId = new JBossLaunchConfigProperties().getServerId(launchConfig);
JBossServer server = ServerConverter.checkedFindJBossServer(serverId);
return server.getServer();
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEJBossStartLaunchDelegate.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEJBossStartLaunchDelegate.java 2011-11-11 16:21:46 UTC (rev 36304)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEJBossStartLaunchDelegate.java 2011-11-11 19:06:20 UTC (rev 36305)
@@ -162,7 +162,7 @@
}
private String getDefaultLaunchCommand(ILaunchConfiguration config) throws CoreException {
- String serverId = JBossLaunchConfigProperties.getServerId(config);
+ String serverId = new JBossLaunchConfigProperties().getServerId(config);
JBossServer jbossServer = ServerConverter.checkedFindJBossServer(serverId);
String rseHome = jbossServer.getServer().getAttribute(RSEUtils.RSE_SERVER_HOME_DIR, "");
// initialize startup command to something reasonable
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSERemotePublishHandler.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSERemotePublishHandler.java 2011-11-11 16:21:46 UTC (rev 36304)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSERemotePublishHandler.java 2011-11-11 19:06:20 UTC (rev 36305)
@@ -44,62 +44,139 @@
public boolean shouldRestartModule() {
return shouldRestartModule;
}
- public IStatus[] copyFile(IModuleFile mf, IPath path,
- IProgressMonitor monitor) throws CoreException {
- File file = PublishUtil.getFile(mf);
+ public IStatus[] copyFile(final IModuleFile mf, final IPath path,
+ final IProgressMonitor monitor) throws CoreException {
+ final File file = PublishUtil.getFile(mf);
shouldRestartModule |= PublishCopyUtil.checkRestartModule(file);
- IPath remotePath = root.append(path);
- try {
- method.getFileService().upload(file, remotePath.removeLastSegments(1).toString(),
- remotePath.lastSegment(), true, null, null, monitor);
- } catch( SystemMessageException sme ) {
- IStatus s = new Status(IStatus.ERROR, RSECorePlugin.PLUGIN_ID, IEventCodes.JST_PUB_FAIL,
- "failed to copy to " + remotePath.toString(), sme);
- throw new CoreException(s);
+ final IPath remotePath = root.append(path);
+
+ final CoreException[] coreEx = new CoreException[1];
+ final RuntimeException[] runtEx = new RuntimeException[1];
+ coreEx[0] = null;
+ runtEx[0] = null;
+
+ Thread t = new Thread("RSERemotePublishHandler") {
+ public void run() {
+ try {
+ method.getFileService().upload(file, remotePath.removeLastSegments(1).toString(),
+ remotePath.lastSegment(), true, null, null, monitor);
+ } catch( CoreException ce ) {
+ coreEx[0] = ce;
+ } catch( SystemMessageException sme ) {
+ IStatus s = new Status(IStatus.ERROR, RSECorePlugin.PLUGIN_ID, IEventCodes.JST_PUB_FAIL,
+ "failed to copy to " + remotePath.toString(), sme);
+ coreEx[0] = new CoreException(s);
+ } catch( RuntimeException re) {
+ runtEx[0] = re;
+ }
+ }
+ };
+ t.start();
+ while(!monitor.isCanceled() && t.isAlive()) {
+ try {
+ Thread.sleep(500);
+ } catch(InterruptedException ie) {}
}
+
+ if( monitor.isCanceled()) {
+ throw new CoreException(Status.CANCEL_STATUS);
+ }
+ if( runtEx[0] != null ) throw runtEx[0];
+ if( coreEx[0] != null ) throw coreEx[0];
return new IStatus[]{};
}
- public IStatus[] deleteResource(IPath path, IProgressMonitor monitor)
+ public IStatus[] deleteResource(final IPath path, final IProgressMonitor monitor)
throws CoreException {
- IPath remotePath = root.append(path);
- try {
- method.getFileService().delete(remotePath.removeLastSegments(1).toString(), remotePath.lastSegment(), monitor);
- } catch(SystemElementNotFoundException senfe ) {
- // ignore, file already does not exist remotely
- } catch( SystemMessageException sme ) {
- IStatus s = new Status(IStatus.ERROR, RSECorePlugin.PLUGIN_ID, IEventCodes.JST_PUB_FAIL,
- "failed to delete " + remotePath.toString(), sme);
- throw new CoreException(s);
+ final IPath remotePath = root.append(path);
+ final CoreException[] coreEx = new CoreException[1];
+ final RuntimeException[] runtEx = new RuntimeException[1];
+ coreEx[0] = null;
+ runtEx[0] = null;
+ Thread t = new Thread("RSERemotePublishHandler") {
+ public void run() {
+ try {
+ method.getFileService().delete(remotePath.removeLastSegments(1).toString(), remotePath.lastSegment(), monitor);
+ } catch(SystemElementNotFoundException senfe ) {
+ // ignore, file already does not exist remotely
+ } catch( SystemMessageException sme ) {
+ IStatus s = new Status(IStatus.ERROR, RSECorePlugin.PLUGIN_ID, IEventCodes.JST_PUB_FAIL,
+ "failed to delete " + remotePath.toString(), sme);
+ coreEx[0] = new CoreException(s);
+ } catch(CoreException ce) {
+ coreEx[0] = ce;
+ } catch(RuntimeException re) {
+ runtEx[0] = re;
+ }
+ }
+ };
+ t.start();
+ while(!monitor.isCanceled() && t.isAlive()) {
+ try {
+ Thread.sleep(500);
+ } catch(InterruptedException ie) {}
}
+
+ if( monitor.isCanceled())
+ throw new CoreException(Status.CANCEL_STATUS);
+ if( runtEx[0] != null ) throw runtEx[0];
+ if( coreEx[0] != null ) throw coreEx[0];
return new IStatus[]{};
}
- public IStatus[] makeDirectoryIfRequired(IPath dir,
- IProgressMonitor monitor) throws CoreException {
+ public IStatus[] makeDirectoryIfRequired(final IPath dir,
+ final IProgressMonitor monitor) throws CoreException {
monitor.beginTask("Make directory " + dir.toString(), 100); //$NON-NLS-1$
if( dir.segmentCount() > 0 )
makeDirectoryIfRequired(dir.removeLastSegments(1), ProgressMonitorUtil.submon(monitor, 70));
- IPath toMake = root.append(dir);
+ final IPath toMake = root.append(dir);
if( createdFolders.contains(toMake))
return new IStatus[]{Status.OK_STATUS};
- try {
- if( toMake.segmentCount() > 0 ) {
- method.getFileService().createFolder(toMake.removeLastSegments(1).toString(),
- toMake.lastSegment(), ProgressMonitorUtil.submon(monitor, 30));
+
+ final CoreException[] coreEx = new CoreException[1];
+ final RuntimeException[] runtEx = new RuntimeException[1];
+ final IStatus[] failStat = new IStatus[1];
+ coreEx[0] = null;
+ runtEx[0] = null;
+ failStat[0] = null;
+ Thread t = new Thread("RSERemotePublishHandler") {
+ public void run() {
+ try {
+ if( toMake.segmentCount() > 0 ) {
+ method.getFileService().createFolder(toMake.removeLastSegments(1).toString(),
+ toMake.lastSegment(), ProgressMonitorUtil.submon(monitor, 30));
+ }
+ } catch( SystemMessageException sme ) {
+ IStatus s = new Status(IStatus.ERROR, RSECorePlugin.PLUGIN_ID, IEventCodes.JST_PUB_FAIL,
+ "failed to create folder " + toMake.toString(), sme);
+ failStat[0] = s;
+ } catch( CoreException ce ) {
+ coreEx[0] = ce;
+ } catch( RuntimeException re) {
+ runtEx[0] = re;
+ }
+ createdFolders.add(toMake);
}
- } catch( SystemMessageException sme ) {
- IStatus s = new Status(IStatus.ERROR, RSECorePlugin.PLUGIN_ID, IEventCodes.JST_PUB_FAIL,
- "failed to create folder " + toMake.toString(), sme);
- return new IStatus[]{s};
+ };
+ t.start();
+ while(!monitor.isCanceled() && t.isAlive()) {
+ try {
+ Thread.sleep(500);
+ } catch(InterruptedException ie) {}
}
- createdFolders.add(toMake);
+
+ if( monitor.isCanceled())
+ throw new CoreException(Status.CANCEL_STATUS);
+ if( runtEx[0] != null ) throw runtEx[0];
+ if( coreEx[0] != null ) throw coreEx[0];
+ if( failStat[0] != null ) return failStat;
monitor.done();
return new IStatus[]{};
}
- public IStatus[] touchResource(IPath path) {
- IPath file = root.append(path);
+ // TODO DEPRECATE! This needs an IProgressMonitor api to avoid blockage! JBIDE-9384
+ public IStatus[] touchResource(final IPath path) {
+ final IPath file = root.append(path);
try {
IRemoteFile rf = method.getFileServiceSubSystem().getRemoteFileObject(file.toString(), new NullProgressMonitor());
if( !rf.exists()) {
@@ -114,17 +191,43 @@
return new IStatus[]{};
}
- public boolean isFile(IPath path, IProgressMonitor monitor)
+ public boolean isFile(final IPath path, final IProgressMonitor monitor)
throws CoreException {
- IPath file = root.append(path);
- try {
- IRemoteFile rf = method.getFileServiceSubSystem().getRemoteFileObject(file.toString(), new NullProgressMonitor());
- return rf.exists() && rf.isFile();
- } catch(SystemMessageException sme) {
- IStatus s = new Status(IStatus.ERROR, RSECorePlugin.PLUGIN_ID, IEventCodes.JST_PUB_FAIL,
- "failed to touch remote resource " + file.toString(), sme);
- throw new CoreException(s);
+ final IPath file = root.append(path);
+ final CoreException[] coreEx = new CoreException[1];
+ final RuntimeException[] runtEx = new RuntimeException[1];
+ final Boolean[] boolRet = new Boolean[1];
+ coreEx[0] = null;
+ runtEx[0] = null;
+ boolRet[0] = null;
+ Thread t = new Thread("RSERemotePublishHandler") {
+ public void run() {
+ try {
+ IRemoteFile rf = method.getFileServiceSubSystem().getRemoteFileObject(file.toString(), new NullProgressMonitor());
+ boolRet[0] = rf.exists() && rf.isFile();
+ } catch(SystemMessageException sme) {
+ IStatus s = new Status(IStatus.ERROR, RSECorePlugin.PLUGIN_ID, IEventCodes.JST_PUB_FAIL,
+ "failed to touch remote resource " + file.toString(), sme);
+ coreEx[0] = new CoreException(s);
+ } catch( RuntimeException re) {
+ runtEx[0] = re;
+ }
+ }
+ };
+ t.start();
+ while(!monitor.isCanceled() && t.isAlive()) {
+ try {
+ Thread.sleep(500);
+ } catch(InterruptedException ie) {}
}
+
+ if( monitor.isCanceled()) {
+ throw new CoreException(Status.CANCEL_STATUS);
+ }
+ if( runtEx[0] != null ) throw runtEx[0];
+ if( coreEx[0] != null ) throw coreEx[0];
+ monitor.done();
+ return boolRet[0];
}
}
13 years, 2 months