JBoss Tools SVN: r36661 - in trunk: vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2011-11-25 09:42:23 -0500 (Fri, 25 Nov 2011)
New Revision: 36661
Added:
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/SwtUtil.java
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/VpeResourcesDialog.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeEditAnyDialog.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/SplitToolBar.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/VpeDropDownMenu.java
Log:
https://issues.jboss.org/browse/JBIDE-10221 /
https://issues.jboss.org/browse/JBIDE-10249 : org.jboss.tools.vpe plugin has Image leak
Added: trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/SwtUtil.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/SwtUtil.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/SwtUtil.java 2011-11-25 14:42:23 UTC (rev 36661)
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2007-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
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.util;
+
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.graphics.Resource;
+import org.eclipse.swt.widgets.Widget;
+
+/**
+ * @author Yahor Radtsevich (yradtsevich)
+ */
+public class SwtUtil {
+
+ /**
+ * Adds a dispose listener to {@code widget}
+ * which when invoked disposes given {@code resource}
+ *
+ * @param resource resource to be disposed
+ * @param widget widget to which disposal bind disposal of {@code resource}
+ */
+ public static void bindDisposal(final Resource resource, Widget widget) {
+ widget.addDisposeListener(new DisposeListener() {
+ public void widgetDisposed(DisposeEvent e) {
+ resource.dispose();
+ System.out.println("Resource Disposed: " + resource);
+ }
+ });
+ }
+}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeEditAnyDialog.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeEditAnyDialog.java 2011-11-25 13:21:37 UTC (rev 36660)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeEditAnyDialog.java 2011-11-25 14:42:23 UTC (rev 36661)
@@ -40,6 +40,7 @@
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
import org.jboss.tools.common.model.ui.ModelUIImages;
+import org.jboss.tools.common.util.SwtUtil;
import org.jboss.tools.jst.css.CSSPlugin;
import org.jboss.tools.jst.css.dialog.CSSStyleDialog;
import org.jboss.tools.jst.css.dialog.common.Util;
@@ -96,8 +97,10 @@
*/
getShell().setText(VpeUIMessages.TEMPLATE);
setTitle(VpeUIMessages.TAG_ATTRIBUTES);
- setTitleImage(ModelUIImages.getImageDescriptor(
- ModelUIImages.WIZARD_DEFAULT).createImage(null));
+ final Image titleImage = ModelUIImages.getImageDescriptor(
+ ModelUIImages.WIZARD_DEFAULT).createImage(null);
+ setTitleImage(titleImage);
+ SwtUtil.bindDisposal(titleImage, getShell());
setMessage(VpeUIMessages.USER_SPECIFIED_TAG_DIALOG_DESCRIPTION);
/*
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/SplitToolBar.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/SplitToolBar.java 2011-11-25 13:21:37 UTC (rev 36660)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/SplitToolBar.java 2011-11-25 14:42:23 UTC (rev 36661)
@@ -102,7 +102,9 @@
// coolBar.layout();
// final Button button = new Button(parent, SWT.FLAT|SWT.PUSH);
-// button.setImage(ImageDescriptor.createFromFile(MozillaEditor.class, "icons/arrow_more.gif").createImage());
+// Image arrowMoreImage = ImageDescriptor.createFromFile(MozillaEditor.class, "icons/arrow_more.gif").createImage();
+// button.setImage(arrowMoreImage);
+// SWTUtil.bindDisposal(arrowMoreImage, button);
// button.setVisible(false);
//
// button.addListener(SWT.Selection, new Listener() {
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/VpeDropDownMenu.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/VpeDropDownMenu.java 2011-11-25 13:21:37 UTC (rev 36660)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/VpeDropDownMenu.java 2011-11-25 14:42:23 UTC (rev 36661)
@@ -16,11 +16,13 @@
import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.ToolBar;
import org.eclipse.swt.widgets.ToolItem;
+import org.jboss.tools.common.util.SwtUtil;
import org.jboss.tools.vpe.editor.mozilla.MozillaEditor;
/**
@@ -34,8 +36,10 @@
public VpeDropDownMenu(ToolBar bar, String toolTipText) {
ToolItem item = new ToolItem(bar, SWT.MENU);
item.setToolTipText(toolTipText);
- item.setImage(ImageDescriptor.createFromFile(MozillaEditor.class,
- "icons/arrow.gif").createImage()); //$NON-NLS-1$
+ final Image arrowImage = ImageDescriptor.createFromFile(MozillaEditor.class,
+ "icons/arrow.gif").createImage(); //$NON-NLS-1$
+ item.setImage(arrowImage);
+ SwtUtil.bindDisposal(arrowImage, item);
item.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/VpeResourcesDialog.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/VpeResourcesDialog.java 2011-11-25 13:21:37 UTC (rev 36660)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/VpeResourcesDialog.java 2011-11-25 14:42:23 UTC (rev 36661)
@@ -36,6 +36,7 @@
import org.jboss.tools.common.model.ui.ModelUIImages;
import org.jboss.tools.common.model.ui.action.CommandBar;
import org.jboss.tools.common.resref.core.ResourceReference;
+import org.jboss.tools.common.util.SwtUtil;
public class VpeResourcesDialog extends TitleAreaDialog {
@@ -76,11 +77,7 @@
final Image wizardDefaultImage = ModelUIImages.getImageDescriptor(
ModelUIImages.WIZARD_DEFAULT).createImage(null);
setTitleImage(wizardDefaultImage);
- parent.addDisposeListener(new DisposeListener() {
- public void widgetDisposed(DisposeEvent e) {
- wizardDefaultImage.dispose();
- }
- });
+ SwtUtil.bindDisposal(wizardDefaultImage, parent);
setMessage(Messages.VRD_PAGE_DESIGN_OPTIONS_ABOUT);
Composite composite = new Composite(parent, SWT.NONE);
13 years, 1 month
JBoss Tools SVN: r36660 - trunk/bpel.
by jbosstools-commits@lists.jboss.org
Author: max.andersen(a)jboss.com
Date: 2011-11-25 08:21:37 -0500 (Fri, 25 Nov 2011)
New Revision: 36660
Removed:
trunk/bpel/.project
Log:
JBDS-1810 added a bogus .project file so subprojects arent visible
Deleted: trunk/bpel/.project
===================================================================
--- trunk/bpel/.project 2011-11-25 12:41:44 UTC (rev 36659)
+++ trunk/bpel/.project 2011-11-25 13:21:37 UTC (rev 36660)
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.jboss.tools.bpel-trunk</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- </buildSpec>
- <natures>
- </natures>
-</projectDescription>
13 years, 1 month
JBoss Tools SVN: r36659 - in trunk/as/plugins: org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors and 6 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2011-11-25 07:41:44 -0500 (Fri, 25 Nov 2011)
New Revision: 36659
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/properties/jboss.71.default.ports.properties
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathModel.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/BehaviourModel.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/v7/management/IJBoss7ManagerService.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/v7/management/JBoss7DeploymentState.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/v7/management/JBoss7ManagerServiceProxy.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/v7/management/JBoss7ManagerUtil.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/v7/management/JBoss7ManangerConnectException.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/v7/management/JBoss7ManangerException.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IJBossToolingConstants.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.core/plugin.properties
trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/internal/management/as7/AS7Manager.java
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/internal/management/as7/JBoss7ManagerService.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.properties
Log:
JBIDE-10224
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathModel.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathModel.java 2011-11-25 12:35:34 UTC (rev 36658)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathModel.java 2011-11-25 12:41:44 UTC (rev 36659)
@@ -267,6 +267,7 @@
rtToPortsFile.put(IConstants.AS_51, properties.append(IJBossToolingConstants.DEFAULT_PROPS_51));
rtToPortsFile.put(IConstants.AS_60, properties.append(IJBossToolingConstants.DEFAULT_PROPS_60));
rtToPortsFile.put(IConstants.AS_70, properties.append(IJBossToolingConstants.DEFAULT_PROPS_70));
+ rtToPortsFile.put(IConstants.AS_71, properties.append(IJBossToolingConstants.DEFAULT_PROPS_71));
rtToPortsFile.put(IConstants.EAP_43, properties.append(IJBossToolingConstants.DEFAULT_PROPS_EAP_43));
rtToPortsFile.put(IConstants.EAP_50, properties.append(IJBossToolingConstants.DEFAULT_PROPS_EAP_50));
rtToPortsFile.put(IConstants.EAP_60, properties.append(IJBossToolingConstants.DEFAULT_PROPS_70));
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/BehaviourModel.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/BehaviourModel.java 2011-11-25 12:35:34 UTC (rev 36658)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/BehaviourModel.java 2011-11-25 12:41:44 UTC (rev 36659)
@@ -48,7 +48,7 @@
ArrayList<IJBossLaunchDelegate> list = new ArrayList<IJBossLaunchDelegate>();
BehaviourImpl[] impls = beh.getImplementations();
for( int i = 0; i < impls.length; i++ ) {
- list.add(impls[i].getLaunchDelegate());
+ list.add(impls[i].createLaunchDelegate());
}
return list;
}
@@ -58,7 +58,7 @@
*/
public IJBossLaunchDelegate getLaunchDelegate(IServer server, String mode) {
Behaviour beh = map.get(server.getServerType().getId());
- return beh.getImpl(mode).getLaunchDelegate();
+ return beh.getImpl(mode).createLaunchDelegate();
}
protected void loadModel() {
@@ -126,9 +126,7 @@
private String name;
private String typeId;
private IConfigurationElement element;
- private IJBossLaunchDelegate launchDelegate;
private String supportedServers;
- private IJBossBehaviourDelegate behaviourDelegate = null;
public BehaviourImpl(IConfigurationElement element) {
this.element = element;
@@ -161,25 +159,18 @@
return null;
}
- public IJBossLaunchDelegate getLaunchDelegate() {
- if( launchDelegate != null)
- return launchDelegate;
-
+ public IJBossLaunchDelegate createLaunchDelegate() {
try {
- launchDelegate = (IJBossLaunchDelegate) element.createExecutableExtension("launchDelegate"); //$NON-NLS-1$
- return launchDelegate;
+ return (IJBossLaunchDelegate) element.createExecutableExtension("launchDelegate"); //$NON-NLS-1$
} catch( CoreException ce ) {
JBossServerCorePlugin.getInstance().getLog().log(ce.getStatus());
}
return null;
}
- public IJBossBehaviourDelegate getBehaviourDelegate() {
- if( behaviourDelegate != null )
- return behaviourDelegate;
+ public IJBossBehaviourDelegate createBehaviourDelegate() {
try {
- behaviourDelegate = (IJBossBehaviourDelegate)element.createExecutableExtension("behaviourDelegate"); //$NON-NLS-1$
- return behaviourDelegate;
+ return (IJBossBehaviourDelegate)element.createExecutableExtension("behaviourDelegate"); //$NON-NLS-1$
} catch(CoreException ce) {
JBossServerCorePlugin.getInstance().getLog().log(ce.getStatus());
}
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-11-25 12:35:34 UTC (rev 36658)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DelegatingServerBehavior.java 2011-11-25 12:41:44 UTC (rev 36659)
@@ -55,7 +55,7 @@
return delegate;
BehaviourImpl impl = BehaviourModel.getModel().getBehaviour(getServer().getServerType().getId()).getImpl(id);
- IJBossBehaviourDelegate d = impl.getBehaviourDelegate();
+ IJBossBehaviourDelegate d = impl.createBehaviourDelegate();
d.setActualBehaviour(this);
lastModeId = id;
delegate = d;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/v7/management/IJBoss7ManagerService.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/v7/management/IJBoss7ManagerService.java 2011-11-25 12:35:34 UTC (rev 36658)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/v7/management/IJBoss7ManagerService.java 2011-11-25 12:41:44 UTC (rev 36659)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
+ * 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,
@@ -7,7 +7,7 @@
*
* Contributors:
* Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
+ ******************************************************************************/
package org.jboss.ide.eclipse.as.core.server.v7.management;
import java.io.File;
@@ -19,7 +19,7 @@
public static final String AS_VERSION_PROPERTY = "as.version"; //$NON-NLS-1$
public static final String AS_VERSION_700 = "700"; //$NON-NLS-1$
-
+ public static final String AS_VERSION_710_Beta = "710.beta1"; //$NON-NLS-1$
public static final int MGMT_PORT = 9999;
/**
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/v7/management/JBoss7DeploymentState.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/v7/management/JBoss7DeploymentState.java 2011-11-25 12:35:34 UTC (rev 36658)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/v7/management/JBoss7DeploymentState.java 2011-11-25 12:41:44 UTC (rev 36659)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
+ * 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,
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/v7/management/JBoss7ManagerServiceProxy.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/v7/management/JBoss7ManagerServiceProxy.java 2011-11-25 12:35:34 UTC (rev 36658)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/v7/management/JBoss7ManagerServiceProxy.java 2011-11-25 12:41:44 UTC (rev 36659)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
+ * 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,
@@ -7,7 +7,7 @@
*
* Contributors:
* Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
+ ******************************************************************************/
package org.jboss.ide.eclipse.as.core.server.v7.management;
import java.io.File;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/v7/management/JBoss7ManagerUtil.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/v7/management/JBoss7ManagerUtil.java 2011-11-25 12:35:34 UTC (rev 36658)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/v7/management/JBoss7ManagerUtil.java 2011-11-25 12:41:44 UTC (rev 36659)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
+ * 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,
@@ -7,7 +7,7 @@
*
* Contributors:
* Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
+ ******************************************************************************/
package org.jboss.ide.eclipse.as.core.server.v7.management;
import org.eclipse.wst.server.core.IServer;
@@ -18,21 +18,50 @@
public class JBoss7ManagerUtil {
private static final String JBOSS7_RUNTIME = "org.jboss.ide.eclipse.as.runtime.70"; //$NON-NLS-1$
+ private static final String JBOSS71_RUNTIME = "org.jboss.ide.eclipse.as.runtime.71"; //$NON-NLS-1$
private static final String EAP6_RUNTIME = "org.jboss.ide.eclipse.as.runtime.eap.60"; //$NON-NLS-1$
public static IJBoss7ManagerService getService(IServer server) throws InvalidSyntaxException {
BundleContext context = JBossServerCorePlugin.getContext();
+ skipLazyInit();
JBoss7ManagerServiceProxy proxy = new JBoss7ManagerServiceProxy(context, getRequiredVersion(server));
proxy.open();
return proxy;
}
+ private static boolean initialized = false;
+ /* HUUUUUUUUGE HACK */
+ private synchronized static void skipLazyInit() {
+ if( !initialized ) {
+ // Testing to see if forcing the proxy open will
+ BundleContext context = JBossServerCorePlugin.getContext();
+ JBoss7ManagerServiceProxy proxy = null;
+ try {
+ proxy = new JBoss7ManagerServiceProxy(context, IJBoss7ManagerService.AS_VERSION_710_Beta);
+ proxy.open();
+ proxy.getServerState("localhost", 9999); //$NON-NLS-1$
+ } catch( Exception e ) {
+ e.printStackTrace();
+ }
+ try {
+ proxy = new JBoss7ManagerServiceProxy(context, IJBoss7ManagerService.AS_VERSION_700);
+ proxy.open();
+ proxy.getServerState("localhost", 9999); //$NON-NLS-1$
+ } catch(Exception e ) {
+ e.printStackTrace();
+ }
+ initialized = true;
+ }
+ }
+
private static String getRequiredVersion(IServer server) {
String id = server.getRuntime().getRuntimeType().getId();
if (JBOSS7_RUNTIME.equals(id)
|| EAP6_RUNTIME.equals(id)) {
return IJBoss7ManagerService.AS_VERSION_700;
}
+ if( JBOSS71_RUNTIME.equals(id))
+ return IJBoss7ManagerService.AS_VERSION_710_Beta;
return null;
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/v7/management/JBoss7ManangerConnectException.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/v7/management/JBoss7ManangerConnectException.java 2011-11-25 12:35:34 UTC (rev 36658)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/v7/management/JBoss7ManangerConnectException.java 2011-11-25 12:41:44 UTC (rev 36659)
@@ -1,13 +1,13 @@
-/*******************************************************************************
- * Copyright (c) 2010 Red Hat Inc..
- * 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 Incorporated - initial API and implementation
- *******************************************************************************/
+/*******************************************************************************
+ * 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.v7.management;
/**
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/v7/management/JBoss7ManangerException.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/v7/management/JBoss7ManangerException.java 2011-11-25 12:35:34 UTC (rev 36658)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/v7/management/JBoss7ManangerException.java 2011-11-25 12:41:44 UTC (rev 36659)
@@ -1,13 +1,13 @@
-/*******************************************************************************
- * Copyright (c) 2010 Red Hat Inc..
- * 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 Incorporated - initial API and implementation
- *******************************************************************************/
+/*******************************************************************************
+ * 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.v7.management;
/**
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IJBossToolingConstants.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IJBossToolingConstants.java 2011-11-25 12:35:34 UTC (rev 36658)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IJBossToolingConstants.java 2011-11-25 12:41:44 UTC (rev 36659)
@@ -24,6 +24,7 @@
public static final String AS_51 = "org.jboss.ide.eclipse.as.runtime.51"; //$NON-NLS-1$
public static final String AS_60 = "org.jboss.ide.eclipse.as.runtime.60"; //$NON-NLS-1$
public static final String AS_70 = "org.jboss.ide.eclipse.as.runtime.70"; //$NON-NLS-1$
+ public static final String AS_71 = "org.jboss.ide.eclipse.as.runtime.71"; //$NON-NLS-1$
public static final String EAP_RUNTIME_PREFIX = "org.jboss.ide.eclipse.as.runtime.eap."; //$NON-NLS-1$
public static final String EAP_43 = "org.jboss.ide.eclipse.as.runtime.eap.43"; //$NON-NLS-1$
public static final String EAP_50 = "org.jboss.ide.eclipse.as.runtime.eap.50"; //$NON-NLS-1$
@@ -36,6 +37,7 @@
public static final String SERVER_AS_51 = "org.jboss.ide.eclipse.as.51"; //$NON-NLS-1$
public static final String SERVER_AS_60 = "org.jboss.ide.eclipse.as.60"; //$NON-NLS-1$
public static final String SERVER_AS_70 = "org.jboss.ide.eclipse.as.70"; //$NON-NLS-1$
+ public static final String SERVER_AS_71 = "org.jboss.ide.eclipse.as.71"; //$NON-NLS-1$
public static final String EAP_SERVER_PREFIX = "org.jboss.ide.eclipse.as.eap."; //$NON-NLS-1$
public static final String SERVER_EAP_43 = "org.jboss.ide.eclipse.as.eap.43"; //$NON-NLS-1$
public static final String SERVER_EAP_50 = "org.jboss.ide.eclipse.as.eap.50"; //$NON-NLS-1$
@@ -79,8 +81,10 @@
public static final String DEFAULT_PROPS_51 = "jboss.51.default.ports.properties"; //$NON-NLS-1$
public static final String DEFAULT_PROPS_60 = "jboss.60.default.ports.properties"; //$NON-NLS-1$
public static final String DEFAULT_PROPS_70 = "jboss.70.default.ports.properties"; //$NON-NLS-1$
+ public static final String DEFAULT_PROPS_71 = "jboss.71.default.ports.properties"; //$NON-NLS-1$
public static final String DEFAULT_PROPS_EAP_43 = "jboss.eap.43.default.ports.properties"; //$NON-NLS-1$
public static final String DEFAULT_PROPS_EAP_50 = "jboss.eap.50.default.ports.properties"; //$NON-NLS-1$
+ public static final String DEFAULT_PROPS_EAP_60 = "jboss.eap.60.default.ports.properties"; //$NON-NLS-1$
// Poller constants
public static final String DEFAULT_STARTUP_POLLER = WebPortPoller.WEB_POLLER_ID;
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-11-25 12:35:34 UTC (rev 36658)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/ServerUtil.java 2011-11-25 12:41:44 UTC (rev 36659)
@@ -101,6 +101,7 @@
public static boolean isJBoss7(IServerType type) {
return type.getId().equals(IJBossToolingConstants.SERVER_AS_70)
+ || type.getId().equals(IJBossToolingConstants.SERVER_AS_71)
|| type.getId().equals(IJBossToolingConstants.SERVER_EAP_60);
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.properties
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.properties 2011-11-25 12:35:34 UTC (rev 36658)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.properties 2011-11-25 12:41:44 UTC (rev 36659)
@@ -30,10 +30,14 @@
jboss.version.60.description=JBoss Application Server 6.x
jboss.version.60.runtime.name=JBoss 6.x Runtime
-jboss.version.70.name=JBoss AS 7.x
-jboss.version.70.description=JBoss Application Server 7.x
-jboss.version.70.runtime.name=JBoss 7.x Runtime
+jboss.version.70.name=JBoss AS 7.0
+jboss.version.70.description=JBoss Application Server 7.0
+jboss.version.70.runtime.name=JBoss 7.0 Runtime
+jboss.version.71.name=JBoss AS 7.1
+jboss.version.71.description=JBoss Application Server 7.1
+jboss.version.71.runtime.name=JBoss 7.1 Runtime
+
jboss.eap.version.43.name=JBoss Enterprise Application Platform 4.3
jboss.eap.version.43.description=JBoss Enterprise Application Platform (EAP) 4.3
jboss.eap.version.43.runtime.name=JBoss Enterprise Application Platform 4.3 Runtime
@@ -52,9 +56,11 @@
deploy.server.name=Deploy Only
deploy.server.description=A server which only provides a deploy folder for publishing.
-AllJBossRuntimeTypes=org.jboss.ide.eclipse.as.runtime.32,org.jboss.ide.eclipse.as.runtime.40,org.jboss.ide.eclipse.as.runtime.42,org.jboss.ide.eclipse.as.runtime.50,org.jboss.ide.eclipse.as.runtime.51,org.jboss.ide.eclipse.as.runtime.60,org.jboss.ide.eclipse.as.runtime.70,org.jboss.ide.eclipse.as.runtime.eap.43,org.jboss.ide.eclipse.as.runtime.eap.50,org.jboss.ide.eclipse.as.runtime.eap.60
-AllJBossServerTypes=org.jboss.ide.eclipse.as.32,org.jboss.ide.eclipse.as.40,org.jboss.ide.eclipse.as.42,org.jboss.ide.eclipse.as.50,org.jboss.ide.eclipse.as.51,org.jboss.ide.eclipse.as.60,org.jboss.ide.eclipse.as.70,org.jboss.ide.eclipse.as.eap.43,org.jboss.ide.eclipse.as.eap.50,org.jboss.ide.eclipse.as.eap.60,
-AllJBTServerTypes=org.jboss.ide.eclipse.as.32,org.jboss.ide.eclipse.as.40,org.jboss.ide.eclipse.as.42,org.jboss.ide.eclipse.as.50,org.jboss.ide.eclipse.as.51,org.jboss.ide.eclipse.as.60,org.jboss.ide.eclipse.as.70,org.jboss.ide.eclipse.as.eap.43,org.jboss.ide.eclipse.as.eap.50,org.jboss.ide.eclipse.as.eap.60,org.jboss.ide.eclipse.as.systemCopyServer
-ServerTypesJBoss6OrHigher=org.jboss.ide.eclipse.as.60,org.jboss.ide.eclipse.as.70,org.jboss.ide.eclipse.as.eap.60
+AllJBossRuntimeTypes=org.jboss.ide.eclipse.as.runtime.32,org.jboss.ide.eclipse.as.runtime.40,org.jboss.ide.eclipse.as.runtime.42,org.jboss.ide.eclipse.as.runtime.50,org.jboss.ide.eclipse.as.runtime.51,org.jboss.ide.eclipse.as.runtime.60,org.jboss.ide.eclipse.as.runtime.70,org.jboss.ide.eclipse.as.runtime.71,org.jboss.ide.eclipse.as.runtime.eap.43,org.jboss.ide.eclipse.as.runtime.eap.50,org.jboss.ide.eclipse.as.runtime.eap.60
+AllJBossServerTypes=org.jboss.ide.eclipse.as.32,org.jboss.ide.eclipse.as.40,org.jboss.ide.eclipse.as.42,org.jboss.ide.eclipse.as.50,org.jboss.ide.eclipse.as.51,org.jboss.ide.eclipse.as.60,org.jboss.ide.eclipse.as.70,org.jboss.ide.eclipse.as.71,org.jboss.ide.eclipse.as.eap.43,org.jboss.ide.eclipse.as.eap.50,org.jboss.ide.eclipse.as.eap.60,
+AllJBTServerTypes=org.jboss.ide.eclipse.as.32,org.jboss.ide.eclipse.as.40,org.jboss.ide.eclipse.as.42,org.jboss.ide.eclipse.as.50,org.jboss.ide.eclipse.as.51,org.jboss.ide.eclipse.as.60,org.jboss.ide.eclipse.as.70,org.jboss.ide.eclipse.as.71,org.jboss.ide.eclipse.as.eap.43,org.jboss.ide.eclipse.as.eap.50,org.jboss.ide.eclipse.as.eap.60,org.jboss.ide.eclipse.as.systemCopyServer
ServerTypesJBoss6OrLower=org.jboss.ide.eclipse.as.32,org.jboss.ide.eclipse.as.40,org.jboss.ide.eclipse.as.42,org.jboss.ide.eclipse.as.50,org.jboss.ide.eclipse.as.51,org.jboss.ide.eclipse.as.60,org.jboss.ide.eclipse.as.eap.43,org.jboss.ide.eclipse.as.eap.50
-ServerTypesJBoss7=org.jboss.ide.eclipse.as.70,org.jboss.ide.eclipse.as.eap.60
\ No newline at end of file
+RuntimeTypesJBoss6OrLower=org.jboss.ide.eclipse.as.runtime.32,org.jboss.ide.eclipse.as.runtime.40,org.jboss.ide.eclipse.as.runtime.42,org.jboss.ide.eclipse.as.runtime.50,org.jboss.ide.eclipse.as.runtime.51,org.jboss.ide.eclipse.as.runtime.60,org.jboss.ide.eclipse.as.runtime.eap.43,org.jboss.ide.eclipse.as.runtime.eap.50
+ServerTypesJBoss6OrHigher=org.jboss.ide.eclipse.as.60,org.jboss.ide.eclipse.as.70,org.jboss.ide.eclipse.as.71,org.jboss.ide.eclipse.as.eap.60
+ServerTypesJBoss7=org.jboss.ide.eclipse.as.70,org.jboss.ide.eclipse.as.71,org.jboss.ide.eclipse.as.eap.60
+RuntimeTypesJBoss7=org.jboss.ide.eclipse.as.runtime.70,org.jboss.ide.eclipse.as.runtime.71,org.jboss.ide.eclipse.as.runtime.eap.60
\ No newline at end of file
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml 2011-11-25 12:35:34 UTC (rev 36658)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml 2011-11-25 12:41:44 UTC (rev 36659)
@@ -131,6 +131,23 @@
supportsRemoteHosts="true"/>
<serverType
+ behaviourClass="org.jboss.ide.eclipse.as.core.server.internal.v7.DelegatingJBoss7ServerBehavior"
+ class="org.jboss.ide.eclipse.as.core.server.internal.v7.JBoss7Server"
+ description="%jboss.version.71.description"
+ hasConfiguration="false"
+ id="org.jboss.ide.eclipse.as.71"
+ initialState="stopped"
+ launchConfigId="org.jboss.ide.eclipse.as.core.server.JBoss7StartupConfiguration"
+ launchModes="run,debug,profile"
+ name="%jboss.version.71.name"
+ runtime="true"
+ runtimeTypeId="org.jboss.ide.eclipse.as.runtime.71"
+ startBeforePublish="false"
+ startTimeout="450000"
+ stopTimeout="450000"
+ supportsRemoteHosts="true"/>
+
+ <serverType
behaviourClass="org.jboss.ide.eclipse.as.core.server.internal.DelegatingServerBehavior"
class="org.jboss.ide.eclipse.as.core.server.internal.JBossServer"
description="%jboss.eap.version.43.description"
@@ -342,7 +359,30 @@
<moduleType types="jboss.osgi" versions="1.0"/>
</runtimeType>
+ <runtimeType
+ vendor="%providerName"
+ class="org.jboss.ide.eclipse.as.core.server.internal.v7.LocalJBoss7ServerRuntime"
+ description="%jboss.version.71.description"
+ name="%jboss.version.71.runtime.name"
+ id="org.jboss.ide.eclipse.as.runtime.71"
+ version="7.1">
+ <moduleType types="jst.appclient" versions="5.0, 6.0"/>
+ <moduleType types="wst.web" versions="1.0,1.2,1.3,1.4"/>
+ <moduleType types="jst.web" versions="2.2, 2.3, 2.4, 2.5, 3.0"/>
+ <moduleType types="jst.ejb" versions="1.0, 1.1, 2.0, 2.1, 3.0, 3.1"/>
+ <moduleType types="jst.ear" versions="1.2, 1.3, 1.4, 5.0, 6.0"/>
+ <moduleType types="jst.connector" versions="1.0, 1.5, 1.6"/>
+ <moduleType types="jst.utility" versions="1.0"/>
+ <moduleType types="jboss.package" versions="1.0"/>
+ <moduleType types="jboss.singlefile" versions="1.0"/>
+ <moduleType types="jst.jboss.esb" versions="4.2,4.3,4.4,4.5,4.6,4.7,4.9"/>
+ <moduleType types="jst.jboss.sar" versions="1.0"/>
+ <moduleType types="jbt.bpel.module" versions="1.1, 2.0"/>
+ <moduleType types="bpel.module" versions="1.1, 2.0"/>
+ <moduleType types="jboss.osgi" versions="1.0"/>
+ </runtimeType>
+
<runtimeType
vendor="%enterpriseProviderName"
class="org.jboss.ide.eclipse.as.core.server.internal.LocalJBossServerRuntime"
@@ -560,7 +600,7 @@
class="org.jboss.ide.eclipse.as.core.server.internal.v7.JBoss7ManagerServicePoller"
id="org.jboss.ide.eclipse.as.core.server.JBoss7ManagerServicePoller"
name="JBoss 7 Manager Service"
- serverTypes="org.jboss.ide.eclipse.as.70, org.jboss.ide.eclipse.as.eap.60"
+ serverTypes="org.jboss.ide.eclipse.as.70,org.jboss.ide.eclipse.as.71,org.jboss.ide.eclipse.as.eap.60"
supportsShutdown="true"
supportsStartup="true">
</serverPoller>
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.core/properties/jboss.71.default.ports.properties
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/properties/jboss.71.default.ports.properties (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/properties/jboss.71.default.ports.properties 2011-11-25 12:41:44 UTC (rev 36659)
@@ -0,0 +1,6 @@
+JBoss_Web=//*[@name="standard-sockets"]/*[@name="http"]
+JBoss_Web_FILE=standalone/configuration/standalone.xml
+JBoss_Web_ATTRIBUTE=port
+JBoss_Management=//*[local-name()="socket-binding-group"]/*[local-name()="socket-binding"][@name="management-native"]
+JBoss_Management_ATTRIBUTE=port
+JBoss_Management_FILE=standalone/configuration/standalone.xml
\ No newline at end of file
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/internal/management/as7/AS7Manager.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/internal/management/as7/AS7Manager.java 2011-11-25 12:35:34 UTC (rev 36658)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/internal/management/as7/AS7Manager.java 2011-11-25 12:41:44 UTC (rev 36659)
@@ -65,6 +65,9 @@
public AS7Manager(String host, int port) throws UnknownHostException {
this.client = ModelControllerClient.Factory.create(host, port);
this.manager = ServerDeploymentManager.Factory.create(client);
+ System.out.println("70 client class: " + client.getClass());
+ System.out.println("70 manager class: " + manager.getClass());
+
}
public IJBoss7DeploymentResult undeploySync(String name, IProgressMonitor monitor)
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/internal/management/as7/JBoss7ManagerService.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/internal/management/as7/JBoss7ManagerService.java 2011-11-25 12:35:34 UTC (rev 36658)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/internal/management/as7/JBoss7ManagerService.java 2011-11-25 12:41:44 UTC (rev 36659)
@@ -17,49 +17,64 @@
import org.jboss.ide.eclipse.as.core.server.v7.management.IJBoss7ManagerService;
import org.jboss.ide.eclipse.as.core.server.v7.management.JBoss7DeploymentState;
import org.jboss.ide.eclipse.as.core.server.v7.management.JBoss7ServerState;
+import org.jboss.ide.eclipse.as.internal.management.as7.AS7Manager;
/**
* @author Rob Stryker
*/
public class JBoss7ManagerService implements IJBoss7ManagerService {
-
public IJBoss7DeploymentResult deployAsync(String host, int port, String deploymentName,
File file, IProgressMonitor monitor) throws Exception {
AS7Manager manager = new AS7Manager(host, port);
- IJBoss7DeploymentResult result = manager.deploy(deploymentName, file);
- manager.dispose();
- return result;
+ try {
+ IJBoss7DeploymentResult result = manager.deploy(deploymentName, file);
+ return result;
+ } finally {
+ manager.dispose();
+ }
}
public IJBoss7DeploymentResult deploySync(String host, int port, String deploymentName,
File file, IProgressMonitor monitor) throws Exception {
AS7Manager manager = new AS7Manager(host, port);
- IJBoss7DeploymentResult result = manager.deploySync(deploymentName, file, monitor);
- manager.dispose();
- return result;
+ try {
+ IJBoss7DeploymentResult result = manager.deploySync(deploymentName, file, monitor);
+ return result;
+ } finally {
+ manager.dispose();
+ }
}
public IJBoss7DeploymentResult undeployAsync(String host, int port, String deploymentName,
boolean removeFile, IProgressMonitor monitor) throws Exception {
AS7Manager manager = new AS7Manager(host, port);
- IJBoss7DeploymentResult result = manager.undeploy(deploymentName);
- manager.dispose();
- return result;
+ try {
+ IJBoss7DeploymentResult result = manager.undeploy(deploymentName);
+ return result;
+ } finally {
+ manager.dispose();
+ }
}
public IJBoss7DeploymentResult syncUndeploy(String host, int port, String deploymentName,
boolean removeFile, IProgressMonitor monitor) throws Exception {
AS7Manager manager = new AS7Manager(host, port);
- IJBoss7DeploymentResult result = manager.undeploySync(deploymentName, monitor);
- manager.dispose();
- return result;
+ try {
+ IJBoss7DeploymentResult result = manager.undeploySync(deploymentName, monitor);
+ return result;
+ } finally {
+ manager.dispose();
+ }
}
public JBoss7DeploymentState getDeploymentState(String host, int port, String deploymentName) throws Exception {
AS7Manager manager = new AS7Manager(host, port);
- JBoss7DeploymentState result = manager.getDeploymentStateSafe(deploymentName);
- manager.dispose();
- return result;
+ try {
+ JBoss7DeploymentState result = manager.getDeploymentStateSafe(deploymentName);
+ return result;
+ } finally {
+ manager.dispose();
+ }
}
@Deprecated
@@ -69,16 +84,22 @@
public JBoss7ServerState getServerState(String host, int port) throws Exception {
AS7Manager manager = new AS7Manager(host, port);
- JBoss7ServerState state = manager.getServerState();
- manager.dispose();
- return state;
+ try {
+ JBoss7ServerState state = manager.getServerState();
+ return state;
+ } finally {
+ manager.dispose();
+ }
}
public boolean isRunning(String host, int port) throws Exception {
AS7Manager manager = new AS7Manager(host, port);
- boolean ret = manager.isRunning();
- manager.dispose();
- return ret;
+ try {
+ boolean ret = manager.isRunning();
+ return ret;
+ } finally {
+ manager.dispose();
+ }
}
@Deprecated
@@ -88,8 +109,11 @@
public void stop(String host, int port) throws Exception {
AS7Manager manager = new AS7Manager(host, port);
- manager.stopServer();
- manager.dispose();
+ try {
+ manager.stopServer();
+ } finally {
+ manager.dispose();
+ }
}
@Override
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.properties
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.properties 2011-11-25 12:35:34 UTC (rev 36658)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.properties 2011-11-25 12:41:44 UTC (rev 36659)
@@ -23,11 +23,11 @@
NavigatorContent_XMLConfiguration=XML Configuration
NavigatorContent_JMX=JMX
-AllJBossRuntimeTypes=org.jboss.ide.eclipse.as.runtime.32,org.jboss.ide.eclipse.as.runtime.40,org.jboss.ide.eclipse.as.runtime.42,org.jboss.ide.eclipse.as.runtime.50,org.jboss.ide.eclipse.as.runtime.51,org.jboss.ide.eclipse.as.runtime.60,org.jboss.ide.eclipse.as.runtime.70,org.jboss.ide.eclipse.as.runtime.eap.43,org.jboss.ide.eclipse.as.runtime.eap.50,org.jboss.ide.eclipse.as.runtime.eap.60
-AllJBossServerTypes=org.jboss.ide.eclipse.as.32,org.jboss.ide.eclipse.as.40,org.jboss.ide.eclipse.as.42,org.jboss.ide.eclipse.as.50,org.jboss.ide.eclipse.as.51,org.jboss.ide.eclipse.as.60,org.jboss.ide.eclipse.as.70,org.jboss.ide.eclipse.as.eap.43,org.jboss.ide.eclipse.as.eap.50,org.jboss.ide.eclipse.as.eap.60
-AllJBTServerTypes=org.jboss.ide.eclipse.as.32,org.jboss.ide.eclipse.as.40,org.jboss.ide.eclipse.as.42,org.jboss.ide.eclipse.as.50,org.jboss.ide.eclipse.as.51,org.jboss.ide.eclipse.as.60,org.jboss.ide.eclipse.as.70,org.jboss.ide.eclipse.as.eap.43,org.jboss.ide.eclipse.as.eap.50,org.jboss.ide.eclipse.as.eap.60,org.jboss.ide.eclipse.as.systemCopyServer
+AllJBossRuntimeTypes=org.jboss.ide.eclipse.as.runtime.32,org.jboss.ide.eclipse.as.runtime.40,org.jboss.ide.eclipse.as.runtime.42,org.jboss.ide.eclipse.as.runtime.50,org.jboss.ide.eclipse.as.runtime.51,org.jboss.ide.eclipse.as.runtime.60,org.jboss.ide.eclipse.as.runtime.70,org.jboss.ide.eclipse.as.runtime.71,org.jboss.ide.eclipse.as.runtime.eap.43,org.jboss.ide.eclipse.as.runtime.eap.50,org.jboss.ide.eclipse.as.runtime.eap.60
+AllJBossServerTypes=org.jboss.ide.eclipse.as.32,org.jboss.ide.eclipse.as.40,org.jboss.ide.eclipse.as.42,org.jboss.ide.eclipse.as.50,org.jboss.ide.eclipse.as.51,org.jboss.ide.eclipse.as.60,org.jboss.ide.eclipse.as.70,org.jboss.ide.eclipse.as.71,org.jboss.ide.eclipse.as.eap.43,org.jboss.ide.eclipse.as.eap.50,org.jboss.ide.eclipse.as.eap.60,
+AllJBTServerTypes=org.jboss.ide.eclipse.as.32,org.jboss.ide.eclipse.as.40,org.jboss.ide.eclipse.as.42,org.jboss.ide.eclipse.as.50,org.jboss.ide.eclipse.as.51,org.jboss.ide.eclipse.as.60,org.jboss.ide.eclipse.as.70,org.jboss.ide.eclipse.as.71,org.jboss.ide.eclipse.as.eap.43,org.jboss.ide.eclipse.as.eap.50,org.jboss.ide.eclipse.as.eap.60,org.jboss.ide.eclipse.as.systemCopyServer
+ServerTypesJBoss6OrLower=org.jboss.ide.eclipse.as.32,org.jboss.ide.eclipse.as.40,org.jboss.ide.eclipse.as.42,org.jboss.ide.eclipse.as.50,org.jboss.ide.eclipse.as.51,org.jboss.ide.eclipse.as.60,org.jboss.ide.eclipse.as.eap.43,org.jboss.ide.eclipse.as.eap.50
RuntimeTypesJBoss6OrLower=org.jboss.ide.eclipse.as.runtime.32,org.jboss.ide.eclipse.as.runtime.40,org.jboss.ide.eclipse.as.runtime.42,org.jboss.ide.eclipse.as.runtime.50,org.jboss.ide.eclipse.as.runtime.51,org.jboss.ide.eclipse.as.runtime.60,org.jboss.ide.eclipse.as.runtime.eap.43,org.jboss.ide.eclipse.as.runtime.eap.50
-ServerTypesJBoss6OrLower=org.jboss.ide.eclipse.as.32,org.jboss.ide.eclipse.as.40,org.jboss.ide.eclipse.as.42,org.jboss.ide.eclipse.as.50,org.jboss.ide.eclipse.as.51,org.jboss.ide.eclipse.as.60,org.jboss.ide.eclipse.as.eap.43,org.jboss.ide.eclipse.as.eap.50
-ServerTypesJBoss6OrHigher=org.jboss.ide.eclipse.as.60,org.jboss.ide.eclipse.as.70
-ServerTypesJBoss7=org.jboss.ide.eclipse.as.70,org.jboss.ide.eclipse.as.eap.60
-RuntimeTypesJBoss7=org.jboss.ide.eclipse.as.runtime.70,org.jboss.ide.eclipse.as.runtime.eap.60
\ No newline at end of file
+ServerTypesJBoss6OrHigher=org.jboss.ide.eclipse.as.60,org.jboss.ide.eclipse.as.70,org.jboss.ide.eclipse.as.71,org.jboss.ide.eclipse.as.eap.60
+ServerTypesJBoss7=org.jboss.ide.eclipse.as.70,org.jboss.ide.eclipse.as.71,org.jboss.ide.eclipse.as.eap.60
+RuntimeTypesJBoss7=org.jboss.ide.eclipse.as.runtime.70,org.jboss.ide.eclipse.as.runtime.71,org.jboss.ide.eclipse.as.runtime.eap.60
\ No newline at end of file
13 years, 1 month
JBoss Tools SVN: r36658 - in trunk/as/plugins: org.jboss.ide.eclipse.as.management.as71 and 12 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2011-11-25 07:35:34 -0500 (Fri, 25 Nov 2011)
New Revision: 36658
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/.classpath
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/.project
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/.settings/
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/.settings/org.eclipse.jdt.core.prefs
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/META-INF/
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/META-INF/MANIFEST.MF
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/META-INF/jboss-management-service.xml
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/build.properties
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/jboss-as-controller-client-7.1.0.CR1-SNAPSHOT.jar
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/jboss-as-protocol-7.1.0.CR1-SNAPSHOT.jar
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/jboss-dmr-1.1.0.Final.jar
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/jboss-logging-3.1.0.CR2.jar
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/jboss-marshalling-1.3.4.GA.jar
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/jboss-remoting-3.2.0.CR3.jar
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/jboss-sasl-1.0.0.Beta6.jar
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/jboss-threads-2.0.0.GA.jar
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/pom.xml
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/as71/
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/as71/AS71ManagementActivator.java
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/as71/AS71Manager.java
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/as71/AS7Messages.java
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/as71/AS7Messages.properties
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/as71/CommandFormatException.java
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/as71/CommandLineException.java
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/as71/DefaultOperationRequestAddress.java
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/as71/DefaultOperationRequestBuilder.java
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/as71/DeploymentOperationResult.java
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/as71/JBoss71ManagerService.java
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/as71/ModelDescriptionConstants.java
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/as71/OperationFormatException.java
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/as71/OperationRequestAddress.java
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/as71/OperationRequestBuilder.java
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/as71/ValidatingOperationCallbackHandler.java
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/as71/util/
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/as71/util/AS7ManagerUtil.java
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/xnio-api-3.0.0.CR4.jar
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/xnio-nio-3.0.0.CR4.jar
Modified:
trunk/as/plugins/pom.xml
Log:
JBIDE-10253 - clone management for as7.1
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/.classpath
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/.classpath (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/.classpath 2011-11-25 12:35:34 UTC (rev 36658)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry exported="true" kind="lib" path="jboss-as-controller-client-7.1.0.CR1-SNAPSHOT.jar" sourcepath="/home/rob/code/jboss/as7/jboss-as/controller-client"/>
+ <classpathentry exported="true" kind="lib" path="jboss-as-protocol-7.1.0.CR1-SNAPSHOT.jar" sourcepath="/home/rob/code/jboss/as7/jboss-as/protocol"/>
+ <classpathentry exported="true" kind="lib" path="jboss-dmr-1.1.0.Final.jar" sourcepath="/home/rob/code/jboss/as7/jboss-dmr"/>
+ <classpathentry exported="true" kind="lib" path="jboss-logging-3.1.0.CR2.jar"/>
+ <classpathentry exported="true" kind="lib" path="jboss-marshalling-1.3.4.GA.jar"/>
+ <classpathentry exported="true" kind="lib" path="jboss-remoting-3.2.0.CR3.jar"/>
+ <classpathentry exported="true" kind="lib" path="jboss-sasl-1.0.0.Beta6.jar"/>
+ <classpathentry exported="true" kind="lib" path="jboss-threads-2.0.0.GA.jar"/>
+ <classpathentry exported="true" kind="lib" path="xnio-api-3.0.0.CR4.jar"/>
+ <classpathentry exported="true" kind="lib" path="xnio-nio-3.0.0.CR4.jar"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/.project
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/.project (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/.project 2011-11-25 12:35:34 UTC (rev 36658)
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.ide.eclipse.as.management.as71</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ds.core.builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/.settings/org.eclipse.jdt.core.prefs 2011-11-25 12:35:34 UTC (rev 36658)
@@ -0,0 +1,8 @@
+#Fri Apr 15 16:21:37 EDT 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/META-INF/MANIFEST.MF
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/META-INF/MANIFEST.MF (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/META-INF/MANIFEST.MF 2011-11-25 12:35:34 UTC (rev 36658)
@@ -0,0 +1,25 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: JBoss AS7.1 management API
+Bundle-SymbolicName: org.jboss.ide.eclipse.as.management.as71
+Bundle-Version: 2.3.0.qualifier
+Bundle-Activator: org.jboss.ide.eclipse.as.internal.management.as71.AS71ManagementActivator
+Require-Bundle: org.jboss.ide.eclipse.as.core;bundle-version="2.3.0",
+ org.eclipse.core.runtime;bundle-version="[3.7.0,4.0.0)",
+ org.eclipse.wst.server.core;bundle-version="1.1.302"
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-ClassPath: .,
+ jboss-as-controller-client-7.1.0.CR1-SNAPSHOT.jar,
+ jboss-as-protocol-7.1.0.CR1-SNAPSHOT.jar,
+ jboss-dmr-1.1.0.Final.jar,
+ jboss-logging-3.1.0.CR2.jar,
+ jboss-marshalling-1.3.4.GA.jar,
+ jboss-remoting-3.2.0.CR3.jar,
+ jboss-sasl-1.0.0.Beta6.jar,
+ jboss-threads-2.0.0.GA.jar,
+ xnio-api-3.0.0.CR4.jar,
+ xnio-nio-3.0.0.CR4.jar
+Service-Component: META-INF/jboss-management-service.xml
+Export-Package: org.jboss.ide.eclipse.as.internal.management.as71;x-friends:="org.jboss.ide.eclipse.as.management.as7.tests"
+Bundle-Vendor: JBoss by Red Hat
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/META-INF/jboss-management-service.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/META-INF/jboss-management-service.xml (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/META-INF/jboss-management-service.xml 2011-11-25 12:35:34 UTC (rev 36658)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.jboss.ide.eclipse.as.management.as7.service">
+ <implementation class="org.jboss.ide.eclipse.as.internal.management.as71.JBoss71ManagerService"/>
+ <service>
+ <provide interface="org.jboss.ide.eclipse.as.core.server.v7.management.IJBoss7ManagerService"/>
+ </service>
+ <property name="as.version" type="String" value="710.beta1"/>
+</scr:component>
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/build.properties
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/build.properties (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/build.properties 2011-11-25 12:35:34 UTC (rev 36658)
@@ -0,0 +1,19 @@
+# reminder, when updating to something newer, also update:
+# ~/trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/
+# ~/trunk/requirements/jbossas/build.properties
+# latest downloads: http://www.jboss.org/jbossas/downloads
+# current: http://download.jboss.org/jbossas/7.0/jboss-7.0.0.Beta3/jboss-7.0.0.Beta3...
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ jboss-as-controller-client-7.1.0.CR1-SNAPSHOT.jar,\
+ jboss-as-protocol-7.1.0.CR1-SNAPSHOT.jar,\
+ jboss-dmr-1.1.0.Final.jar,\
+ jboss-logging-3.1.0.CR2.jar,\
+ jboss-marshalling-1.3.4.GA.jar,\
+ jboss-remoting-3.2.0.CR3.jar,\
+ jboss-sasl-1.0.0.Beta6.jar,\
+ jboss-threads-2.0.0.GA.jar,\
+ xnio-api-3.0.0.CR4.jar,\
+ xnio-nio-3.0.0.CR4.jar
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/jboss-as-controller-client-7.1.0.CR1-SNAPSHOT.jar
===================================================================
(Binary files differ)
Property changes on: trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/jboss-as-controller-client-7.1.0.CR1-SNAPSHOT.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/jboss-as-protocol-7.1.0.CR1-SNAPSHOT.jar
===================================================================
(Binary files differ)
Property changes on: trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/jboss-as-protocol-7.1.0.CR1-SNAPSHOT.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/jboss-dmr-1.1.0.Final.jar
===================================================================
(Binary files differ)
Property changes on: trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/jboss-dmr-1.1.0.Final.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/jboss-logging-3.1.0.CR2.jar
===================================================================
(Binary files differ)
Property changes on: trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/jboss-logging-3.1.0.CR2.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/jboss-marshalling-1.3.4.GA.jar
===================================================================
(Binary files differ)
Property changes on: trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/jboss-marshalling-1.3.4.GA.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/jboss-remoting-3.2.0.CR3.jar
===================================================================
(Binary files differ)
Property changes on: trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/jboss-remoting-3.2.0.CR3.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/jboss-sasl-1.0.0.Beta6.jar
===================================================================
(Binary files differ)
Property changes on: trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/jboss-sasl-1.0.0.Beta6.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/jboss-threads-2.0.0.GA.jar
===================================================================
(Binary files differ)
Property changes on: trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/jboss-threads-2.0.0.GA.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/pom.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/pom.xml (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/pom.xml 2011-11-25 12:35:34 UTC (rev 36658)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.jboss.tools.as</groupId>
+ <artifactId>plugins</artifactId>
+ <version>2.3.0-SNAPSHOT</version>
+ </parent>
+ <groupId>org.jboss.tools.as.plugins</groupId>
+ <artifactId>org.jboss.ide.eclipse.as.management.as71</artifactId>
+ <packaging>eclipse-plugin</packaging>
+</project>
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/as71/AS71ManagementActivator.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/as71/AS71ManagementActivator.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/as71/AS71ManagementActivator.java 2011-11-25 12:35:34 UTC (rev 36658)
@@ -0,0 +1,54 @@
+package org.jboss.ide.eclipse.as.internal.management.as71;
+
+import org.eclipse.core.runtime.Plugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class AS71ManagementActivator extends Plugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.jboss.ide.eclipse.as.management.as7"; //$NON-NLS-1$
+
+ // The shared instance
+ private static AS71ManagementActivator plugin;
+
+ /**
+ * The constructor
+ */
+ public AS71ManagementActivator() {
+ }
+
+ public static BundleContext getContext() {
+ return plugin.getBundle().getBundleContext();
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static AS71ManagementActivator getDefault() {
+ return plugin;
+ }
+
+}
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/as71/AS71Manager.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/as71/AS71Manager.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/as71/AS71Manager.java 2011-11-25 12:35:34 UTC (rev 36658)
@@ -0,0 +1,306 @@
+/*******************************************************************************
+ * 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.internal.management.as71;
+
+import static org.jboss.ide.eclipse.as.internal.management.as71.ModelDescriptionConstants.ADDRESS;
+import static org.jboss.ide.eclipse.as.internal.management.as71.ModelDescriptionConstants.CHILD_TYPE;
+import static org.jboss.ide.eclipse.as.internal.management.as71.ModelDescriptionConstants.DEPLOYMENT;
+import static org.jboss.ide.eclipse.as.internal.management.as71.ModelDescriptionConstants.ENABLED;
+import static org.jboss.ide.eclipse.as.internal.management.as71.ModelDescriptionConstants.FAILURE_DESCRIPTION;
+import static org.jboss.ide.eclipse.as.internal.management.as71.ModelDescriptionConstants.NAME;
+import static org.jboss.ide.eclipse.as.internal.management.as71.ModelDescriptionConstants.OP;
+import static org.jboss.ide.eclipse.as.internal.management.as71.ModelDescriptionConstants.OP_ADDR;
+import static org.jboss.ide.eclipse.as.internal.management.as71.ModelDescriptionConstants.READ_ATTRIBUTE_OPERATION;
+import static org.jboss.ide.eclipse.as.internal.management.as71.ModelDescriptionConstants.READ_CHILDREN_NAMES_OPERATION;
+import static org.jboss.ide.eclipse.as.internal.management.as71.ModelDescriptionConstants.READ_RESOURCE_OPERATION;
+import static org.jboss.ide.eclipse.as.internal.management.as71.ModelDescriptionConstants.RESULT;
+import static org.jboss.ide.eclipse.as.internal.management.as71.ModelDescriptionConstants.SERVER_STATE;
+import static org.jboss.ide.eclipse.as.internal.management.as71.ModelDescriptionConstants.SHUTDOWN;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.UnknownHostException;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import java.util.concurrent.Future;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.osgi.util.NLS;
+import org.jboss.as.controller.client.ModelControllerClient;
+import org.jboss.as.controller.client.helpers.standalone.DeploymentAction;
+import org.jboss.as.controller.client.helpers.standalone.DeploymentPlanBuilder;
+import org.jboss.as.controller.client.helpers.standalone.ServerDeploymentManager;
+import org.jboss.as.controller.client.helpers.standalone.ServerDeploymentPlanResult;
+import org.jboss.as.protocol.StreamUtils;
+import org.jboss.dmr.ModelNode;
+import org.jboss.ide.eclipse.as.core.server.v7.management.IJBoss7DeploymentResult;
+import org.jboss.ide.eclipse.as.core.server.v7.management.JBoss7DeploymentState;
+import org.jboss.ide.eclipse.as.core.server.v7.management.JBoss7ManangerException;
+import org.jboss.ide.eclipse.as.core.server.v7.management.JBoss7ServerState;
+import org.jboss.ide.eclipse.as.internal.management.as71.util.AS7ManagerUtil;
+
+/**
+ * @author André Dietisheim
+ */
+public class AS71Manager {
+
+ public static final int MGMT_PORT = 9999;
+
+ private ModelControllerClient client;
+ private ServerDeploymentManager manager;
+
+ public AS71Manager(String host) throws UnknownHostException {
+ this(host, MGMT_PORT);
+ }
+
+ public AS71Manager(String host, int port) throws UnknownHostException {
+ this.client = ModelControllerClient.Factory.create(host, port);
+ this.manager = ServerDeploymentManager.Factory.create(client);
+ System.out.println("71 client class: " + client.getClass());
+ System.out.println("71 client class: " + manager.getClass());
+ }
+
+ public IJBoss7DeploymentResult undeploySync(String name, IProgressMonitor monitor)
+ throws JBoss7ManangerException {
+ IJBoss7DeploymentResult result = undeploy(name);
+ result.getStatus();
+ return result;
+ }
+
+ public IJBoss7DeploymentResult deploySync(String name, File file, IProgressMonitor monitor)
+ throws JBoss7ManangerException {
+ IJBoss7DeploymentResult result = deploy(name, file);
+ result.getStatus();
+ return result;
+ }
+
+ public IJBoss7DeploymentResult undeploy(String name) throws JBoss7ManangerException {
+ try {
+ DeploymentPlanBuilder builder = manager.newDeploymentPlan();
+ builder = builder.undeploy(name).andRemoveUndeployed();
+ return new DeploymentOperationResult(builder.getLastAction(), manager.execute(builder.build()));
+ } catch (Exception e) {
+ throw new JBoss7ManangerException(e);
+ }
+ }
+
+ public IJBoss7DeploymentResult remove(String name) throws JBoss7ManangerException {
+ try {
+ DeploymentPlanBuilder builder = manager.newDeploymentPlan();
+ builder = builder.remove(name);
+ return new DeploymentOperationResult(builder.getLastAction(), manager.execute(builder.build()));
+ } catch (Exception e) {
+ throw new JBoss7ManangerException(e);
+ }
+ }
+
+ public IJBoss7DeploymentResult deploy(File file) throws JBoss7ManangerException {
+ return deploy(file.getName(), file);
+ }
+
+ public IJBoss7DeploymentResult add(String name, File file) throws JBoss7ManangerException {
+ try {
+ return execute(manager.newDeploymentPlan().add(name, file));
+ } catch (IOException e) {
+ throw new JBoss7ManangerException(e);
+ }
+ }
+
+ public IJBoss7DeploymentResult deploy(String name, File file) throws JBoss7ManangerException {
+ try {
+ return execute(manager.newDeploymentPlan().add(name, file).andDeploy());
+ } catch (IOException e) {
+ throw new JBoss7ManangerException(e);
+ }
+ }
+
+ public IJBoss7DeploymentResult replace(File file) throws JBoss7ManangerException {
+ return replace(file.getName(), file);
+ }
+
+ public IJBoss7DeploymentResult replace(String name, File file) throws JBoss7ManangerException {
+ try {
+ return execute(manager.newDeploymentPlan().replace(name, file));
+ } catch (IOException e) {
+ throw new JBoss7ManangerException(e);
+ }
+ }
+
+ /**
+ * Get the deployment state
+ * This API may cause additional management requests, but it prevents exceptions
+ * from being thrown on the server.
+ *
+ * @param name
+ * @return
+ * @throws JBoss7ManangerException
+ */
+ public JBoss7DeploymentState getDeploymentStateSafe(String name) throws JBoss7ManangerException {
+ if( hasDeployment(name)) {
+ return JBoss7DeploymentState.NOT_FOUND;
+ }
+ return getDeploymentState(name);
+ }
+
+ /**
+ * Get the deployment state.
+ * This may cause exceptions to be thrown on the server side if the deployment has not yet
+ * been found or started to register.
+ *
+ *
+ * @param name
+ * @return
+ * @throws JBoss7ManangerException
+ */
+ public JBoss7DeploymentState getDeploymentState(String name) throws JBoss7ManangerException {
+ ModelNode request = new ModelNode();
+ request.get(OP).set(READ_RESOURCE_OPERATION);
+ request.get(ADDRESS).add(DEPLOYMENT, name);
+ ModelNode result = null;
+ try {
+ result = execute(request);
+ } catch( JBoss7ManangerException j7me ) {
+ return JBoss7DeploymentState.NOT_FOUND;
+ }
+
+ Boolean enabled = AS7ManagerUtil.getBooleanProperty(ENABLED, result);
+ if (enabled == null) {
+ throw new JBoss7ManangerException(
+ NLS.bind(AS7Messages.ModuleStateEvaluationFailed, name));
+ } else if (enabled) {
+ return JBoss7DeploymentState.STARTED;
+ } else {
+ return JBoss7DeploymentState.STOPPED;
+ }
+ }
+
+ public void addDeploymentDirectory(String path) {
+
+ }
+
+
+ /**
+ * Shuts the server down.
+ *
+ * @throws JBoss7ManangerException
+ */
+ public void stopServer() throws JBoss7ManangerException {
+ ModelNode request = new ModelNode();
+ request.get(OP).set(SHUTDOWN);
+ quietlyExecute(request);
+ }
+
+ public JBoss7ServerState getServerState() throws JBoss7ManangerException {
+ ModelNode request = new ModelNode();
+ request.get(OP).set(READ_ATTRIBUTE_OPERATION);
+ request.get(NAME).set(SERVER_STATE);
+ ModelNode response = execute(request);
+ return toJBoss7ServerState(response);
+ }
+
+ public boolean isRunning() {
+ try {
+ return getServerState() == JBoss7ServerState.RUNNING;
+ } catch (Exception e) {
+ return false;
+ }
+ }
+
+ private JBoss7ServerState toJBoss7ServerState(ModelNode response) throws JBoss7ManangerException {
+ try {
+ return JBoss7ServerState.valueOfIgnoreCase(response.asString());
+ } catch (IllegalArgumentException e) {
+ throw new JBoss7ManangerException(e);
+ }
+ }
+
+ public void dispose() {
+ StreamUtils.safeClose(client);
+ }
+
+ private ModelNode execute(ModelNode node) throws JBoss7ManangerException {
+ try {
+ ModelNode response = client.execute(node);
+ if (!AS7ManagerUtil.isSuccess(response)) {
+ throw new JBoss7ManangerException(
+ NLS.bind(AS7Messages.OperationOnAddressFailed,
+ new Object[] { node.get(OP),
+ node.get(ADDRESS),
+ response.get(FAILURE_DESCRIPTION) }
+ ));
+ }
+ return response.get(RESULT);
+ } catch (Exception e) {
+ throw new JBoss7ManangerException(e);
+ }
+ }
+
+ public void quietlyExecute(ModelNode node) throws JBoss7ManangerException {
+ try {
+ client.execute(node);
+ } catch (Exception e) {
+ if (!isConnectionCloseException(e)) {
+ throw new JBoss7ManangerException(e);
+ }
+ }
+ }
+
+ private boolean isConnectionCloseException(Exception e) {
+ return e instanceof IOException
+ && e.getMessage() != null
+ && e.getMessage().indexOf("Channel closed") > -1;
+ }
+
+ private IJBoss7DeploymentResult execute(DeploymentPlanBuilder builder) throws JBoss7ManangerException {
+ try {
+ DeploymentAction action = builder.getLastAction();
+ Future<ServerDeploymentPlanResult> planResult = manager.execute(builder.build());
+ return new DeploymentOperationResult(action, planResult);
+ } catch (Exception e) {
+ throw new JBoss7ManangerException(e);
+ }
+ }
+
+ public static ModelNode getEmptyOperation(String operationName, ModelNode address) {
+ ModelNode op = new ModelNode();
+ op.get(OP).set(operationName);
+ if (address != null) {
+ op.get(OP_ADDR).set(address);
+ }
+ else {
+ // Just establish the standard structure; caller can fill in address later
+ op.get(OP_ADDR);
+ }
+ return op;
+ }
+
+ public boolean hasDeployment(String name) throws JBoss7ManangerException {
+ return getDeploymentNames().contains(name);
+ }
+
+ private Set<String> getDeploymentNames() throws JBoss7ManangerException {
+ final ModelNode op = getEmptyOperation(READ_CHILDREN_NAMES_OPERATION, new ModelNode());
+ op.get(CHILD_TYPE).set(DEPLOYMENT);
+ ModelNode response = execute(op);
+ ModelNode result = response.get(RESULT);
+ Set<String> deploymentNames = new HashSet<String>();
+ if (result.isDefined()) {
+ final List<ModelNode> deploymentNodes = result.asList();
+ for (ModelNode node : deploymentNodes) {
+ deploymentNames.add(node.asString());
+ }
+ }
+ return deploymentNames;
+ }
+
+
+}
\ No newline at end of file
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/as71/AS7Messages.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/as71/AS7Messages.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/as71/AS7Messages.java 2011-11-25 12:35:34 UTC (rev 36658)
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * 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.internal.management.as71;
+
+import org.eclipse.osgi.util.NLS;
+
+public class AS7Messages extends NLS {
+ public static String ModuleStateEvaluationFailed;
+ public static String OperationOnAddressFailed;
+ public static String FailedToBuildOperation;
+ public static String OperationOutcomeToString;
+ public static String OperationOnUnitNotExecuted;
+ public static String OperationOnUnitFailed;
+ public static String OperationOnUnitRolledBack;
+ public static String OperationNotExecConfigRequiresRestart;
+ static {
+ NLS.initializeMessages("org.jboss.ide.eclipse.as.management.as7.AS7Messages", //$NON-NLS-1$
+ AS7Messages.class);
+ }
+
+}
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/as71/AS7Messages.properties
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/as71/AS7Messages.properties (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/as71/AS7Messages.properties 2011-11-25 12:35:34 UTC (rev 36658)
@@ -0,0 +1,8 @@
+ModuleStateEvaluationFailed=Could not evaluate state for deployment {0}
+OperationOnAddressFailed=Could not execute {0} for {1}. Failure was {2}.
+FailedToBuildOperation=Failed to build operation.
+OperationOutcomeToString=Operation outcome is {0}.
+OperationOnUnitNotExecuted=The operation {0} was not executed on unit {1}
+OperationOnUnitFailed=The operation {0} failed for unit {1}
+OperationOnUnitRolledBack=The operation {0} for unit {1} was rolled back
+OperationNotExecConfigRequiresRestart=The operation {0} was not executed on unit {1}. The server configuration was changed though and the server needs to be restarted.
\ No newline at end of file
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/as71/CommandFormatException.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/as71/CommandFormatException.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/as71/CommandFormatException.java 2011-11-25 12:35:34 UTC (rev 36658)
@@ -0,0 +1,53 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.internal.management.as71;
+
+/**
+ * @author Alexey Loubyansky
+ *
+ */
+public class CommandFormatException extends CommandLineException {
+
+ private static final long serialVersionUID = -5802389813870206943L;
+
+ /**
+ * @param message
+ * @param cause
+ */
+ public CommandFormatException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ /**
+ * @param message
+ */
+ public CommandFormatException(String message) {
+ super(message);
+ }
+
+ /**
+ * @param cause
+ */
+ public CommandFormatException(Throwable cause) {
+ super(cause);
+ }
+}
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/as71/CommandLineException.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/as71/CommandLineException.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/as71/CommandLineException.java 2011-11-25 12:35:34 UTC (rev 36658)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.internal.management.as71;
+
+/**
+ * @author Alexey Loubyansky
+ *
+ */
+public class CommandLineException extends Exception {
+
+ private static final long serialVersionUID = 423938082439473323L;
+
+ public CommandLineException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ public CommandLineException(String message) {
+ super(message);
+ }
+
+ public CommandLineException(Throwable cause) {
+ super(cause);
+ }
+}
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/as71/DefaultOperationRequestAddress.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/as71/DefaultOperationRequestAddress.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/as71/DefaultOperationRequestAddress.java 2011-11-25 12:35:34 UTC (rev 36658)
@@ -0,0 +1,258 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.internal.management.as71;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * This implementation is not thread-safe.
+ *
+ * @author Alexey Loubyansky
+ */
+public class DefaultOperationRequestAddress implements OperationRequestAddress {
+
+ private final List<NodeImpl> nodes = new ArrayList<NodeImpl>();
+
+ public DefaultOperationRequestAddress() {
+ }
+
+ /**
+ * Creates a prefix and initializes it to the value of the argument.
+ * @param initial the initial value
+ */
+ public DefaultOperationRequestAddress(OperationRequestAddress initial) {
+ if(!initial.isEmpty()) {
+ for(Node node : initial) {
+ toNode(node.getType(), node.getName());
+ }
+ }
+ }
+
+ @Override
+ public void toNodeType(String nodeType) {
+
+ nodes.add(new NodeImpl(nodeType, null));
+ }
+
+ @Override
+ public void toNode(String nodeName) {
+
+ if(nodes.isEmpty())
+ throw new IllegalStateException("The prefix should end with the node type before going to a specific node name.");
+
+ nodes.get(nodes.size() - 1).name = nodeName;
+ }
+
+ @Override
+ public void toNode(String nodeType, String nodeName) {
+
+ if(endsOnType()) {
+ throw new IllegalStateException("The prefix ends on a type. A node name must be specified before this method can be invoked.");
+ }
+ nodes.add(new NodeImpl(nodeType, nodeName));
+ }
+
+ @Override
+ public String toNodeType() {
+
+ if(nodes.isEmpty()) {
+ return null;
+ }
+ String name = nodes.get(nodes.size() - 1).name;
+ nodes.get(nodes.size() - 1).name = null;
+ return name;
+ }
+
+ @Override
+ public Node toParentNode() {
+
+ if(nodes.isEmpty()) {
+ return null;
+ }
+ return nodes.remove(nodes.size() - 1);
+ }
+
+ @Override
+ public void reset() {
+ nodes.clear();
+ }
+
+ @Override
+ public boolean endsOnType() {
+ if(nodes.isEmpty()) {
+ return false;
+ }
+
+ NodeImpl node = nodes.get(nodes.size() - 1);
+ return node.name == null;
+ }
+
+ @Override
+ public boolean isEmpty() {
+ return nodes.isEmpty();
+ }
+
+ @Override
+ public Iterator<Node> iterator() {
+
+ final Node[] array = nodes.toArray(new Node[nodes.size()]);
+ return new Iterator<Node>() {
+
+ int i = 0;
+
+ @Override
+ public boolean hasNext() {
+ return i < array.length;
+ }
+
+ @Override
+ public Node next() {
+ return array[i++];
+ }
+
+ @Override
+ public void remove() {
+ throw new UnsupportedOperationException();
+ }
+
+ };
+ }
+
+ @Override
+ public String getNodeType() {
+
+ if(nodes.isEmpty()) {
+ return null;
+ }
+ return nodes.get(nodes.size() - 1).type;
+ }
+
+ @Override
+ public String getNodeName() {
+
+ if(nodes.isEmpty()) {
+ return null;
+ }
+ return nodes.get(nodes.size() - 1).name;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((nodes == null) ? 0 : nodes.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (!(obj instanceof OperationRequestAddress))
+ return false;
+
+ OperationRequestAddress other = (OperationRequestAddress) obj;
+
+ if(isEmpty() != other.isEmpty())
+ return false;
+
+ Iterator<Node> thisIterator = iterator();
+ Iterator<Node> otherIterator = other.iterator();
+ boolean result = true;
+ while(result) {
+ if(!thisIterator.next().equals(otherIterator.next())) {
+ result = false;
+ } else {
+ if (!thisIterator.hasNext()) {
+ if (otherIterator.hasNext()) {
+ result = false;
+ }
+ break;
+ }
+ if (!otherIterator.hasNext()) {
+ if (thisIterator.hasNext()) {
+ result = false;
+ }
+ break;
+ }
+ }
+ }
+ return result;
+ }
+
+ private static final class NodeImpl implements Node {
+
+ String type;
+ String name;
+
+ NodeImpl(String type, String name) {
+ this.type = type;
+ this.name = name;
+ }
+
+ @Override
+ public String getType() {
+ return type;
+ }
+ @Override
+ public String getName() {
+ return name;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((name == null) ? 0 : name.hashCode());
+ result = prime * result + ((type == null) ? 0 : type.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+
+ if(!(obj instanceof Node))
+ return false;
+
+ Node other = (Node) obj;
+ if (name == null) {
+ if (other.getName() != null)
+ return false;
+ } else if (!name.equals(other.getName()))
+ return false;
+ if (type == null) {
+ if (other.getType() != null)
+ return false;
+ } else if (!type.equals(other.getType()))
+ return false;
+ return true;
+ }
+ }
+}
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/as71/DefaultOperationRequestBuilder.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/as71/DefaultOperationRequestBuilder.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/as71/DefaultOperationRequestBuilder.java 2011-11-25 12:35:34 UTC (rev 36658)
@@ -0,0 +1,234 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.internal.management.as71;
+
+import java.io.IOException;
+import java.util.Iterator;
+
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.UnsupportedCallbackException;
+
+import org.jboss.dmr.ModelNode;
+import org.jboss.ide.eclipse.as.internal.management.as71.OperationRequestAddress.Node;
+
+/**
+ *
+ * @author Alexey Loubyansky
+ */
+public class DefaultOperationRequestBuilder extends ValidatingOperationCallbackHandler implements OperationRequestBuilder {
+
+ private ModelNode request = new ModelNode();
+ private OperationRequestAddress prefix;
+
+ public DefaultOperationRequestBuilder() {
+ this.prefix = new DefaultOperationRequestAddress();
+ }
+
+ public DefaultOperationRequestBuilder(OperationRequestAddress prefix) {
+ if(prefix == null) {
+ throw new IllegalArgumentException("Prefix can't be null");
+ }
+ this.prefix = new DefaultOperationRequestAddress(prefix);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.as.cli.operation.OperationParser.CallbackHandler#rootNode()
+ */
+ public void rootNode() {
+ prefix.reset();
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.as.cli.operation.OperationParser.CallbackHandler#parentNode()
+ */
+ public void parentNode() {
+ prefix.toParentNode();
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.as.cli.operation.OperationParser.CallbackHandler#nodeType()
+ */
+ public void nodeType() {
+ prefix.toNodeType();
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.as.cli.operation.OperationParser.CallbackHandler#nodeTypeNameSeparator(int)
+ */
+ public void nodeTypeNameSeparator(int index) {
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.as.cli.operation.OperationParser.CallbackHandler#nodeSeparator(int)
+ */
+ public void nodeSeparator(int index) {
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.as.cli.operation.OperationParser.CallbackHandler#addressOperationSeparator(int)
+ */
+ public void addressOperationSeparator(int index) {
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.as.cli.operation.OperationParser.CallbackHandler#operationName(java.lang.String)
+ */
+ @Override
+ public void validatedOperationName(String operationName) {
+ this.setOperationName(operationName);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.as.cli.operation.OperationParser.CallbackHandler#propertyListStart(int)
+ */
+ public void propertyListStart(int index) {
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.as.cli.operation.OperationParser.CallbackHandler#propertyNameValueSeparator(int)
+ */
+ public void propertyNameValueSeparator(int index) {
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.as.cli.operation.OperationParser.CallbackHandler#propertySeparator(int)
+ */
+ public void propertySeparator(int index) {
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.as.cli.operation.OperationParser.CallbackHandler#propertyListEnd(int)
+ */
+ public void propertyListEnd(int index) {
+ }
+
+ @Override
+ protected void validatedNodeType(String nodeType)
+ throws OperationFormatException {
+ this.addNodeType(nodeType);
+ }
+
+ @Override
+ protected void validatedNodeName(String nodeName)
+ throws OperationFormatException {
+ this.addNodeName(nodeName);
+ }
+
+ @Override
+ protected void validatedPropertyName(String propertyName)
+ throws OperationFormatException {
+ throw new OperationFormatException("Property '" + propertyName + "' is missing the value.");
+ }
+
+ @Override
+ protected void validatedProperty(String name, String value,
+ int nameValueSeparatorIndex) throws OperationFormatException {
+ this.addProperty(name, value);
+ }
+
+ public void nodeTypeOrName(String typeOrName)
+ throws OperationFormatException {
+
+ if(prefix.endsOnType()) {
+ this.addNodeName(typeOrName);
+ } else {
+ this.addNodeType(typeOrName);
+ }
+ }
+
+ /**
+ * Makes sure that the operation name and the address have been set and returns a ModelNode
+ * representing the operation request.
+ */
+ public ModelNode buildRequest() throws OperationFormatException {
+
+ ModelNode address = request.get("address");
+ if(prefix.isEmpty()) {
+ address.setEmptyList();
+ } else {
+ Iterator<Node> iterator = prefix.iterator();
+ while (iterator.hasNext()) {
+ OperationRequestAddress.Node node = iterator.next();
+ if (node.getName() != null) {
+ address.add(node.getType(), node.getName());
+ } else if (iterator.hasNext()) {
+ throw new OperationFormatException(
+ "The node name is not specified for type '"
+ + node.getType() + "'");
+ }
+ }
+ }
+
+ if(!request.hasDefined("operation")) {
+ throw new OperationFormatException("The operation name is missing or the format of the operation request is wrong.");
+ }
+
+ return request;
+ }
+
+ @Override
+ public void setOperationName(String name) {
+ request.get("operation").set(name);
+ }
+
+ @Override
+ public void addNode(String type, String name) {
+ prefix.toNode(type, name);
+ }
+
+ @Override
+ public void addNodeType(String type) {
+ prefix.toNodeType(type);
+ }
+
+ @Override
+ public void addNodeName(String name) {
+ prefix.toNode(name);
+ }
+
+ @Override
+ public void addProperty(String name, String value) {
+
+ if(name == null || name.trim().isEmpty())
+ throw new IllegalArgumentException("The argument name is not specified: '" + name + "'");
+ if(value == null || value.trim().isEmpty())
+ throw new IllegalArgumentException("The argument value is not specified: '" + value + "'");
+ ModelNode toSet = null;
+ try {
+ toSet = ModelNode.fromString(value);
+ } catch (Exception e) {
+ // just use the string
+ toSet = new ModelNode().set(value);
+ }
+ request.get(name).set(toSet);
+ }
+
+ public ModelNode getModelNode() {
+ return request;
+ }
+
+ public void handle(Callback[] callbacks) throws IOException,
+ UnsupportedCallbackException {
+ // TODO Auto-generated method stub
+
+ }
+}
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/as71/DeploymentOperationResult.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/as71/DeploymentOperationResult.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/as71/DeploymentOperationResult.java 2011-11-25 12:35:34 UTC (rev 36658)
@@ -0,0 +1,95 @@
+/*******************************************************************************
+ * 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.internal.management.as71;
+
+import java.text.MessageFormat;
+import java.util.concurrent.Future;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.osgi.util.NLS;
+import org.jboss.as.controller.client.helpers.standalone.DeploymentAction;
+import org.jboss.as.controller.client.helpers.standalone.ServerDeploymentActionResult;
+import org.jboss.as.controller.client.helpers.standalone.ServerDeploymentPlanResult;
+import org.jboss.ide.eclipse.as.core.server.v7.management.IJBoss7DeploymentResult;
+import org.jboss.ide.eclipse.as.core.server.v7.management.JBoss7ManangerException;
+
+/**
+ * A class that holds the status of a deployment operation.
+ *
+ * @author André Dietisheim
+ *
+ */
+public class DeploymentOperationResult implements IJBoss7DeploymentResult {
+
+ private Future<ServerDeploymentPlanResult> planResult;
+ private DeploymentAction action;
+
+ DeploymentOperationResult(DeploymentAction action, Future<ServerDeploymentPlanResult> planResult) {
+ Assert.isNotNull(action);
+ this.action = action;
+ Assert.isNotNull(planResult);
+ this.planResult = planResult;
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.ide.eclipse.as.management.as7.deployment.IDeploymentResult#getStatus()
+ */
+ @Override
+ public IStatus getStatus() throws JBoss7ManangerException {
+ try {
+ ServerDeploymentActionResult actionResult = planResult.get().getDeploymentActionResult(action.getId());
+ return createStatus(action.getDeploymentUnitUniqueName(), action.getType().name(), actionResult);
+ } catch (Exception e) {
+ throw new JBoss7ManangerException(e);
+ }
+ }
+
+ private IStatus createStatus(String deploymentName, String actionName, ServerDeploymentActionResult actionResult) {
+ if (actionResult == null) {
+ return null;
+ }
+
+ IStatus status = null;
+ switch (actionResult.getResult()) {
+ case NOT_EXECUTED:
+ status = createStatus(IStatus.ERROR, NLS.bind(
+ AS7Messages.OperationOnUnitNotExecuted,
+ actionName, deploymentName));
+ break;
+ case EXECUTED:
+ status = Status.OK_STATUS;
+ break;
+ case FAILED:
+ status = createStatus(IStatus.ERROR, NLS.bind(AS7Messages.OperationOnUnitFailed,
+ actionName, deploymentName));
+ break;
+ case ROLLED_BACK:
+ status = createStatus(IStatus.ERROR,
+ NLS.bind(AS7Messages.OperationOnUnitRolledBack,
+ actionName, deploymentName));
+ break;
+ case CONFIGURATION_MODIFIED_REQUIRES_RESTART:
+ status = createStatus(
+ IStatus.WARNING,
+ NLS.bind(AS7Messages.OperationNotExecConfigRequiresRestart,
+ actionName, deploymentName));
+ break;
+ }
+ return status;
+ }
+
+ private IStatus createStatus(int severity, String messagePattern, Object... messageArguments) {
+ return new Status(severity, AS71ManagementActivator.getContext().getBundle().getSymbolicName(), MessageFormat.format(
+ messagePattern, messageArguments));
+ }
+}
\ No newline at end of file
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/as71/JBoss71ManagerService.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/as71/JBoss71ManagerService.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/as71/JBoss71ManagerService.java 2011-11-25 12:35:34 UTC (rev 36658)
@@ -0,0 +1,122 @@
+/*******************************************************************************
+ * 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.internal.management.as71;
+
+import java.io.File;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.jboss.ide.eclipse.as.core.server.v7.management.IJBoss7DeploymentResult;
+import org.jboss.ide.eclipse.as.core.server.v7.management.IJBoss7ManagerService;
+import org.jboss.ide.eclipse.as.core.server.v7.management.JBoss7DeploymentState;
+import org.jboss.ide.eclipse.as.core.server.v7.management.JBoss7ServerState;
+
+/**
+ * @author Rob Stryker
+ */
+public class JBoss71ManagerService implements IJBoss7ManagerService {
+
+ public IJBoss7DeploymentResult deployAsync(String host, int port, String deploymentName,
+ File file, IProgressMonitor monitor) throws Exception {
+ AS71Manager manager = new AS71Manager(host, port);
+ try {
+ IJBoss7DeploymentResult result = manager.deploy(deploymentName, file);
+ return result;
+ } finally {
+ manager.dispose();
+ }
+ }
+
+ public IJBoss7DeploymentResult deploySync(String host, int port, String deploymentName,
+ File file, IProgressMonitor monitor) throws Exception {
+ AS71Manager manager = new AS71Manager(host, port);
+ try {
+ IJBoss7DeploymentResult result = manager.deploySync(deploymentName, file, monitor);
+ return result;
+ } finally {
+ manager.dispose();
+ }
+ }
+
+ public IJBoss7DeploymentResult undeployAsync(String host, int port, String deploymentName,
+ boolean removeFile, IProgressMonitor monitor) throws Exception {
+ AS71Manager manager = new AS71Manager(host, port);
+ try {
+ IJBoss7DeploymentResult result = manager.undeploy(deploymentName);
+ return result;
+ } finally {
+ manager.dispose();
+ }
+ }
+
+ public IJBoss7DeploymentResult syncUndeploy(String host, int port, String deploymentName,
+ boolean removeFile, IProgressMonitor monitor) throws Exception {
+ AS71Manager manager = new AS71Manager(host, port);
+ try {
+ IJBoss7DeploymentResult result = manager.undeploySync(deploymentName, monitor);
+ return result;
+ } finally {
+ manager.dispose();
+ }
+ }
+
+ public JBoss7DeploymentState getDeploymentState(String host, int port, String deploymentName) throws Exception {
+ AS71Manager manager = new AS71Manager(host, port);
+ try {
+ JBoss7DeploymentState result = manager.getDeploymentStateSafe(deploymentName);
+ return result;
+ } finally {
+ manager.dispose();
+ }
+ }
+
+ @Deprecated
+ public JBoss7ServerState getServerState(String host) throws Exception {
+ return getServerState(host, AS71Manager.MGMT_PORT);
+ }
+
+ public JBoss7ServerState getServerState(String host, int port) throws Exception {
+ AS71Manager manager = new AS71Manager(host, port);
+ try {
+ JBoss7ServerState state = manager.getServerState();
+ return state;
+ } finally {
+ manager.dispose();
+ }
+ }
+
+ public boolean isRunning(String host, int port) throws Exception {
+ AS71Manager manager = new AS71Manager(host, port);
+ try {
+ boolean ret = manager.isRunning();
+ return ret;
+ } finally {
+ manager.dispose();
+ }
+ }
+
+ @Deprecated
+ public void stop(String host) throws Exception {
+ stop(host, AS71Manager.MGMT_PORT);
+ }
+
+ public void stop(String host, int port) throws Exception {
+ AS71Manager manager = new AS71Manager(host, port);
+ try {
+ manager.stopServer();
+ } finally {
+ manager.dispose();
+ }
+ }
+
+ @Override
+ public void dispose() {
+ }
+}
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/as71/ModelDescriptionConstants.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/as71/ModelDescriptionConstants.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/as71/ModelDescriptionConstants.java 2011-11-25 12:35:34 UTC (rev 36658)
@@ -0,0 +1,184 @@
+/*******************************************************************************
+ * 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.internal.management.as71;
+
+
+/**
+ * String constants frequently used in model descriptions.
+ *
+ * @author Brian Stansberry
+ */
+public class ModelDescriptionConstants {
+
+ // KEEP THESE IN ALPHABETICAL ORDER!
+
+ /** The key for {@link AttributeAccess.AccessType} fields. */
+ public static final String ACCESS_TYPE = "access-type";
+ public static final String ADD = "add";
+ public static final String ADD_OPERATION = "add-operation";
+ public static final String ADDRESS = "address";
+ public static final String ANY = "any";
+ public static final String ANY_ADDRESS = "any-address";
+ public static final String ANY_IPV4_ADDRESS = "any-ipv4-address";
+ public static final String ANY_IPV6_ADDRESS = "any-ipv6-address";
+ public static final String ATTRIBUTES = "attributes";
+ public static final String AUTO_START = "auto-start";
+ public static final String BYTES = "bytes";
+ public static final String CANCELLED = "cancelled";
+ public static final String CHILD_TYPE = "child-type";
+ public static final String CHILDREN = "children";
+ public static final String COMPOSITE = "composite";
+ public static final String CONCURRENT_GROUPS = "concurrent-groups";
+ public static final String CPU_AFFINITY = "cpu-affinity";
+ public static final String CRITERIA = "criteria";
+ public static final String COMPENSATING_OPERATION = "compensating-operation";
+ public static final String DEFAULT = "default";
+ public static final String DESCRIBE = "describe";
+ public static final String DEFAULT_INTERFACE = "default-interface";
+ public static final String DEPLOY = "deploy";
+ public static final String DEPLOYMENT = "deployment";
+ public static final String DEPLOYMENT_SCANNER = "deployment-scanner";
+ public static final String DESCRIPTION = "description";
+ public static final String DISABLE = "disable";
+ public static final String DOMAIN_CONTROLLER = "domain-controller";
+ public static final String DOMAIN_FAILURE_DESCRIPTION = "domain-failure-description";
+ public static final String DOMAIN_RESULTS = "domain-results";
+ public static final String ENABLE = "enable";
+ public static final String ENABLED = "enabled";
+ public static final String EXTENSION = "extension";
+ public static final String FAILED = "failed";
+ public static final String FAILURE_DESCRIPTION = "failure-description";
+ public static final String FIXED_PORT = "fixed-port";
+ public static final String FULL_REPLACE_DEPLOYMENT = "full-replace-deployment";
+ public static final String GRACEFUL_SHUTDOWN_TIMEOUT = "graceful-shutdown-timeout";
+ public static final String GROUP = "group";
+ public static final String HASH = "hash";
+ public static final String HEAD_COMMENT_ALLOWED = "head-comment-allowed";
+ public static final String HTTP_INTERFACE = "http-interface";
+ public static final String HOST = "host";
+ public static final String HOST_FAILURE_DESCRIPTION = "host-failure-description";
+ public static final String HOST_FAILURE_DESCRIPTIONS = "host-failure-descriptions";
+ public static final String IGNORED = "ignored";
+ public static final String INCLUDE = "include";
+ public static final String INCLUDES = "includes";
+ public static final String INCLUDE_RUNTIME = "include-runtime";
+ public static final String INET_ADDRESS = "inet-address";
+ public static final String INPUT_STREAM_INDEX = "input-stream-index";
+ public static final String INTERFACE = "interface";
+ public static final String IN_SERIES = "in-series";
+ public static final String JVM = "jvm";
+ public static final String JVM_TYPE = "type";
+ public static final String LOCAL = "local";
+ public static final String LOCALE = "locale";
+ public static final String MANAGEMENT_INTERFACES = "management-interfaces";
+ public static final String MASK = "mask";
+ public static final String MAX = "max";
+ public static final String MAX_FAILED_SERVERS = "max-failed-servers";
+ public static final String MAX_FAILURE_PERCENTAGE = "max-failure-percentage";
+ public static final String MAX_LENGTH = "max-length";
+ public static final String MAX_OCCURS = "max-occurs";
+ public static final String MAX_THREADS = "max-threads";
+ public static final String MIN = "min";
+ public static final String MIN_LENGTH = "min-length";
+ public static final String MIN_OCCURS = "min-occurs";
+ public static final String MIN_VALUE = "min-value";
+ public static final String MODEL_DESCRIPTION = "model-description";
+ public static final String MULTICAST_ADDRESS = "multicast-address";
+ public static final String MULTICAST_PORT = "multicast-port";
+ public static final String NAME = "name";
+ public static final String NAMESPACE = "namespace";
+ public static final String NAMESPACES = "namespaces";
+ public static final String NATIVE_INTERFACE = "native-interface";
+ public static final String NETWORK = "network";
+ public static final String NILLABLE = "nillable";
+ public static final String NOT = "not";
+ /** Use this as the standard operation name field in the operation *request* ModelNode */
+ public static final String OP = "operation";
+ /** Use this standard operation address field in the operation *request* ModelNode */
+ public static final String OP_ADDR = "address";
+ public static final String OPERATIONS = "operations";
+ public static final String OPERATION_HEADERS = "operation-headers";
+ /** Use this standard operation address field in the operation *description* ModelNode */
+ public static final String OPERATION_NAME = "operation-name";
+ public static final String OUTCOME = "outcome";
+ public static final String PATH = "path";
+ public static final String PORT = "port";
+ public static final String PORT_OFFSET = "port-offset";
+ public static final String PRIORITY = "priority";
+ public static final String PROFILE = "profile";
+ public static final String PROFILE_NAME = "profile-name";
+ public static final String READ_ATTRIBUTE_OPERATION = "read-attribute";
+ public static final String READ_CHILDREN_NAMES_OPERATION = "read-children-names";
+ public static final String READ_CHILDREN_TYPES_OPERATION = "read-children-types";
+ public static final String READ_CHILDREN_RESOURCES_OPERATION = "read-children-resources";
+ public static final String READ_CONFIG_AS_XML_OPERATION = "read-config-as-xml";
+ public static final String READ_OPERATION_DESCRIPTION_OPERATION = "read-operation-description";
+ public static final String READ_OPERATION_NAMES_OPERATION = "read-operation-names";
+ public static final String READ_RESOURCE_DESCRIPTION_OPERATION = "read-resource-description";
+ public static final String READ_RESOURCE_METRICS = "read-resource-metrics";
+ public static final String READ_RESOURCE_OPERATION = "read-resource";
+ public static final String REDEPLOY = "redeploy";
+ public static final String RELATIVE_TO = "relative-to";
+ public static final String REMOVE = "remove";
+ public static final String REMOTE = "remote";
+ public static final String REPLACE_DEPLOYMENT = "replace-deployment";
+ public static final String REPLY_PROPERTIES = "reply-properties";
+ public static final String REQUEST_PROPERTIES = "request-properties";
+ public static final String RECURSIVE = "recursive";
+ public static final String REQUIRED = "required";
+ public static final String RESPONSE = "response";
+ public static final String RESULT = "result";
+ public static final String ROLLBACK_ACROSS_GROUPS = "rollback-across-groups";
+ public static final String ROLLBACK_FAILURE_DESCRIPTION = "rollback-failure-description";
+ public static final String ROLLBACK_ON_RUNTIME_FAILURE = "rollback-on-runtime-failure";
+ public static final String ROLLED_BACK = "rolled-back";
+ public static final String ROLLING_TO_SERVERS = "rolling-to-servers";
+ public static final String ROLLOUT_PLAN = "rollout-plan";
+ public static final String RUNTIME_NAME = "runtime-name";
+ public static final String RUNNING_SERVER = "server";
+ public static final String SCANNER = "scanner";
+ public static final String SCAN_ENABLED = "scan-enabled";
+ public static final String SCAN_INTERVAL = "scan-interval";
+ public static final String SCHEMA_LOCATION = "schema-location";
+ public static final String SCHEMA_LOCATIONS = "schema-locations";
+ public static final String SERVER = "server";
+ public static final String SERVERS = "servers";
+ public static final String SERVER_CONFIG = "server-config";
+ public static final String SERVER_GROUP = "server-group";
+ public static final String SERVER_GROUPS = "server-groups";
+ public static final String SERVER_OPERATIONS = "server-operations";
+ public static final String SERVER_STATE = "server-state";
+ public static final String SHUTDOWN = "shutdown";
+ public static final String SOCKET_BINDING = "socket-binding";
+ public static final String SOCKET_BINDING_GROUP = "socket-binding-group";
+ public static final String SOCKET_BINDING_GROUP_NAME = "socket-binding-group-name";
+ public static final String SOCKET_BINDING_PORT_OFFSET = "socket-binding-port-offset";
+ public static final String START = "start";
+ public static final String STEPS = "steps";
+ /** The key for {@link AttributeAccess.Storage} fields. */
+ public static final String STORAGE = "storage";
+ public static final String SUBSYSTEM = "subsystem";
+ public static final String SUCCESS = "success";
+ public static final String SYSTEM_PROPERTY = "system-property";
+ public static final String SYSTEM_PROPERTIES = "system-properties";
+ public static final String TAIL_COMMENT_ALLOWED = "tail-comment-allowed";
+ public static final String TO_REPLACE = "to-replace";
+ public static final String TYPE = "type";
+ public static final String UNDEPLOY = "undeploy";
+ public static final String UPLOAD_DEPLOYMENT_BYTES = "upload-deployment-bytes";
+ public static final String UPLOAD_DEPLOYMENT_URL = "upload-deployment-url";
+ public static final String UPLOAD_DEPLOYMENT_STREAM = "upload-deployment-stream";
+ public static final String URL = "url";
+ public static final String VALUE = "value";
+ public static final String VALUE_TYPE = "value-type";
+ public static final String WRITE_ATTRIBUTE_OPERATION = "write-attribute";
+
+}
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/as71/OperationFormatException.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/as71/OperationFormatException.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/as71/OperationFormatException.java 2011-11-25 12:35:34 UTC (rev 36658)
@@ -0,0 +1,61 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.internal.management.as71;
+
+
+/**
+ *
+ * @author Alexey Loubyansky
+ */
+public class OperationFormatException extends CommandFormatException {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -3481664048439674648L;
+
+ /**
+ * @param message
+ * @param cause
+ */
+ public OperationFormatException(String message, Throwable cause) {
+ super(message, cause);
+ // TODO Auto-generated constructor stub
+ }
+
+ /**
+ * @param message
+ */
+ public OperationFormatException(String message) {
+ super(message);
+ // TODO Auto-generated constructor stub
+ }
+
+ /**
+ * @param cause
+ */
+ public OperationFormatException(Throwable cause) {
+ super(cause);
+ // TODO Auto-generated constructor stub
+ }
+
+}
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/as71/OperationRequestAddress.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/as71/OperationRequestAddress.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/as71/OperationRequestAddress.java 2011-11-25 12:35:34 UTC (rev 36658)
@@ -0,0 +1,110 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.internal.management.as71;
+
+
+
+/**
+ * An instance of this interface represents a prefix for the operation request address part.
+ *
+ * @author Alexey Loubyansky
+ */
+public interface OperationRequestAddress extends Iterable<OperationRequestAddress.Node> {
+
+ /**
+ * Appends the node type to the prefix.
+ * Note, the current prefix must end on the node name before this method
+ * is invoked.
+ *
+ * @param nodeType the node type to append to the prefix.
+ */
+ void toNodeType(String nodeType);
+
+ /**
+ * Appends the node name to the prefix.
+ * Note, the current prefix must end on the node type before this method
+ * is invoked.
+ *
+ * @param nodeName the node name to append to the prefix.
+ */
+ void toNode(String nodeName);
+
+ /**
+ * Appends the node to the prefix.
+ * Note, the current prefix must end on the node (i.e. node name) before
+ * this method is invoked.
+ *
+ * @param nodeType the node type of the node to append to the prefix
+ * @param nodeName the node name of the node to append to the prefix
+ */
+ void toNode(String nodeType, String nodeName);
+
+ /**
+ * Sets the current prefix to the node type of the current node,
+ * i.e. the node name is removed from the end of the prefix.
+ * @return the node name the prefix ended on
+ */
+ String toNodeType();
+
+ /**
+ * Removes the last node in the prefix, i.e. moves the value a node up.
+ * @return the node the prefix ended on
+ */
+ Node toParentNode();
+
+ /**
+ * Resets the prefix, i.e. this will make the prefix empty.
+ */
+ void reset();
+
+ /**
+ * Checks whether the prefix ends on a node type or a node name.
+ * @return true if the prefix ends on a node type, otherwise false.
+ */
+ boolean endsOnType();
+
+ /**
+ * Checks whether the prefix is empty.
+ * @return true if the prefix is empty, otherwise false.
+ */
+ boolean isEmpty();
+
+ /**
+ * Returns the node type of the last node.
+ * @return the node type of the last node or null if the prefix is empty.
+ */
+ String getNodeType();
+
+ /**
+ * Returns the node name of the last node.
+ * @return the node name of the last node or null if the prefix ends
+ * on a type or is empty.
+ */
+ String getNodeName();
+
+ interface Node {
+
+ String getType();
+
+ String getName();
+ }
+}
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/as71/OperationRequestBuilder.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/as71/OperationRequestBuilder.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/as71/OperationRequestBuilder.java 2011-11-25 12:35:34 UTC (rev 36658)
@@ -0,0 +1,77 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.internal.management.as71;
+
+import org.jboss.dmr.ModelNode;
+
+/**
+ * TODO this is not used for now...
+ *
+ * @author Alexey Loubyansky
+ */
+public interface OperationRequestBuilder {
+
+ /**
+ * Sets the name operation to be invoked.
+ *
+ * @param name the name of the operation to invoke.
+ */
+ void setOperationName(String name);
+
+ /**
+ * The address is specified as a path to the target node. Each element of the path is a node
+ * and is identified by its type and name.
+ *
+ * @param type the type of the node
+ * @param name the name of the node
+ */
+ void addNode(String type, String name);
+
+ /**
+ * This method is supposed to be invoked from applying the prefix with ends on a node type.
+ * @param type the type of the node.
+ */
+ void addNodeType(String type);
+
+ /**
+ * This method assumes there is a non-empty prefix which ends on a node type.
+ * Otherwise, this method will result in an exception.
+ * @param name the name of the node for the type specified by the prefix.
+ */
+ void addNodeName(String name);
+
+ /**
+ * Adds an argument.
+ *
+ * @param name the name of the argument
+ * @param value the value of the argument
+ */
+ void addProperty(String name, String value);
+
+ /**
+ * Builds the operation request based on the collected operation name, address and arguments.
+ *
+ * @return an instance of ModelNode representing the operation request
+ * @throws OperationFormatException
+ */
+ ModelNode buildRequest() throws OperationFormatException;
+}
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/as71/ValidatingOperationCallbackHandler.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/as71/ValidatingOperationCallbackHandler.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/as71/ValidatingOperationCallbackHandler.java 2011-11-25 12:35:34 UTC (rev 36658)
@@ -0,0 +1,131 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.internal.management.as71;
+
+import java.util.regex.Pattern;
+
+import javax.security.auth.callback.CallbackHandler;
+
+/**
+ *
+ * @author Alexey Loubyansky
+ */
+public abstract class ValidatingOperationCallbackHandler implements CallbackHandler {
+
+ private static final Pattern ALPHANUMERICS_PATTERN = Pattern.compile("[_a-zA-Z](?:[-_a-zA-Z0-9]*[_a-zA-Z0-9])?");
+ private static final Pattern NODE_NAME_PATTERN = Pattern.compile("\\*|[^*\\p{Space}\\p{Cntrl}]+");
+
+
+ protected String operationStr;
+
+ public void start(String operationString) {
+ this.operationStr = operationString;
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.as.cli.operation.OperationParser.CallbackHandler#nodeType(java.lang.String)
+ */
+ public void nodeType(String nodeType) throws OperationFormatException {
+
+ assertValidType(nodeType);
+ validatedNodeType(nodeType);
+ }
+
+ protected abstract void validatedNodeType(String nodeType) throws OperationFormatException;
+
+ /* (non-Javadoc)
+ * @see org.jboss.as.cli.operation.OperationParser.CallbackHandler#nodeName(java.lang.String)
+ */
+ public void nodeName(String nodeName) throws OperationFormatException {
+
+ assertValidNodeName(nodeName);
+ validatedNodeName(nodeName);
+ }
+
+ protected abstract void validatedNodeName(String nodeName) throws OperationFormatException;
+
+ /* (non-Javadoc)
+ * @see org.jboss.as.cli.operation.OperationParser.CallbackHandler#operationName(java.lang.String)
+ */
+ public void operationName(String operationName)
+ throws OperationFormatException {
+
+ if (operationName == null || !ALPHANUMERICS_PATTERN.matcher(operationName).matches()) {
+ throw new OperationFormatException("'" + operationName + "' is not a valid operation name.");
+ }
+
+ validatedOperationName(operationName);
+ }
+
+ protected abstract void validatedOperationName(String operationName) throws OperationFormatException;
+
+ /* (non-Javadoc)
+ * @see org.jboss.as.cli.operation.OperationParser.CallbackHandler#propertyName(java.lang.String)
+ */
+ public void propertyName(String propertyName)
+ throws OperationFormatException {
+
+ assertValidParameterName(propertyName);
+ validatedPropertyName(propertyName);
+ }
+
+ protected abstract void validatedPropertyName(String propertyName) throws OperationFormatException;
+
+ /* (non-Javadoc)
+ * @see org.jboss.as.cli.operation.OperationParser.CallbackHandler#property(java.lang.String, java.lang.String, int)
+ */
+ public void property(String name, String value, int nameValueSeparatorIndex)
+ throws OperationFormatException {
+
+ assertValidParameterName(name);
+
+ if (value.isEmpty()) {
+ throw new OperationFormatException("Parameter '" + value + "' is missing value.");
+ }
+
+ validatedProperty(name, value, nameValueSeparatorIndex);
+ }
+
+ protected abstract void validatedProperty(String name, String value, int nameValueSeparatorIndex) throws OperationFormatException;
+
+ protected void assertValidType(String nodeType)
+ throws OperationFormatException {
+ if (nodeType == null || !ALPHANUMERICS_PATTERN.matcher(nodeType).matches()) {
+ throw new OperationFormatException("'" + nodeType + "' is not a valid node type name.");
+ }
+ }
+
+ protected void assertValidNodeName(String nodeName)
+ throws OperationFormatException {
+ if (nodeName == null || !NODE_NAME_PATTERN.matcher(nodeName).matches()) {
+ throw new OperationFormatException("'" + nodeName + "' is not a valid node name.");
+ }
+ }
+
+ protected void assertValidParameterName(String name)
+ throws OperationFormatException {
+ if (name == null || !ALPHANUMERICS_PATTERN.matcher(name).matches()) {
+ throw new OperationFormatException("'" + name + "' is not a valid parameter name.");
+ }
+ }
+
+}
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/as71/util/AS7ManagerUtil.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/as71/util/AS7ManagerUtil.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/as71/util/AS7ManagerUtil.java 2011-11-25 12:35:34 UTC (rev 36658)
@@ -0,0 +1,162 @@
+/*******************************************************************************
+ * 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.internal.management.as71.util;
+
+import static org.jboss.ide.eclipse.as.internal.management.as71.ModelDescriptionConstants.CHILD_TYPE;
+import static org.jboss.ide.eclipse.as.internal.management.as71.ModelDescriptionConstants.DEPLOYMENT;
+import static org.jboss.ide.eclipse.as.internal.management.as71.ModelDescriptionConstants.FAILURE_DESCRIPTION;
+import static org.jboss.ide.eclipse.as.internal.management.as71.ModelDescriptionConstants.OUTCOME;
+import static org.jboss.ide.eclipse.as.internal.management.as71.ModelDescriptionConstants.READ_CHILDREN_NAMES_OPERATION;
+import static org.jboss.ide.eclipse.as.internal.management.as71.ModelDescriptionConstants.REQUEST_PROPERTIES;
+import static org.jboss.ide.eclipse.as.internal.management.as71.ModelDescriptionConstants.RESULT;
+import static org.jboss.ide.eclipse.as.internal.management.as71.ModelDescriptionConstants.SUCCESS;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.osgi.util.NLS;
+import org.jboss.as.controller.client.ModelControllerClient;
+import org.jboss.as.controller.client.Operation;
+import org.jboss.dmr.ModelNode;
+import org.jboss.dmr.ModelType;
+import org.jboss.dmr.Property;
+import org.jboss.ide.eclipse.as.core.server.v7.management.JBoss7ManangerException;
+import org.jboss.ide.eclipse.as.internal.management.as71.AS7Messages;
+import org.jboss.ide.eclipse.as.internal.management.as71.DefaultOperationRequestBuilder;
+import org.jboss.ide.eclipse.as.internal.management.as71.OperationFormatException;
+
+/**
+ * Various utility methods to deal with the as7 management api.
+ *
+ * @author Alexey Loubyansky
+ * @author André Dietisheim
+ */
+public class AS7ManagerUtil {
+
+ public static boolean isSuccess(ModelNode operationResult) {
+ if (operationResult != null) {
+ ModelNode outcome = operationResult.get(OUTCOME);
+ return outcome != null && outcome.asString().equals(SUCCESS);
+ }
+ return false;
+ }
+
+ public static String getFailureDescription(ModelNode operationResult) {
+ if (operationResult == null) {
+ return null;
+ }
+
+ ModelNode descr = operationResult.get(FAILURE_DESCRIPTION);
+ if (descr == null) {
+ return null;
+ }
+
+ return descr.asString();
+ }
+
+ public static List<String> getList(ModelNode operationResult) {
+ if (!operationResult.hasDefined(RESULT))
+ return Collections.emptyList();
+
+ List<ModelNode> nodeList = operationResult.get(RESULT).asList();
+ if (nodeList.isEmpty())
+ return Collections.emptyList();
+
+ List<String> list = new ArrayList<String>(nodeList.size());
+ for (ModelNode node : nodeList) {
+ list.add(node.asString());
+ }
+ return list;
+ }
+
+ public static List<String> getRequestPropertyNames(ModelNode operationResult) {
+ if (!operationResult.hasDefined(RESULT))
+ return Collections.emptyList();
+
+ ModelNode result = operationResult.get(RESULT);
+ if (!result.hasDefined(REQUEST_PROPERTIES))
+ return Collections.emptyList();
+
+ List<Property> nodeList = result.get(REQUEST_PROPERTIES).asPropertyList();
+ if (nodeList.isEmpty())
+ return Collections.emptyList();
+
+ List<String> list = new ArrayList<String>(nodeList.size());
+ for (Property node : nodeList) {
+ list.add(node.getName());
+ }
+ return list;
+ }
+
+ public static boolean isDeployed(String name, ModelControllerClient client) {
+ return getDeployments(client).contains(name);
+ }
+
+ public static List<String> getDeployments(ModelControllerClient client) {
+
+ DefaultOperationRequestBuilder builder = new DefaultOperationRequestBuilder();
+ final ModelNode request;
+ try {
+ builder.operationName(READ_CHILDREN_NAMES_OPERATION);
+ builder.addProperty(CHILD_TYPE, DEPLOYMENT);
+ request = builder.buildRequest();
+ } catch (OperationFormatException e) {
+ throw new IllegalStateException(AS7Messages.FailedToBuildOperation, e);
+ }
+
+ try {
+ ModelNode outcome = client.execute(request);
+ if (isSuccess(outcome)) {
+ return getList(outcome);
+ }
+ } catch (Exception e) {
+ }
+
+ return Collections.emptyList();
+ }
+
+ public static Boolean getBooleanProperty(String propertyName, ModelNode node) {
+ if (node == null) {
+ return null;
+ }
+ ModelNode valueNode = node.get(propertyName);
+ if (valueNode == null) {
+ return null;
+ }
+ String value = valueNode.toString();
+ if (value == null
+ || valueNode.getType() != ModelType.BOOLEAN) {
+ return null;
+ }
+ return Boolean.valueOf(value);
+ }
+
+ public static ModelNode execute(Operation operation, ModelControllerClient client) throws JBoss7ManangerException {
+ try {
+ ModelNode result = client.execute(operation);
+ if (result.hasDefined(OUTCOME)
+ && SUCCESS.equals(result.get(OUTCOME).asString())) {
+ return result.get(RESULT);
+ }
+ else if (result.hasDefined(FAILURE_DESCRIPTION)) {
+ throw new JBoss7ManangerException(result.get(FAILURE_DESCRIPTION).toString());
+ }
+ else {
+ throw new JBoss7ManangerException(NLS.bind(
+ AS7Messages.OperationOutcomeToString, result.get(OUTCOME).asString()));
+ }
+ } catch (IOException e) {
+ throw new JBoss7ManangerException(e);
+ }
+ }
+}
\ No newline at end of file
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/xnio-api-3.0.0.CR4.jar
===================================================================
(Binary files differ)
Property changes on: trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/xnio-api-3.0.0.CR4.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/xnio-nio-3.0.0.CR4.jar
===================================================================
(Binary files differ)
Property changes on: trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/xnio-nio-3.0.0.CR4.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified: trunk/as/plugins/pom.xml
===================================================================
--- trunk/as/plugins/pom.xml 2011-11-25 11:15:47 UTC (rev 36657)
+++ trunk/as/plugins/pom.xml 2011-11-25 12:35:34 UTC (rev 36658)
@@ -24,6 +24,7 @@
<module>org.jboss.ide.eclipse.as.rse.ui</module>
<module>org.jboss.ide.eclipse.as.jmx.integration</module>
<module>org.jboss.ide.eclipse.as.management.as7</module>
+ <module>org.jboss.ide.eclipse.as.management.as71</module>
</modules>
</project>
13 years, 1 month
JBoss Tools SVN: r36657 - trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour.
by jbosstools-commits@lists.jboss.org
Author: xcoulon
Date: 2011-11-25 06:15:47 -0500 (Fri, 25 Nov 2011)
New Revision: 36657
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressBehaviourDelegate.java
Log:
adding missing methods
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressBehaviourDelegate.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressBehaviourDelegate.java 2011-11-25 11:15:13 UTC (rev 36656)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressBehaviourDelegate.java 2011-11-25 11:15:47 UTC (rev 36657)
@@ -81,4 +81,16 @@
}
+ @Override
+ public void onServerStarted() {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void onServerStopped() {
+ // TODO Auto-generated method stub
+
+ }
+
}
13 years, 1 month
JBoss Tools SVN: r36656 - trunk/openshift/plugins/org.jboss.tools.openshift.express.client.
by jbosstools-commits@lists.jboss.org
Author: xcoulon
Date: 2011-11-25 06:15:13 -0500 (Fri, 25 Nov 2011)
New Revision: 36656
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.client/.classpath
trunk/openshift/plugins/org.jboss.tools.openshift.express.client/org.jboss.tools.openshift.express.client-2.3.0-SNAPSHOT.jar
Log:
JBIDE-10096 Application is not removed from available application list in OpenShift Tooling
https://issues.jboss.org/browse/JBIDE-10096
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.client/.classpath
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.client/.classpath 2011-11-25 10:08:05 UTC (rev 36655)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.client/.classpath 2011-11-25 11:15:13 UTC (rev 36656)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry exported="true" kind="lib" path="org.jboss.tools.openshift.express.client-2.3.0-SNAPSHOT.jar" sourcepath="/home/adietish/jboss-workspaces/openshift-java-client/org.jboss.tools.openshift.express.client"/>
+ <classpathentry exported="true" kind="lib" path="org.jboss.tools.openshift.express.client-2.3.0-SNAPSHOT.jar" sourcepath="/openshift-java-client"/>
<classpathentry exported="true" kind="lib" path="jboss-dmr-1.0.0.Final.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.client/org.jboss.tools.openshift.express.client-2.3.0-SNAPSHOT.jar
===================================================================
(Binary files differ)
13 years, 1 month
JBoss Tools SVN: r36655 - trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/wizard/web/jboss.
by jbosstools-commits@lists.jboss.org
Author: ljelinko
Date: 2011-11-25 05:08:05 -0500 (Fri, 25 Nov 2011)
New Revision: 36655
Modified:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/wizard/web/jboss/JSFPortletCreationTask.java
Log:
added first page
Modified: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/wizard/web/jboss/JSFPortletCreationTask.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/wizard/web/jboss/JSFPortletCreationTask.java 2011-11-25 10:07:20 UTC (rev 36654)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/wizard/web/jboss/JSFPortletCreationTask.java 2011-11-25 10:08:05 UTC (rev 36655)
@@ -1,6 +1,8 @@
package org.jboss.tools.portlet.ui.bot.task.wizard.web.jboss;
+import org.jboss.tools.portlet.ui.bot.task.wizard.WizardPageDefaultsFillingTask;
+
/**
* Creates a new java portlet using a JBoss wizard.
*
@@ -11,5 +13,7 @@
public JSFPortletCreationTask() {
super("JBoss JSF/Seam Portlet");
+ // leave defaults on the first page
+ addWizardPage(new WizardPageDefaultsFillingTask());
}
}
13 years, 1 month
JBoss Tools SVN: r36654 - in trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test: jsf and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: ljelinko
Date: 2011-11-25 05:07:20 -0500 (Fri, 25 Nov 2011)
New Revision: 36654
Modified:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/core/CreateJavaPortlet.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/jsf/CreateJSFPortlet.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/template/CreatePortletTemplate.java
Log:
added assert for non expected files
Modified: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/core/CreateJavaPortlet.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/core/CreateJavaPortlet.java 2011-11-25 10:06:33 UTC (rev 36653)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/core/CreateJavaPortlet.java 2011-11-25 10:07:20 UTC (rev 36654)
@@ -44,12 +44,20 @@
@Override
protected List<String> getExpectedFiles() {
return Arrays.asList(
- "WebContent/WEB-INF/default-object.xml",
- "WebContent/WEB-INF/portlet-instances.xml",
+ DEFAULT_OBJECTS_XML,
+ PORTLET_INSTANCES_XML,
CLASS_FILE);
}
@Override
+ protected List<String> getNonExpectedFiles() {
+ return Arrays.asList(
+ JSF_FOLDER,
+ JBOSS_APP_XML,
+ JBOSS_PORTLET_XML);
+ }
+
+ @Override
protected List<XMLNode> getExpectedXMLNodes() {
return Arrays.asList(new XMLNode("portlet-app/portlet/portlet-class", FULL_CLASS_NAME));
}
Modified: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/jsf/CreateJSFPortlet.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/jsf/CreateJSFPortlet.java 2011-11-25 10:06:33 UTC (rev 36653)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/jsf/CreateJSFPortlet.java 2011-11-25 10:07:20 UTC (rev 36654)
@@ -6,6 +6,7 @@
import java.util.List;
import org.jboss.tools.portlet.ui.bot.entity.XMLNode;
+import org.jboss.tools.portlet.ui.bot.task.wizard.WizardPageDefaultsFillingTask;
import org.jboss.tools.portlet.ui.bot.task.wizard.web.jboss.AbstractPortletCreationTask;
import org.jboss.tools.portlet.ui.bot.task.wizard.web.jboss.JSFPortletCreationTask;
import org.jboss.tools.portlet.ui.bot.test.template.CreatePortletTemplate;
@@ -17,11 +18,9 @@
*
*/
public class CreateJSFPortlet extends CreatePortletTemplate {
-
+
private static final String FACES_CLASS_NAME = "javax.portlet.faces.GenericFacesPortlet";
-
- private static final String JSF_FOLDER = "WebContent/jsf/";
-
+
@Override
protected String getProjectName() {
return PROJECT_NAME;
@@ -29,7 +28,10 @@
@Override
protected AbstractPortletCreationTask getCreatePortletTask() {
- return new JSFPortletCreationTask();
+ JSFPortletCreationTask task = new JSFPortletCreationTask();
+ task.addWizardPage(new WizardPageDefaultsFillingTask());
+ task.addWizardPage(new WizardPageDefaultsFillingTask());
+ return task;
}
@Override
@@ -37,14 +39,20 @@
return Arrays.asList(
JSF_FOLDER + "edit.jsp",
JSF_FOLDER + "view.jsp",
- JSF_FOLDER + "help.jsp",
- "WebContent/WEB-INF/default-object.xml",
- "WebContent/WEB-INF/portlet-instances.xml",
- "WebContent/WEB-INF/jboss-app.xml",
- "WebContent/WEB-INF/jboss-portlet.xml");
+ JSF_FOLDER + "help.jsp"
+ );
}
@Override
+ protected List<String> getNonExpectedFiles() {
+ return Arrays.asList(
+ DEFAULT_OBJECTS_XML,
+ PORTLET_INSTANCES_XML,
+ JBOSS_APP_XML,
+ JBOSS_PORTLET_XML);
+ }
+
+ @Override
protected List<XMLNode> getExpectedXMLNodes() {
return Arrays.asList(new XMLNode("portlet-app/portlet/portlet-class", FACES_CLASS_NAME));
}
Modified: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/template/CreatePortletTemplate.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/template/CreatePortletTemplate.java 2011-11-25 10:06:33 UTC (rev 36653)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/template/CreatePortletTemplate.java 2011-11-25 10:07:20 UTC (rev 36654)
@@ -1,5 +1,6 @@
package org.jboss.tools.portlet.ui.bot.test.template;
+import static org.hamcrest.Matchers.not;
import static org.jboss.tools.portlet.ui.bot.entity.EntityFactory.file;
import static org.jboss.tools.portlet.ui.bot.matcher.factory.DefaultMatchersFactory.isNumberOfErrors;
import static org.jboss.tools.portlet.ui.bot.matcher.factory.WorkspaceMatchersFactory.containsNodes;
@@ -22,32 +23,55 @@
*
*/
public abstract class CreatePortletTemplate extends SWTTaskBasedTestCase {
+
+ protected static final String WEB_INF = "WebContent/WEB-INF/";
+
+ protected static final String DEFAULT_OBJECTS_XML = WEB_INF + "default-object.xml";
+
+ protected static final String PORTLET_INSTANCES_XML = WEB_INF + "portlet-instances.xml";
+
+ protected static final String JBOSS_APP_XML = WEB_INF + "jboss-app.xml";
+
+ protected static final String JBOSS_PORTLET_XML = WEB_INF + "jboss-portlet.xml";
+ protected static final String JSF_FOLDER = "WebContent/jsf/";
+
protected abstract String getProjectName();
-
+
protected abstract AbstractPortletCreationTask getCreatePortletTask();
-
+
protected abstract List<String> getExpectedFiles();
-
+
+ protected abstract List<String> getNonExpectedFiles();
+
protected abstract List<XMLNode> getExpectedXMLNodes();
-
+
@Test
public void testCreate(){
doPerform(getCreatePortletTask());
-
+
doAssertThat(0, isNumberOfErrors());
doAssertThat(getExpectedWorkspaceFiles(), exist());
- doAssertThat(file(getProjectName(), "WebContent/WEB-INF/portlet.xml"),
+ doAssertThat(getNonExpectedWorkspaceFiles(), not(exist()));
+ doAssertThat(file(getProjectName(), WEB_INF + "portlet.xml"),
containsNodes(getExpectedXMLNodes()));
}
-
+
private List<WorkspaceFile> getExpectedWorkspaceFiles(){
- List<WorkspaceFile> expectedWorkspaceFiles = new ArrayList<WorkspaceFile>();
-
- for (String file : getExpectedFiles()){
- expectedWorkspaceFiles.add(new WorkspaceFile(getProjectName(), file));
+ return wrap(getExpectedFiles());
+ }
+
+ private List<WorkspaceFile> getNonExpectedWorkspaceFiles(){
+ return wrap(getNonExpectedFiles());
+ }
+
+ private List<WorkspaceFile> wrap(List<String> files){
+ List<WorkspaceFile> workspaceFiles = new ArrayList<WorkspaceFile>();
+
+ for (String file : files){
+ workspaceFiles.add(new WorkspaceFile(getProjectName(), file));
}
-
- return expectedWorkspaceFiles;
+
+ return workspaceFiles;
}
}
13 years, 1 month
JBoss Tools SVN: r36653 - trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/testcase.
by jbosstools-commits@lists.jboss.org
Author: ljelinko
Date: 2011-11-25 05:06:33 -0500 (Fri, 25 Nov 2011)
New Revision: 36653
Modified:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/testcase/SWTTaskBasedTestCase.java
Log:
changed doAssertThat to accept all Matchers
Modified: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/testcase/SWTTaskBasedTestCase.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/testcase/SWTTaskBasedTestCase.java 2011-11-25 07:10:38 UTC (rev 36652)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/testcase/SWTTaskBasedTestCase.java 2011-11-25 10:06:33 UTC (rev 36653)
@@ -2,6 +2,7 @@
import static org.junit.Assert.assertThat;
+import org.hamcrest.Matcher;
import org.jboss.tools.portlet.ui.bot.matcher.SWTMatcher;
import org.jboss.tools.portlet.ui.bot.task.SWTBotAware;
import org.jboss.tools.portlet.ui.bot.task.SWTTask;
@@ -22,7 +23,7 @@
task.perform();
}
- protected <T> void doAssertThat(T actual, SWTMatcher<T> matcher){
+ protected <T> void doAssertThat(T actual, Matcher<T> matcher){
if (matcher instanceof SWTBotAware){
((SWTBotAware) matcher).setBot(bot);
}
13 years, 1 month
JBoss Tools SVN: r36652 - trunk/openshift/plugins/org.jboss.tools.openshift.egit.core/src/org/jboss/tools/openshift/egit/core.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2011-11-25 02:10:38 -0500 (Fri, 25 Nov 2011)
New Revision: 36652
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.egit.core/src/org/jboss/tools/openshift/egit/core/EgitBehaviourDelegate.java
Log:
Avoiding build errors - change in superclass
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.egit.core/src/org/jboss/tools/openshift/egit/core/EgitBehaviourDelegate.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.egit.core/src/org/jboss/tools/openshift/egit/core/EgitBehaviourDelegate.java 2011-11-25 07:09:44 UTC (rev 36651)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.egit.core/src/org/jboss/tools/openshift/egit/core/EgitBehaviourDelegate.java 2011-11-25 07:10:38 UTC (rev 36652)
@@ -71,4 +71,16 @@
// do nothing
}
+ @Override
+ public void onServerStarted() {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void onServerStopped() {
+ // TODO Auto-generated method stub
+
+ }
+
}
13 years, 1 month