Author: rob.stryker(a)jboss.com
Date: 2007-10-17 23:57:50 -0400 (Wed, 17 Oct 2007)
New Revision: 4311
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/ExtensionManager.java
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/EarArchiveType.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/descriptors/AntFileFilter.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/XPathCategory.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathFileResult.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/descriptors/XPathQuery.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/extensions/jmx/JMXUtil.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/polling/JMXPoller.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/polling/ProcessTerminatedPoller.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/polling/TimeoutPoller.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/ArchivesBuildListener.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/ArchivesModelModuleContributor.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/PackagedArtifactAdapter.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/SingleDeployableFactory.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IJBossServerPublisher.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IJBossServerRuntime.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IServerPollingAttributes.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IServerStartupParameters.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IServerStatePoller.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/UnitedServerListener.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/UnitedServerListenerManager.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServer.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/DeployableServerRuntime.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/JBossServer.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServerBehavior.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/DeployableLaunchConfiguration.java
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/TwiddleLaunchConfiguration.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/TwiddleLauncher.java
Log:
Refactored for exceptions (JBIDE-1048)
added headers to files that didn't have
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/ExtensionManager.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/ExtensionManager.java 2007-10-17
22:36:41 UTC (rev 4310)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/ExtensionManager.java 2007-10-18
03:57:50 UTC (rev 4311)
@@ -31,18 +31,25 @@
import org.jboss.ide.eclipse.as.core.server.internal.ServerStatePollerType;
/**
- *
+ * Manages the extensions for this plugin
* @author rob.stryker(a)jboss.com
*/
public class ExtensionManager {
+
+ /** Singleton instance of the manager */
private static ExtensionManager instance;
+
+ /** Singleton getter */
public static ExtensionManager getDefault() {
if( instance == null )
instance = new ExtensionManager();
return instance;
}
+ /** The map of pollerID -> PollerObject */
private HashMap<String, ServerStatePollerType> pollers;
+
+ /** The method used to load / instantiate the pollers */
public void loadPollers() {
pollers = new HashMap<String, ServerStatePollerType>();
IExtensionRegistry registry = Platform.getExtensionRegistry();
@@ -51,11 +58,19 @@
pollers.put(cf[i].getAttribute("id"), new ServerStatePollerType(cf[i]));
}
}
+
+ /**
+ * Get a poller with the specified ID
+ * @param id the id
+ * @return the poller
+ */
public ServerStatePollerType getPollerType(String id) {
if( pollers == null )
loadPollers();
return pollers.get(id);
}
+
+ /** Get only the pollers that can poll for startups */
public ServerStatePollerType[] getStartupPollers() {
if( pollers == null )
loadPollers();
@@ -69,6 +84,8 @@
}
return list.toArray(new ServerStatePollerType[list.size()]);
}
+
+ /** Get only the pollers that can poll for shutdowns */
public ServerStatePollerType[] getShutdownPollers() {
if( pollers == null )
loadPollers();
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
22:36:41 UTC (rev 4310)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/JBossServerCorePlugin.java 2007-10-18
03:57:50 UTC (rev 4311)
@@ -71,6 +71,8 @@
*/
public void start(BundleContext context) throws Exception {
super.start(context);
+
+ // Start the array of models that need to be started
ArchivesBuildListener.getInstance();
XPathModel.getDefault();
UnitedServerListenerManager.getDefault();
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/archives/EarArchiveType.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/archives/EarArchiveType.java 2007-10-17
22:36:41 UTC (rev 4310)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/archives/EarArchiveType.java 2007-10-18
03:57:50 UTC (rev 4311)
@@ -1,3 +1,24 @@
+/**
+ * JBoss, a Division of Red Hat
+ * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+* This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
package org.jboss.ide.eclipse.as.core.extensions.archives;
import org.eclipse.core.resources.IContainer;
@@ -13,6 +34,9 @@
import org.jboss.ide.eclipse.archives.core.model.IArchiveType;
import org.jboss.ide.eclipse.as.core.modules.ModulePackageTypeConverter;
+/**
+ * @author rob.stryker(a)redhat.com
+ */
public class EarArchiveType extends J2EEArchiveType {
public final static String ID =
"org.jboss.ide.eclipse.as.core.packages.earPackageType";
public String getAssociatedModuleType() {
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
22:36:41 UTC (rev 4310)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/archives/EjbArchiveType.java 2007-10-18
03:57:50 UTC (rev 4311)
@@ -1,3 +1,24 @@
+/**
+ * JBoss, a Division of Red Hat
+ * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+* This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
package org.jboss.ide.eclipse.as.core.extensions.archives;
import org.eclipse.core.resources.IProject;
@@ -9,6 +30,10 @@
import org.eclipse.wst.server.core.IModule;
import org.jboss.ide.eclipse.archives.core.model.IArchive;
+/**
+ *
+ * @author rob.stryker(a)redhat.com
+ */
public class EjbArchiveType extends J2EEArchiveType {
public final static String ID =
"org.jboss.ide.eclipse.as.core.packages.ejbPackageType";
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/AntFileFilter.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/AntFileFilter.java 2007-10-17
22:36:41 UTC (rev 4310)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/AntFileFilter.java 2007-10-18
03:57:50 UTC (rev 4311)
@@ -1,3 +1,24 @@
+/**
+ * JBoss, a Division of Red Hat
+ * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+* This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
package org.jboss.ide.eclipse.as.core.extensions.descriptors;
import org.apache.tools.ant.DirectoryScanner;
@@ -2,2 +23,7 @@
+/**
+ * A class to scann files and folders for files that match a pattern
+ * Delegates to a DirectoryScanner provided by the ant plugins
+ * @author rob.stryker(a)redhat.com
+ */
public class AntFileFilter {
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
22:36:41 UTC (rev 4310)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XMLDocumentRepository.java 2007-10-18
03:57:50 UTC (rev 4311)
@@ -26,41 +26,71 @@
/**
* Parses and potentially stores descriptor files.
*
- * @author rstryker
+ * @author rstryker(a)redhat.com
*
*/
public class XMLDocumentRepository {
+ /** singleton instance */
private static XMLDocumentRepository instance = null;
+ /** singleton getter */
public static XMLDocumentRepository getDefault() {
if (instance == null)
instance = new XMLDocumentRepository();
return instance;
}
+ /** maps a path to its actual document object */
private HashMap pathToDocument;
+
+ /** maps a path to the last time that path's file was changed */
private HashMap pathToTimestamp;
+
+ /** a link to a parent repository which may already contain the document
+ * and may prevent a costly reparse. */
private XMLDocumentRepository parent;
+ /** package-private constructor */
XMLDocumentRepository() {
pathToDocument = new HashMap();
pathToTimestamp = new HashMap();
}
+ /** public constructor with a parent repository
+ * @param parent The parent repository
+ */
public XMLDocumentRepository(XMLDocumentRepository parent) {
pathToDocument = new HashMap();
pathToTimestamp = new HashMap();
this.parent = parent;
}
+ /**
+ * get the document for a full path
+ * @param fullPath
+ * @return the document
+ */
public Document getDocument(String fullPath) {
return getDocument(fullPath, true);
}
+ /**
+ * get the document for a full path.
+ * @param fullPath The path of the file
+ * @param load Whether to load if the document has not already been loaded
+ * @return the document
+ */
public Document getDocument(String fullPath, boolean load) {
return getDocument(fullPath, load, true);
}
+ /**
+ * get the document for a full path
+ * @param fullPath the path of the file
+ * @param load whether to load the document if not already loaded
+ * @param save whether to save this document in the repository or just return it
+ * @return the document
+ */
public Document getDocument(String fullPath, boolean load, boolean save) {
Document d = (Document) pathToDocument.get(fullPath);
if (d == null && load) {
@@ -74,6 +104,11 @@
return d;
}
+ /**
+ * refresh the document for a given file
+ * @param fullPath the path to the file
+ * @return whether the document was re-read
+ */
public boolean refresh(String fullPath) {
if (new File(fullPath).lastModified() != ((Long) pathToTimestamp
.get(fullPath)).longValue()) {
@@ -85,6 +120,10 @@
return false;
}
+ /*
+ * Load the document for some path and return it.
+ * Upon exception, log the exception and return null
+ */
private Document loadDocument(String fullpath) {
Exception ex = null;
try {
@@ -121,6 +160,10 @@
return null;
}
+ /*
+ * Save some document "doc" to some full file path
+ * Upon error, log it
+ */
public static void saveDocument(Document doc, String fullPath) {
Exception ex = null;
try {
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathCategory.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathCategory.java 2007-10-17
22:36:41 UTC (rev 4310)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathCategory.java 2007-10-18
03:57:50 UTC (rev 4311)
@@ -1,3 +1,24 @@
+/**
+ * JBoss, a Division of Red Hat
+ * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+* This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
package org.jboss.ide.eclipse.as.core.extensions.descriptors;
import java.util.HashMap;
@@ -5,10 +26,16 @@
import org.eclipse.wst.server.core.IServer;
import org.jboss.ide.eclipse.as.core.server.internal.ServerAttributeHelper;
+/**
+ * A class representing an XPath Category, which
+ * is owned by a server and has XPath queries in it
+ * @author rob.stryker(a)redhat.com
+ *
+ */
public class XPathCategory {
protected String name; // cannot include delimiter from the model, comma
protected IServer server;
- protected HashMap children;
+ protected HashMap<String, XPathQuery> children;
public XPathCategory(String name, IServer server) {
this.name = name;
@@ -21,20 +48,23 @@
return children != null;
}
+ /*
+ * Lazily load the queries upon request
+ */
public XPathQuery[] getQueries() {
if( children == null ) {
- children = new HashMap();
+ children = new HashMap<String, XPathQuery>();
XPathQuery[] queries = XPathModel.getDefault().loadQueries(this, server);
for( int i = 0; i < queries.length; i++ ) {
children.put(queries[i].getName(), queries[i]);
}
}
- return (XPathQuery[]) children.values().toArray(new XPathQuery[children.size()]);
+ return children.values().toArray(new XPathQuery[children.size()]);
}
public XPathQuery getQuery(String name) {
getQueries();
- return (XPathQuery)children.get(name);
+ return children.get(name);
}
public void addQuery(XPathQuery query) {
getQueries();
@@ -47,6 +77,9 @@
children.remove(query.getName());
}
+ /*
+ * Save these queries to its server object
+ */
public void save() {
ServerAttributeHelper helper = ServerAttributeHelper.createHelper(server);
XPathModel.getDefault().saveCategory(this, server, helper);
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathFileResult.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathFileResult.java 2007-10-17
22:36:41 UTC (rev 4310)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathFileResult.java 2007-10-18
03:57:50 UTC (rev 4311)
@@ -1,3 +1,24 @@
+/**
+ * JBoss, a Division of Red Hat
+ * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+* This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
package org.jboss.ide.eclipse.as.core.extensions.descriptors;
import java.util.ArrayList;
@@ -10,14 +31,19 @@
import org.dom4j.tree.DefaultAttribute;
import org.dom4j.tree.DefaultElement;
-
+/**
+ * A class representing an xpath file result.
+ * It's children may be individual element results
+ * @author rob.stryker(a)redhat.com
+ *
+ */
public class XPathFileResult {
protected XPathQuery query;
- protected List nodeList;
+ protected List<Node> nodeList;
protected String fileLoc;
protected XPathResultNode[] children;
- public XPathFileResult(XPathQuery query, String fileLoc, List nodeList) {
+ public XPathFileResult(XPathQuery query, String fileLoc, List<Node> nodeList) {
this.query = query;
this.fileLoc = fileLoc;
this.nodeList = nodeList;
@@ -31,20 +57,21 @@
return query;
}
+ /* Lazily load the children */
public XPathResultNode[] getChildren() {
if( children == null ) {
- ArrayList childList = new ArrayList();
- Iterator i = nodeList.iterator();
+ ArrayList<XPathResultNode> childList = new ArrayList<XPathResultNode>();
+ Iterator<Node> i = nodeList.iterator();
int z = 0;
while(i.hasNext()) {
- Node o = (Node)i.next();
- childList.add(new XPathResultNode(o, query.getAttribute(), z++));
+ childList.add(new XPathResultNode(i.next(), query.getAttribute(), z++));
}
- children = (XPathResultNode[]) childList.toArray(new
XPathResultNode[childList.size()]);
+ children = childList.toArray(new XPathResultNode[childList.size()]);
}
return children;
}
+ /* A class representing an actual result node / element in the document */
public class XPathResultNode {
protected Node node;
protected String attribute;
@@ -121,27 +148,27 @@
public String[] getElementChildrenNames() {
DefaultElement element = ((DefaultElement)node);
- List l = element.elements();
+ List<DefaultElement> l = element.elements();
DefaultElement child;
- ArrayList names = new ArrayList();
- for( Iterator i = l.iterator();i.hasNext();) {
- child = (DefaultElement)i.next();
+ ArrayList<String> names = new ArrayList<String>();
+ for( Iterator<DefaultElement> i = l.iterator();i.hasNext();) {
+ child = i.next();
if( !names.contains(child.getName()))
names.add(child.getName());
}
- return (String[]) names.toArray(new String[names.size()]);
+ return names.toArray(new String[names.size()]);
}
public String[] getElementAttributeNames() {
DefaultElement element = ((DefaultElement)node);
List l = element.attributes();
DefaultAttribute child;
- ArrayList names = new ArrayList();
+ ArrayList<String> names = new ArrayList<String>();
for( Iterator i = l.iterator();i.hasNext();) {
child = (DefaultAttribute)i.next();
if( !names.contains(child.getName()))
names.add(child.getName());
}
- return (String[]) names.toArray(new String[names.size()]);
+ return names.toArray(new String[names.size()]);
}
public String[] getElementAttributeValues(String attName) {
DefaultElement element = ((DefaultElement)node);
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
22:36:41 UTC (rev 4310)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathModel.java 2007-10-18
03:57:50 UTC (rev 4311)
@@ -1,7 +1,27 @@
+/**
+ * JBoss, a Division of Red Hat
+ * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+* This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
package org.jboss.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;
@@ -22,8 +42,13 @@
import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
import org.jboss.ide.eclipse.as.core.server.internal.AbstractJBossServerRuntime;
import org.jboss.ide.eclipse.as.core.server.internal.ServerAttributeHelper;
-import org.jboss.ide.eclipse.as.core.util.ServerConverter;
+/**
+ * The class representing the model for all xpath storage and searching
+ * Also API entrance point.
+ * @author rob.stryker(a)redhat.com
+ *
+ */
public class XPathModel {
public static final String EMPTY_STRING =
"org.jboss.ide.eclipse.as.core.model.descriptor.EmptyString";
public static final String PORTS_CATEGORY_NAME = "Ports";
@@ -35,6 +60,7 @@
private static final String QUERY =
"org.jboss.ide.eclipse.as.core.model.descriptor.Query";
+ /* Singleton */
private static XPathModel instance;
public static XPathModel getDefault() {
if( instance == null )
@@ -43,6 +69,10 @@
}
protected HashMap<String, ArrayList<XPathCategory>> serverToCategories;
+
+ /* Constructor. Adds lifecycle listener to know when there's a new server and
+ * properly add the default XPaths to that server object.
+ */
public XPathModel() {
serverToCategories = new HashMap<String, ArrayList<XPathCategory>>();
ServerCore.addServerLifecycleListener(new IServerLifecycleListener() {
@@ -68,7 +98,7 @@
return null;
}
- public ArrayList<XPathCategory> getCategoryCollection(IServer server) {
+ protected ArrayList<XPathCategory> getCategoryCollection(IServer server) {
if( serverToCategories.get(server.getId()) == null ) {
ArrayList<XPathCategory> val = new
ArrayList<XPathCategory>(Arrays.asList(load(server)));
serverToCategories.put(server.getId(), val);
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathQuery.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathQuery.java 2007-10-17
22:36:41 UTC (rev 4310)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathQuery.java 2007-10-18
03:57:50 UTC (rev 4311)
@@ -1,3 +1,24 @@
+/**
+ * JBoss, a Division of Red Hat
+ * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+* This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
package org.jboss.ide.eclipse.as.core.extensions.descriptors;
import java.io.Serializable;
@@ -4,6 +25,7 @@
import java.util.ArrayList;
import java.util.List;
+import org.dom4j.Node;
import org.eclipse.core.runtime.Path;
import
org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathFileResult.XPathResultNode;
@@ -80,15 +102,15 @@
protected void loadResults() {
String[] files = getFilter().getIncludedFiles();
String fileLoc;
- ArrayList resultList = new ArrayList();
- List nodeList;
+ ArrayList<XPathFileResult> resultList = new ArrayList<XPathFileResult>();
+ List<Node> nodeList;
for( int i = 0; i < files.length; i++ ) {
fileLoc = new Path(baseDir).append(files[i]).toOSString();
nodeList = getRepository().getDocument(fileLoc).selectNodes(xpathPattern);
if( nodeList.size() > 0 )
resultList.add(new XPathFileResult(this, fileLoc, nodeList));
}
- results = (XPathFileResult[]) resultList.toArray(new
XPathFileResult[resultList.size()]);
+ results = resultList.toArray(new XPathFileResult[resultList.size()]);
}
public String getFirstResult() {
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
22:36:41 UTC (rev 4310)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/jmx/JMXClassLoaderRepository.java 2007-10-18
03:57:50 UTC (rev 4311)
@@ -1,3 +1,24 @@
+/**
+ * JBoss, a Division of Red Hat
+ * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+* This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
package org.jboss.ide.eclipse.as.core.extensions.jmx;
import java.net.MalformedURLException;
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
22:36:41 UTC (rev 4310)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/jmx/JMXModel.java 2007-10-18
03:57:50 UTC (rev 4311)
@@ -1,3 +1,24 @@
+/**
+ * JBoss, a Division of Red Hat
+ * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+* This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
package org.jboss.ide.eclipse.as.core.extensions.jmx;
import java.io.IOException;
@@ -26,7 +47,13 @@
import org.eclipse.wst.server.core.IServer;
import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
+/**
+ * Model and objects related to JMX
+ * @author rob.stryker(a)redhat.com
+ *
+ */
public class JMXModel {
+ /* Singleton */
protected static JMXModel instance;
public static JMXModel getDefault() {
if( instance == null )
@@ -36,11 +63,16 @@
protected HashMap<String, JMXModelRoot> root;
-
+ /* constructor */
protected JMXModel() {
root = new HashMap<String, JMXModelRoot>();
}
+ /**
+ * Get the Model Root for one particular server
+ * @param server
+ * @return that server's model
+ */
public JMXModelRoot getModel(IServer server) {
if (root.get(server.getId()) == null) {
JMXModelRoot serverRoot = new JMXModelRoot(server);
@@ -49,11 +81,17 @@
return root.get(server.getId());
}
+ /**
+ * Clear the server's model
+ * @param server
+ */
public void clearModel(IServer server) {
root.remove(server.getId());
}
-
+ /**
+ * The model for one server
+ */
public static class JMXModelRoot {
protected IServer server;
protected JMXDomain[] domains = null;
@@ -71,6 +109,9 @@
return exception;
}
+ /**
+ * Lazily load the domains
+ */
public void loadDomains() {
exception = null;
JMXRunnable run = new JMXRunnable() {
@@ -91,6 +132,9 @@
}
}
+ /**
+ * A JMX Domain
+ */
public static class JMXDomain {
protected String name;
protected IServer server;
@@ -119,6 +163,9 @@
exception = null;
}
+ /**
+ * Lazily load the beans for this domain
+ */
public void loadBeans() {
exception = null;
JMXRunnable run = new JMXRunnable() {
@@ -145,6 +192,9 @@
}
}
+ /**
+ * The JMX Bean Object
+ */
public static class JMXBean {
protected String domain;
protected String name;
@@ -197,6 +247,9 @@
return this.exception;
}
+ /**
+ * Load the child operations and attributes
+ */
public void loadInfo() {
exception = null;
JMXRunnable run = new JMXRunnable() {
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/jmx/JMXUtil.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/jmx/JMXUtil.java 2007-10-17
22:36:41 UTC (rev 4310)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/jmx/JMXUtil.java 2007-10-18
03:57:50 UTC (rev 4311)
@@ -1,3 +1,24 @@
+/**
+ * JBoss, a Division of Red Hat
+ * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+* This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
package org.jboss.ide.eclipse.as.core.extensions.jmx;
import java.lang.reflect.Constructor;
@@ -14,7 +35,7 @@
/**
* Utility class
- * @author Rob Stryker
+ * @author Rob Stryker rob.stryker(a)redhat.com
*
*/
public class JMXUtil {
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/polling/JMXPoller.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/polling/JMXPoller.java 2007-10-17
22:36:41 UTC (rev 4310)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/polling/JMXPoller.java 2007-10-18
03:57:50 UTC (rev 4311)
@@ -43,6 +43,11 @@
import org.jboss.ide.eclipse.as.core.server.internal.PollThread;
import org.jboss.ide.eclipse.as.core.util.SimpleTreeItem;
+/**
+ * A poller dedicated to server startup, checks via JMX
+ * @author Rob rob.stryker(a)redhat.com
+ *
+ */
public class JMXPoller implements IServerStatePoller {
public static final String STARTED_PROPERTY =
"org.jboss.ide.eclipse.as.core.extensions.polling.jmx.STARTED_PROPERTY";
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/polling/ProcessTerminatedPoller.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/polling/ProcessTerminatedPoller.java 2007-10-17
22:36:41 UTC (rev 4310)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/polling/ProcessTerminatedPoller.java 2007-10-18
03:57:50 UTC (rev 4311)
@@ -1,3 +1,24 @@
+/**
+ * JBoss, a Division of Red Hat
+ * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+* This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
package org.jboss.ide.eclipse.as.core.extensions.polling;
import org.eclipse.core.runtime.NullProgressMonitor;
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/polling/TimeoutPoller.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/polling/TimeoutPoller.java 2007-10-17
22:36:41 UTC (rev 4310)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/polling/TimeoutPoller.java 2007-10-18
03:57:50 UTC (rev 4311)
@@ -31,7 +31,11 @@
import org.jboss.ide.eclipse.as.core.server.internal.PollThread;
import org.jboss.ide.eclipse.as.core.server.internal.ServerAttributeHelper;
-// Wait 15 seconds, then say it's at it's expected state
+/**
+ * Wait 15 seconds, then say it's at it's expected state
+ * @author Rob
+ *
+ */
public class TimeoutPoller implements IServerStatePoller {
private boolean expectedState;
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/ArchivesBuildListener.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/ArchivesBuildListener.java 2007-10-17
22:36:41 UTC (rev 4310)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/ArchivesBuildListener.java 2007-10-18
03:57:50 UTC (rev 4311)
@@ -39,7 +39,6 @@
import org.jboss.ide.eclipse.archives.core.model.IArchiveNodeDelta;
import org.jboss.ide.eclipse.archives.core.model.other.IArchiveBuildListener;
import org.jboss.ide.eclipse.archives.core.model.other.IArchiveModelListener;
-import org.jboss.ide.eclipse.archives.core.util.ModelUtil;
import
org.jboss.ide.eclipse.as.core.modules.PackageModuleFactory.PackagedModuleDelegate;
import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
import org.jboss.ide.eclipse.as.core.server.internal.DeployableServerBehavior;
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/ArchivesModelModuleContributor.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/ArchivesModelModuleContributor.java 2007-10-17
22:36:41 UTC (rev 4310)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/ArchivesModelModuleContributor.java 2007-10-18
03:57:50 UTC (rev 4311)
@@ -1,3 +1,24 @@
+/**
+ * JBoss, a Division of Red Hat
+ * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+* This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
package org.jboss.ide.eclipse.as.core.modules;
import java.util.ArrayList;
@@ -15,6 +36,11 @@
import org.jboss.ide.eclipse.as.core.modules.PackageModuleFactory.IModuleContributor;
import
org.jboss.ide.eclipse.as.core.modules.PackageModuleFactory.PackagedModuleDelegate;
+/**
+ *
+ * @author Rob Stryker rob.stryker(a)jboss.com
+ *
+ */
public class ArchivesModelModuleContributor implements IModuleContributor {
private static ArchivesModelModuleContributor instance;
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/PackagedArtifactAdapter.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/PackagedArtifactAdapter.java 2007-10-17
22:36:41 UTC (rev 4310)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/PackagedArtifactAdapter.java 2007-10-18
03:57:50 UTC (rev 4311)
@@ -1,3 +1,24 @@
+/**
+ * JBoss, a Division of Red Hat
+ * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+* This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
package org.jboss.ide.eclipse.as.core.modules;
import org.eclipse.core.resources.IProject;
@@ -6,7 +27,11 @@
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.IModuleArtifact;
import org.eclipse.wst.server.core.model.ModuleArtifactAdapterDelegate;
-
+/**
+ *
+ * @author Rob Stryker rob.stryker(a)redhat.com
+ *
+ */
public class PackagedArtifactAdapter extends ModuleArtifactAdapterDelegate {
public PackagedArtifactAdapter() {
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/SingleDeployableFactory.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/SingleDeployableFactory.java 2007-10-17
22:36:41 UTC (rev 4310)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/SingleDeployableFactory.java 2007-10-18
03:57:50 UTC (rev 4311)
@@ -1,3 +1,24 @@
+/**
+ * JBoss, a Division of Red Hat
+ * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+* This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
package org.jboss.ide.eclipse.as.core.modules;
import java.util.ArrayList;
@@ -27,6 +48,11 @@
import org.jboss.ide.eclipse.as.core.server.UnitedServerListener;
import org.jboss.ide.eclipse.as.core.server.UnitedServerListenerManager;
+/**
+ * The factory responsible for turning regular files into modules
+ * @author Rob Stryker rob.stryker(a)jboss.com
+ *
+ */
public class SingleDeployableFactory extends ModuleFactoryDelegate {
public static final String FACTORY_ID =
"org.jboss.ide.eclipse.as.core.singledeployablefactory";
private static SingleDeployableFactory factDelegate;
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IJBossServerPublisher.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IJBossServerPublisher.java 2007-10-17
22:36:41 UTC (rev 4310)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IJBossServerPublisher.java 2007-10-18
03:57:50 UTC (rev 4311)
@@ -27,6 +27,11 @@
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.model.IModuleResourceDelta;
+/**
+ *
+ * @author Rob Stryker
+ *
+ */
public interface IJBossServerPublisher {
public IStatus publishModule(int kind, int deltaKind, int modulePublishState,
IModule[] module, IProgressMonitor monitor)
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IJBossServerRuntime.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IJBossServerRuntime.java 2007-10-17
22:36:41 UTC (rev 4310)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IJBossServerRuntime.java 2007-10-18
03:57:50 UTC (rev 4311)
@@ -23,6 +23,10 @@
import org.eclipse.jdt.launching.IVMInstall;
+/**
+ *
+ * @author Rob Stryker
+ */
public interface IJBossServerRuntime {
public static String PROPERTY_VM_ID = "PROPERTY_VM_ID";
public static String PROPERTY_VM_TYPE_ID = "PROPERTY_VM_TYPE_ID";
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IServerPollingAttributes.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IServerPollingAttributes.java 2007-10-17
22:36:41 UTC (rev 4310)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IServerPollingAttributes.java 2007-10-18
03:57:50 UTC (rev 4311)
@@ -21,6 +21,10 @@
*/
package org.jboss.ide.eclipse.as.core.server;
+/**
+ *
+ * @author Rob Stryker
+ */
public interface IServerPollingAttributes {
public static final String START_TIMEOUT =
"org.jboss.ide.eclipse.as.core.server.attributes.startTimeout";
public static final String STOP_TIMEOUT =
"org.jboss.ide.eclipse.as.core.server.attributes.stopTimeout";
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IServerStartupParameters.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IServerStartupParameters.java 2007-10-17
22:36:41 UTC (rev 4310)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IServerStartupParameters.java 2007-10-18
03:57:50 UTC (rev 4311)
@@ -21,6 +21,11 @@
*/
package org.jboss.ide.eclipse.as.core.server;
+/**
+ *
+ * @author Rob Stryker
+ *
+ */
public interface IServerStartupParameters {
public static final String JBOSS_SERVER_HOME_DIR = "jboss.server.home.dir";
public static final String JBOSS_SERVER_BASE_DIR = "jboss.server.base.dir";
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IServerStatePoller.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IServerStatePoller.java 2007-10-17
22:36:41 UTC (rev 4310)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IServerStatePoller.java 2007-10-18
03:57:50 UTC (rev 4311)
@@ -24,6 +24,11 @@
import org.eclipse.wst.server.core.IServer;
import org.jboss.ide.eclipse.as.core.server.internal.PollThread;
+/**
+ *
+ * @author Rob Stryker
+ *
+ */
public interface IServerStatePoller extends IServerPollingAttributes {
public static final boolean SERVER_UP = true;
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/UnitedServerListener.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/UnitedServerListener.java 2007-10-17
22:36:41 UTC (rev 4310)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/UnitedServerListener.java 2007-10-18
03:57:50 UTC (rev 4311)
@@ -1,3 +1,24 @@
+/**
+ * JBoss, a Division of Red Hat
+ * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+* This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
package org.jboss.ide.eclipse.as.core.server;
import org.eclipse.core.runtime.IStatus;
@@ -4,6 +25,11 @@
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.ServerEvent;
+/**
+ *
+ * @author Rob Stryker
+ *
+ */
public class UnitedServerListener {
public void init(IServer server) {}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/UnitedServerListenerManager.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/UnitedServerListenerManager.java 2007-10-17
22:36:41 UTC (rev 4310)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/UnitedServerListenerManager.java 2007-10-18
03:57:50 UTC (rev 4311)
@@ -1,3 +1,24 @@
+/**
+ * JBoss, a Division of Red Hat
+ * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+* This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
package org.jboss.ide.eclipse.as.core.server;
import java.util.ArrayList;
@@ -11,6 +32,11 @@
import org.eclipse.wst.server.core.ServerCore;
import org.eclipse.wst.server.core.ServerEvent;
+/**
+ *
+ * @author Rob Stryker
+ *
+ */
public class UnitedServerListenerManager implements
IServerLifecycleListener, IServerListener, IPublishListener {
protected static UnitedServerListenerManager instance;
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServer.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServer.java 2007-10-17
22:36:41 UTC (rev 4310)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServer.java 2007-10-18
03:57:50 UTC (rev 4311)
@@ -1,3 +1,24 @@
+/**
+ * JBoss, a Division of Red Hat
+ * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+* This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
package org.jboss.ide.eclipse.as.core.server.internal;
import org.eclipse.core.runtime.CoreException;
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
22:36:41 UTC (rev 4310)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServerBehavior.java 2007-10-18
03:57:50 UTC (rev 4311)
@@ -1,3 +1,24 @@
+/**
+ * JBoss, a Division of Red Hat
+ * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+* This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
package org.jboss.ide.eclipse.as.core.server.internal;
import java.util.ArrayList;
@@ -48,25 +69,27 @@
workingCopy.setAttribute(DeployableLaunchConfiguration.ACTION_KEY,
DeployableLaunchConfiguration.START);
}
- private void print(int kind, int deltaKind, IModule[] module) {
+ private String print(int kind, int deltaKind, IModule[] module) {
+ String ret = "";
String name = "";
for( int i = 0; i < module.length; i++ )
name += module[i].getName();
- System.out.print("publishing module (" + name + "): ");
+ ret += "publishing module (" + name + "): ";
switch( kind ) {
- case IServer.PUBLISH_INCREMENTAL: System.out.print("incremental, "); break;
- case IServer.PUBLISH_FULL: System.out.print("full, "); break;
- case IServer.PUBLISH_AUTO: System.out.print("auto, "); break;
- case IServer.PUBLISH_CLEAN: System.out.print("clean, "); break;
+ case IServer.PUBLISH_INCREMENTAL: ret += "incremental, "; break;
+ case IServer.PUBLISH_FULL: ret += "full, "; break;
+ case IServer.PUBLISH_AUTO: ret += "auto, "; break;
+ case IServer.PUBLISH_CLEAN: ret += "clean, "; break;
}
switch( deltaKind ) {
- case ServerBehaviourDelegate.NO_CHANGE: System.out.print("no change");
break;
- case ServerBehaviourDelegate.ADDED: System.out.print("added"); break;
- case ServerBehaviourDelegate.CHANGED: System.out.print("changed"); break;
- case ServerBehaviourDelegate.REMOVED: System.out.print("removed"); break;
+ case ServerBehaviourDelegate.NO_CHANGE: ret += "no change"; break;
+ case ServerBehaviourDelegate.ADDED: ret += "added"; break;
+ case ServerBehaviourDelegate.CHANGED: ret += "changed"; break;
+ case ServerBehaviourDelegate.REMOVED: ret += "removed"; break;
}
- System.out.println(" to server " + getServer().getName() + "(" +
getServer().getId() + ")");
+ ret += " to server " + getServer().getName() + "(" +
getServer().getId() + ")";
+ return ret;
}
protected PublishEvent publishEvent;
@@ -103,7 +126,6 @@
// delta = [no_change, added, changed, removed] = [0,1,2,3]
if( module.length == 0 ) return;
IJBossServerPublisher publisher;
- print(kind, deltaKind, module);
int modulePublishState = getServer().getModulePublishState(module) + 0;
PublishEvent root = PublisherEventLogger.createModuleRootEvent(publishEvent, module,
kind, deltaKind);
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServerRuntime.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServerRuntime.java 2007-10-17
22:36:41 UTC (rev 4310)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServerRuntime.java 2007-10-18
03:57:50 UTC (rev 4311)
@@ -1,3 +1,24 @@
+/**
+ * JBoss, a Division of Red Hat
+ * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+* This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
package org.jboss.ide.eclipse.as.core.server.internal;
import org.eclipse.wst.server.core.model.RuntimeDelegate;
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
22:36:41 UTC (rev 4310)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossLaunchAdapter.java 2007-10-18
03:57:50 UTC (rev 4311)
@@ -1,3 +1,24 @@
+/**
+ * JBoss, a Division of Red Hat
+ * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+* This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
package org.jboss.ide.eclipse.as.core.server.internal;
import java.io.FileInputStream;
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServer.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServer.java 2007-10-17
22:36:41 UTC (rev 4310)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServer.java 2007-10-18
03:57:50 UTC (rev 4311)
@@ -55,6 +55,11 @@
import org.jboss.ide.eclipse.as.core.server.IServerStartupParameters;
import org.jboss.ide.eclipse.as.core.util.ArgsUtil;
+/**
+ *
+ * @author Rob Stryker rob.stryker(a)jboss.com
+ *
+ */
public class JBossServer extends ServerDelegate
implements IServerStartupParameters, IDeployableServer, IURLProvider {
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServerBehavior.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServerBehavior.java 2007-10-17
22:36:41 UTC (rev 4310)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServerBehavior.java 2007-10-18
03:57:50 UTC (rev 4311)
@@ -36,6 +36,11 @@
import
org.jboss.ide.eclipse.as.core.server.internal.launch.JBossServerStartupLaunchConfiguration;
import org.jboss.ide.eclipse.as.core.server.internal.launch.StopLaunchConfiguration;
+/**
+ *
+ * @author Rob Stryker
+ *
+ */
public class JBossServerBehavior extends DeployableServerBehavior {
private PollThread pollThread = null;
protected IProcess process;
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
22:36:41 UTC (rev 4310)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/ServerStatePollerType.java 2007-10-18
03:57:50 UTC (rev 4311)
@@ -1,3 +1,24 @@
+/**
+ * JBoss, a Division of Red Hat
+ * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+* This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
package org.jboss.ide.eclipse.as.core.server.internal;
import org.eclipse.core.runtime.IConfigurationElement;
@@ -6,6 +27,11 @@
import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
import org.jboss.ide.eclipse.as.core.server.IServerStatePoller;
+/**
+ * A wrapper for pollers
+ * @author Rob Stryker rob.stryker(a)redhat.com
+ *
+ */
public class ServerStatePollerType {
private IConfigurationElement el;
public ServerStatePollerType(IConfigurationElement el) {
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/DeployableLaunchConfiguration.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/DeployableLaunchConfiguration.java 2007-10-17
22:36:41 UTC (rev 4310)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/DeployableLaunchConfiguration.java 2007-10-18
03:57:50 UTC (rev 4311)
@@ -1,3 +1,24 @@
+/**
+ * JBoss, a Division of Red Hat
+ * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+* This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
package org.jboss.ide.eclipse.as.core.server.internal.launch;
import org.eclipse.core.runtime.CoreException;
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
22:36:41 UTC (rev 4310)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/StopLaunchConfiguration.java 2007-10-18
03:57:50 UTC (rev 4311)
@@ -1,3 +1,24 @@
+/**
+ * JBoss, a Division of Red Hat
+ * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+* This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
package org.jboss.ide.eclipse.as.core.server.internal.launch;
import java.io.File;
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 2007-10-17
22:36:41 UTC (rev 4310)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/TwiddleLaunchConfiguration.java 2007-10-18
03:57:50 UTC (rev 4311)
@@ -1,3 +1,24 @@
+/**
+ * JBoss, a Division of Red Hat
+ * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+* This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
package org.jboss.ide.eclipse.as.core.server.internal.launch;
import java.io.File;
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/TwiddleLauncher.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/TwiddleLauncher.java 2007-10-17
22:36:41 UTC (rev 4310)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/TwiddleLauncher.java 2007-10-18
03:57:50 UTC (rev 4311)
@@ -25,7 +25,10 @@
import java.util.Arrays;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.ILaunch;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.debug.core.ILaunchManager;
@@ -34,6 +37,7 @@
import org.eclipse.debug.core.model.IStreamMonitor;
import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
import org.eclipse.wst.server.core.IServer;
+import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
public class TwiddleLauncher {
@@ -93,12 +97,6 @@
// stop listening
for( int i = 0; i < processes.length; i++ ) {
processes[i].stopListening();
- if( canceled ) {
- try {
- // if canceled, terminate all twiddle processes
- processes[i].getProcess().terminate();
- } catch( Exception e ) {}
- }
}
return processes;
@@ -114,6 +112,16 @@
}
}
if( !allTerminated ) {
+ if( canceled ) {
+ try {
+ // if canceled, terminate all twiddle processes
+ for( int i = 0; i < processes.length; i++ )
+ processes[i].getProcess().terminate();
+ } catch( DebugException e ) {
+ IStatus s = new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, "Cannot
terminate twiddle process", e);
+ JBossServerCorePlugin.getDefault().getLog().log(s);
+ }
+ }
// sleep
try {
Thread.sleep(delay);