Author: rob.stryker(a)jboss.com
Date: 2011-12-13 09:49:38 -0500 (Tue, 13 Dec 2011)
New Revision: 37269
Removed:
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/AltMethodZippedFolderPublisher.java
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/PackagesPublisher.java
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/SingleFolderZippedPublisher.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IPollerFailureHandler.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/launch/AbstractJBossLaunchConfigType.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ServerBehavior.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/JBoss7RuntimeClasspathUtil.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/ModuleUtil.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions/ExploreAction.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions/ExploreActionDelegate.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossRuntimeJava6WizardFragment.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/xpl/ServerActionProvider.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/xpl/ServerContentProvider.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/xpl/ServerLabelProvider.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/xpl/ServersView.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/xpl/ServersViewDropAdapterAssistant.java
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/src/org/jboss/ide/eclipse/as/wtp/core/vcf/ReferenceResolverUtil.java
Modified:
trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/build/SaveArchivesJob.java
trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/ArchivesModel.java
trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/IArchiveModel.java
trunk/archives/plugins/org.jboss.ide.eclipse.archives.jdt.integration/src/org/jboss/ide/eclipse/archives/jdt/integration/ui/LibFilesetWizard.java
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/AbstractArchiveWizard.java
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/FilesetWizard.java
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/filesets/FilesetContentProvider.java
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/ArchivesModelModuleContributor.java
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/LocalZippedPublisherUtil.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/XPathQuery.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/publishers/AbstractPublishMethod.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PublishUtil.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DelegatingServerBehavior.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/JBossServer.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/LocalJBossServerRuntime.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/DelegatingJBoss7ServerBehavior.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/xpl/PublishCopyUtil.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/jbosscore/org/jboss/ide/eclipse/as/core/util/ServerUtil.java
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEHostShellModel.java
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEJBossStartLaunchDelegate.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions/ExploreUtils.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/dialogs/XPathDialogs.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/XPathActionProvider.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossServerWizardFragment.java
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/src/org/jboss/ide/eclipse/as/wtp/core/util/ServerModelUtilities.java
trunk/as/tests/org.jboss.ide.eclipse.as.archives.integration.test/src/org/jboss/ide/eclipse/as/archives/integration/test/BuildDeployTest.java
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2/MockPublishMethod.java
trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/src/org/jboss/tools/bpel/runtimes/module/JBTBPELPublisher.java
Log:
JBIDE-10465 - removal of deprecated cruft
Modified:
trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/build/SaveArchivesJob.java
===================================================================
---
trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/build/SaveArchivesJob.java 2011-12-13
14:38:45 UTC (rev 37268)
+++
trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/build/SaveArchivesJob.java 2011-12-13
14:49:38 UTC (rev 37269)
@@ -43,7 +43,7 @@
}
}
try {
- ArchivesModel.instance().save(projectPath, new NullProgressMonitor());
+ ArchivesModel.instance().getRoot(projectPath).save(new NullProgressMonitor());
} catch( ArchivesModelException ame ) {
IStatus status = new Status(IStatus.ERROR, ArchivesCorePlugin.PLUGIN_ID,
ArchivesCoreMessages.ErrorUpdatingModel, ame);
return status;
Modified:
trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/ArchivesModel.java
===================================================================
---
trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/ArchivesModel.java 2011-12-13
14:38:45 UTC (rev 37268)
+++
trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/ArchivesModel.java 2011-12-13
14:49:38 UTC (rev 37269)
@@ -23,8 +23,8 @@
import org.jboss.ide.eclipse.archives.core.ArchivesCoreMessages;
import org.jboss.ide.eclipse.archives.core.model.internal.ArchiveModelNode;
import org.jboss.ide.eclipse.archives.core.model.internal.xb.XMLBinding;
-import org.jboss.ide.eclipse.archives.core.model.internal.xb.XbPackages;
import org.jboss.ide.eclipse.archives.core.model.internal.xb.XMLBinding.XbException;
+import org.jboss.ide.eclipse.archives.core.model.internal.xb.XbPackages;
import org.jboss.ide.eclipse.archives.core.util.ModelUtil;
/**
@@ -135,16 +135,6 @@
return (archivesRoot.get(project));
}
- @Deprecated
- public void save(IPath projectPath, IProgressMonitor monitor) throws
ArchivesModelException {
- save(getRoot(projectPath), monitor);
- }
-
- @Deprecated
- public void save(IArchiveModelRootNode modelNode, IProgressMonitor monitor) throws
ArchivesModelException {
- modelNode.save(monitor);
- }
-
public boolean isProjectRegistered(IPath projectPath) {
return projectPath != null && archivesRoot.containsKey(projectPath);
}
Modified:
trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/IArchiveModel.java
===================================================================
---
trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/IArchiveModel.java 2011-12-13
14:38:45 UTC (rev 37268)
+++
trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/IArchiveModel.java 2011-12-13
14:49:38 UTC (rev 37269)
@@ -25,8 +25,6 @@
public static final String DEFAULT_PACKAGES_FILE = ".packages"; //$NON-NLS-1$
public boolean isProjectRegistered(IPath projectPath);
- public void save(IPath projectPath, IProgressMonitor monitor) throws
ArchivesModelException;
- public void save(IArchiveModelRootNode modelNode, IProgressMonitor monitor) throws
ArchivesModelException;
public IArchiveModelRootNode registerProject(IPath projectPath, IProgressMonitor
monitor) throws ArchivesModelException;
public IArchiveModelRootNode registerProject(IPath projectPath, String file,
IProgressMonitor monitor) throws ArchivesModelException;
public void registerProject(IArchiveModelRootNode modelNode, IProgressMonitor monitor);
Modified:
trunk/archives/plugins/org.jboss.ide.eclipse.archives.jdt.integration/src/org/jboss/ide/eclipse/archives/jdt/integration/ui/LibFilesetWizard.java
===================================================================
---
trunk/archives/plugins/org.jboss.ide.eclipse.archives.jdt.integration/src/org/jboss/ide/eclipse/archives/jdt/integration/ui/LibFilesetWizard.java 2011-12-13
14:38:45 UTC (rev 37268)
+++
trunk/archives/plugins/org.jboss.ide.eclipse.archives.jdt.integration/src/org/jboss/ide/eclipse/archives/jdt/integration/ui/LibFilesetWizard.java 2011-12-13
14:49:38 UTC (rev 37269)
@@ -54,7 +54,7 @@
if (createFileset)
parentNode.addChild(fileset);
try {
- ArchivesModel.instance().save(fileset.getProjectPath(), monitor);
+ ArchivesModel.instance().getRoot(fileset.getProjectPath()).save(monitor);
} catch( ArchivesModelException ame ) {
IStatus status = new Status(IStatus.ERROR, PackagesUIPlugin.PLUGIN_ID,
ArchivesUIMessages.ErrorCompletingWizard, ame);
PackagesUIPlugin.getDefault().getLog().log(status);
Modified:
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/AbstractArchiveWizard.java
===================================================================
---
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/AbstractArchiveWizard.java 2011-12-13
14:38:45 UTC (rev 37268)
+++
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/AbstractArchiveWizard.java 2011-12-13
14:49:38 UTC (rev 37269)
@@ -114,7 +114,7 @@
try {
if( create )
parent.addChild(pkg);
- ArchivesModel.instance().save(project.getLocation(), monitor);
+ ArchivesModel.instance().getRoot(project.getLocation()).save( monitor);
} catch( ArchivesModelException ame ) {
IStatus status = new Status(IStatus.ERROR, PackagesUIPlugin.PLUGIN_ID,
ArchivesUIMessages.ErrorCompletingWizard, ame);
PackagesUIPlugin.getDefault().getLog().log(status);
Modified:
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/FilesetWizard.java
===================================================================
---
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/FilesetWizard.java 2011-12-13
14:38:45 UTC (rev 37268)
+++
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/FilesetWizard.java 2011-12-13
14:49:38 UTC (rev 37269)
@@ -55,7 +55,7 @@
if (createFileset)
parentNode.addChild(fileset);
try {
- ArchivesModel.instance().save(fileset.getProjectPath(), monitor);
+ ArchivesModel.instance().getRoot(fileset.getProjectPath()).save( monitor);
} catch( ArchivesModelException ame ) {
IStatus status = new Status(IStatus.ERROR, PackagesUIPlugin.PLUGIN_ID,
ArchivesUIMessages.ErrorCompletingWizard, ame);
PackagesUIPlugin.getDefault().getLog().log(status);
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/filesets/FilesetContentProvider.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/filesets/FilesetContentProvider.java 2011-12-13
14:38:45 UTC (rev 37268)
+++
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/filesets/FilesetContentProvider.java 2011-12-13
14:49:38 UTC (rev 37269)
@@ -144,29 +144,10 @@
private Fileset[] loadFilesets() {
if( FilesetUtil.getFile(server).exists()) {
return FilesetUtil.loadFilesets(server);
- } else {
- return loadFilesets_LEGACY();
- }
+ }
+ return new Fileset[0];
}
- @Deprecated
- private Fileset[] loadFilesets_LEGACY() {
- Fileset[] filesets = new Fileset[0];
- if (server != null) {
- ServerAttributeHelper helper = ServerAttributeHelper
- .createHelper(server);
- List<String> tmp = (ArrayList<String>)helper.getAttribute(FILESET_KEY,
new ArrayList<String>());
- String[] asStrings = (String[]) tmp.toArray(new String[tmp
- .size()]);
- filesets = new Fileset[asStrings.length];
- for (int i = 0; i < asStrings.length; i++) {
- filesets[i] = new Fileset(asStrings[i]);
- filesets[i].setServer(server);
- }
- }
- return filesets;
- }
-
public void saveFilesets() {
FilesetUtil.saveFilesets(server, children);
}
Deleted:
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/AltMethodZippedFolderPublisher.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/AltMethodZippedFolderPublisher.java 2011-12-13
14:38:45 UTC (rev 37268)
+++
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/AltMethodZippedFolderPublisher.java 2011-12-13
14:49:38 UTC (rev 37269)
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * TODO: Logging and Progress Monitors
- ******************************************************************************/
-package org.jboss.ide.eclipse.archives.webtools.modules;
-
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.IServer;
-import org.jboss.ide.eclipse.as.core.modules.SingleDeployableFactory;
-import org.jboss.ide.eclipse.as.core.publishers.LocalPublishMethod;
-import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
-import org.jboss.ide.eclipse.as.core.util.ServerConverter;
-import org.jboss.ide.eclipse.as.wtp.core.modules.IJBTModule;
-
-/**
- * This class is in charge of RSE zipped publishing for deployable folders
- */
-@Deprecated
-public class AltMethodZippedFolderPublisher extends AltMethodZippedJSTPublisher {
- public boolean accepts(String method, IServer server, IModule[] module) {
- if( LocalPublishMethod.LOCAL_PUBLISH_METHOD.equals(method))
- return false;
-
- IDeployableServer ds = ServerConverter.getDeployableServer(server);
- if( module != null && module.length > 0
- && module[module.length-1] != null
- &&
module[module.length-1].getModuleType().getId().equals(SingleDeployableFactory.MODULE_TYPE))
{
- IModule mod = module[module.length-1];
- IJBTModule del = (IJBTModule)mod.loadAdapter(IJBTModule.class, new
NullProgressMonitor());
- if( del != null && !del.isBinary())
- return ds != null && ds.zipsWTPDeployments();; // we have a folder
- }
- return false;
- }
-}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/ArchivesModelModuleContributor.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/ArchivesModelModuleContributor.java 2011-12-13
14:38:45 UTC (rev 37268)
+++
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/ArchivesModelModuleContributor.java 2011-12-13
14:49:38 UTC (rev 37269)
@@ -91,7 +91,7 @@
projectToModules.put(project.getLocation(), mods);
if( requiresSave ) {
try {
- ArchivesModel.instance().save(project.getLocation(),
+ ArchivesModel.instance().getRoot(project.getLocation()).save(
new NullProgressMonitor());
} catch( ArchivesModelException ame ) {
}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/LocalZippedPublisherUtil.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/LocalZippedPublisherUtil.java 2011-12-13
14:38:45 UTC (rev 37268)
+++
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/LocalZippedPublisherUtil.java 2011-12-13
14:49:38 UTC (rev 37269)
@@ -229,7 +229,7 @@
IPath path = getOutputFilePath(combine(parent, last));
path = path.removeLastSegments(1);
de.schlichtherle.io.File root = TrueZipUtil.getFile(path,
TrueZipUtil.getJarArchiveDetector());
- IModuleResource[] resources = getResources(last);
+ IModuleResource[] resources = getResources(last, new NullProgressMonitor());
results.addAll(Arrays.asList(copy(root, resources)));
TrueZipUtil.umount();
return (IStatus[]) results.toArray(new IStatus[results.size()]);
Deleted:
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/PackagesPublisher.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/PackagesPublisher.java 2011-12-13
14:38:45 UTC (rev 37268)
+++
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/PackagesPublisher.java 2011-12-13
14:49:38 UTC (rev 37269)
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.ide.eclipse.archives.webtools.modules;
-
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.IServer;
-import org.jboss.ide.eclipse.as.core.publishers.LocalPublishMethod;
-import org.jboss.ide.eclipse.as.core.server.internal.v7.JBoss7JSTPublisher;
-
-@Deprecated
-public class PackagesPublisher extends JBoss7JSTPublisher {
- public boolean accepts(String method, IServer server, IModule[] module) {
-// if( LocalPublishMethod.LOCAL_PUBLISH_METHOD.equals(method) &&
-// verifyModuleType(module, PackageModuleFactory.MODULE_TYPE))
-// return true;
- return false;
- }
-}
Deleted:
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/SingleFolderZippedPublisher.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/SingleFolderZippedPublisher.java 2011-12-13
14:38:45 UTC (rev 37268)
+++
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/SingleFolderZippedPublisher.java 2011-12-13
14:49:38 UTC (rev 37269)
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * TODO: Logging and Progress Monitors
- ******************************************************************************/
-package org.jboss.ide.eclipse.archives.webtools.modules;
-
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.IServer;
-import org.jboss.ide.eclipse.as.core.modules.SingleDeployableFactory;
-import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
-import org.jboss.ide.eclipse.as.core.util.ServerConverter;
-import org.jboss.ide.eclipse.as.wtp.core.modules.IJBTModule;
-
-@Deprecated
-public class SingleFolderZippedPublisher extends WTPZippedPublisher {
- public boolean accepts(String method, IServer server, IModule[] module) {
- IDeployableServer ds = ServerConverter.getDeployableServer(server);
- if( module != null && module.length > 0
- && module[module.length-1] != null
- &&
module[module.length-1].getModuleType().getId().equals(SingleDeployableFactory.MODULE_TYPE))
{
- IModule mod = module[module.length-1];
- IJBTModule del = (IJBTModule)mod.loadAdapter(IJBTModule.class, new
NullProgressMonitor());
- if( del != null && !del.isBinary() && ds.zipsWTPDeployments())
- return true; // we have a folder
- }
- return false;
- }
-}
\ No newline at end of file
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 2011-12-13
14:38:45 UTC (rev 37268)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathCategory.java 2011-12-13
14:49:38 UTC (rev 37269)
@@ -10,13 +10,9 @@
******************************************************************************/
package org.jboss.ide.eclipse.as.core.extensions.descriptors;
-import java.util.ArrayList;
import java.util.HashMap;
-import java.util.List;
-import org.eclipse.core.runtime.Path;
import org.eclipse.wst.server.core.IServer;
-import org.jboss.ide.eclipse.as.core.server.internal.ServerAttributeHelper;
import org.jboss.ide.eclipse.as.core.util.internal.IMemento;
/**
@@ -26,48 +22,22 @@
*
*/
public class XPathCategory {
- @Deprecated private static final String DELIMITER = ","; //$NON-NLS-1$
- @Deprecated private static final String QUERY_LIST =
- "org.jboss.ide.eclipse.as.core.model.descriptor.QueryList"; //$NON-NLS-1$
- @Deprecated private static final String QUERY =
- "org.jboss.ide.eclipse.as.core.model.descriptor.Query"; //$NON-NLS-1$
-
-
protected String name; // cannot include delimiter from the model, comma
protected IServer server;
protected IMemento memento;
protected HashMap<String, XPathQuery> children;
- @Deprecated
+ /**
+ * Create a stub empty category
+ * @param name
+ * @param server
+ */
public XPathCategory(String name, IServer server) {
this.name = name;
this.server = server;
children = new HashMap<String, XPathQuery>();
- XPathQuery[] queries = loadQueries_LEGACY(this, server);
- for( int i = 0; i < queries.length; i++ ) {
- children.put(queries[i].getName(), queries[i]);
- }
}
- private static XPathQuery[] loadQueries_LEGACY(XPathCategory category, IServer server)
{
- ServerAttributeHelper helper = ServerAttributeHelper.createHelper(server);
- String list = helper.getAttribute(QUERY_LIST + '.' +
category.getName().replace(' ', '_'), (String)null);
- if( list == null )
- return new XPathQuery[] {};
- String[] queriesByName = list.split(DELIMITER);
- List<String> queryAsStringValues;
- ArrayList<XPathQuery> returnList = new ArrayList<XPathQuery>();
- for( int i = 0; i < queriesByName.length; i++ ) {
- queryAsStringValues = helper.getAttribute(QUERY + '.' +
queriesByName[i].replace(' ', '_'), (List)null);
- if( queryAsStringValues != null ) {
- XPathQuery q =new
XPathQuery(queriesByName[i].substring(queriesByName[i].indexOf(Path.SEPARATOR)+1),
queryAsStringValues);
- q.setCategory(category);
- returnList.add(q);
- }
- }
- return (XPathQuery[]) returnList.toArray(new XPathQuery[returnList.size()]);
- }
-
public XPathCategory(IServer server, IMemento memento) {
this.server = server;
this.name = memento.getString("name"); //$NON-NLS-1$
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 2011-12-13
14:38:45 UTC (rev 37268)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathQuery.java 2011-12-13
14:49:38 UTC (rev 37269)
@@ -71,11 +71,6 @@
setEffectiveBaseDir();
}
- @Deprecated
- public XPathQuery(IMemento memento) {
- this(memento, null);
- }
-
public XPathQuery(String name, List list) {
this.name = name;
this.baseDir = list.get(0).equals(XPathModel.EMPTY_STRING) ? null :
(String)list.get(0);
@@ -97,11 +92,6 @@
setEffectiveBaseDir();
}
- @Deprecated
- public XPathQuery(String name, String baseDir, String filePattern, String xpathPattern,
String attribute) {
- this(null, name, baseDir, filePattern, xpathPattern, attribute);
- }
-
private void setEffectiveBaseDir() {
IPath dir = baseDir == null ? null : new Path(baseDir);
if( dir == null && category != null) {
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 2011-12-13
14:38:45 UTC (rev 37268)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/SingleDeployableFactory.java 2011-12-13
14:49:38 UTC (rev 37269)
@@ -49,7 +49,6 @@
import org.eclipse.wst.server.core.internal.ModuleFactory;
import org.eclipse.wst.server.core.internal.PublishServerJob;
import org.eclipse.wst.server.core.internal.ServerPlugin;
-import org.eclipse.wst.server.core.model.IModuleFolder;
import org.eclipse.wst.server.core.model.IModuleResource;
import org.eclipse.wst.server.core.model.ModuleDelegate;
import org.eclipse.wst.server.core.model.ModuleFactoryDelegate;
@@ -184,39 +183,6 @@
}
}
- /**
- * Saves the deployable list for ALL files.
- * Should not be used
- * @deprecated
- */
- public void saveDeployableList() {
- HashMap<String, String> map = new HashMap<String, String>();
- IProject[] allProjects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
- for( int i = 0; i < allProjects.length; i++)
- map.put(allProjects[i].getName(), ""); //$NON-NLS-1$
-
- Set<IPath> allPaths = moduleIdToModule.keySet();
- Iterator<IPath> j = allPaths.iterator();
- IPath tmp;
- while(j.hasNext()) {
- tmp = j.next();
- map.put(tmp.segment(0), map.get(tmp.segment(0)) +
tmp.removeFirstSegments(1).makeRelative() + "\n"); //$NON-NLS-1$
- }
-
- String qualifier =
JBossServerCorePlugin.getDefault().getDescriptor().getUniqueIdentifier();
- for( int k = 0; k < allProjects.length; k++ ) {
- IScopeContext context = new ProjectScope(allProjects[k]);
- IEclipsePreferences node = context.getNode(qualifier);
- if (node != null)
- node.put(PREFERENCE_KEY, map.get(allProjects[k].getName()));
- try {
- node.flush();
- } catch (BackingStoreException e) {
- // TODO Log
- }
- }
- }
-
public void saveDeployableList(String projectName) {
IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
String list = ""; //$NON-NLS-1$
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/AbstractPublishMethod.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/AbstractPublishMethod.java 2011-12-13
14:38:45 UTC (rev 37268)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/AbstractPublishMethod.java 2011-12-13
14:49:38 UTC (rev 37269)
@@ -20,18 +20,12 @@
import org.jboss.ide.eclipse.as.core.ExtensionManager;
import org.jboss.ide.eclipse.as.core.extensions.events.ServerLogger;
import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethod;
-import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethodType;
import org.jboss.ide.eclipse.as.core.server.IJBossServerPublisher;
import org.jboss.ide.eclipse.as.core.server.internal.DeployableServerBehavior;
public abstract class AbstractPublishMethod implements IJBossServerPublishMethod {
public abstract String getPublishMethodId();
-// @Deprecated
-// public IJBossServerPublishMethodType getPublishMethodType() {
-// return ExtensionManager.getDefault().getPublishMethod(getPublishMethodId());
-// }
-
public void publishStart(DeployableServerBehavior behaviour,
IProgressMonitor monitor) throws CoreException {
}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PublishUtil.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PublishUtil.java 2011-12-13
14:38:45 UTC (rev 37268)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PublishUtil.java 2011-12-13
14:49:38 UTC (rev 37269)
@@ -176,27 +176,15 @@
return root;
}
- /**
+ /*
* This method is deprecated. Please use the following:
* @see getDeployPath(IModule[] module, String folder, IDeployableServer server)
* @param moduleTree
* @param deployFolder
* @return
*/
- @Deprecated
- public static IPath getDeployPath(IModule[] moduleTree, String deployFolder) {
- IPath root = new Path( deployFolder );
- String type, modName, name, uri, suffixedName;
- for( int i = 0; i < moduleTree.length; i++ ) {
- type = moduleTree[i].getModuleType().getId();
- modName = moduleTree[i].getName();
- name = new Path(modName).lastSegment();
- suffixedName = name + getSuffix(type);
- uri = getParentRelativeURI(moduleTree, i, suffixedName);
- root = root.append(uri);
- }
- return root;
- }
+ // @Deprecated
+ //public static IPath getDeployPath(IModule[] moduleTree, String deployFolder);
private static String getParentRelativeURI(IModule[] tree, int index, String
defaultName) {
if( index != 0 ) {
@@ -268,17 +256,6 @@
return suffix;
}
- @Deprecated
- public static boolean isBinaryObject(IModule[] moduleTree) {
- IModule lastMod = moduleTree[moduleTree.length-1];
- return ServerModelUtilities.isBinaryModule(lastMod);
- }
-
- @Deprecated
- public static IModuleResource[] getResources(IModule module) throws CoreException {
- return getResources(module, new NullProgressMonitor());
- }
-
public static IModuleResource[] getResources(IModule module, IProgressMonitor monitor)
throws CoreException {
monitor.beginTask("Fetching Module Resources", 100); //$NON-NLS-1$
ModuleDelegate md = (ModuleDelegate)module.loadAdapter(ModuleDelegate.class,
ProgressMonitorUtil.submon(monitor, 100));
@@ -292,7 +269,7 @@
}
public static IModuleResource[] getResources(IModule[] tree) throws CoreException {
- return getResources(tree[tree.length-1]);
+ return getResources(tree[tree.length-1], new NullProgressMonitor());
}
public static File getFile(IModuleResource resource) {
Deleted:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IPollerFailureHandler.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IPollerFailureHandler.java 2011-12-13
14:38:45 UTC (rev 37268)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IPollerFailureHandler.java 2011-12-13
14:49:38 UTC (rev 37269)
@@ -1,19 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.ide.eclipse.as.core.server;
-
-
-/**
- * @author rob.stryker <rob.stryker(a)redhat.com>
- * @deprecated
- */
-public interface IPollerFailureHandler extends IProvideCredentials {
-}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DelegatingServerBehavior.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DelegatingServerBehavior.java 2011-12-13
14:38:45 UTC (rev 37268)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DelegatingServerBehavior.java 2011-12-13
14:49:38 UTC (rev 37269)
@@ -127,13 +127,6 @@
}
}
- @Deprecated
- protected boolean shouldSuspendScanner() {
- if( getServer().getServerState() != IServer.STATE_STARTED)
- return false;
- return true;
- }
-
// Can start / stop / restart etc
@Override
public IStatus canStart(String launchMode) {
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 2011-12-13
14:38:45 UTC (rev 37268)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServer.java 2011-12-13
14:49:38 UTC (rev 37269)
@@ -104,21 +104,19 @@
public String getDeployFolder() {
- IJBossServerRuntime jbsrt = getRuntime();
- return ServerUtil.makeGlobal(jbsrt, new Path(getAttribute(DEPLOY_DIRECTORY,
""))).toString(); //$NON-NLS-1$
+ return ServerUtil.makeGlobal(getServer().getRuntime(), new
Path(getAttribute(DEPLOY_DIRECTORY, ""))).toString(); //$NON-NLS-1$
}
public void setDeployFolder(String folder) {
- setAttribute(DEPLOY_DIRECTORY, ServerUtil.makeRelative(getRuntime(), new
Path(folder)).toString());
+ setAttribute(DEPLOY_DIRECTORY, ServerUtil.makeRelative(getServer().getRuntime(), new
Path(folder)).toString());
}
public String getTempDeployFolder() {
- IJBossServerRuntime jbsrt = getRuntime();
- return ServerUtil.makeGlobal(jbsrt, new Path(getAttribute(TEMP_DEPLOY_DIRECTORY,
""))).toString(); //$NON-NLS-1$
+ return ServerUtil.makeGlobal(getServer().getRuntime(), new
Path(getAttribute(TEMP_DEPLOY_DIRECTORY, ""))).toString(); //$NON-NLS-1$
}
public void setTempDeployFolder(String folder) {
- setAttribute(TEMP_DEPLOY_DIRECTORY, ServerUtil.makeRelative(getRuntime(), new
Path(folder)).toString());
+ setAttribute(TEMP_DEPLOY_DIRECTORY, ServerUtil.makeRelative(getServer().getRuntime(),
new Path(folder)).toString());
}
public void setDeployLocationType(String type) {
@@ -158,20 +156,6 @@
return RuntimeUtils.getJBossServerRuntime(getServer());
}
- /**
- * @Deprecated
- * @see RuntimeUtils.getJBossServerRuntime(getServer())
- */
- public static IJBossServerRuntime getRuntime(IServer server) {
- IJBossServerRuntime ajbsrt = null;
- if( server.getRuntime() != null ) {
- ajbsrt = (IJBossServerRuntime) server.getRuntime()
- .loadAdapter(IJBossServerRuntime.class,
- new NullProgressMonitor());
- }
- return ajbsrt;
- }
-
public boolean hasJMXProvider() {
return false;
}
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 2011-12-13
14:38:45 UTC (rev 37268)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServer.java 2011-12-13
14:49:38 UTC (rev 37269)
@@ -38,7 +38,6 @@
import org.eclipse.core.runtime.Path;
import org.eclipse.jst.server.core.IWebModule;
import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.IRuntime;
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.model.IURLProvider;
import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
@@ -46,10 +45,10 @@
import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathQuery;
import org.jboss.ide.eclipse.as.core.publishers.LocalPublishMethod;
import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
-import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethodType;
import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
import org.jboss.ide.eclipse.as.core.util.DeploymentPreferenceLoader;
import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
+import org.jboss.ide.eclipse.as.core.util.RuntimeUtils;
import org.jboss.ide.eclipse.as.core.util.ServerUtil;
/**
@@ -104,17 +103,17 @@
}
/**
- * No changes will be made to this API and new server
- * types are expected to override the getDeployFolder() api's
+ * Legacy method used by some (such as UI) who want to
+ * deeply introspect the value for specific deployment location
+ * constants.
*
* @param jbs
* @param type
* @return
*/
- @Deprecated
public static String getDeployFolder(JBossServer jbs, String type) {
IServer server = jbs.getServer();
- IJBossServerRuntime jbsrt = getRuntime(server);
+ IJBossServerRuntime jbsrt = RuntimeUtils.getJBossServerRuntime(server);
if( type.equals(DEPLOY_CUSTOM)) {
String val = jbs.getAttribute(DEPLOY_DIRECTORY, (String)null);
if( val != null ) {
@@ -141,10 +140,18 @@
return getTempDeployFolder(this, getDeployLocationType());
}
- @Deprecated
+ /**
+ * Legacy method used by some (such as UI) who want to
+ * deeply introspect the value for specific deployment location
+ * constants.
+ *
+ * @param jbs
+ * @param type
+ * @return
+ */
public static String getTempDeployFolder(JBossServer jbs, String type) {
IServer server = jbs.getServer();
- IJBossServerRuntime jbsrt = getRuntime(server);
+ IJBossServerRuntime jbsrt =RuntimeUtils.getJBossServerRuntime(server);
if( type.equals(DEPLOY_CUSTOM))
return ServerUtil.makeGlobal(jbsrt.getRuntime(),
new Path(server.getAttribute(TEMP_DEPLOY_DIRECTORY, ""))).toString();
//$NON-NLS-1$
Deleted:
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 2011-12-13
14:38:45 UTC (rev 37268)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServerBehavior.java 2011-12-13
14:49:38 UTC (rev 37269)
@@ -1,183 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.ide.eclipse.as.core.server.internal;
-
-import java.util.HashMap;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.IServer;
-import org.jboss.ide.eclipse.as.core.publishers.AbstractServerToolsPublisher;
-import org.jboss.ide.eclipse.as.core.publishers.JSTPublisherXMLToucher;
-import org.jboss.ide.eclipse.as.core.publishers.LocalPublishMethod;
-import org.jboss.ide.eclipse.as.core.publishers.PublishUtil;
-import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
-import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethod;
-import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethodType;
-import
org.jboss.ide.eclipse.as.core.server.internal.launch.DelegatingStartLaunchConfiguration;
-import
org.jboss.ide.eclipse.as.core.server.xpl.PublishCopyUtil.IPublishCopyCallbackHandler;
-import org.jboss.ide.eclipse.as.core.util.DeploymentPreferenceLoader;
-import org.jboss.ide.eclipse.as.core.util.LaunchCommandPreferences;
-import org.jboss.ide.eclipse.as.core.util.ServerConverter;
-import org.jboss.ide.eclipse.as.wtp.core.util.ServerModelUtilities;
-
-/**
- *
- * @author Rob Stryker
- *
- */
-@Deprecated
-public class JBossServerBehavior extends DeployableServerBehavior {
-
- /**
- * TODO: move to its own file (so that we can hide implementations and export
interfaces) & rename to IJBossBehaviourDelegate
- */
- public static interface JBossBehaviourDelegate {
- public String getBehaviourTypeId();
- public void setActualBehaviour(JBossServerBehavior actualBehaviour);
- public void stop(boolean force);
- public void publishStart(final IProgressMonitor monitor) throws CoreException;
- public void publishFinish(final IProgressMonitor monitor) throws CoreException;
- public void setServerStarting();
- public void setServerStopping();
- public IStatus canChangeState(String launchMode);
- public String getDefaultStopArguments() throws CoreException;
- }
-
- private static HashMap<String, Class> delegateClassMap;
- static {
- delegateClassMap = new HashMap<String, Class>();
- delegateClassMap.put(LocalPublishMethod.LOCAL_PUBLISH_METHOD,
LocalJBossBehaviorDelegate.class);
- }
- public static void addDelegateMapping(String s, Class c) {
- delegateClassMap.put(s, c);
- }
-
- public JBossServerBehavior() {
- super();
- }
-
- private JBossBehaviourDelegate delegate;
- private String lastModeId;
- public JBossBehaviourDelegate getDelegate() {
- IJBossServerPublishMethodType type =
DeploymentPreferenceLoader.getCurrentDeploymentMethodType(getServer());
- String id = type == null ? LocalPublishMethod.LOCAL_PUBLISH_METHOD : type.getId();
- if( id.equals(lastModeId) && delegate != null &&
delegate.getBehaviourTypeId().equals(id))
- return delegate;
-
- Class c = getDelegateMap().get(id);
- if( c == null )
- c = getDelegateMap().get(LocalPublishMethod.LOCAL_PUBLISH_METHOD);
-
- try {
- JBossBehaviourDelegate o = (JBossBehaviourDelegate)c.newInstance();
- o.setActualBehaviour(this);
- lastModeId = id;
- delegate = o;
- } catch( InstantiationException ie) {
- } catch( IllegalAccessException iae) {
- }
- return delegate;
- }
-
- protected HashMap<String, Class> getDelegateMap() {
- return delegateClassMap;
- }
-
- public void stop(boolean force) {
- getDelegate().stop(force);
- }
-
- /*
- * This shouldn't be done in the delegate.
- * The launch config class directly should do it and allow all modes
- * to participate?
- */
- public void setupLaunchConfiguration(ILaunchConfigurationWorkingCopy workingCopy,
IProgressMonitor monitor) throws CoreException {
- new DelegatingStartLaunchConfiguration().setupLaunchConfiguration(workingCopy,
getServer());
- }
-
- public void setRunMode(String mode) {
- setMode(mode);
- }
-
- public void serverStarting() {
- super.setServerStarting();
- getDelegate().setServerStarting();
- }
-
- public void serverStopping() {
- super.setServerStopping();
- getDelegate().setServerStopping();
- }
-
- protected void publishStart(final IProgressMonitor monitor) throws CoreException {
- super.publishStart(monitor);
- getDelegate().publishStart(monitor);
- }
-
- protected void publishFinish(final IProgressMonitor monitor) throws CoreException {
- getDelegate().publishFinish(monitor);
- super.publishFinish(monitor);
- }
-
- public boolean shouldSuspendScanner() {
- if( getServer().getServerState() != IServer.STATE_STARTED)
- return false;
- return true;
- }
-
- // Can start / stop / restart etc
- public IStatus canStart(String launchMode) {
- return canChangeState(launchMode);
- }
- public IStatus canRestart(String launchMode) {
- return canChangeState(launchMode);
- }
- public IStatus canStop() {
- return canChangeState(null);
- }
- public IStatus canStop(String launchMode) {
- return canChangeState(launchMode);
- }
- protected IStatus canChangeState(String launchMode) {
- return getDelegate().canChangeState(launchMode);
- }
-
- public boolean canRestartModule(IModule[] module){
- if( module.length == 1 )
- return true;
- return false;
- }
-
- public void restartModule(IModule[] module, IProgressMonitor monitor) throws
CoreException {
- IDeployableServer ds = ServerConverter.getDeployableServer(getServer());
- if( ds == null )
- return;
-
- IJBossServerPublishMethod method = createPublishMethod();
- IPath depPath = PublishUtil.getDeployPath(method, module, ds);
- if( ServerModelUtilities.isBinaryModule(module[module.length-1]) ||
ds.zipsWTPDeployments()) {
- // touch the file
- method.getCallbackHandler(depPath.removeLastSegments(1),
getServer()).touchResource(new Path(depPath.lastSegment()));
- } else {
- // touch the descriptor
- IPublishCopyCallbackHandler callback =
method.getCallbackHandler(AbstractServerToolsPublisher.getRootPath(depPath).append(depPath),
getServer());
- JSTPublisherXMLToucher.getInstance().touch(depPath, module[0], callback);
- }
- }
-}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/LocalJBossServerRuntime.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/LocalJBossServerRuntime.java 2011-12-13
14:38:45 UTC (rev 37268)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/LocalJBossServerRuntime.java 2011-12-13
14:49:38 UTC (rev 37269)
@@ -78,14 +78,6 @@
return getNextRuntimeName(base);
}
- /**
- * @deprecated replaced by {@link #isEAP()} and {@link RuntimeUtils#isEAP(IRuntime)}
- */
- @Deprecated
- public static boolean isEAP(IRuntime rt) {
- return
rt.getRuntimeType().getId().startsWith("org.jboss.ide.eclipse.as.runtime.eap.");
//$NON-NLS-1$
- }
-
public boolean isEAP() {
return getRuntime() != null
&& getRuntime().getRuntimeType() != null
Deleted:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/AbstractJBossLaunchConfigType.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/AbstractJBossLaunchConfigType.java 2011-12-13
14:38:45 UTC (rev 37268)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/AbstractJBossLaunchConfigType.java 2011-12-13
14:49:38 UTC (rev 37269)
@@ -1,196 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.ide.eclipse.as.core.server.internal.launch;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.jdt.launching.AbstractJavaLaunchConfigurationDelegate;
-import org.eclipse.jdt.launching.ExecutionArguments;
-import org.eclipse.jdt.launching.IRuntimeClasspathEntry;
-import org.eclipse.jdt.launching.IVMInstall;
-import org.eclipse.jdt.launching.IVMRunner;
-import org.eclipse.jdt.launching.VMRunnerConfiguration;
-import org.eclipse.jst.server.core.ServerProfilerDelegate;
-import org.eclipse.wst.server.core.IServer;
-import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
-import org.jboss.ide.eclipse.as.core.Messages;
-import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
-import org.jboss.ide.eclipse.as.core.server.internal.JBossServer;
-import org.jboss.ide.eclipse.as.core.server.internal.DelegatingServerBehavior;
-import
org.jboss.ide.eclipse.as.core.server.internal.launch.configuration.JBossLaunchConfigProperties;
-import org.jboss.ide.eclipse.as.core.util.LaunchConfigUtils;
-import org.jboss.ide.eclipse.as.core.util.RuntimeUtils;
-import org.jboss.ide.eclipse.as.core.util.ServerConverter;
-import org.jboss.ide.eclipse.as.core.util.ServerUtil;
-
-/**
- * @deprecated replaced by {@link AbstractJBossStartLaunchConfiguration}
- * @author Rob Stryker
- */
-@Deprecated
-public abstract class AbstractJBossLaunchConfigType extends
AbstractJavaLaunchConfigurationDelegate {
-
- // we have no need to do anything in pre-launch check
- @Override
- public boolean preLaunchCheck(ILaunchConfiguration configuration, String mode,
IProgressMonitor monitor)
- throws CoreException {
- return true;
- }
-
- public void preLaunch(ILaunchConfiguration configuration,
- String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException {
- // override me
- }
-
- public void postLaunch(ILaunchConfiguration configuration,
- String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException {
- // override me
- }
-
- @Override
- public void launch(ILaunchConfiguration configuration, String mode,
- ILaunch launch, IProgressMonitor monitor) throws CoreException {
- preLaunch(configuration, mode, launch, monitor);
- actualLaunch(configuration, mode, launch, monitor);
- postLaunch(configuration, mode, launch, monitor);
- }
-
- protected void actualLaunch(ILaunchConfiguration configuration,
- String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException {
- // And off we go!
- IVMInstall vm = verifyVMInstall(configuration);
- IVMRunner runner = vm.getVMRunner(mode);
-
- if (runner == null && ILaunchManager.PROFILE_MODE.equals(mode)) {
- runner = vm.getVMRunner(ILaunchManager.RUN_MODE);
- }
- if (runner == null) {
- throw new CoreException(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, 0,
- Messages.runModeNotSupported, null));
- }
-
- File workingDir = verifyWorkingDirectory(configuration);
- String workingDirName = null;
- if (workingDir != null)
- workingDirName = workingDir.getAbsolutePath();
-
- // Program & VM args
- String pgmArgs = getProgramArguments(configuration);
- String vmArgs = getVMArguments(configuration);
- ExecutionArguments execArgs = new ExecutionArguments(vmArgs, pgmArgs);
-
- // VM-specific attributes
- Map<?, ?> vmAttributesMap = getVMSpecificAttributesMap(configuration);
-
- // Classpath
- String[] classpath = getClasspath(configuration);
-
- // Environment
- String[] environment = getEnvironment(configuration);
-
- // Create VM config
- String mainType = getMainTypeName(configuration);
- VMRunnerConfiguration runConfig = new VMRunnerConfiguration(mainType, classpath);
- runConfig.setProgramArguments(execArgs.getProgramArgumentsArray());
- runConfig.setVMArguments(execArgs.getVMArgumentsArray());
- runConfig.setWorkingDirectory(workingDirName);
- runConfig.setVMSpecificAttributesMap(vmAttributesMap);
- runConfig.setEnvironment(environment);
-
- // Bootpath
- String[] bootpath = getBootpath(configuration);
- if (bootpath != null && bootpath.length > 0)
- runConfig.setBootClassPath(bootpath);
-
- setDefaultSourceLocator(launch, configuration);
-
- if (ILaunchManager.PROFILE_MODE.equals(mode)) {
- try {
- ServerProfilerDelegate.configureProfiling(launch, vm, runConfig, monitor);
- } catch (CoreException ce) {
- IServer server = org.eclipse.wst.server.core.ServerUtil.getServer(configuration);
- DelegatingServerBehavior jbsb = (DelegatingServerBehavior)
server.getAdapter(DelegatingServerBehavior.class);
- jbsb.stop(true);
- // genericServer.stopImpl();
- throw ce;
- }
- }
- // Launch the configuration
- runner.run(runConfig, launch, monitor);
- }
-
- @Deprecated
- public static JBossServer findJBossServer(String serverId) throws CoreException {
- return ServerConverter.findJBossServer(serverId);
- }
-
- @Deprecated
- public static IJBossServerRuntime findJBossServerRuntime(IServer server) throws
CoreException {
- return RuntimeUtils.checkedGetJBossServerRuntime(server);
- }
-
- @Deprecated
- public static void addCPEntry(ArrayList<IRuntimeClasspathEntry> list, JBossServer
jbs, String relative) throws CoreException {
- String serverHome =
org.jboss.ide.eclipse.as.core.util.ServerUtil.checkedGetServerHome(jbs);
- LaunchConfigUtils.addCPEntry(serverHome, relative, list);
- }
-
- @Deprecated
- public static void addCPEntry(ArrayList<IRuntimeClasspathEntry> list, IPath path)
{
- LaunchConfigUtils.addCPEntry(path, list);
- }
-
- @Deprecated
- public static void addJREEntry(List<IRuntimeClasspathEntry> cp, IVMInstall
vmInstall) {
- LaunchConfigUtils.addJREEntry(vmInstall, cp);
- }
-
- @Deprecated
- public static void addToolsJar(ArrayList<IRuntimeClasspathEntry> cp, IVMInstall
vmInstall) {
- LaunchConfigUtils.addToolsJar(vmInstall, cp);
- }
-
- @Deprecated
- public static ArrayList<String>
convertClasspath(List<IRuntimeClasspathEntry> cp) throws CoreException {
- return (ArrayList) LaunchConfigUtils.toStrings(cp);
- }
-
- @Deprecated
- protected static void addDirectory(String serverHome, List<IRuntimeClasspathEntry>
classpath,
- String dirName) {
- LaunchConfigUtils.addDirectory(serverHome, classpath, dirName);
- }
-
- @Deprecated
- public static String getServerHome(JBossServer jbs) throws CoreException {
- return ServerUtil.checkedGetServerHome(jbs);
- }
-
- @Deprecated
- public IVMInstall getVMInstall(ILaunchConfiguration configuration) throws CoreException
{
- String serverId = new JBossLaunchConfigProperties().getServerId(configuration);
- JBossServer jbs = ServerConverter.findJBossServer(serverId);
- IJBossServerRuntime runtime =
RuntimeUtils.checkedGetJBossServerRuntime(jbs.getServer());
- return runtime.getVM();
- }
-
-}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/DelegatingJBoss7ServerBehavior.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/DelegatingJBoss7ServerBehavior.java 2011-12-13
14:38:45 UTC (rev 37268)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/DelegatingJBoss7ServerBehavior.java 2011-12-13
14:49:38 UTC (rev 37269)
@@ -50,11 +50,6 @@
private PollThread pollThread;
@Override
- public boolean shouldSuspendScanner() {
- return false;
- }
-
- @Override
public void setupLaunchConfiguration(ILaunchConfigurationWorkingCopy launchConfig,
IProgressMonitor monitor)
throws CoreException {
// TODO: implement setup for RSE launch delegate too
Deleted:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ServerBehavior.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ServerBehavior.java 2011-12-13
14:38:45 UTC (rev 37268)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ServerBehavior.java 2011-12-13
14:49:38 UTC (rev 37269)
@@ -1,20 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.ide.eclipse.as.core.server.internal.v7;
-
-
-/**
- * @deprecated replaced by {@link DelegatingJBoss7ServerBehavior}
- *
- * @author Rob Stryker
- */
-public class JBoss7ServerBehavior extends DelegatingJBoss7ServerBehavior {
-}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/xpl/PublishCopyUtil.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/xpl/PublishCopyUtil.java 2011-12-13
14:38:45 UTC (rev 37268)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/xpl/PublishCopyUtil.java 2011-12-13
14:49:38 UTC (rev 37269)
@@ -283,12 +283,5 @@
for (int i = 0; i < size; i++)
list.add(a[i]);
}
-
- @Deprecated
- public static boolean checkRestartModule(File file) {
- if( file.getName().toLowerCase().endsWith(".jar")) //$NON-NLS-1$
- return true;
- return false;
- }
}
\ No newline at end of file
Deleted:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/JBoss7RuntimeClasspathUtil.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/JBoss7RuntimeClasspathUtil.java 2011-12-13
14:38:45 UTC (rev 37268)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/JBoss7RuntimeClasspathUtil.java 2011-12-13
14:49:38 UTC (rev 37269)
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.ide.eclipse.as.core.util;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jdt.launching.IRuntimeClasspathEntry;
-import org.eclipse.jdt.launching.IVMInstall;
-import org.eclipse.jdt.launching.JavaRuntime;
-import org.eclipse.wst.server.core.IServer;
-import
org.jboss.ide.eclipse.as.core.server.internal.launch.AbstractJBossLaunchConfigType;
-import
org.jboss.ide.eclipse.as.core.server.internal.launch.AbstractJBossStartLaunchConfiguration;
-
-public class JBoss7RuntimeClasspathUtil {
-
- @Deprecated
- public static List<String> getClasspath(IServer server, IVMInstall vmInstall)
throws CoreException {
- List<IRuntimeClasspathEntry> classpath = new
ArrayList<IRuntimeClasspathEntry>();
- classpath.add(getModulesClasspathEntry(server));
- AbstractJBossLaunchConfigType.addJREEntry(classpath, vmInstall);
- List<String> runtimeClassPaths =
AbstractJBossLaunchConfigType.convertClasspath(classpath);
- return runtimeClassPaths;
- }
-
- @Deprecated
- public static IRuntimeClasspathEntry getModulesClasspathEntry(IServer server) throws
CoreException {
- IPath runtimeLocation = server.getRuntime().getLocation();
- IPath modulesLocation =
runtimeLocation.append(IJBossRuntimeResourceConstants.JBOSS7_MODULES_JAR);
- return JavaRuntime.newArchiveRuntimeClasspathEntry(modulesLocation);
- }
-}
Deleted:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/ModuleUtil.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/ModuleUtil.java 2011-12-13
14:38:45 UTC (rev 37268)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/ModuleUtil.java 2011-12-13
14:49:38 UTC (rev 37269)
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.ide.eclipse.as.core.util;
-
-import java.util.ArrayList;
-
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.IServer;
-import org.jboss.ide.eclipse.as.wtp.core.util.ServerModelUtilities;
-
-@Deprecated
-/**
- * Please use org.jboss.ide.eclipse.as.wtp.core.util.ServerModelUtilities
- */
-public class ModuleUtil {
- @Deprecated
- public static ArrayList<IModule[]> getShallowChildren(IServer server, IModule[]
root) {
- return ServerModelUtilities.getShallowChildren(server, root);
- }
- @Deprecated
- public static ArrayList<IModule[]> getDeepChildren(IServer server, IModule[] mod)
{
- return ServerModelUtilities.getDeepChildren(server, mod);
- }
- @Deprecated
- public static IModule[] getChildModules(IModule[] module) {
- return ServerModelUtilities.getChildModules(module);
- }
-}
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 2011-12-13
14:38:45 UTC (rev 37268)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/ServerConverter.java 2011-12-13
14:49:38 UTC (rev 37269)
@@ -191,14 +191,4 @@
servers.toArray(ret);
return ret;
}
-
- @Deprecated
- public static IJBossServerRuntime getJBossRuntime(IServer server) throws CoreException
{
- return RuntimeUtils.checkedGetJBossServerRuntime(server);
- }
-
- @Deprecated
- public static IJBossServerRuntime getJBossRuntime(IServerAttributes server) {
- return RuntimeUtils.getJBossServerRuntime(server);
- }
}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/ServerUtil.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/ServerUtil.java 2011-12-13
14:38:45 UTC (rev 37268)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/ServerUtil.java 2011-12-13
14:49:38 UTC (rev 37269)
@@ -60,14 +60,7 @@
public static IJBossBehaviourDelegate checkedGetBehaviorDelegate(IServer server) throws
CoreException {
return checkedGetServerAdapter(server, DelegatingServerBehavior.class).getDelegate();
}
-
- @Deprecated
- public static IPath makeRelative(IJBossServerRuntime rt, IPath p) {
- if( rt != null && rt.getRuntime() != null )
- return makeRelative(rt.getRuntime(), p);
- return p;
- }
-
+
public static IPath makeRelative(IRuntime rt, IPath p) {
if( p.isAbsolute() && rt != null) {
if(rt.getLocation().isPrefixOf(p)) {
@@ -78,13 +71,6 @@
return p;
}
- @Deprecated
- public static IPath makeGlobal(IJBossServerRuntime rt, IPath p) {
- if( rt != null && rt.getRuntime() != null )
- return makeGlobal(rt.getRuntime(), p);
- return p;
- }
-
public static IPath makeGlobal(IRuntime rt, IPath p) {
if( !p.isAbsolute() ) {
if( rt != null && rt.getLocation() != null ) {
@@ -128,7 +114,7 @@
IPath newTemp = new Path(IJBossRuntimeResourceConstants.SERVER).append(config)
.append(IJBossToolingConstants.TMP)
.append(IJBossToolingConstants.JBOSSTOOLS_TMP).makeRelative();
- IPath newTempAsGlobal = ServerUtil.makeGlobal(jbsrt, newTemp);
+ IPath newTempAsGlobal = makeGlobal(jbsrt.getRuntime(), newTemp);
newTempAsGlobal.toFile().mkdirs();
}
}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEHostShellModel.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEHostShellModel.java 2011-12-13
14:38:45 UTC (rev 37268)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEHostShellModel.java 2011-12-13
14:49:38 UTC (rev 37269)
@@ -159,21 +159,6 @@
}
- /**
- * @deprecated moved to {@link ThreadUtils#sleepFor(int)}
- */
- @Deprecated
- public static void delay(int delay /* in ms */) {
- int x = 0;
- while( x < delay) {
- x+=200;
- try {
- Thread.sleep(200);
- } catch(InterruptedException ie) {
- }
- }
- }
-
public static IShellService findShellService(DelegatingServerBehavior behaviour) throws
CoreException {
return findShellService(behaviour.getServer());
}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEJBossStartLaunchDelegate.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEJBossStartLaunchDelegate.java 2011-12-13
14:38:45 UTC (rev 37268)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEJBossStartLaunchDelegate.java 2011-12-13
14:49:38 UTC (rev 37269)
@@ -14,19 +14,12 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Status;
import org.eclipse.debug.core.ILaunch;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
-import org.eclipse.osgi.util.NLS;
import org.eclipse.wst.server.core.IServer;
-import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
-import org.jboss.ide.eclipse.as.core.Messages;
-import org.jboss.ide.eclipse.as.core.extensions.events.ServerLogger;
import org.jboss.ide.eclipse.as.core.extensions.polling.WebPortPoller;
import org.jboss.ide.eclipse.as.core.server.internal.DelegatingServerBehavior;
import org.jboss.ide.eclipse.as.core.server.internal.IJBossBehaviourDelegate;
@@ -37,10 +30,8 @@
import org.jboss.ide.eclipse.as.core.util.IJBossRuntimeConstants;
import org.jboss.ide.eclipse.as.core.util.IJBossRuntimeResourceConstants;
import org.jboss.ide.eclipse.as.core.util.JBossServerBehaviorUtils;
-import org.jboss.ide.eclipse.as.core.util.LaunchCommandPreferences;
import org.jboss.ide.eclipse.as.core.util.ServerConverter;
import org.jboss.ide.eclipse.as.core.util.ServerUtil;
-import org.jboss.ide.eclipse.as.rse.core.RSEHostShellModel.ServerShellModel;
public class RSEJBossStartLaunchDelegate extends AbstractRSELaunchDelegate {
@@ -56,52 +47,7 @@
launchPingThread(beh);
}
- /**
- *
- * @deprecated
- * This was called from {@link RSEBehaviourDelegate#stop(boolean)
- * WTP keeps launching in launch configs and stopping in
- * the server behavior. We should not change that and offer
- * stopping-functionalities in launch delegates.
- *
- * @param behaviour
- */
- @Deprecated
- public static void launchStopServerCommand(DelegatingServerBehavior behaviour) {
- if (LaunchCommandPreferences.isIgnoreLaunchCommand(behaviour.getServer())) {
- behaviour.setServerStopping();
- behaviour.setServerStopped();
- return;
- }
- ILaunchConfiguration config = null;
- String command2 = "";
- try {
- config = behaviour.getServer().getLaunchConfiguration(false, new
NullProgressMonitor());
- /*
- * ATTENTION: this was commented since #getDefaultStopCommand is not static any
more
- * String defaultCmd = getDefaultStopCommand(behaviour.getServer(), true);
- */
- /*
- * This was added to make it compile
- */
- String defaultCmd = "";
-
-
- command2 = config == null ? defaultCmd :
- RSELaunchConfigProperties.getShutdownCommand(config, defaultCmd);
- behaviour.setServerStopping();
- ServerShellModel model =
RSEHostShellModel.getInstance().getModel(behaviour.getServer());
- model.executeRemoteCommand("/", command2, new String[] {}, new
NullProgressMonitor(), 10000, true);
- if (model.getStartupShell() != null && model.getStartupShell().isActive())
- model.getStartupShell().writeToShell("exit");
- behaviour.setServerStopped();
- } catch (CoreException ce) {
- behaviour.setServerStarted();
- ServerLogger.getDefault().log(behaviour.getServer(), ce.getStatus());
- }
- }
-
@Override
public boolean preLaunchCheck(ILaunchConfiguration configuration,
String mode, IProgressMonitor monitor) throws CoreException {
@@ -150,17 +96,6 @@
return stop;
}
- @Deprecated
- public static IServer findServer(ILaunchConfiguration config) throws CoreException {
- String serverId = config.getAttribute("server-id", (String) null);
- JBossServer jbs = ServerConverter.findJBossServer(serverId);
- if (jbs == null) {
- throw new CoreException(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
- NLS.bind(Messages.ServerNotFound, serverId)));
- }
- return jbs.getServer();
- }
-
private String getDefaultLaunchCommand(ILaunchConfiguration config) throws CoreException
{
String serverId = new JBossLaunchConfigProperties().getServerId(config);
JBossServer jbossServer = ServerConverter.checkedFindJBossServer(serverId);
Deleted:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions/ExploreAction.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions/ExploreAction.java 2011-12-13
14:38:45 UTC (rev 37268)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions/ExploreAction.java 2011-12-13
14:49:38 UTC (rev 37269)
@@ -1,20 +0,0 @@
-/*************************************************************************************
- * Copyright (c) 2008-2011 Red Hat, Inc. and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- *
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * JBoss by Red Hat - Initial implementation.
- ************************************************************************************/
-package org.jboss.ide.eclipse.as.ui.actions;
-
-
-/**
- * @author snjeza
- *
- */
-@Deprecated
-public class ExploreAction {
-}
Deleted:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions/ExploreActionDelegate.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions/ExploreActionDelegate.java 2011-12-13
14:38:45 UTC (rev 37268)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions/ExploreActionDelegate.java 2011-12-13
14:49:38 UTC (rev 37269)
@@ -1,21 +0,0 @@
-/*************************************************************************************
- * Copyright (c) 2008-2011 Red Hat, Inc. and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- *
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * JBoss by Red Hat - Initial implementation.
- ************************************************************************************/
-package org.jboss.ide.eclipse.as.ui.actions;
-
-
-/**
- * @author Snjeza
- *
- */
-@Deprecated
-public class ExploreActionDelegate{
-
-}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions/ExploreUtils.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions/ExploreUtils.java 2011-12-13
14:38:45 UTC (rev 37268)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions/ExploreUtils.java 2011-12-13
14:49:38 UTC (rev 37269)
@@ -25,6 +25,7 @@
import org.jboss.ide.eclipse.as.core.util.ServerConverter;
import org.jboss.ide.eclipse.as.ui.JBossServerUIPlugin;
import org.jboss.ide.eclipse.as.ui.Messages;
+import org.jboss.ide.eclipse.as.wtp.core.util.ServerModelUtilities;
/**
* @author snjeza
@@ -169,7 +170,7 @@
if (Platform.getOS().equals(Platform.OS_WIN32)) {
return fullPath;
}
- if( !PublishUtil.isBinaryObject(moduleTree)) {
+ if( !ServerModelUtilities.isBinaryModule(moduleTree)) {
return fullPath;
}
return fullPath.removeLastSegments(1);
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/dialogs/XPathDialogs.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/dialogs/XPathDialogs.java 2011-12-13
14:38:45 UTC (rev 37268)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/dialogs/XPathDialogs.java 2011-12-13
14:49:38 UTC (rev 37269)
@@ -64,11 +64,10 @@
import org.jboss.ide.eclipse.as.core.extensions.descriptors.XMLDocumentRepository;
import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathCategory;
import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathFileResult;
+import
org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathFileResult.XPathResultNode;
import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathModel;
import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathQuery;
-import
org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathFileResult.XPathResultNode;
import org.jboss.ide.eclipse.as.core.server.internal.JBossServer;
-import org.jboss.ide.eclipse.as.core.util.ServerUtil;
import org.jboss.ide.eclipse.as.ui.Messages;
@@ -391,7 +390,7 @@
final String directory2 = directory;
IRunnableWithProgress op = new IRunnableWithProgress() {
public void run(IProgressMonitor monitor) throws InvocationTargetException,
InterruptedException {
- XPathQuery tmp = new XPathQuery("", directory2, filePattern, xpText,
attText); //$NON-NLS-1$
+ XPathQuery tmp = new XPathQuery(null, "", directory2, filePattern, xpText,
attText); //$NON-NLS-1$
tmp.setRepository(repository);
final ArrayList<XPathFileResult> list = new
ArrayList<XPathFileResult>();
list.addAll(Arrays.asList(tmp.getResults()));
@@ -637,7 +636,7 @@
ArrayList list = xpathCache.get(xpath);
return (XPathResultNode[]) list.toArray(new XPathResultNode[list.size()]);
}
- XPathQuery tmp = new XPathQuery("", path, "**/*.xml", xpath,
null); //$NON-NLS-1$ //$NON-NLS-2$
+ XPathQuery tmp = new XPathQuery(null, "", path, "**/*.xml", xpath,
null); //$NON-NLS-1$ //$NON-NLS-2$
tmp.setRepository(repository);
ArrayList<XPathResultNode> list = new ArrayList<XPathResultNode>();
XPathFileResult[] items = tmp.getResults();
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/XPathActionProvider.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/XPathActionProvider.java 2011-12-13
14:38:45 UTC (rev 37268)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/XPathActionProvider.java 2011-12-13
14:49:38 UTC (rev 37269)
@@ -142,7 +142,8 @@
categoryItem = categoryList[i];
}
if (categoryItem != null) {
- XPathQuery query = new XPathQuery(d.getName(),
+ XPathQuery query = new XPathQuery(
+ null, d.getName(),
"server/${config}", // TODO externalize this in a constant
null, d.getXpath(), d.getAttribute());
categoryItem.addQuery(query);
Deleted:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossRuntimeJava6WizardFragment.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossRuntimeJava6WizardFragment.java 2011-12-13
14:38:45 UTC (rev 37268)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossRuntimeJava6WizardFragment.java 2011-12-13
14:49:38 UTC (rev 37269)
@@ -1,29 +0,0 @@
-/**
- * JBoss by Red Hat
- * Copyright 2006-2009, 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.ui.wizards;
-
-
-@Deprecated
-public class JBossRuntimeJava6WizardFragment extends JBossRuntimeWizardFragment {
- public JBossRuntimeJava6WizardFragment() {
- }
-}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossServerWizardFragment.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossServerWizardFragment.java 2011-12-13
14:38:45 UTC (rev 37268)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossServerWizardFragment.java 2011-12-13
14:49:38 UTC (rev 37269)
@@ -36,7 +36,7 @@
import org.eclipse.wst.server.ui.wizard.IWizardHandle;
import org.eclipse.wst.server.ui.wizard.WizardFragment;
import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
-import org.jboss.ide.eclipse.as.core.server.internal.LocalJBossServerRuntime;
+import org.jboss.ide.eclipse.as.core.util.RuntimeUtils;
import org.jboss.ide.eclipse.as.ui.JBossServerUISharedImages;
import org.jboss.ide.eclipse.as.ui.Messages;
import org.jboss.ide.eclipse.as.ui.UIUtil;
@@ -89,7 +89,7 @@
protected boolean isEAP() {
IRuntime rt = (IRuntime) getTaskModel().getObject(TaskModel.TASK_RUNTIME);
- return LocalJBossServerRuntime.isEAP(rt);
+ return RuntimeUtils.isEAP(rt);
}
public ImageDescriptor getImageDescriptor() {
Deleted:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/xpl/ServerActionProvider.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/xpl/ServerActionProvider.java 2011-12-13
14:38:45 UTC (rev 37268)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/xpl/ServerActionProvider.java 2011-12-13
14:49:38 UTC (rev 37269)
@@ -1,20 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- *
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - Base Code
- * Red Hat - Refactor for CNF
- *******************************************************************************/
-package org.jboss.tools.as.wst.server.ui.xpl;
-
-import org.eclipse.ui.navigator.CommonActionProvider;
-/**
- * @deprecated
- */
-public class ServerActionProvider extends CommonActionProvider {
- // Deprecated class
-}
Deleted:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/xpl/ServerContentProvider.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/xpl/ServerContentProvider.java 2011-12-13
14:38:45 UTC (rev 37268)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/xpl/ServerContentProvider.java 2011-12-13
14:49:38 UTC (rev 37269)
@@ -1,365 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- *
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - Base Code
- * Red Hat - Refactor for CNF
- *******************************************************************************/
-package org.jboss.tools.as.wst.server.ui.xpl;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.IPublishListener;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.IServerLifecycleListener;
-import org.eclipse.wst.server.core.IServerListener;
-import org.eclipse.wst.server.core.ServerCore;
-import org.eclipse.wst.server.core.ServerEvent;
-import org.eclipse.wst.server.core.internal.Server;
-import org.eclipse.wst.server.core.internal.UpdateServerJob;
-import org.eclipse.wst.server.core.util.PublishAdapter;
-import org.eclipse.wst.server.ui.internal.view.servers.ModuleServer;
-import org.eclipse.wst.server.ui.internal.viewers.BaseContentProvider;
-
-/**
- * @deprecated
- */
-public class ServerContentProvider extends BaseContentProvider implements
ITreeContentProvider {
- public static Object INITIALIZING = new Object();
- protected IServerLifecycleListener serverResourceListener;
- protected IPublishListener publishListener;
- protected IServerListener serverListener;
-
- // servers that are currently publishing and starting
- protected static Set<String> publishing = new HashSet<String>(4);
- protected static Set<String> starting = new HashSet<String>(4);
- protected boolean animationActive = false;
- protected boolean stopAnimation = false;
- protected boolean initialized = false;
-
-
- private StructuredViewer viewer;
-
- public ServerContentProvider() {
- addListeners();
- }
-
- public Object[] getElements(Object element) {
- if( !initialized ) {
- deferInitialization();
- return new Object[] {INITIALIZING};
- }
-
- List<IServer> list = new ArrayList<IServer>();
- IServer[] servers = ServerCore.getServers();
- if (servers != null) {
- int size = servers.length;
- for (int i = 0; i < size; i++) {
- if (!((Server)servers[i]).isPrivate())
- list.add(servers[i]);
- }
- }
- return list.toArray();
- }
-
- public Object[] getChildren(Object element) {
- if (element instanceof ModuleServer) {
- ModuleServer ms = (ModuleServer) element;
- try {
- IModule[] children = ms.server.getChildModules(ms.module, null);
- int size = children.length;
- ModuleServer[] ms2 = new ModuleServer[size];
- for (int i = 0; i < size; i++) {
- int size2 = ms.module.length;
- IModule[] module = new IModule[size2 + 1];
- System.arraycopy(ms.module, 0, module, 0, size2);
- module[size2] = children[i];
- ms2[i] = new ModuleServer(ms.server, module);
- }
- return ms2;
- } catch (Exception e) {
- return new Object[]{};
- }
- }
-
- // TODO TELL ANGEL ABOUT THIS IF STATEMENT
- if( element instanceof IServer) {
- IServer server = (IServer) element;
- IModule[] modules = server.getModules();
- int size = modules.length;
- ModuleServer[] ms = new ModuleServer[size];
- for (int i = 0; i < size; i++) {
- ms[i] = new ModuleServer(server, new IModule[] { modules[i] });
- }
- return ms;
- }
- return new Object[]{};
- }
-
- public Object getParent(Object element) {
- if (element instanceof ModuleServer) {
- ModuleServer ms = (ModuleServer) element;
- return ms.server;
- }
- return null;
- }
-
- public boolean hasChildren(Object element) {
- if (element instanceof ModuleServer) {
- // Check if the module server has child modules.
- ModuleServer curModuleServer = (ModuleServer)element;
- IServer curServer = curModuleServer.server;
- IModule[] curModule = curModuleServer.module;
- if (curServer != null && curModule != null) {
- IModule[] curChildModule = curServer.getChildModules(curModule, null);
- if (curChildModule != null && curChildModule.length > 0)
- return true;
-
- return false;
- }
-
- return false;
- }
- if( element instanceof IServer ) {
- return ((IServer) element).getModules().length > 0;
- }
- return false;
- }
-
- public void inputChanged(Viewer aViewer, Object oldInput, Object newInput) {
- viewer = (StructuredViewer) aViewer;
- }
-
- public void dispose() {
- // remove all listeners!
- ServerCore.removeServerLifecycleListener(serverResourceListener);
- IServer[] servers = ServerCore.getServers();
- for( int i = 0;i < servers.length; i++ ) {
- servers[i].removePublishListener(publishListener);
- servers[i].removeServerListener(serverListener);
- }
- }
-
-
-
- // Listeners and refreshing the viewer
- protected void addListeners() {
- serverResourceListener = new IServerLifecycleListener() {
- public void serverAdded(IServer server) {
- refreshServer(null);
- server.addServerListener(serverListener);
- ((Server) server).addPublishListener(publishListener);
- }
- public void serverChanged(IServer server) {
- refreshServer(server);
- }
- public void serverRemoved(IServer server) {
- refreshServer(null);
- server.removeServerListener(serverListener);
- ((Server) server).removePublishListener(publishListener);
- }
- };
- ServerCore.addServerLifecycleListener(serverResourceListener);
-
- publishListener = new PublishAdapter() {
- public void publishStarted(IServer server) {
- handlePublishChange(server, true);
- }
-
- public void publishFinished(IServer server, IStatus status) {
- handlePublishChange(server, false);
- }
- };
-
- serverListener = new IServerListener() {
- public void serverChanged(ServerEvent event) {
- if (event == null)
- return;
-
- int eventKind = event.getKind();
- IServer server = event.getServer();
- if ((eventKind & ServerEvent.SERVER_CHANGE) != 0) {
- // server change event
- if ((eventKind & ServerEvent.STATE_CHANGE) != 0) {
- refreshServer(server, true);
- int state = event.getState();
- String id = server.getId();
- if (state == IServer.STATE_STARTING || state == IServer.STATE_STOPPING) {
- boolean startThread = false;
- synchronized (starting) {
- if (!starting.contains(id)) {
- if (starting.isEmpty())
- startThread = true;
- starting.add(id);
- }
- }
- if (startThread)
- startThread();
- } else {
- boolean stopThread = false;
- synchronized (starting) {
- if (starting.contains(id)) {
- starting.remove(id);
- if (starting.isEmpty())
- stopThread = true;
- }
- }
- if (stopThread)
- stopThread();
- }
- } else
- refreshServer(server);
- } else if ((eventKind & ServerEvent.MODULE_CHANGE) != 0) {
- // module change event
- if ((eventKind & ServerEvent.STATE_CHANGE) != 0 || (eventKind &
ServerEvent.PUBLISH_STATE_CHANGE) != 0) {
- refreshServer(server);
- }
- }
- }
- };
-
- // add listeners to servers
- IServer[] servers = ServerCore.getServers();
- if (servers != null) {
- int size = servers.length;
- for (int i = 0; i < size; i++) {
- servers[i].addServerListener(serverListener);
- ((Server) servers[i]).addPublishListener(publishListener);
- }
- }
- }
-
- protected void deferInitialization() {
- Job job = new
Job(org.eclipse.wst.server.ui.internal.Messages.jobInitializingServersView) {
- public IStatus run(IProgressMonitor monitor) {
- IServer[] servers = ServerCore.getServers();
- int size = servers.length;
- for (int i = 0; i < size; i++) {
- ((Server)servers[i]).getAllModules().iterator();
- }
-
- for (int i = 0; i < size; i++) {
- IServer server = servers[i];
- if (server.getServerType() != null && server.getServerState() ==
IServer.STATE_UNKNOWN) {
- UpdateServerJob job2 = new UpdateServerJob(new IServer[]{server});
- job2.schedule();
- }
- }
- initialized = true;
- refreshServer(null);
- return Status.OK_STATUS;
- }
- };
-
- job.setSystem(true);
- job.setPriority(Job.SHORT);
- job.schedule();
- }
-
- protected void updateServerLabel(final IServer server) {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- try {
- if( viewer != null && !viewer.getControl().isDisposed()) {
- viewer.update(server, null);
- }
- } catch (Exception e) {
- // ignore
- }
- }
- });
- }
-
- protected void refreshServer(final IServer server) {
- refreshServer(server, false);
- }
- protected void refreshServer(final IServer server, final boolean resetSelection) {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- try {
- if( viewer != null && !viewer.getControl().isDisposed()) {
- viewer.refresh(server);
- if( resetSelection ) {
- ISelection sel = viewer.getSelection();
- viewer.setSelection(sel);
- }
- }
- } catch (Exception e) {
- // ignore
- }
- }
- });
- }
-
- protected void handlePublishChange(IServer server, boolean isPublishing) {
- String serverId = server.getId();
- if (isPublishing)
- publishing.add(serverId);
- else
- publishing.remove(serverId);
-
- refreshServer(server);
- }
-
-
- protected void startThread() {
- if (animationActive)
- return;
-
- stopAnimation = false;
-
- final Display display = viewer == null ? Display.getDefault() :
viewer.getControl().getDisplay();
- final int SLEEP = 200;
- final Runnable[] animator = new Runnable[1];
- animator[0] = new Runnable() {
- public void run() {
- if (!stopAnimation) {
- try {
- int size = 0;
- String[] servers;
- synchronized (starting) {
- size = starting.size();
- servers = new String[size];
- starting.toArray(servers);
- }
-
- for (int i = 0; i < size; i++) {
- IServer server = ServerCore.findServer(servers[i]);
- if (server != null ) {
- updateServerLabel(server);
- }
- }
- } catch (Exception e) {
- //Trace.trace(Trace.STRING_FINEST,
Messages.ServerContentProvider_ErrorInServersViewAnimation, e);
- }
- display.timerExec(SLEEP, animator[0]);
- }
- }
- };
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- display.timerExec(SLEEP, animator[0]);
- }
- });
- }
-
- protected void stopThread() {
- stopAnimation = true;
- }}
Deleted:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/xpl/ServerLabelProvider.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/xpl/ServerLabelProvider.java 2011-12-13
14:38:45 UTC (rev 37268)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/xpl/ServerLabelProvider.java 2011-12-13
14:49:38 UTC (rev 37269)
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- *
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - Base Code
- * Red Hat - Refactor for CNF
- *******************************************************************************/
-package org.jboss.tools.as.wst.server.ui.xpl;
-
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.ui.ServerUICore;
-import org.eclipse.wst.server.ui.internal.ImageResource;
-import org.eclipse.wst.server.ui.internal.Messages;
-import org.eclipse.wst.server.ui.internal.view.servers.ModuleServer;
-/**
- * Server table label provider.
- * @deprecated
- */
-public class ServerLabelProvider extends LabelProvider {
-
- /**
- * ServerTableLabelProvider constructor comment.
- */
- public ServerLabelProvider() {
- super();
- }
-
- public String getText(Object element) {
- if (element instanceof ModuleServer) {
- ModuleServer ms = (ModuleServer) element;
- if (ms.module == null)
- return ""; //$NON-NLS-1$
- int size = ms.module.length;
- String name = ms.module[size - 1].getName();
- return name;
- }
-
- if( element instanceof IServer ) {
- IServer server = (IServer) element;
- return notNull(server.getName());
- }
-
- if( element == ServerContentProvider.INITIALIZING)
- return Messages.viewInitializing;
-
- return null;
- }
- public Image getImage(Object element) {
- Image image = null;
- if (element instanceof ModuleServer) {
- ModuleServer ms = (ModuleServer) element;
- ILabelProvider labelProvider = ServerUICore.getLabelProvider();
- image = labelProvider.getImage(ms.module[ms.module.length - 1]);
- labelProvider.dispose();
- } else if( element instanceof IServer ) {
- IServer server = (IServer) element;
- if (server.getServerType() != null) {
- image = ImageResource.getImage(server.getServerType().getId());
- }
- }
- return image;
- }
-
- protected String notNull(String s) {
- if (s == null)
- return ""; //$NON-NLS-1$
- return s;
- }
-
- public boolean isLabelProperty(Object element, String property) {
- return false;
- }
-}
\ No newline at end of file
Deleted:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/xpl/ServersView.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/xpl/ServersView.java 2011-12-13
14:38:45 UTC (rev 37268)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/xpl/ServersView.java 2011-12-13
14:49:38 UTC (rev 37269)
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- *
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - Code taken from Superclass
- * Red Hat Inc - Refactor
- *******************************************************************************/
-package org.jboss.tools.as.wst.server.ui.xpl;
-
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.IViewSite;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.navigator.CommonNavigator;
-/**
- * A view of servers, their modules, and status.
- * @deprecated
- */
-public class ServersView extends CommonNavigator {
-
- /**
- * ServersView constructor comment.
- */
- public ServersView() {
- super();
- }
-
- private IMemento memento;
-
- public void init(IViewSite aSite, IMemento aMemento)
- throws PartInitException {
- this.memento = memento;
- super.init(aSite, aMemento);
- }
-}
\ No newline at end of file
Deleted:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/xpl/ServersViewDropAdapterAssistant.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/xpl/ServersViewDropAdapterAssistant.java 2011-12-13
14:38:45 UTC (rev 37268)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/xpl/ServersViewDropAdapterAssistant.java 2011-12-13
14:49:38 UTC (rev 37269)
@@ -1,212 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- *
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat - Initial Implementation
- *******************************************************************************/
-package org.jboss.tools.as.wst.server.ui.xpl;
-
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.swt.dnd.DND;
-import org.eclipse.swt.dnd.DropTargetEvent;
-import org.eclipse.swt.dnd.FileTransfer;
-import org.eclipse.swt.dnd.TransferData;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.activities.WorkbenchActivityHelper;
-import org.eclipse.ui.internal.Workbench;
-import org.eclipse.ui.navigator.CommonDropAdapter;
-import org.eclipse.ui.navigator.CommonDropAdapterAssistant;
-import org.eclipse.ui.part.ResourceTransfer;
-import org.eclipse.ui.views.navigator.LocalSelectionTransfer;
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.IModuleArtifact;
-import org.eclipse.wst.server.core.IModuleType;
-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.ServerPlugin;
-import org.eclipse.wst.server.ui.internal.EclipseUtil;
-import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
-import org.eclipse.wst.server.ui.internal.actions.RunOnServerActionDelegate;
-
-/**
- *
- * @author rob
- * @deprecated
- */
-public class ServersViewDropAdapterAssistant extends CommonDropAdapterAssistant {
-
- @SuppressWarnings("unchecked") private List fElements;
-
- public ServersViewDropAdapterAssistant() {
- super();
- }
- protected void doInit() {
- }
-
- public IStatus validatePluginTransferDrop(
- IStructuredSelection aDragSelection, Object aDropTarget) {
- initializeSelection(aDragSelection);
- return internalValidate(aDropTarget, fElements);
- }
-
- public IStatus validateDrop(Object target, int operation,
- TransferData transferType) {
- if (LocalSelectionTransfer.getInstance().isSupportedType(transferType)) {
- ISelection s = LocalSelectionTransfer.getInstance().getSelection();
- initializeSelection(s);
- return internalValidate(target, fElements);
- }
- return Status.CANCEL_STATUS;
- }
-
- protected void initializeSelection(ISelection s) {
- if (fElements != null)
- return;
- if (!(s instanceof IStructuredSelection)) {
- fElements= Collections.EMPTY_LIST;
- return;
- }
- fElements = ((IStructuredSelection) s).toList();
- }
-
- @SuppressWarnings("unchecked")
- protected IStatus internalValidate(Object target, List elements) {
- if( target instanceof IServer ) {
- IServer server = (IServer)target;
- Object next;
- if( elements != null ) {
- Iterator i = elements.iterator();
- while(i.hasNext() ) {
- next = i.next();
- IModuleArtifact[] moduleArtifacts = ServerPlugin.getModuleArtifacts(next);
- if (moduleArtifacts != null && moduleArtifacts.length > 0 ) {
- for( int j = 0; j < moduleArtifacts.length; j++ ) {
- if( moduleArtifacts[j] != null && moduleArtifacts[j].getModule() != null )
{
- IModuleType[] moduleTypes =
server.getServerType().getRuntimeType().getModuleTypes();
- if (ServerUtil.isSupportedModule(moduleTypes,
moduleArtifacts[j].getModule().getModuleType())) {
- return Status.OK_STATUS;
- }
- }
- }
- }
- }
- }
- }
- clear();
- return Status.CANCEL_STATUS;
- }
-
- public IStatus handleDrop(CommonDropAdapter dropAdapter,
- DropTargetEvent dropTargetEvent, Object target) {
- IStatus ret = internalHandleDrop(target, fElements);
- if( ret.isOK())
- dropTargetEvent.detail = DND.DROP_NONE;
- return ret;
- }
-
- public IStatus handlePluginTransferDrop(
- IStructuredSelection aDragSelection, Object aDropTarget) {
- return internalHandleDrop(aDropTarget, fElements);
- }
-
- protected IStatus internalHandleDrop(Object target, List elements) {
- boolean b = false;
- if( target instanceof IServer ) {
- b = true;
- if( fElements != null ) {
- Iterator iterator = elements.iterator();
- while (iterator.hasNext()) {
- Object data2 = iterator.next();
- if (!doSel((IServer)target, data2))
- b = false;
- }
- }
- }
- clear();
- return b ? Status.OK_STATUS : Status.CANCEL_STATUS;
- }
-
- private void clear() {
- fElements = null;
- }
-
- protected boolean doSel(IServer server, Object data) {
- // check if the selection is a project (module) that we can add to the server
- IProject project = (IProject) Platform.getAdapterManager().getAdapter(data,
IProject.class);
- if (project != null) {
- IModule[] modules = ServerUtil.getModules(project);
- if (modules != null && modules.length == 1) {
- try {
- IServerWorkingCopy wc = server.createWorkingCopy();
- IModule[] parents = wc.getRootModules(modules[0], null);
- if (parents == null || parents.length == 0)
- return false;
-
- if (ServerUtil.containsModule(server, parents[0], null))
- return false;
-
- IModule[] add = new IModule[] { parents[0] };
- if (wc.canModifyModules(add, null, null).getSeverity() != IStatus.ERROR) {
- wc.modifyModules(modules, null, null);
- wc.save(false, null);
- return true;
- }
- } catch (final CoreException ce) {
- final Shell shell = Workbench.getInstance().getActiveWorkbenchWindow().getShell();
- shell.getDisplay().asyncExec(new Runnable() {
- public void run() {
- EclipseUtil.openError(shell, ce.getLocalizedMessage());
- }
- });
- return true;
- }
- }
- }
-
- // otherwise, try Run on Server
- final IServer finalServer = server;
- RunOnServerActionDelegate ros = new RunOnServerActionDelegate() {
- public IServer getServer(IModule module, IModuleArtifact moduleArtifact,
IProgressMonitor monitor) throws CoreException {
- if (!ServerUIPlugin.isCompatibleWithLaunchMode(finalServer, launchMode))
- return null;
-
- if (!ServerUtil.containsModule(finalServer, module, monitor)) {
- IServerWorkingCopy wc = finalServer.createWorkingCopy();
- try {
- ServerUtil.modifyModules(wc, new IModule[] { module }, new IModule[0], monitor);
- wc.save(false, monitor);
- } catch (CoreException ce) {
- throw ce;
- }
- }
-
- return finalServer;
- }
- };
- Action action = new Action() {
- //
- };
- ros.selectionChanged(action, new StructuredSelection(data));
-
- ros.run(action);
- return true;
- }
-}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/src/org/jboss/ide/eclipse/as/wtp/core/util/ServerModelUtilities.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/src/org/jboss/ide/eclipse/as/wtp/core/util/ServerModelUtilities.java 2011-12-13
14:38:45 UTC (rev 37268)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/src/org/jboss/ide/eclipse/as/wtp/core/util/ServerModelUtilities.java 2011-12-13
14:49:38 UTC (rev 37269)
@@ -66,6 +66,10 @@
return new IModule[0];
}
+ public static boolean isBinaryModule(IModule[] moduleTree) {
+ return moduleTree == null ? false : isBinaryModule(moduleTree[moduleTree.length - 1]);
+ }
+
public static boolean isBinaryModule(IModule module) {
IJ2EEModule jee = (IJ2EEModule) module.loadAdapter(IJ2EEModule.class, null);
if( jee != null )
Deleted:
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/src/org/jboss/ide/eclipse/as/wtp/core/vcf/ReferenceResolverUtil.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/src/org/jboss/ide/eclipse/as/wtp/core/vcf/ReferenceResolverUtil.java 2011-12-13
14:38:45 UTC (rev 37268)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/src/org/jboss/ide/eclipse/as/wtp/core/vcf/ReferenceResolverUtil.java 2011-12-13
14:49:38 UTC (rev 37269)
@@ -1,137 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.ide.eclipse.as.wtp.core.vcf;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.common.componentcore.internal.ModulecorePlugin;
-import org.eclipse.wst.common.componentcore.internal.ReferencedComponent;
-import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
-import org.eclipse.wst.common.componentcore.resources.IVirtualReference;
-import org.jboss.ide.eclipse.as.wtp.core.ASWTPToolsPlugin;
-
-@Deprecated
-public class ReferenceResolverUtil {
- public static ReferenceResolverUtil instance = null;
- public static ReferenceResolverUtil getDefault() {
- if( instance == null )
- instance = new ReferenceResolverUtil();
- return instance;
- }
-
- private HashMap<String, ReferenceResolverWrapper> resolvers = null;
- private ArrayList<IReferenceResolver> sorted = null;
- private DefaultReferenceResolver defaultResolver = new DefaultReferenceResolver();
- public IReferenceResolver[] getResolvers() {
- if( resolvers == null )
- loadResolvers();
- return (IReferenceResolver[]) sorted.toArray(new IReferenceResolver[sorted.size()]);
- }
-
- public IReferenceResolver getResolver(IVirtualComponent context, ReferencedComponent
reference) {
- getResolvers();
- Iterator<IReferenceResolver> i = sorted.iterator();
- IReferenceResolver resolver;
- while(i.hasNext()) {
- resolver = i.next();
- if( resolver.canResolve(context, reference))
- return resolver;
- }
- return defaultResolver;
- }
-
- public IReferenceResolver getResolver(IVirtualReference reference) {
- getResolvers();
- Iterator<IReferenceResolver> i = sorted.iterator();
- IReferenceResolver resolver;
- while(i.hasNext()) {
- resolver = i.next();
- if( resolver.canResolve(reference))
- return resolver;
- }
- return defaultResolver;
- }
-
- protected void loadResolvers() {
- HashMap<String, ReferenceResolverWrapper> map = new HashMap<String,
ReferenceResolverWrapper>();
-
- IExtensionRegistry registry = Platform.getExtensionRegistry();
- IConfigurationElement[] cf =
registry.getConfigurationElementsFor(ASWTPToolsPlugin.PLUGIN_ID,
"referenceResolver"); //$NON-NLS-1$
- String id = null;
- for( int j = 0; j < cf.length; j++ ) {
- id = cf[j].getAttribute("id");
- try {
- map.put(id, new ReferenceResolverWrapper(
- id, (IReferenceResolver)
- cf[j].createExecutableExtension("class"),
- cf[j].getAttribute("weight")));
- } catch( CoreException ce ) {
- // TODO figure it out
- }
- }
- resolvers = map;
-
- // Cache the sorted ones
- List<ReferenceResolverWrapper> list = new ArrayList(resolvers.values());
- Comparator comparator = new Comparator() {
- public int compare(Object o1, Object o2) {
- if( !(o1 instanceof ReferenceResolverWrapper))
- return -1;
- if( !(o2 instanceof ReferenceResolverWrapper))
- return 1;
- return ((ReferenceResolverWrapper)o2).getWeight()
- - ((ReferenceResolverWrapper)o1).getWeight();
- }
- };
-
- Collections.sort(list, comparator);
- ArrayList<IReferenceResolver> sorted = new
ArrayList<IReferenceResolver>();
- Iterator i = list.iterator();
- while(i.hasNext())
- sorted.add(((ReferenceResolverWrapper)i.next()).getResolver());
- this.sorted = sorted;
- }
-
-
- protected class ReferenceResolverWrapper {
- private String id;
- private IReferenceResolver resolver;
- private int weight;
- public ReferenceResolverWrapper(String id, IReferenceResolver resolver, String weight)
{
- this.id = id;
- this.resolver = resolver;
- try {
- this.weight = Integer.parseInt(weight);
- } catch( NumberFormatException nfe) {
- this.weight = 1000;
- }
- }
- public int getWeight() {
- return weight;
- }
- public String getId() {
- return id;
- }
- public IReferenceResolver getResolver() {
- return resolver;
- }
- }
-
-}
Modified:
trunk/as/tests/org.jboss.ide.eclipse.as.archives.integration.test/src/org/jboss/ide/eclipse/as/archives/integration/test/BuildDeployTest.java
===================================================================
---
trunk/as/tests/org.jboss.ide.eclipse.as.archives.integration.test/src/org/jboss/ide/eclipse/as/archives/integration/test/BuildDeployTest.java 2011-12-13
14:38:45 UTC (rev 37268)
+++
trunk/as/tests/org.jboss.ide.eclipse.as.archives.integration.test/src/org/jboss/ide/eclipse/as/archives/integration/test/BuildDeployTest.java 2011-12-13
14:49:38 UTC (rev 37269)
@@ -273,7 +273,7 @@
rootArchive.setProperty(ArchivesModuleModelListener.DEPLOY_SERVERS, servers);
rootArchive.setProperty(ArchivesModuleModelListener.DEPLOY_AFTER_BUILD, new
Boolean(alwaysPublish).toString());
final IPath projectPath = rootArchive.getProjectPath();
- ArchivesModel.instance().save(projectPath, new NullProgressMonitor());
+ ArchivesModel.instance().getRoot(projectPath).save( new NullProgressMonitor());
}
protected void buildArchive() {
Modified:
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2/MockPublishMethod.java
===================================================================
---
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2/MockPublishMethod.java 2011-12-13
14:38:45 UTC (rev 37268)
+++
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2/MockPublishMethod.java 2011-12-13
14:49:38 UTC (rev 37269)
@@ -22,7 +22,6 @@
import org.eclipse.wst.server.core.model.IModuleFile;
import org.jboss.ide.eclipse.as.core.publishers.AbstractPublishMethod;
import org.jboss.ide.eclipse.as.core.publishers.PublishUtil;
-import org.jboss.ide.eclipse.as.core.server.xpl.PublishCopyUtil;
import
org.jboss.ide.eclipse.as.core.server.xpl.PublishCopyUtil.IPublishCopyCallbackHandler;
public class MockPublishMethod extends AbstractPublishMethod {
@@ -94,7 +93,7 @@
IProgressMonitor monitor) throws CoreException {
// System.out.println("copying to " + root.append(path));
File file = PublishUtil.getFile(mf);
- shouldRestartModule |= PublishCopyUtil.checkRestartModule(file);
+ shouldRestartModule |= checkRestartModule(file);
IPath path2 = root.append(path);
if( !changed.contains(path2.makeRelative()))
changed.add(path2.makeRelative());
@@ -114,5 +113,11 @@
IPath path2 = root.append(path);
return path2.toFile().exists() && path2.toFile().isFile();
}
+ public boolean checkRestartModule(File file) {
+ if( file.getName().toLowerCase().endsWith(".jar")) //$NON-NLS-1$
+ return true;
+ return false;
+ }
+
}
}
Modified:
trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/src/org/jboss/tools/bpel/runtimes/module/JBTBPELPublisher.java
===================================================================
---
trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/src/org/jboss/tools/bpel/runtimes/module/JBTBPELPublisher.java 2011-12-13
14:38:45 UTC (rev 37268)
+++
trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/src/org/jboss/tools/bpel/runtimes/module/JBTBPELPublisher.java 2011-12-13
14:49:38 UTC (rev 37269)
@@ -26,6 +26,7 @@
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.MultiStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.osgi.util.NLS;
@@ -42,8 +43,8 @@
import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethod;
import org.jboss.ide.eclipse.as.core.server.IJBossServerPublisher;
+import org.jboss.ide.eclipse.as.core.server.xpl.LocalCopyCallback;
import org.jboss.ide.eclipse.as.core.server.xpl.PublishCopyUtil;
-import org.jboss.ide.eclipse.as.core.server.xpl.PublishCopyUtil.LocalCopyCallback;
import org.jboss.ide.eclipse.as.core.util.FileUtil;
import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
import org.jboss.ide.eclipse.as.core.util.IWTPConstants;
@@ -128,7 +129,7 @@
IModule last = moduleTree[moduleTree.length -1];
IPath deployPath = getDeployPath(moduleTree, ds);
IPath tempDeployPath = PublishUtil.getTempDeployFolder(moduleTree, ds);
- IModuleResource[] members = PublishUtil.getResources(last);
+ IModuleResource[] members = PublishUtil.getResources(last, new NullProgressMonitor());
//
https://issues.jboss.org/browse/JBDS-1573
// make sure the project has a deploy.xml (bpel-deploy.xml for backward
compatibility).
boolean hasDeployXML = false;