Author: rob.stryker(a)jboss.com
Date: 2007-09-11 00:52:59 -0400 (Tue, 11 Sep 2007)
New Revision: 3522
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/AbstractJBossServerRuntime.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/DeployableServer.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/DeployableServerBehavior.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/DeployableServerRuntime.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/JBoss32ServerRuntime.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/JBoss40ServerRuntime.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/JBoss42ServerRuntime.java
Removed:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/server/AbstractJBossServerRuntime.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/server/JBoss32ServerRuntime.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/server/JBoss40ServerRuntime.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/server/JBoss42ServerRuntime.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/stripped/
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/META-INF/MANIFEST.MF
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/launch/DeployableLaunchConfiguration.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/model/descriptor/XPathModel.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/packages/ArchivesBuildListener.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/JBossServerBehavior.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/ASLaunchConfigurationConverter.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/ServerConverter.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml
Log:
Moved as.core.runtime.server package's files into the as.core.server package.
Moving to a cleaner API which can be opened up logically and more easily extended.
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/META-INF/MANIFEST.MF 2007-09-11
04:49:58 UTC (rev 3521)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/META-INF/MANIFEST.MF 2007-09-11
04:52:59 UTC (rev 3522)
@@ -30,11 +30,9 @@
org.jboss.ide.eclipse.as.core.packages.types,
org.jboss.ide.eclipse.as.core.publishers,
org.jboss.ide.eclipse.as.core.runtime,
- org.jboss.ide.eclipse.as.core.runtime.server,
org.jboss.ide.eclipse.as.core.runtime.server.polling,
org.jboss.ide.eclipse.as.core.server,
org.jboss.ide.eclipse.as.core.server.attributes,
- org.jboss.ide.eclipse.as.core.server.stripped,
org.jboss.ide.eclipse.as.core.server.xpl,
org.jboss.ide.eclipse.as.core.singledeployable,
org.jboss.ide.eclipse.as.core.util
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/launch/DeployableLaunchConfiguration.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/launch/DeployableLaunchConfiguration.java 2007-09-11
04:49:58 UTC (rev 3521)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/launch/DeployableLaunchConfiguration.java 2007-09-11
04:52:59 UTC (rev 3522)
@@ -7,7 +7,7 @@
import org.eclipse.debug.core.model.ILaunchConfigurationDelegate;
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.ServerUtil;
-import org.jboss.ide.eclipse.as.core.server.stripped.DeployableServerBehavior;
+import org.jboss.ide.eclipse.as.core.server.DeployableServerBehavior;
public class DeployableLaunchConfiguration implements
ILaunchConfigurationDelegate {
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/model/descriptor/XPathModel.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/model/descriptor/XPathModel.java 2007-09-11
04:49:58 UTC (rev 3521)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/model/descriptor/XPathModel.java 2007-09-11
04:52:59 UTC (rev 3522)
@@ -14,7 +14,7 @@
import org.eclipse.core.runtime.Path;
import org.eclipse.wst.server.core.IServer;
import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
-import org.jboss.ide.eclipse.as.core.runtime.server.AbstractJBossServerRuntime;
+import org.jboss.ide.eclipse.as.core.server.AbstractJBossServerRuntime;
import org.jboss.ide.eclipse.as.core.server.ServerAttributeHelper;
public class XPathModel {
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/packages/ArchivesBuildListener.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/packages/ArchivesBuildListener.java 2007-09-11
04:49:58 UTC (rev 3521)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/packages/ArchivesBuildListener.java 2007-09-11
04:52:59 UTC (rev 3522)
@@ -41,8 +41,8 @@
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.packages.PackageModuleFactory.PackagedModuleDelegate;
+import org.jboss.ide.eclipse.as.core.server.DeployableServerBehavior;
import org.jboss.ide.eclipse.as.core.server.attributes.IDeployableServer;
-import org.jboss.ide.eclipse.as.core.server.stripped.DeployableServerBehavior;
import org.jboss.ide.eclipse.as.core.util.FileUtil;
/**
Deleted:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/server/AbstractJBossServerRuntime.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/server/AbstractJBossServerRuntime.java 2007-09-11
04:49:58 UTC (rev 3521)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/server/AbstractJBossServerRuntime.java 2007-09-11
04:52:59 UTC (rev 3522)
@@ -1,91 +0,0 @@
-/**
- * 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.runtime.server;
-
-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.jdt.launching.IVMInstall;
-import org.eclipse.jdt.launching.IVMInstallType;
-import org.eclipse.jdt.launching.JavaRuntime;
-import org.eclipse.wst.server.core.IRuntimeWorkingCopy;
-import org.eclipse.wst.server.core.internal.Messages;
-import org.eclipse.wst.server.core.internal.RuntimeWorkingCopy;
-import org.eclipse.wst.server.core.internal.ServerPlugin;
-import org.eclipse.wst.server.core.model.RuntimeDelegate;
-import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
-import org.jboss.ide.eclipse.as.core.runtime.IJBossServerRuntime;
-
-public abstract class AbstractJBossServerRuntime extends RuntimeDelegate implements
IJBossServerRuntime {
-
- public void setDefaults(IProgressMonitor monitor) {
- getRuntimeWorkingCopy().setLocation(new Path(""));
- }
-
- public IStatus validate() {
- IStatus s = super.validate();
- if( !s.isOK()) return s;
-
- if( getJBossConfiguration().equals(""))
- return new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, 0, "Runtime
Configuration Not Set", null);
-
- return Status.OK_STATUS;
- }
-
- public void setVMInstall(IVMInstall selectedVM) {
- IRuntimeWorkingCopy copy = getRuntimeWorkingCopy();
- if( copy instanceof RuntimeWorkingCopy ) {
- ((RuntimeWorkingCopy)copy).setAttribute(PROPERTY_VM_ID, selectedVM.getId());
- ((RuntimeWorkingCopy)copy).setAttribute(PROPERTY_VM_TYPE_ID,
selectedVM.getVMInstallType().getId());
- try {
- copy.save(true, new NullProgressMonitor());
- } catch( CoreException ce ) {
-
- }
- }
- }
-
- public IVMInstall getVM() {
- String id = getAttribute(PROPERTY_VM_ID, (String)null);
- String type = getAttribute(PROPERTY_VM_TYPE_ID, (String)null);
-
- IVMInstallType vmInstallType = JavaRuntime.getVMInstallType(type);
- IVMInstall[] vmInstalls = vmInstallType.getVMInstalls();
-
- for (int i = 0; i < vmInstalls.length; i++) {
- if (id.equals(vmInstalls[i].getId()))
- return vmInstalls[i];
- }
-
- // not found, return default vm
- return JavaRuntime.getDefaultVMInstall();
- }
-
- public String getJBossConfiguration() {
- return getAttribute(PROPERTY_CONFIGURATION_NAME, (String)"");
- }
-
- public abstract String getId();
-}
Deleted:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/server/JBoss32ServerRuntime.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/server/JBoss32ServerRuntime.java 2007-09-11
04:49:58 UTC (rev 3521)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/server/JBoss32ServerRuntime.java 2007-09-11
04:52:59 UTC (rev 3522)
@@ -1,34 +0,0 @@
-/**
- * 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.runtime.server;
-
-
-public class JBoss32ServerRuntime extends AbstractJBossServerRuntime {
-
- public JBoss32ServerRuntime() {
- // TODO Auto-generated constructor stub
- }
-
- public String getId() {
- return "3.2";
- }
-}
Deleted:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/server/JBoss40ServerRuntime.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/server/JBoss40ServerRuntime.java 2007-09-11
04:49:58 UTC (rev 3521)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/server/JBoss40ServerRuntime.java 2007-09-11
04:52:59 UTC (rev 3522)
@@ -1,32 +0,0 @@
-/**
- * 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.runtime.server;
-
-
-public class JBoss40ServerRuntime extends AbstractJBossServerRuntime {
-
- public JBoss40ServerRuntime() {
- }
- public String getId() {
- return "4.0";
- }
-}
Deleted:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/server/JBoss42ServerRuntime.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/server/JBoss42ServerRuntime.java 2007-09-11
04:49:58 UTC (rev 3521)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/server/JBoss42ServerRuntime.java 2007-09-11
04:52:59 UTC (rev 3522)
@@ -1,9 +0,0 @@
-package org.jboss.ide.eclipse.as.core.runtime.server;
-
-public class JBoss42ServerRuntime extends AbstractJBossServerRuntime {
- public JBoss42ServerRuntime() {
- }
- public String getId() {
- return "4.2";
- }
-}
\ No newline at end of file
Copied:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/AbstractJBossServerRuntime.java
(from rev 3493,
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/server/AbstractJBossServerRuntime.java)
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/AbstractJBossServerRuntime.java
(rev 0)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/AbstractJBossServerRuntime.java 2007-09-11
04:52:59 UTC (rev 3522)
@@ -0,0 +1,91 @@
+/**
+ * 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.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.jdt.launching.IVMInstall;
+import org.eclipse.jdt.launching.IVMInstallType;
+import org.eclipse.jdt.launching.JavaRuntime;
+import org.eclipse.wst.server.core.IRuntimeWorkingCopy;
+import org.eclipse.wst.server.core.internal.Messages;
+import org.eclipse.wst.server.core.internal.RuntimeWorkingCopy;
+import org.eclipse.wst.server.core.internal.ServerPlugin;
+import org.eclipse.wst.server.core.model.RuntimeDelegate;
+import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
+import org.jboss.ide.eclipse.as.core.runtime.IJBossServerRuntime;
+
+public abstract class AbstractJBossServerRuntime extends RuntimeDelegate implements
IJBossServerRuntime {
+
+ public void setDefaults(IProgressMonitor monitor) {
+ getRuntimeWorkingCopy().setLocation(new Path(""));
+ }
+
+ public IStatus validate() {
+ IStatus s = super.validate();
+ if( !s.isOK()) return s;
+
+ if( getJBossConfiguration().equals(""))
+ return new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, 0, "Runtime
Configuration Not Set", null);
+
+ return Status.OK_STATUS;
+ }
+
+ public void setVMInstall(IVMInstall selectedVM) {
+ IRuntimeWorkingCopy copy = getRuntimeWorkingCopy();
+ if( copy instanceof RuntimeWorkingCopy ) {
+ ((RuntimeWorkingCopy)copy).setAttribute(PROPERTY_VM_ID, selectedVM.getId());
+ ((RuntimeWorkingCopy)copy).setAttribute(PROPERTY_VM_TYPE_ID,
selectedVM.getVMInstallType().getId());
+ try {
+ copy.save(true, new NullProgressMonitor());
+ } catch( CoreException ce ) {
+
+ }
+ }
+ }
+
+ public IVMInstall getVM() {
+ String id = getAttribute(PROPERTY_VM_ID, (String)null);
+ String type = getAttribute(PROPERTY_VM_TYPE_ID, (String)null);
+
+ IVMInstallType vmInstallType = JavaRuntime.getVMInstallType(type);
+ IVMInstall[] vmInstalls = vmInstallType.getVMInstalls();
+
+ for (int i = 0; i < vmInstalls.length; i++) {
+ if (id.equals(vmInstalls[i].getId()))
+ return vmInstalls[i];
+ }
+
+ // not found, return default vm
+ return JavaRuntime.getDefaultVMInstall();
+ }
+
+ public String getJBossConfiguration() {
+ return getAttribute(PROPERTY_CONFIGURATION_NAME, (String)"");
+ }
+
+ public abstract String getId();
+}
Copied:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/DeployableServer.java
(from rev 3493,
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/stripped/DeployableServer.java)
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/DeployableServer.java
(rev 0)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/DeployableServer.java 2007-09-11
04:52:59 UTC (rev 3522)
@@ -0,0 +1,77 @@
+package org.jboss.ide.eclipse.as.core.server;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.IServerWorkingCopy;
+import org.eclipse.wst.server.core.model.ServerDelegate;
+import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
+import org.jboss.ide.eclipse.as.core.server.attributes.IDeployableServer;
+
+public class DeployableServer extends ServerDelegate implements IDeployableServer {
+
+ public static final String DEPLOY_DIRECTORY =
"org.jboss.ide.eclipse.as.core.server.stripped.deploy_directory";
+
+ public DeployableServer() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see
org.eclipse.wst.server.core.model.ServerDelegate#canModifyModules(org.eclipse.wst.server.core.IModule[],
org.eclipse.wst.server.core.IModule[])
+ */
+ public IStatus canModifyModules(IModule[] add, IModule[] remove) {
+ return new Status(IStatus.OK, JBossServerCorePlugin.PLUGIN_ID,0, "OK",
null);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see
org.eclipse.wst.server.core.model.ServerDelegate#getChildModules(org.eclipse.wst.server.core.IModule[])
+ */
+ public IModule[] getChildModules(IModule[] module) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see
org.eclipse.wst.server.core.model.ServerDelegate#getRootModules(org.eclipse.wst.server.core.IModule)
+ */
+ public IModule[] getRootModules(IModule module) throws CoreException {
+ return new IModule[] { module };
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see
org.eclipse.wst.server.core.model.ServerDelegate#modifyModules(org.eclipse.wst.server.core.IModule[],
org.eclipse.wst.server.core.IModule[], org.eclipse.core.runtime.IProgressMonitor)
+ */
+ public void modifyModules(IModule[] add, IModule[] remove,
+ IProgressMonitor monitor) throws CoreException {
+ // TODO Auto-generated method stub
+ }
+
+ /* (non-Javadoc)
+ * @see
org.jboss.ide.eclipse.as.core.server.attributes.IDeployableServer#getDeployDirectory()
+ */
+ public String getDeployDirectory() {
+ return getAttribute(DEPLOY_DIRECTORY, "");
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see
org.jboss.ide.eclipse.as.core.server.attributes.IDeployableServer#getAttributeHelper()
+ */
+ public ServerAttributeHelper getAttributeHelper() {
+ IServerWorkingCopy copy = getServerWorkingCopy();
+ if( copy == null ) {
+ copy = getServer().createWorkingCopy();
+ }
+ return new ServerAttributeHelper(getServer(), copy);
+ }
+
+ // only used for xpaths and is a complete crap hack ;) misleading, too
+ public String getConfigDirectory() {
+ return getDeployDirectory();
+ }
+}
Copied:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/DeployableServerBehavior.java
(from rev 3493,
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/stripped/DeployableServerBehavior.java)
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/DeployableServerBehavior.java
(rev 0)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/DeployableServerBehavior.java 2007-09-11
04:52:59 UTC (rev 3522)
@@ -0,0 +1,192 @@
+package org.jboss.ide.eclipse.as.core.server;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.MultiStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.internal.IModuleVisitor;
+import org.eclipse.wst.server.core.internal.ProgressUtil;
+import org.eclipse.wst.server.core.internal.Server;
+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.launch.DeployableLaunchConfiguration;
+import org.jboss.ide.eclipse.as.core.model.EventLogModel;
+import org.jboss.ide.eclipse.as.core.model.EventLogModel.EventLogTreeItem;
+import org.jboss.ide.eclipse.as.core.packages.PackageModuleFactory;
+import org.jboss.ide.eclipse.as.core.publishers.IJBossServerPublisher;
+import org.jboss.ide.eclipse.as.core.publishers.JstPublisher;
+import org.jboss.ide.eclipse.as.core.publishers.NullPublisher;
+import org.jboss.ide.eclipse.as.core.publishers.PackagesPublisher;
+import org.jboss.ide.eclipse.as.core.publishers.PublisherEventLogger;
+import org.jboss.ide.eclipse.as.core.singledeployable.SingleFilePublisher;
+
+public class DeployableServerBehavior extends ServerBehaviourDelegate {
+
+ public DeployableServerBehavior() {
+ }
+
+ public void stop(boolean force) {
+ setServerStopped(); // simple enough
+ }
+
+ public void setupLaunchConfiguration(ILaunchConfigurationWorkingCopy workingCopy,
IProgressMonitor monitor) throws CoreException {
+ workingCopy.setAttribute(DeployableLaunchConfiguration.ACTION_KEY,
DeployableLaunchConfiguration.START);
+ }
+
+
+
+// public IModuleResourceDelta[] getPublishedResourceDelta(IModule[] module) {
+// return ((Server)getServer()).getPublishedResourceDelta(module);
+// }
+
+ private void print(int kind, int deltaKind, String name) {
+ System.out.print("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;
+ }
+ 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;
+ }
+ System.out.println(" to server " + getServer().getName() + "(" +
getServer().getId() + ")");
+ }
+ protected void publishModule(int kind, int deltaKind, IModule[] module, IProgressMonitor
monitor) throws CoreException {
+ // kind = [incremental, full, auto, clean] = [1,2,3,4]
+ // delta = [no_change, added, changed, removed] = [0,1,2,3]
+ if( module.length == 0 ) return;
+ IJBossServerPublisher publisher;
+ print(kind, deltaKind, module[0].getName());
+ int modulePublishState = getServer().getModulePublishState(module) + 0;
+
+ EventLogTreeItem root = EventLogModel.getModel(getServer()).getRoot();
+ if( module.length > 1 ) {
+ root = PublisherEventLogger.createMultipleModuleTopLevelEvent(root, module.length);
+ }
+
+ for( int i = 0; i < module.length; i++ ) {
+ try {
+ if( isJstModule(module[i]) ) {
+ publisher = new JstPublisher(getServer(), root);
+ } else if( isPackagesTypeModule(module[i]) ) {
+ publisher = new PackagesPublisher(getServer(), root);
+ } else if( module[i].getModuleType().getId().equals("jboss.singlefile")){
+ publisher = new SingleFilePublisher(getServer());
+ } else {
+ publisher = new NullPublisher();
+ }
+ publisher.setDelta(getPublishedResourceDelta(module));
+ publisher.publishModule(kind, deltaKind, modulePublishState, module[0], monitor);
+ setModulePublishState(module, publisher.getPublishState());
+ }
+ catch( Throwable e ) {e.printStackTrace();}
+ }
+ }
+
+
+
+ /* Temporary and will need to be fixed */
+ // TODO: Change to if it is a flex project. Don't know how to do that yet.
+ protected boolean isJstModule(IModule mod) {
+ String type = mod.getModuleType().getId();
+ if( type.equals("jst.ejb") || type.equals("jst.client")
+ || type.equals("jst.web") || type.equals("jst.ear"))
+ return true;
+ return false;
+ }
+
+ protected boolean isPackagesTypeModule(IModule module) {
+ return module.getModuleType().getId().equals(PackageModuleFactory.MODULE_TYPE);
+ }
+
+ /*
+ * Change the state of the server
+ */
+ public void setServerStarted() {
+ setServerState(IServer.STATE_STARTED);
+ }
+
+ public void setServerStarting() {
+ setServerState(IServer.STATE_STARTING);
+ }
+
+ public void setServerStopped() {
+ setServerState(IServer.STATE_STOPPED);
+ }
+
+ public void setServerStopping() {
+ setServerState(IServer.STATE_STOPPING);
+ }
+
+
+ // Basically stolen from RunOnServerActionDelegate
+ public IStatus publishOneModule(int kind, IModule[] module, int deltaKind,
IProgressMonitor monitor) {
+ ArrayList moduleList = new ArrayList();
+ ArrayList deltaKindList = new ArrayList();
+ moduleList.add(module);
+ deltaKindList.add(new Integer(deltaKind));
+
+
+ try {
+ ((Server)getServer()).getServerPublishInfo().startCaching();
+
+
+ PublishOperation[] tasks = getTasks(kind, moduleList, deltaKindList);
+ MultiStatus tempMulti = new MultiStatus(ServerPlugin.PLUGIN_ID, 0, "",
null);
+ publishStart(ProgressUtil.getSubMonitorFor(monitor, 1000));
+ performTasks(tasks, monitor);
+ publishServer(kind, ProgressUtil.getSubMonitorFor(monitor, 1000));
+ publishModules(kind, moduleList, deltaKindList, tempMulti, monitor);
+ publishFinish(ProgressUtil.getSubMonitorFor(monitor, 500));
+
+ final List modules2 = new ArrayList();
+ ((Server)getServer()).visit(new IModuleVisitor() {
+ public boolean visit(IModule[] module) {
+ if (((Server)getServer()).getModulePublishState(module) ==
IServer.PUBLISH_STATE_NONE)
+ ((Server)getServer()).getServerPublishInfo().fill(module);
+
+ modules2.add(module);
+ return true;
+ }
+ }, monitor);
+
+ ((Server)getServer()).getServerPublishInfo().removeDeletedModulePublishInfo(((Server)getServer()),
modules2);
+ ((Server)getServer()).getServerPublishInfo().clearCache();
+ ((Server)getServer()).getServerPublishInfo().save();
+
+ return Status.OK_STATUS;
+
+ } catch( Exception e ) {
+
+ }
+ return Status.CANCEL_STATUS;
+ }
+
+// protected void addAndRemoveModules(IModule[] module, int deltaKind) {
+// 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
+// }
+}
Copied:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/DeployableServerRuntime.java
(from rev 3493,
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/stripped/DeployableServerRuntime.java)
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/DeployableServerRuntime.java
(rev 0)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/DeployableServerRuntime.java 2007-09-11
04:52:59 UTC (rev 3522)
@@ -0,0 +1,11 @@
+package org.jboss.ide.eclipse.as.core.server;
+
+import org.eclipse.wst.server.core.model.RuntimeDelegate;
+
+public class DeployableServerRuntime extends RuntimeDelegate {
+
+ public DeployableServerRuntime() {
+ // TODO Auto-generated constructor stub
+ }
+
+}
Copied:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/JBoss32ServerRuntime.java
(from rev 3493,
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/server/JBoss32ServerRuntime.java)
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/JBoss32ServerRuntime.java
(rev 0)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/JBoss32ServerRuntime.java 2007-09-11
04:52:59 UTC (rev 3522)
@@ -0,0 +1,34 @@
+/**
+ * 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;
+
+
+public class JBoss32ServerRuntime extends AbstractJBossServerRuntime {
+
+ public JBoss32ServerRuntime() {
+ // TODO Auto-generated constructor stub
+ }
+
+ public String getId() {
+ return "3.2";
+ }
+}
Copied:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/JBoss40ServerRuntime.java
(from rev 3493,
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/server/JBoss40ServerRuntime.java)
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/JBoss40ServerRuntime.java
(rev 0)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/JBoss40ServerRuntime.java 2007-09-11
04:52:59 UTC (rev 3522)
@@ -0,0 +1,32 @@
+/**
+ * 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;
+
+
+public class JBoss40ServerRuntime extends AbstractJBossServerRuntime {
+
+ public JBoss40ServerRuntime() {
+ }
+ public String getId() {
+ return "4.0";
+ }
+}
Copied:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/JBoss42ServerRuntime.java
(from rev 3493,
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/server/JBoss42ServerRuntime.java)
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/JBoss42ServerRuntime.java
(rev 0)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/JBoss42ServerRuntime.java 2007-09-11
04:52:59 UTC (rev 3522)
@@ -0,0 +1,9 @@
+package org.jboss.ide.eclipse.as.core.server;
+
+public class JBoss42ServerRuntime extends AbstractJBossServerRuntime {
+ public JBoss42ServerRuntime() {
+ }
+ public String getId() {
+ return "4.2";
+ }
+}
\ No newline at end of file
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/JBossServerBehavior.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/JBossServerBehavior.java 2007-09-11
04:49:58 UTC (rev 3521)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/JBossServerBehavior.java 2007-09-11
04:52:59 UTC (rev 3522)
@@ -35,7 +35,6 @@
import org.jboss.ide.eclipse.as.core.model.EventLogModel.EventLogTreeItem;
import org.jboss.ide.eclipse.as.core.runtime.server.polling.IServerStatePoller;
import org.jboss.ide.eclipse.as.core.runtime.server.polling.PollThread;
-import org.jboss.ide.eclipse.as.core.server.stripped.DeployableServerBehavior;
public class JBossServerBehavior extends DeployableServerBehavior {
private PollThread pollThread = null;
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/ASLaunchConfigurationConverter.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/ASLaunchConfigurationConverter.java 2007-09-11
04:49:58 UTC (rev 3521)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/ASLaunchConfigurationConverter.java 2007-09-11
04:52:59 UTC (rev 3522)
@@ -68,7 +68,7 @@
import org.eclipse.wst.server.core.internal.ServerType;
import org.jboss.ide.eclipse.as.core.launch.JBossServerStartupLaunchConfiguration;
import org.jboss.ide.eclipse.as.core.runtime.IJBossServerRuntime;
-import org.jboss.ide.eclipse.as.core.runtime.server.AbstractJBossServerRuntime;
+import org.jboss.ide.eclipse.as.core.server.AbstractJBossServerRuntime;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/ServerConverter.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/ServerConverter.java 2007-09-11
04:49:58 UTC (rev 3521)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/ServerConverter.java 2007-09-11
04:52:59 UTC (rev 3522)
@@ -26,9 +26,9 @@
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.ServerCore;
+import org.jboss.ide.eclipse.as.core.server.DeployableServerBehavior;
import org.jboss.ide.eclipse.as.core.server.JBossServer;
import org.jboss.ide.eclipse.as.core.server.attributes.IDeployableServer;
-import org.jboss.ide.eclipse.as.core.server.stripped.DeployableServerBehavior;
/**
*
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml 2007-09-11 04:49:58 UTC (rev
3521)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml 2007-09-11 04:52:59 UTC (rev
3522)
@@ -58,8 +58,8 @@
supportsRemoteHosts="false"/>
<serverType
-
behaviourClass="org.jboss.ide.eclipse.as.core.server.stripped.DeployableServerBehavior"
-
class="org.jboss.ide.eclipse.as.core.server.stripped.DeployableServer"
+
behaviourClass="org.jboss.ide.eclipse.as.core.server.DeployableServerBehavior"
+ class="org.jboss.ide.eclipse.as.core.server.DeployableServer"
description="A server which cannot be started, stopped, or debugged\nbut
provides a deploy folder for publishing."
hasConfiguration="false"
id="org.jboss.ide.eclipse.as.systemCopyServer"
@@ -79,7 +79,7 @@
point="org.eclipse.wst.server.core.runtimeTypes">
<runtimeType
vendor="%providerName"
-
class="org.jboss.ide.eclipse.as.core.runtime.server.JBoss32ServerRuntime"
+ class="org.jboss.ide.eclipse.as.core.server.JBoss32ServerRuntime"
description="%jboss.version.32.description"
name="JBoss 3.2 Runtime"
id="org.jboss.ide.eclipse.as.runtime.32"
@@ -102,7 +102,7 @@
</runtimeType>
<runtimeType
vendor="%providerName"
-
class="org.jboss.ide.eclipse.as.core.runtime.server.JBoss40ServerRuntime"
+ class="org.jboss.ide.eclipse.as.core.server.JBoss40ServerRuntime"
description="%jboss.version.40.description"
name="JBoss 4.0 Runtime"
id="org.jboss.ide.eclipse.as.runtime.40"
@@ -131,7 +131,7 @@
</runtimeType>
<runtimeType
vendor="%providerName"
-
class="org.jboss.ide.eclipse.as.core.runtime.server.JBoss42ServerRuntime"
+ class="org.jboss.ide.eclipse.as.core.server.JBoss42ServerRuntime"
description="%jboss.version.42.description"
name="JBoss 4.2 Runtime"
id="org.jboss.ide.eclipse.as.runtime.42"
@@ -162,7 +162,7 @@
<runtimeType
-
class="org.jboss.ide.eclipse.as.core.server.stripped.DeployableServerRuntime"
+
class="org.jboss.ide.eclipse.as.core.server.DeployableServerRuntime"
description="A runtime provided to allow a deploy-only server the
ability to deploy certain project types."
id="org.jboss.ide.eclipse.as.runtime.stripped"
name="JBoss Deploy-only"