Author: rob.stryker(a)jboss.com
Date: 2012-05-08 04:27:08 -0400 (Tue, 08 May 2012)
New Revision: 40844
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/ResourceDeployer.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam23FacetInstallDelegate.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamPerspectiveFactory.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java
Log:
seam tools should use public API where possible
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/ResourceDeployer.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/ResourceDeployer.java 2012-05-08
06:45:10 UTC (rev 40843)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/ResourceDeployer.java 2012-05-08
08:27:08 UTC (rev 40844)
@@ -20,11 +20,12 @@
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.IRuntimeType;
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.IServerWorkingCopy;
+import org.eclipse.wst.server.core.ServerUtil;
import org.eclipse.wst.server.core.internal.ChainedJob;
import org.jboss.ide.eclipse.as.core.modules.SingleDeployableFactory;
-import org.jboss.ide.eclipse.as.core.server.internal.DeployableServerBehavior;
import org.jboss.tools.seam.core.SeamCoreMessages;
import org.jboss.tools.seam.core.SeamCorePlugin;
@@ -59,12 +60,9 @@
return new Status(Status.WARNING, SeamCorePlugin.PLUGIN_ID,
SeamCoreMessages.DATA_SOURCE_XML_DEPLOYER_NO_SERVER_SELECTED_TO_DEPLOY_DATASOURCE_TO);
}
- // convert it to a DeployableServer instance
- DeployableServerBehavior deployer = (DeployableServerBehavior) s
- .loadAdapter(DeployableServerBehavior.class, null);
-
- // if its not null, the adaptation worked.
- if (deployer == null) {
+ IRuntimeType rt = s.getServerType().getRuntimeType();
+ if (!ServerUtil.isSupportedModule(rt.getModuleTypes(),
+ SingleDeployableFactory.MODULE_TYPE, SingleDeployableFactory.VERSION)) {
return new Status(Status.WARNING, SeamCorePlugin.PLUGIN_ID,
SeamCoreMessages.DATA_SOURCE_XML_DEPLOYER_SERVER_DID_NOT_SUPPORT_DEPLOY_OF_DATASOURCE);
}
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam23FacetInstallDelegate.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam23FacetInstallDelegate.java 2012-05-08
06:45:10 UTC (rev 40843)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam23FacetInstallDelegate.java 2012-05-08
08:27:08 UTC (rev 40844)
@@ -24,9 +24,11 @@
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
+import org.eclipse.wst.server.core.IRuntimeType;
import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.ServerUtil;
import org.eclipse.wst.server.core.internal.ChainedJob;
-import org.jboss.ide.eclipse.as.core.server.internal.JBossServer;
+import org.jboss.ide.eclipse.as.core.modules.SingleDeployableFactory;
import org.jboss.tools.jst.web.server.RegistrationHelper;
import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.core.project.facet.SeamRuntime;
@@ -187,10 +189,11 @@
} catch (CoreException e) {
SeamCorePlugin.getDefault().logError(e);
}
- JBossServer server = getJBossServer(model);
- if (server != null) {
- ChainedJob dsJob = new ResourceDeployer(project, server.getServer(),
resource.getFullPath().removeFirstSegments(1));
- dsJob.setNextJob(RegistrationHelper.getRegisterInServerJob(project, new
IServer[]{server.getServer()}, null));
+
+ IServer server = getServer(model);
+ if (serverSupportsSingleFileModule(server)) {
+ ChainedJob dsJob = new ResourceDeployer(project, server,
resource.getFullPath().removeFirstSegments(1));
+ dsJob.setNextJob(RegistrationHelper.getRegisterInServerJob(project, new
IServer[]{server}, null));
dsJob.schedule();
}
}
@@ -198,4 +201,13 @@
}
}
}
+
+ private static boolean serverSupportsSingleFileModule(IServer s) {
+ IRuntimeType rt = s.getServerType().getRuntimeType();
+ if (ServerUtil.isSupportedModule(rt.getModuleTypes(),
+ SingleDeployableFactory.MODULE_TYPE, SingleDeployableFactory.VERSION)) {
+ return true;
+ }
+ return false;
+ }
}
\ No newline at end of file
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java 2012-05-08
06:45:10 UTC (rev 40843)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java 2012-05-08
08:27:08 UTC (rev 40844)
@@ -89,7 +89,6 @@
import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.ServerCore;
-import org.jboss.ide.eclipse.as.core.server.internal.JBossServer;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.seam.core.ISeamProject;
import org.jboss.tools.seam.core.SeamCoreMessages;
@@ -1353,20 +1352,4 @@
}
return server;
}
-
- /**
- * If the server defined in the model is a JBoss AS then return it.
- * @param model
- * @return
- */
- public static JBossServer getJBossServer(IDataModel model) {
- IServer server = getServer(model);
- if(server!=null) {
- JBossServer jbs = (JBossServer) server.loadAdapter(JBossServer.class, new
NullProgressMonitor());
- if (jbs != null) {
- return jbs;
- }
- }
- return null;
- }
}
\ No newline at end of file
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamPerspectiveFactory.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamPerspectiveFactory.java 2012-05-08
06:45:10 UTC (rev 40843)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamPerspectiveFactory.java 2012-05-08
08:27:08 UTC (rev 40844)
@@ -10,7 +10,6 @@
public class SeamPerspectiveFactory implements IPerspectiveFactory {
private static final String SEAM_COMPONENTS_NAVIGATOR =
ISeamUiConstants.SEAM_COMPONENTS_VIEW_ID;
- private static String JBOSS_SERVERS_VIEW =
"org.jboss.ide.eclipse.as.ui.views.JBossServerView"; //$NON-NLS-1$
private static String WTP_SERVERS_VIEW =
"org.eclipse.wst.server.ui.ServersView"; //$NON-NLS-1$
public static final String PERSPECTIVE_ID =
"org.jboss.tools.seam.ui.SeamPerspective"; //$NON-NLS-1$
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java 2012-05-08
06:45:10 UTC (rev 40843)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java 2012-05-08
08:27:08 UTC (rev 40844)
@@ -76,7 +76,7 @@
import org.eclipse.wst.server.core.ServerCore;
import org.eclipse.wst.server.core.internal.ChainedJob;
import org.eclipse.wst.server.ui.ServerUIUtil;
-import org.jboss.ide.eclipse.as.core.server.internal.JBossServer;
+import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
import org.jboss.tools.jst.web.server.RegistrationHelper;
import org.jboss.tools.seam.core.SeamCoreMessages;
import org.jboss.tools.seam.core.SeamCorePlugin;
@@ -85,8 +85,8 @@
import org.jboss.tools.seam.core.project.facet.SeamRuntimeManager;
import org.jboss.tools.seam.core.project.facet.SeamVersion;
import org.jboss.tools.seam.internal.core.project.facet.AntCopyUtils;
+import org.jboss.tools.seam.internal.core.project.facet.ISeamFacetDataModelProperties;
import org.jboss.tools.seam.internal.core.project.facet.ResourceDeployer;
-import org.jboss.tools.seam.internal.core.project.facet.ISeamFacetDataModelProperties;
import
org.jboss.tools.seam.internal.core.project.facet.SeamFacetAbstractInstallDelegate;
import org.jboss.tools.seam.internal.core.project.facet.SeamFacetInstallDelegate;
import
org.jboss.tools.seam.internal.core.project.facet.SeamFacetProjectCreationDataModelProvider;
@@ -414,7 +414,7 @@
IServer server = SeamFacetAbstractInstallDelegate.getServer(model);
if (server != null) {
- JBossServer jbs = (JBossServer) server.loadAdapter(JBossServer.class, new
NullProgressMonitor());
+ IDeployableServer jbs = (IDeployableServer)
server.loadAdapter(IDeployableServer.class, new NullProgressMonitor());
if (jbs != null) {
String[] driverJars = (String[])
model.getProperty(ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_PATH);
if(driverJars!=null) {
Show replies by date