Author: rob.stryker(a)jboss.com
Date: 2007-10-16 21:52:42 -0400 (Tue, 16 Oct 2007)
New Revision: 4278
Removed:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/NestedPublishInfo.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/JBossServerCorePlugin.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/archives/EjbArchiveType.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/archives/J2EEArchiveType.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/archives/WarArchiveType.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XMLDocumentRepository.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathModel.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/jmx/JMXClassLoaderRepository.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/jmx/JMXModel.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServerBehavior.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossLaunchAdapter.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/ServerAttributeHelper.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/ServerStatePollerType.java
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/StopLaunchConfiguration.java
Log:
JBIDE-1048
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/JBossServerCorePlugin.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/JBossServerCorePlugin.java 2007-10-17
01:13:54 UTC (rev 4277)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/JBossServerCorePlugin.java 2007-10-17
01:52:42 UTC (rev 4278)
@@ -90,17 +90,6 @@
return plugin;
}
-
- public static String getResourceString (String key) {
- try {
- String value = Platform.getResourceString(getDefault().getBundle(), key);
- return value;
- } catch (Exception e) {
- e.printStackTrace();
- return key;
- }
- }
-
/**
* Returns the plugin's resource bundle,
*/
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/archives/EjbArchiveType.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/archives/EjbArchiveType.java 2007-10-17
01:13:54 UTC (rev 4277)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/archives/EjbArchiveType.java 2007-10-17
01:52:42 UTC (rev 4278)
@@ -5,6 +5,7 @@
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.wst.server.core.IModule;
import org.jboss.ide.eclipse.archives.core.model.IArchive;
@@ -44,7 +45,8 @@
IJavaProject proj = JavaCore.create(project);
IPath outputLoc = proj.getOutputLocation();
addFileset(project, topLevel, outputLoc.toOSString(), null);
- } catch( Exception e ) {
+ } catch( JavaModelException jmde) {
+ // ignore. No reporting necessary here
}
}
}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/archives/J2EEArchiveType.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/archives/J2EEArchiveType.java 2007-10-17
01:13:54 UTC (rev 4277)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/archives/J2EEArchiveType.java 2007-10-17
01:52:42 UTC (rev 4278)
@@ -27,7 +27,9 @@
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.JavaModelException;
@@ -40,6 +42,7 @@
import org.jboss.ide.eclipse.archives.core.model.IArchiveFolder;
import org.jboss.ide.eclipse.archives.core.model.IArchiveNode;
import org.jboss.ide.eclipse.archives.core.model.IArchiveType;
+import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
/**
*
@@ -82,7 +85,6 @@
try {
sourcePath = javaProject.getOutputLocation();
} catch (JavaModelException e) {
- e.printStackTrace();
return null;
}
sourcePath = sourcePath.removeFirstSegments(1);
@@ -93,7 +95,7 @@
sourcePathContainer = project.getFolder(sourcePath);
return createGenericIArchive(project, deployDirectory, packageName,
sourcePathContainer);
} catch( Exception e ) {
- e.printStackTrace();
+ JBossServerCorePlugin.getDefault().getLog().log(new Status(IStatus.ERROR,
JBossServerCorePlugin.PLUGIN_ID, "Unexpected Exception", e));
}
return null;
}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/archives/WarArchiveType.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/archives/WarArchiveType.java 2007-10-17
01:13:54 UTC (rev 4277)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/archives/WarArchiveType.java 2007-10-17
01:52:42 UTC (rev 4278)
@@ -27,7 +27,9 @@
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
import org.eclipse.jdt.core.IClasspathEntry;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.JavaCore;
@@ -41,6 +43,7 @@
import org.jboss.ide.eclipse.archives.core.model.IArchiveFileSet;
import org.jboss.ide.eclipse.archives.core.model.IArchiveFolder;
import org.jboss.ide.eclipse.archives.core.model.IArchiveNode;
+import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
/**
*
@@ -111,6 +114,7 @@
outputLoc = outputLoc.append(jp.getOutputLocation());
addFileset(project, folder, jp.getOutputLocation().toOSString(), "**/*");
} catch( JavaModelException jme ) {
+ // no logging
}
}
}
@@ -165,7 +169,7 @@
}
}
} catch( JavaModelException jme ) {
- jme.printStackTrace();
+ // no logging
}
}
}
@@ -205,7 +209,7 @@
}
return topLevel;
} catch( Exception e ) {
- e.printStackTrace();
+ JBossServerCorePlugin.getDefault().getLog().log(new Status(IStatus.ERROR,
JBossServerCorePlugin.PLUGIN_ID, "Unexpected Exception", e));
}
return null;
}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XMLDocumentRepository.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XMLDocumentRepository.java 2007-10-17
01:13:54 UTC (rev 4277)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XMLDocumentRepository.java 2007-10-17
01:52:42 UTC (rev 4278)
@@ -1,32 +1,43 @@
package org.jboss.ide.eclipse.as.core.extensions.descriptors;
import java.io.File;
+import java.io.FileNotFoundException;
import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.MalformedURLException;
import java.net.URL;
import java.util.HashMap;
+import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import org.dom4j.Document;
+import org.dom4j.DocumentException;
import org.dom4j.io.OutputFormat;
import org.dom4j.io.SAXReader;
import org.dom4j.io.XMLWriter;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
+import org.xml.sax.SAXException;
/**
* Parses and potentially stores descriptor files.
*
* @author rstryker
- *
+ *
*/
public class XMLDocumentRepository {
private static XMLDocumentRepository instance = null;
+
public static XMLDocumentRepository getDefault() {
- if( instance == null )
+ if (instance == null)
instance = new XMLDocumentRepository();
return instance;
}
-
+
private HashMap pathToDocument;
private HashMap pathToTimestamp;
private XMLDocumentRepository parent;
@@ -45,52 +56,73 @@
public Document getDocument(String fullPath) {
return getDocument(fullPath, true);
}
-
+
public Document getDocument(String fullPath, boolean load) {
return getDocument(fullPath, load, true);
}
-
+
public Document getDocument(String fullPath, boolean load, boolean save) {
- Document d = (Document)pathToDocument.get(fullPath);
- if( d == null && load ) {
+ Document d = (Document) pathToDocument.get(fullPath);
+ if (d == null && load) {
d = loadDocument(fullPath);
- if( save ) {
+ if (save) {
pathToDocument.put(fullPath, d);
- pathToTimestamp.put(fullPath, new Long(new File(fullPath).lastModified()));
+ pathToTimestamp.put(fullPath, new Long(new File(fullPath)
+ .lastModified()));
}
}
return d;
}
-
+
public boolean refresh(String fullPath) {
- if( new File(fullPath).lastModified() !=
((Long)pathToTimestamp.get(fullPath)).longValue()) {
+ if (new File(fullPath).lastModified() != ((Long) pathToTimestamp
+ .get(fullPath)).longValue()) {
pathToDocument.put(fullPath, loadDocument(fullPath));
- pathToTimestamp.put(fullPath, new Long(new File(fullPath).lastModified()));
+ pathToTimestamp.put(fullPath, new Long(new File(fullPath)
+ .lastModified()));
return true;
}
return false;
}
-
+
private Document loadDocument(String fullpath) {
+ Exception ex = null;
try {
- URL url = new File(fullpath).toURI().toURL();
+ URL url;
+ url = new File(fullpath).toURI().toURL();
SAXParserFactory spf = SAXParserFactory.newInstance();
SAXParser sp = spf.newSAXParser();
-
sp.getXMLReader().setFeature("http://apache.org/xml/features/nonvali...;,
false);
-
+ sp
+ .getXMLReader()
+ .setFeature(
+ "http://apache.org/xml/features/nonvalidating/load-external-dtd",
+ false);
+
SAXReader reader = new SAXReader(false);
reader.setXMLReader(sp.getXMLReader());
Document document = reader.read(url);
-
+
return document;
- } catch( Exception e ) {
- e.printStackTrace();
+ } catch (MalformedURLException e) {
+ ex = e;
+ } catch (ParserConfigurationException e) {
+ ex = e;
+ } catch (SAXException e) {
+ ex = e;
+ } catch (DocumentException e) {
+ ex = e;
}
+ if (ex != null) {
+ JBossServerCorePlugin.getDefault().getLog().log(
+ new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
+ "Could not load document: " + fullpath, ex));
+ }
return null;
}
public static void saveDocument(Document doc, String fullPath) {
+ Exception ex = null;
try {
File outFile = new File(fullPath);
FileOutputStream os = new FileOutputStream(outFile);
@@ -98,9 +130,19 @@
XMLWriter writer = new XMLWriter(os, outformat);
writer.write(doc);
writer.flush();
- } catch( Exception e ) {
- e.printStackTrace();
+ } catch (MalformedURLException e) {
+ ex = e;
+ } catch (FileNotFoundException e) {
+ ex = e;
+ } catch (UnsupportedEncodingException e) {
+ ex = e;
+ } catch (IOException e) {
+ ex = e;
}
-
+ if (ex != null) {
+ JBossServerCorePlugin.getDefault().getLog().log(
+ new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
+ "Could not save document: " + fullPath, ex));
+ }
}
}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathModel.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathModel.java 2007-10-17
01:13:54 UTC (rev 4277)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathModel.java 2007-10-17
01:52:42 UTC (rev 4278)
@@ -1,5 +1,7 @@
package org.jboss.ide.eclipse.as.core.extensions.descriptors;
+import java.io.IOException;
+import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Arrays;
@@ -10,8 +12,10 @@
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.IServerLifecycleListener;
import org.eclipse.wst.server.core.ServerCore;
@@ -187,11 +191,9 @@
for( int i = 0; i < queriesByName.length; i++ ) {
queryAsStringValues = helper.getAttribute(QUERY + "." +
queriesByName[i].replace(' ', '_'), (List)null);
if( queryAsStringValues != null ) {
- try {
- XPathQuery q =new
XPathQuery(queriesByName[i].substring(queriesByName[i].indexOf(Path.SEPARATOR)+1),
queryAsStringValues);
- q.setCategory(category);
- returnList.add(q);
- } catch( Exception e ) {e.printStackTrace(); }
+ XPathQuery q =new
XPathQuery(queriesByName[i].substring(queriesByName[i].indexOf(Path.SEPARATOR)+1),
queryAsStringValues);
+ q.setCategory(category);
+ returnList.add(q);
}
}
return (XPathQuery[]) returnList.toArray(new XPathQuery[returnList.size()]);
@@ -239,11 +241,12 @@
}
}
retVal.add(ports);
- } catch( Exception e ) {
- e.printStackTrace();
+ } catch (IOException e) {
+ JBossServerCorePlugin.getDefault().getLog().log(
+ new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
+ "Error loading default xpaths", e));
}
serverToCategories.put(server.getId(), retVal);
- //save(server);
}
}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/jmx/JMXClassLoaderRepository.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/jmx/JMXClassLoaderRepository.java 2007-10-17
01:13:54 UTC (rev 4277)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/jmx/JMXClassLoaderRepository.java 2007-10-17
01:52:42 UTC (rev 4278)
@@ -7,8 +7,11 @@
import java.util.HashMap;
import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
import org.eclipse.wst.server.core.IRuntime;
import org.eclipse.wst.server.core.IServer;
+import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
/**
* A repository for classloaders that relate to servers,
@@ -99,6 +102,9 @@
Thread.currentThread().getContextClassLoader());
idToLoader.put(s.getId(), loader);
} catch (MalformedURLException murle) {
+ JBossServerCorePlugin.getDefault().getLog().log(
+ new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
+ "Cannot load JMX classes for server: " + s.getName(), murle));
}
}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/jmx/JMXModel.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/jmx/JMXModel.java 2007-10-17
01:13:54 UTC (rev 4277)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/jmx/JMXModel.java 2007-10-17
01:52:42 UTC (rev 4278)
@@ -21,7 +21,10 @@
import javax.management.ReflectionException;
import javax.naming.InitialContext;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
import org.eclipse.wst.server.core.IServer;
+import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
public class JMXModel {
protected static JMXModel instance;
@@ -251,6 +254,8 @@
tmp.loadValue(connection);
wrapped.add(tmp);
} catch( Exception e ) {
+ // some attributes may not load because the result is not serializable.
+ // no need to report every error
}
}
attributes = (WrappedMBeanAttributeInfo[]) wrapped.toArray(new
WrappedMBeanAttributeInfo[wrapped.size()]);
@@ -379,7 +384,9 @@
r.run(connection);
}
} catch (Exception e) {
- e.printStackTrace();
+ JBossServerCorePlugin.getDefault().getLog().log(
+ new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
+ "Error while running JMX-safe code", e));
}
Thread.currentThread().setContextClassLoader(currentLoader);
}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServerBehavior.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServerBehavior.java 2007-10-17
01:13:54 UTC (rev 4277)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServerBehavior.java 2007-10-17
01:52:42 UTC (rev 4278)
@@ -22,6 +22,7 @@
import org.eclipse.wst.server.core.internal.ServerPlugin;
import org.eclipse.wst.server.core.model.PublishOperation;
import org.eclipse.wst.server.core.model.ServerBehaviourDelegate;
+import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel;
import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel.EventLogTreeItem;
import org.jboss.ide.eclipse.as.core.modules.PackageModuleFactory;
@@ -172,16 +173,16 @@
* hack for eclipse bug 169570
*/
public IStatus publishOneModule(IModule[] module, int kind, int deltaKind, boolean
recurse, IProgressMonitor monitor) {
+ try {
- // add it to the server first
- if( module.length == 1 )
- addAndRemoveModules(module, deltaKind);
+ // add it to the server first
+ if( module.length == 1 )
+ addAndRemoveModules(module, deltaKind);
- ArrayList moduleList = new ArrayList();
- ArrayList deltaKindList = new ArrayList();
- fillPublishOneModuleLists(module, moduleList, deltaKindList, deltaKind, recurse);
+ ArrayList moduleList = new ArrayList();
+ ArrayList deltaKindList = new ArrayList();
+ fillPublishOneModuleLists(module, moduleList, deltaKindList, deltaKind, recurse);
- try {
((Server)getServer()).getServerPublishInfo().startCaching();
@@ -210,10 +211,12 @@
return Status.OK_STATUS;
- } catch( Exception e ) {
-
+ } catch( CoreException e ) {
+ IStatus s = new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
+ "Unexpected Exception publishing one module: ", e);
+ JBossServerCorePlugin.getDefault().getLog().log(s);
+ return s;
}
- return Status.CANCEL_STATUS;
}
protected void fillPublishOneModuleLists(IModule[] module, ArrayList moduleList,
ArrayList deltaKindList, int deltaKind, boolean recurse) {
@@ -239,19 +242,18 @@
}
}
- protected void addAndRemoveModules(IModule[] module, int deltaKind) {
+ protected void addAndRemoveModules(IModule[] module, int deltaKind) throws CoreException
{
if( getServer() == null ) return;
boolean contains = ServerUtil.containsModule(getServer(), module[0], new
NullProgressMonitor());
- try {
- if( !contains && (deltaKind == ServerBehaviourDelegate.ADDED) || (deltaKind ==
ServerBehaviourDelegate.CHANGED)) {
- IServerWorkingCopy wc = getServer().createWorkingCopy();
- ServerUtil.modifyModules(wc, module, new IModule[0], new NullProgressMonitor());
- wc.save(false, new NullProgressMonitor());
- } else if( contains && deltaKind == ServerBehaviourDelegate.REMOVED) {
- IServerWorkingCopy wc = getServer().createWorkingCopy();
- ServerUtil.modifyModules(wc, new IModule[0], module, new NullProgressMonitor());
- wc.save(false, new NullProgressMonitor());
- }
- } catch( Exception e ) {} // swallowed
+
+ if( !contains && (deltaKind == ServerBehaviourDelegate.ADDED) || (deltaKind ==
ServerBehaviourDelegate.CHANGED)) {
+ IServerWorkingCopy wc = getServer().createWorkingCopy();
+ ServerUtil.modifyModules(wc, module, new IModule[0], new NullProgressMonitor());
+ wc.save(false, new NullProgressMonitor());
+ } else if( contains && deltaKind == ServerBehaviourDelegate.REMOVED) {
+ IServerWorkingCopy wc = getServer().createWorkingCopy();
+ ServerUtil.modifyModules(wc, new IModule[0], module, new NullProgressMonitor());
+ wc.save(false, new NullProgressMonitor());
+ }
}
}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossLaunchAdapter.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossLaunchAdapter.java 2007-10-17
01:13:54 UTC (rev 4277)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossLaunchAdapter.java 2007-10-17
01:52:42 UTC (rev 4278)
@@ -2,6 +2,7 @@
import java.io.FileInputStream;
import java.io.IOException;
+import java.net.MalformedURLException;
import java.net.URL;
import java.util.Properties;
@@ -92,8 +93,8 @@
url = new URL(url, path);
}
return new HttpLaunchable(url);
- } catch (Exception e) {
- return null;
+ } catch (MalformedURLException e) {
+ return null; // no launchable available.
}
}
Deleted:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/NestedPublishInfo.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/NestedPublishInfo.java 2007-10-17
01:13:54 UTC (rev 4277)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/NestedPublishInfo.java 2007-10-17
01:52:42 UTC (rev 4278)
@@ -1,99 +0,0 @@
-package org.jboss.ide.eclipse.as.core.server.internal;
-
-import java.io.DataInput;
-import java.io.DataOutput;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.IModuleType;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.internal.ModulePublishInfo;
-import org.eclipse.wst.server.core.model.IModuleResourceDelta;
-
-
-
-public class NestedPublishInfo {
- public static final String PUBLISH_INFO = "publishInfo";
- public static final String INDEX = "index.properties";
- private static NestedPublishInfo instance;
-
-
- public static NestedPublishInfo getDefault() {
- if( instance == null ) {
- instance = new NestedPublishInfo();
- }
- return instance;
- }
-
- HashMap idToSPI;
- protected NestedPublishInfo() {
- idToSPI = new HashMap();
- }
-
- public NestedServerPublishInfo getServerPublishInfo(IServer server) {
- if( idToSPI.get(server.getId()) == null ) {
- idToSPI.put(server.getId(), new NestedServerPublishInfo());
- }
- return (NestedServerPublishInfo)idToSPI.get(server.getId());
- }
-
- public static class NestedServerPublishInfo {
-
- private HashMap<String, OpenedModulePublishInfo> idToModulePublishInfo;
- public NestedServerPublishInfo() {
- idToModulePublishInfo = new HashMap<String, OpenedModulePublishInfo>();
- }
-
- public ModulePublishInfo getPublishInfo(ArrayList ids, IModule module) {
- String id = getId(ids);
- ModulePublishInfo ret = idToModulePublishInfo.get(id);
- if( ret == null ) {
- ret = new OpenedModulePublishInfo(id, module.getName(), module.getModuleType());
- idToModulePublishInfo.put(id, (OpenedModulePublishInfo) ret);
- }
- return ret;
- }
-
- // Takes a list of the nesting pattern for the modules
- // followed by the desired module (which can share its current resources)
- public IModuleResourceDelta[] getDelta(ArrayList ids, IModule module) {
- return ((OpenedModulePublishInfo)getPublishInfo(ids, module)).getDelta(new
IModule[]{module});
- }
-
- protected String getId(ArrayList ids) {
- String result = "";
- Iterator i = ids.iterator();
- while(i.hasNext()) {
- result += i.next().hashCode() + "" + Path.SEPARATOR;
- }
- return result;
- }
- }
-
- public static class OpenedModulePublishInfo extends ModulePublishInfo {
-
- public OpenedModulePublishInfo(DataInput in) throws IOException {
- super(in);
- }
-
- public OpenedModulePublishInfo(String moduleId, String name, IModuleType moduleType) {
- super(moduleId, name, moduleType);
- }
-
- public IModuleResourceDelta[] getDelta(IModule[] module) {
- return super.getDelta(module);
- }
-
- public void load(DataInput in) throws IOException {
- super.load(in);
- }
-
- public void save(DataOutput out) {
- super.save(out);
- }
- }
-}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/ServerAttributeHelper.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/ServerAttributeHelper.java 2007-10-17
01:13:54 UTC (rev 4277)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/ServerAttributeHelper.java 2007-10-17
01:52:42 UTC (rev 4278)
@@ -26,11 +26,14 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Status;
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.IServerWorkingCopy;
import org.eclipse.wst.server.core.internal.Server;
import org.eclipse.wst.server.core.internal.ServerWorkingCopy;
+import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
/**
* This class just opens up the get and set attributes for a server,
@@ -113,7 +116,11 @@
public IServer save() {
try {
return save(false, new NullProgressMonitor());
- } catch( Exception e ) {}
+ } catch( Exception e ) {
+ IStatus s = new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
+ "Unexpected Exception while saving server metadata: ", e);
+ JBossServerCorePlugin.getDefault().getLog().log(s);
+ }
return null;
}
}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/ServerStatePollerType.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/ServerStatePollerType.java 2007-10-17
01:13:54 UTC (rev 4277)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/ServerStatePollerType.java 2007-10-17
01:52:42 UTC (rev 4278)
@@ -1,6 +1,9 @@
package org.jboss.ide.eclipse.as.core.server.internal;
import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
import org.jboss.ide.eclipse.as.core.server.IServerStatePoller;
public class ServerStatePollerType {
@@ -24,6 +27,9 @@
try {
return (IServerStatePoller)el.createExecutableExtension("class");
} catch( Exception e ) {
+ IStatus s = new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
+ "Error instantiating Server Poller: " + el.getAttribute("name"),
e);
+ JBossServerCorePlugin.getDefault().getLog().log(s);
}
return null;
}
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 2007-10-17
01:13:54 UTC (rev 4277)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/AbstractJBossLaunchConfigType.java 2007-10-17
01:52:42 UTC (rev 4278)
@@ -127,15 +127,17 @@
protected static ArrayList<String>
convertClasspath(ArrayList<IRuntimeClasspathEntry> cp, IVMInstall vmInstall) {
if (vmInstall != null) {
- try {
- cp.add(JavaRuntime.newRuntimeContainerClasspathEntry(
- new Path(JavaRuntime.JRE_CONTAINER).append(
- "org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType")
- .append(vmInstall.getName()),
- IRuntimeClasspathEntry.BOOTSTRAP_CLASSES));
- } catch (Exception e) {
- // ignore
- }
+ try {
+ cp.add(JavaRuntime.newRuntimeContainerClasspathEntry(
+ new Path(JavaRuntime.JRE_CONTAINER).append(
+ "org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType")
+ .append(vmInstall.getName()),
+ IRuntimeClasspathEntry.BOOTSTRAP_CLASSES));
+ } catch (CoreException e) {
+ IStatus s = new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
+ "Unexpected Exception converting launch classpath: ", e);
+ JBossServerCorePlugin.getDefault().getLog().log(s);
+ }
IPath jrePath = new Path(vmInstall.getInstallLocation()
.getAbsolutePath());
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/StopLaunchConfiguration.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/StopLaunchConfiguration.java 2007-10-17
01:13:54 UTC (rev 4277)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/StopLaunchConfiguration.java 2007-10-17
01:52:42 UTC (rev 4278)
@@ -5,8 +5,10 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.ILaunch;
import org.eclipse.debug.core.ILaunchConfiguration;
@@ -15,6 +17,7 @@
import org.eclipse.debug.core.ILaunchManager;
import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
import org.eclipse.wst.server.core.IServer;
+import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
import org.jboss.ide.eclipse.as.core.server.internal.JBossServer;
@@ -31,6 +34,9 @@
wc.launch(ILaunchManager.RUN_MODE, new NullProgressMonitor());
} catch( CoreException ce ) {
// report it from here
+ IStatus s = new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
+ "Unexpected Exception launching stop server command: ", ce);
+ JBossServerCorePlugin.getDefault().getLog().log(s);
}
}