Author: adietish
Date: 2011-04-23 18:51:24 -0400 (Sat, 23 Apr 2011)
New Revision: 30810
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/IJBoss7Manager.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagerProxy.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagerUtil.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManangerException.java
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/JBoss7Manager.java
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/JBossManagerTest.java
Removed:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/IJBoss7DeploymentManager.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/IJBoss7ManagementInterface.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/IJBoss7ManagementService.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagementUtil.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagentServiceProxy.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManangementException.java
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/JBossDeploymentManager.java
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/JBossManagementService.java
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/JBossManagentSerivceTest.java
Modified:
trunk/as/org.jboss.ide.eclipse.as.management.as7.tests/src/org/jboss/ide/eclipse/as/management/as7/tests/AS7ManagerIntegrationTest.java
trunk/as/org.jboss.ide.eclipse.as.management.as7.tests/src/org/jboss/ide/eclipse/as/management/as7/tests/AS7ManagerTestUtils.java
trunk/as/org.jboss.ide.eclipse.as.management.as7.tests/src/org/jboss/ide/eclipse/as/management/as7/tests/DetypedDeployerIntegrationTest.java
trunk/as/org.jboss.ide.eclipse.as.management.as7.tests/src/org/jboss/ide/eclipse/as/management/as7/tests/JBossManagementServiceIntegrationTest.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/IJBoss7DeploymentResult.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7JSTPublisher.java
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/META-INF/jboss-management-service.xml
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/AS7Manager.java
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/AS7ManagerUtil.java
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/DeploymentOperationResult.java
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/DetypedDeployer.java
Log:
[JBIDE-8784] removed distinction between manager and deployer
Modified:
trunk/as/org.jboss.ide.eclipse.as.management.as7.tests/src/org/jboss/ide/eclipse/as/management/as7/tests/AS7ManagerIntegrationTest.java
===================================================================
---
trunk/as/org.jboss.ide.eclipse.as.management.as7.tests/src/org/jboss/ide/eclipse/as/management/as7/tests/AS7ManagerIntegrationTest.java 2011-04-23
21:56:54 UTC (rev 30809)
+++
trunk/as/org.jboss.ide.eclipse.as.management.as7.tests/src/org/jboss/ide/eclipse/as/management/as7/tests/AS7ManagerIntegrationTest.java 2011-04-23
22:51:24 UTC (rev 30810)
@@ -22,7 +22,7 @@
import java.util.concurrent.ExecutionException;
import org.jboss.ide.eclipse.as.core.server.internal.v7.JBoss7DeploymentState;
-import org.jboss.ide.eclipse.as.core.server.internal.v7.JBoss7ManangementException;
+import org.jboss.ide.eclipse.as.core.server.internal.v7.JBoss7ManangerException;
import org.jboss.ide.eclipse.as.management.as7.deployment.AS7Manager;
import org.junit.After;
import org.junit.Before;
@@ -81,7 +81,7 @@
}
@Ignore
- @Test(expected = JBoss7ManangementException.class)
+ @Test(expected = JBoss7ManangerException.class)
public void cannotDeployWarTwice() throws Exception {
File warFile = AS7ManagerTestUtils.getWarFile(AS7ManagerTestUtils.MINIMALISTIC_WAR);
try {
@@ -93,8 +93,8 @@
}
@Ignore
- @Test(expected = JBoss7ManangementException.class)
- public void cannotUndeployNondeployed() throws JBoss7ManangementException,
InterruptedException, ExecutionException {
+ @Test(expected = JBoss7ManangerException.class)
+ public void cannotUndeployNondeployed() throws JBoss7ManangerException,
InterruptedException, ExecutionException {
AS7ManagerTestUtils.waitUntilFinished(manager.undeploy("inexistant"));
}
@@ -117,7 +117,7 @@
}
@Test
- public void getEnabledStateIfDeploymentIsDeployed() throws URISyntaxException,
IOException, JBoss7ManangementException {
+ public void getEnabledStateIfDeploymentIsDeployed() throws URISyntaxException,
IOException, JBoss7ManangerException {
String deploymentName = "testDeployment";
File warFile = AS7ManagerTestUtils.getWarFile(AS7ManagerTestUtils.MINIMALISTIC_WAR);
try {
@@ -131,7 +131,7 @@
}
@Test
- public void getDisabledStateIfDeploymentIsOnlyAdded() throws URISyntaxException,
IOException, JBoss7ManangementException {
+ public void getDisabledStateIfDeploymentIsOnlyAdded() throws URISyntaxException,
IOException, JBoss7ManangerException {
String deploymentName = "testDeployment";
File warFile = AS7ManagerTestUtils.getWarFile(AS7ManagerTestUtils.MINIMALISTIC_WAR);
try {
@@ -144,8 +144,8 @@
}
}
- @Test(expected = JBoss7ManangementException.class)
- public void getErrorIfDeploymentIsNotDeployed() throws URISyntaxException, IOException,
JBoss7ManangementException {
+ @Test(expected = JBoss7ManangerException.class)
+ public void getErrorIfDeploymentIsNotDeployed() throws URISyntaxException, IOException,
JBoss7ManangerException {
String deploymentName = "testDeployment";
try {
manager.getDeploymentState(deploymentName);
Modified:
trunk/as/org.jboss.ide.eclipse.as.management.as7.tests/src/org/jboss/ide/eclipse/as/management/as7/tests/AS7ManagerTestUtils.java
===================================================================
---
trunk/as/org.jboss.ide.eclipse.as.management.as7.tests/src/org/jboss/ide/eclipse/as/management/as7/tests/AS7ManagerTestUtils.java 2011-04-23
21:56:54 UTC (rev 30809)
+++
trunk/as/org.jboss.ide.eclipse.as.management.as7.tests/src/org/jboss/ide/eclipse/as/management/as7/tests/AS7ManagerTestUtils.java 2011-04-23
22:51:24 UTC (rev 30810)
@@ -22,7 +22,7 @@
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.Platform;
-import org.jboss.ide.eclipse.as.core.server.internal.v7.JBoss7ManangementException;
+import org.jboss.ide.eclipse.as.core.server.internal.v7.JBoss7ManangerException;
import org.jboss.ide.eclipse.as.core.server.internal.v7.IJBoss7DeploymentResult;
import org.jboss.ide.eclipse.as.management.as7.deployment.AS7Manager;
import org.osgi.framework.Bundle;
@@ -78,7 +78,7 @@
}
}
- public static void waitUntilFinished(IJBoss7DeploymentResult result) throws
JBoss7ManangementException {
+ public static void waitUntilFinished(IJBoss7DeploymentResult result) throws
JBoss7ManangerException {
result.getStatus(); // wait for operation to finish
}
Modified:
trunk/as/org.jboss.ide.eclipse.as.management.as7.tests/src/org/jboss/ide/eclipse/as/management/as7/tests/DetypedDeployerIntegrationTest.java
===================================================================
---
trunk/as/org.jboss.ide.eclipse.as.management.as7.tests/src/org/jboss/ide/eclipse/as/management/as7/tests/DetypedDeployerIntegrationTest.java 2011-04-23
21:56:54 UTC (rev 30809)
+++
trunk/as/org.jboss.ide.eclipse.as.management.as7.tests/src/org/jboss/ide/eclipse/as/management/as7/tests/DetypedDeployerIntegrationTest.java 2011-04-23
22:51:24 UTC (rev 30810)
@@ -18,7 +18,7 @@
import java.io.File;
import java.util.List;
-import org.jboss.ide.eclipse.as.core.server.internal.v7.JBoss7ManangementException;
+import org.jboss.ide.eclipse.as.core.server.internal.v7.JBoss7ManangerException;
import org.jboss.ide.eclipse.as.management.as7.deployment.DetypedDeployer;
import org.junit.Test;
@@ -41,7 +41,7 @@
}
}
- @Test(expected = JBoss7ManangementException.class)
+ @Test(expected = JBoss7ManangerException.class)
public void cannotDeployWarTwice() throws Exception {
File warFile = AS7ManagerTestUtils.getWarFile(AS7ManagerTestUtils.MINIMALISTIC_WAR);
try {
@@ -68,8 +68,8 @@
}
}
- @Test(expected = JBoss7ManangementException.class)
- public void cannotUndeployNondeployed() throws JBoss7ManangementException {
+ @Test(expected = JBoss7ManangerException.class)
+ public void cannotUndeployNondeployed() throws JBoss7ManangerException {
DetypedDeployer.undeploy("inexistant", AS7ManagerTestUtils.HOST,
AS7ManagerTestUtils.MGMT_PORT);
}
Modified:
trunk/as/org.jboss.ide.eclipse.as.management.as7.tests/src/org/jboss/ide/eclipse/as/management/as7/tests/JBossManagementServiceIntegrationTest.java
===================================================================
---
trunk/as/org.jboss.ide.eclipse.as.management.as7.tests/src/org/jboss/ide/eclipse/as/management/as7/tests/JBossManagementServiceIntegrationTest.java 2011-04-23
21:56:54 UTC (rev 30809)
+++
trunk/as/org.jboss.ide.eclipse.as.management.as7.tests/src/org/jboss/ide/eclipse/as/management/as7/tests/JBossManagementServiceIntegrationTest.java 2011-04-23
22:51:24 UTC (rev 30810)
@@ -14,7 +14,7 @@
import java.net.UnknownHostException;
-import org.jboss.ide.eclipse.as.core.server.internal.v7.IJBoss7ManagementService;
+import org.jboss.ide.eclipse.as.core.server.internal.v7.IJBoss7Manager;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@@ -43,10 +43,10 @@
public void serviceIsReachable() throws BundleException {
ensureDSIsRunning();
BundleContext context = Activator.getContext();
- ServiceReference<IJBoss7ManagementService> reference =
- context.getServiceReference(IJBoss7ManagementService.class);
+ ServiceReference<IJBoss7Manager> reference =
+ context.getServiceReference(IJBoss7Manager.class);
assertNotNull(reference);
- IJBoss7ManagementService service = context.getService(reference);
+ IJBoss7Manager service = context.getService(reference);
assertNotNull(service);
}
@@ -56,7 +56,7 @@
Bundle bundle = getDSBundle();
assertNotNull(
DS_BUNDLEID + " not installed. You have to install the declarative services
daemon so that "
- + IJBoss7ManagementService.class + " service is registered"
+ + IJBoss7Manager.class + " service is registered"
, bundle);
if (bundle.getState() != Bundle.ACTIVE) {
bundle.start();
Deleted:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/IJBoss7DeploymentManager.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/IJBoss7DeploymentManager.java 2011-04-23
21:56:54 UTC (rev 30809)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/IJBoss7DeploymentManager.java 2011-04-23
22:51:24 UTC (rev 30810)
@@ -1,100 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.ide.eclipse.as.core.server.internal.v7;
-
-import java.io.File;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-
-/**
- *
- * This class is interim API and may change drastically
- * as development on the application server continues.
- * I expect credentials to be required eventually,
- * and the API will need to adjust to handle them.
- *
- */
-public interface IJBoss7DeploymentManager {
- /**
- * Asynchronously deploy a file to a server
- *
- * @param host The host
- * @param port The port
- * @param name The deployment's name
- * @param file The file to be deployed
- * @param monitor The progress monitor
- *
- * @return Not sure what to return yet
- * @throws Exception
- */
- public IJBoss7DeploymentResult deployAsync(String host, int port,
- String deploymentName, File file, IProgressMonitor monitor) throws Exception;
-
- /**
- * Synchronously deploy a file to a server
- *
- * @param host The host
- * @param port The port
- * @param name The deployment's name
- * @param file The file to be deployed
- * @param monitor The progress monitor
- *
- * @return Not sure what to return yet
- * @throws Exception
- */
- public IJBoss7DeploymentResult deploySync(String host, int port,
- String deploymentName, File file, IProgressMonitor monitor) throws Exception;
-
-
- /**
- * Asynchronously undeploy a file to a server
- *
- * @param host The host
- * @param port The port
- * @param name The deployment's name
- * @param file The file to be deployed
- * @param monitor The progress monitor
- *
- * @return Not sure what to return yet
- * @throws Exception
- */
- public IJBoss7DeploymentResult undeployAsync(String host, int port,
- String deploymentName, boolean removeFile, IProgressMonitor monitor) throws
Exception;
-
-
- /**
- * Synchronously undeploy a file to a server
- *
- * @param host The host
- * @param port The port
- * @param name The deployment's name
- * @param file The file to be deployed
- * @param monitor The progress monitor
- *
- * @return Not sure what to return yet
- * @throws Exception
- */
- public IJBoss7DeploymentResult syncUndeploy(String host, int port,
- String deploymentName, boolean removeFile, IProgressMonitor monitor) throws
Exception;
-
- /**
- * Returns the state for a given deployment name on a given host and port.
- *
- * @param host the host to query
- * @param port the port to contact it on
- * @param deploymentName the name of the deployment that shall be queried
- *
- * @return the state of the deployment
- * @throws Exception
- */
- public JBoss7DeploymentState getDeploymentState(String host, int port, String
deploymentName) throws Exception;
-
-}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/IJBoss7DeploymentResult.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/IJBoss7DeploymentResult.java 2011-04-23
21:56:54 UTC (rev 30809)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/IJBoss7DeploymentResult.java 2011-04-23
22:51:24 UTC (rev 30810)
@@ -14,6 +14,6 @@
public interface IJBoss7DeploymentResult {
- public abstract IStatus getStatus() throws JBoss7ManangementException;
+ public abstract IStatus getStatus() throws JBoss7ManangerException;
}
\ No newline at end of file
Deleted:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/IJBoss7ManagementInterface.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/IJBoss7ManagementInterface.java 2011-04-23
21:56:54 UTC (rev 30809)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/IJBoss7ManagementInterface.java 2011-04-23
22:51:24 UTC (rev 30810)
@@ -1,19 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.ide.eclipse.as.core.server.internal.v7;
-
-public interface IJBoss7ManagementInterface {
- /**
- * Need a method to build a request...
- * we can't just expose the entire ModelNode api, but,
- * we need a good way for them to be able to build such nodes
- */
-}
Deleted:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/IJBoss7ManagementService.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/IJBoss7ManagementService.java 2011-04-23
21:56:54 UTC (rev 30809)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/IJBoss7ManagementService.java 2011-04-23
22:51:24 UTC (rev 30810)
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.ide.eclipse.as.core.server.internal.v7;
-
-/**
- * This class may belong in the main JBoss AS core plugin,
- * in case several different plugins need to implement it
- */
-public interface IJBoss7ManagementService {
-
- public static final String AS_VERSION_PROPERTY = "as.version"; //$NON-NLS-1$
-
- public static final String AS_VERSION_700 = "700"; //$NON-NLS-1$
-
- /**
- * Get a manager which can be responsible *only* for
- * deployments, both synchronously and asynchronously.
- * @return
- */
- public IJBoss7DeploymentManager getDeploymentManager() throws
JBoss7ManangementException;
-
- /**
- * Get an interface which can handle executing any and all remote
- * management tasks via wrappers of more raw APIs.
- *
- * @return
- */
- public IJBoss7ManagementInterface getManagementInterface() throws
JBoss7ManangementException;
-}
Copied:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/IJBoss7Manager.java
(from rev 30808,
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/IJBoss7ManagementService.java)
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/IJBoss7Manager.java
(rev 0)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/IJBoss7Manager.java 2011-04-23
22:51:24 UTC (rev 30810)
@@ -0,0 +1,95 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.ide.eclipse.as.core.server.internal.v7;
+
+import java.io.File;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+
+public interface IJBoss7Manager {
+
+ public static final String AS_VERSION_PROPERTY = "as.version"; //$NON-NLS-1$
+
+ public static final String AS_VERSION_700 = "700"; //$NON-NLS-1$
+
+ /**
+ * Asynchronously deploy a file to a server
+ *
+ * @param host The host
+ * @param port The port
+ * @param name The deployment's name
+ * @param file The file to be deployed
+ * @param monitor The progress monitor
+ *
+ * @return Not sure what to return yet
+ * @throws Exception
+ */
+ public IJBoss7DeploymentResult deployAsync(String host, int port,
+ String deploymentName, File file, IProgressMonitor monitor) throws Exception;
+
+ /**
+ * Synchronously deploy a file to a server
+ *
+ * @param host The host
+ * @param port The port
+ * @param name The deployment's name
+ * @param file The file to be deployed
+ * @param monitor The progress monitor
+ *
+ * @return Not sure what to return yet
+ * @throws Exception
+ */
+ public IJBoss7DeploymentResult deploySync(String host, int port,
+ String deploymentName, File file, IProgressMonitor monitor) throws Exception;
+
+ /**
+ * Asynchronously undeploy a file to a server
+ *
+ * @param host The host
+ * @param port The port
+ * @param name The deployment's name
+ * @param file The file to be deployed
+ * @param monitor The progress monitor
+ *
+ * @return Not sure what to return yet
+ * @throws Exception
+ */
+ public IJBoss7DeploymentResult undeployAsync(String host, int port,
+ String deploymentName, boolean removeFile, IProgressMonitor monitor) throws
Exception;
+
+ /**
+ * Synchronously undeploy a file to a server
+ *
+ * @param host The host
+ * @param port The port
+ * @param name The deployment's name
+ * @param file The file to be deployed
+ * @param monitor The progress monitor
+ *
+ * @return Not sure what to return yet
+ * @throws Exception
+ */
+ public IJBoss7DeploymentResult syncUndeploy(String host, int port,
+ String deploymentName, boolean removeFile, IProgressMonitor monitor) throws
Exception;
+
+ /**
+ * Returns the state for a given deployment name on a given host and port.
+ *
+ * @param host the host to query
+ * @param port the port to contact it on
+ * @param deploymentName the name of the deployment that shall be queried
+ *
+ * @return the state of the deployment
+ * @throws Exception
+ */
+ public JBoss7DeploymentState getDeploymentState(String host, int port, String
deploymentName) throws Exception;
+
+}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7JSTPublisher.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7JSTPublisher.java 2011-04-23
21:56:54 UTC (rev 30809)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7JSTPublisher.java 2011-04-23
22:51:24 UTC (rev 30810)
@@ -58,7 +58,7 @@
IServer server, IModule[] module,
int publishType, IModuleResourceDelta[] delta,
IProgressMonitor monitor) throws CoreException {
- //IJBoss7ManagementService service =
JBoss7ManagementUtil.findManagementService(server);
+ //IJBoss7Manager service = JBoss7ManagerUtil.findManagementService(server);
// jboss-7 specific
IDeployableServer ds = ServerConverter.getDeployableServer(server);
Deleted:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagementUtil.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagementUtil.java 2011-04-23
21:56:54 UTC (rev 30809)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagementUtil.java 2011-04-23
22:51:24 UTC (rev 30810)
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.ide.eclipse.as.core.server.internal.v7;
-
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.eclipse.wst.server.core.IServer;
-import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.framework.ServiceReference;
-
-public class JBoss7ManagementUtil {
-
- public static final String SERVICE_VERSION_70 =
"org.jboss.ide.eclipse.as.management.as7.service"; //$NON-NLS-1$
-
- public static IJBoss7ManagementService findManagementService(IServer server) {
- BundleContext context = JBossServerCorePlugin.getContext();
-
- // String tmp = "org.jboss.ide.eclipse.as.management.as7.service";
//$NON-NLS-1$
- // String clazz =
"org.jboss.ide.eclipse.as.management.as7.deployment.JBossManagementService";
//$NON-NLS-1$
- // String iface = "IJBoss7ManagementService"; //$NON-NLS-1$
- // String clazz3 = "org.jboss.ide.eclipse.as.core.server.internal.v7." +
iface; //$NON-NLS-1$
- String requiredService = getRequiredServiceName(server);
- if (requiredService == null)
- return null;
-
- try {
- Collection<ServiceReference<IJBoss7ManagementService>> references =
context.getServiceReferences(
- IJBoss7ManagementService.class, null);
- for (Iterator<ServiceReference<IJBoss7ManagementService>> iterator =
references.iterator();
- iterator.hasNext();) {
- ServiceReference<IJBoss7ManagementService> reference = iterator.next();
- Object compName = reference.getProperty("component.name"); //$NON-NLS-1$
- if (requiredService.equals(compName)) {
- return context.getService(reference);
- }
- }
- } catch (InvalidSyntaxException ise) {
- }
- return null;
- }
-
- private static String getRequiredServiceName(IServer s) {
- // TODO if required, make sure to add new versions here
- return SERVICE_VERSION_70;
- }
-}
Deleted:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagentServiceProxy.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagentServiceProxy.java 2011-04-23
21:56:54 UTC (rev 30809)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagentServiceProxy.java 2011-04-23
22:51:24 UTC (rev 30810)
@@ -1,35 +0,0 @@
-package org.jboss.ide.eclipse.as.core.server.internal.v7;
-
-import java.text.MessageFormat;
-
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.util.tracker.ServiceTracker;
-
-public class JBoss7ManagentServiceProxy extends
ServiceTracker<IJBoss7ManagementService, IJBoss7ManagementService>
- implements IJBoss7ManagementService {
-
- public JBoss7ManagentServiceProxy(BundleContext context, String asVersion) throws
InvalidSyntaxException {
- super(
- context,
- context.createFilter(MessageFormat
- .format("(&(objectClass={0})(as.version={1}))",
IJBoss7ManagementService.class.getCanonicalName(), asVersion)), null); //$NON-NLS-1$
- }
-
- public IJBoss7DeploymentManager getDeploymentManager() throws JBoss7ManangementException
{
-
- return checkedGetService().getDeploymentManager();
- }
-
- public IJBoss7ManagementInterface getManagementInterface() throws
JBoss7ManangementException {
- return checkedGetService().getManagementInterface();
- }
-
- private IJBoss7ManagementService checkedGetService() throws JBoss7ManangementException
{
- IJBoss7ManagementService service = getService();
- if (service == null) {
- throw new JBoss7ManangementException("Could not acquire JBoss Management
service"); //$NON-NLS-1$
- }
- return service;
- }
-}
Copied:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagerProxy.java
(from rev 30809,
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagentServiceProxy.java)
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagerProxy.java
(rev 0)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagerProxy.java 2011-04-23
22:51:24 UTC (rev 30810)
@@ -0,0 +1,53 @@
+package org.jboss.ide.eclipse.as.core.server.internal.v7;
+
+import java.io.File;
+import java.text.MessageFormat;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.util.tracker.ServiceTracker;
+
+public class JBoss7ManagerProxy extends ServiceTracker<IJBoss7Manager,
IJBoss7Manager>
+ implements IJBoss7Manager {
+
+ public JBoss7ManagerProxy(BundleContext context, String asVersion) throws
InvalidSyntaxException {
+ super(
+ context,
+ context.createFilter(MessageFormat
+ .format("(&(objectClass={0})(as.version={1}))",
IJBoss7Manager.class.getCanonicalName(), asVersion)), null); //$NON-NLS-1$
+ }
+
+ public IJBoss7DeploymentResult deployAsync(String host, int port, String deploymentName,
File file,
+ IProgressMonitor monitor) throws Exception {
+ return checkedGetService().deployAsync(host, port, deploymentName, file, monitor);
+ }
+
+ public IJBoss7DeploymentResult deploySync(String host, int port, String deploymentName,
File file,
+ IProgressMonitor monitor) throws Exception {
+ return checkedGetService().deployAsync(host, port, deploymentName, file, monitor);
+ }
+
+ public IJBoss7DeploymentResult undeployAsync(String host, int port, String
deploymentName, boolean removeFile,
+ IProgressMonitor monitor) throws Exception {
+ return checkedGetService().undeployAsync(host, port, deploymentName, removeFile,
monitor);
+ }
+
+ public IJBoss7DeploymentResult syncUndeploy(String host, int port, String
deploymentName, boolean removeFile,
+ IProgressMonitor monitor) throws Exception {
+ return checkedGetService().syncUndeploy(host, port, deploymentName, removeFile,
monitor);
+ }
+
+ public JBoss7DeploymentState getDeploymentState(String host, int port, String
deploymentName) throws Exception {
+ return checkedGetService().getDeploymentState(host, port, deploymentName);
+ }
+
+ private IJBoss7Manager checkedGetService() throws JBoss7ManangerException {
+ IJBoss7Manager service = getService();
+ if (service == null) {
+ throw new JBoss7ManangerException("Could not acquire JBoss Management
service"); //$NON-NLS-1$
+ }
+ return service;
+ }
+
+}
Property changes on:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagerProxy.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Copied:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagerUtil.java
(from rev 30808,
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagementUtil.java)
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagerUtil.java
(rev 0)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagerUtil.java 2011-04-23
22:51:24 UTC (rev 30810)
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.ide.eclipse.as.core.server.internal.v7;
+
+import org.eclipse.wst.server.core.IServer;
+import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
+import org.osgi.framework.BundleContext;
+
+public class JBoss7ManagerUtil {
+
+ public static final String SERVICE_VERSION_70 =
"org.jboss.ide.eclipse.as.management.as7.service"; //$NON-NLS-1$
+
+ public static IJBoss7Manager findManagementService(IServer server) throws Exception {
+ BundleContext context = JBossServerCorePlugin.getContext();
+ return new JBoss7ManagerProxy(context, getRequiredVersion(server));
+ }
+
+ private static String getRequiredVersion(IServer server) {
+ return IJBoss7Manager.AS_VERSION_700;
+ }
+}
Deleted:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManangementException.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManangementException.java 2011-04-23
21:56:54 UTC (rev 30809)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManangementException.java 2011-04-23
22:51:24 UTC (rev 30810)
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * 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
- *******************************************************************************/
-package org.jboss.ide.eclipse.as.core.server.internal.v7;
-
-/**
- * @author André Dietisheim
- */
-public class JBoss7ManangementException extends Exception {
-
- private static final long serialVersionUID = 1L;
-
- public JBoss7ManangementException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public JBoss7ManangementException(Throwable cause) {
- super(cause);
- }
-
- public JBoss7ManangementException(String message) {
- super(message);
- }
-
-}
Copied:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManangerException.java
(from rev 30773,
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManangementException.java)
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManangerException.java
(rev 0)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManangerException.java 2011-04-23
22:51:24 UTC (rev 30810)
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+package org.jboss.ide.eclipse.as.core.server.internal.v7;
+
+/**
+ * @author André Dietisheim
+ */
+public class JBoss7ManangerException extends Exception {
+
+ private static final long serialVersionUID = 1L;
+
+ public JBoss7ManangerException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ public JBoss7ManangerException(Throwable cause) {
+ super(cause);
+ }
+
+ public JBoss7ManangerException(String message) {
+ super(message);
+ }
+
+}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/META-INF/jboss-management-service.xml
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/META-INF/jboss-management-service.xml 2011-04-23
21:56:54 UTC (rev 30809)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/META-INF/jboss-management-service.xml 2011-04-23
22:51:24 UTC (rev 30810)
@@ -1,8 +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.management.as7.deployment.JBossManagementService"/>
+ <implementation
class="org.jboss.ide.eclipse.as.management.as7.deployment.JBoss7Manager"/>
<service>
- <provide
interface="org.jboss.ide.eclipse.as.core.server.internal.v7.IJBoss7ManagementService"/>
+ <provide
interface="org.jboss.ide.eclipse.as.core.server.internal.v7.IJBoss7Manager"/>
</service>
<property name="as.version" type="String"
value="700"/>
</scr:component>
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/AS7Manager.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/AS7Manager.java 2011-04-23
21:56:54 UTC (rev 30809)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/AS7Manager.java 2011-04-23
22:51:24 UTC (rev 30810)
@@ -33,7 +33,7 @@
import org.jboss.as.protocol.StreamUtils;
import org.jboss.dmr.ModelNode;
import org.jboss.ide.eclipse.as.core.server.internal.v7.JBoss7DeploymentState;
-import org.jboss.ide.eclipse.as.core.server.internal.v7.JBoss7ManangementException;
+import org.jboss.ide.eclipse.as.core.server.internal.v7.JBoss7ManangerException;
import org.jboss.ide.eclipse.as.core.server.internal.v7.IJBoss7DeploymentResult;
/**
@@ -50,72 +50,72 @@
}
public IJBoss7DeploymentResult undeploySync(String name, IProgressMonitor monitor)
- throws JBoss7ManangementException {
+ throws JBoss7ManangerException {
IJBoss7DeploymentResult result = undeploy(name);
result.getStatus();
return result;
}
public IJBoss7DeploymentResult deploySync(String name, File file, IProgressMonitor
monitor)
- throws JBoss7ManangementException {
+ throws JBoss7ManangerException {
IJBoss7DeploymentResult result = deploy(name, file);
result.getStatus();
return result;
}
- public IJBoss7DeploymentResult undeploy(String name) throws JBoss7ManangementException
{
+ 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 JBoss7ManangementException(e);
+ throw new JBoss7ManangerException(e);
}
}
- public IJBoss7DeploymentResult remove(String name) throws JBoss7ManangementException {
+ 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 JBoss7ManangementException(e);
+ throw new JBoss7ManangerException(e);
}
}
- public IJBoss7DeploymentResult deploy(File file) throws JBoss7ManangementException {
+ public IJBoss7DeploymentResult deploy(File file) throws JBoss7ManangerException {
return deploy(file.getName(), file);
}
- public IJBoss7DeploymentResult add(String name, File file) throws
JBoss7ManangementException {
+ public IJBoss7DeploymentResult add(String name, File file) throws
JBoss7ManangerException {
try {
return execute(manager.newDeploymentPlan().add(name, file));
} catch (IOException e) {
- throw new JBoss7ManangementException(e);
+ throw new JBoss7ManangerException(e);
}
}
- public IJBoss7DeploymentResult deploy(String name, File file) throws
JBoss7ManangementException {
+ public IJBoss7DeploymentResult deploy(String name, File file) throws
JBoss7ManangerException {
try {
return execute(manager.newDeploymentPlan().add(name, file).andDeploy());
} catch (IOException e) {
- throw new JBoss7ManangementException(e);
+ throw new JBoss7ManangerException(e);
}
}
- public IJBoss7DeploymentResult replace(File file) throws JBoss7ManangementException {
+ public IJBoss7DeploymentResult replace(File file) throws JBoss7ManangerException {
return replace(file.getName(), file);
}
- public IJBoss7DeploymentResult replace(String name, File file) throws
JBoss7ManangementException {
+ public IJBoss7DeploymentResult replace(String name, File file) throws
JBoss7ManangerException {
try {
return execute(manager.newDeploymentPlan().replace(name, file));
} catch (IOException e) {
- throw new JBoss7ManangementException(e);
+ throw new JBoss7ManangerException(e);
}
}
- public JBoss7DeploymentState getDeploymentState(String name) throws
JBoss7ManangementException {
+ public JBoss7DeploymentState getDeploymentState(String name) throws
JBoss7ManangerException {
ModelNode request = new ModelNode();
request.get(OP).set(READ_RESOURCE_OPERATION);
request.get(ADDRESS).add(DEPLOYMENT, name);
@@ -123,7 +123,7 @@
Boolean enabled = AS7ManagerUtil.getBooleanProperty(ENABLED, result);
if (enabled == null) {
- throw new JBoss7ManangementException(
+ throw new JBoss7ManangerException(
MessageFormat.format("Could not evaluate state for deployment {0}",
name));
} else if (enabled) {
return JBoss7DeploymentState.STARTED;
@@ -137,27 +137,27 @@
StreamUtils.safeClose(client);
}
- private ModelNode execute(ModelNode node) throws JBoss7ManangementException {
+ private ModelNode execute(ModelNode node) throws JBoss7ManangerException {
try {
ModelNode response = client.execute(node);
if (!AS7ManagerUtil.isSuccess(response)) {
- throw new JBoss7ManangementException(
+ throw new JBoss7ManangerException(
MessageFormat.format("Could not execute {0} for {1}. Failure was {2}.",
node.get(OP),
node.get(ADDRESS), response.get(FAILURE_DESCRIPTION)));
}
return response.get(RESULT);
} catch (Exception e) {
- throw new JBoss7ManangementException(e);
+ throw new JBoss7ManangerException(e);
}
}
- private IJBoss7DeploymentResult execute(DeploymentPlanBuilder builder) throws
JBoss7ManangementException {
+ 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 JBoss7ManangementException(e);
+ throw new JBoss7ManangerException(e);
}
}
}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/AS7ManagerUtil.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/AS7ManagerUtil.java 2011-04-23
21:56:54 UTC (rev 30809)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/AS7ManagerUtil.java 2011-04-23
22:51:24 UTC (rev 30810)
@@ -28,7 +28,7 @@
import org.jboss.dmr.ModelNode;
import org.jboss.dmr.ModelType;
import org.jboss.dmr.Property;
-import org.jboss.ide.eclipse.as.core.server.internal.v7.JBoss7ManangementException;
+import org.jboss.ide.eclipse.as.core.server.internal.v7.JBoss7ManangerException;
import org.jboss.ide.eclipse.as.management.as7.internal.DefaultOperationRequestBuilder;
import org.jboss.ide.eclipse.as.management.as7.internal.OperationFormatException;
@@ -138,7 +138,7 @@
return Boolean.valueOf(value);
}
- public static ModelNode execute(Operation operation, ModelControllerClient client)
throws JBoss7ManangementException {
+ public static ModelNode execute(Operation operation, ModelControllerClient client)
throws JBoss7ManangerException {
try {
ModelNode result = client.execute(operation);
if (result.hasDefined(OUTCOME)
@@ -146,13 +146,13 @@
return result.get(RESULT);
}
else if (result.hasDefined(FAILURE_DESCRIPTION)) {
- throw new JBoss7ManangementException(result.get(FAILURE_DESCRIPTION).toString());
+ throw new JBoss7ManangerException(result.get(FAILURE_DESCRIPTION).toString());
}
else {
- throw new JBoss7ManangementException("Operation outcome is " +
result.get(OUTCOME).asString());
+ throw new JBoss7ManangerException("Operation outcome is " +
result.get(OUTCOME).asString());
}
} catch (IOException e) {
- throw new JBoss7ManangementException(e);
+ throw new JBoss7ManangerException(e);
}
}
}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/DeploymentOperationResult.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/DeploymentOperationResult.java 2011-04-23
21:56:54 UTC (rev 30809)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/DeploymentOperationResult.java 2011-04-23
22:51:24 UTC (rev 30810)
@@ -19,7 +19,7 @@
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.internal.v7.JBoss7ManangementException;
+import org.jboss.ide.eclipse.as.core.server.internal.v7.JBoss7ManangerException;
import org.jboss.ide.eclipse.as.core.server.internal.v7.IJBoss7DeploymentResult;
import org.jboss.ide.eclipse.as.management.as7.Activator;
@@ -45,12 +45,12 @@
* @see
org.jboss.ide.eclipse.as.management.as7.deployment.IDeploymentResult#getStatus()
*/
@Override
- public IStatus getStatus() throws JBoss7ManangementException {
+ 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 JBoss7ManangementException(e);
+ throw new JBoss7ManangerException(e);
}
}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/DetypedDeployer.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/DetypedDeployer.java 2011-04-23
21:56:54 UTC (rev 30809)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/DetypedDeployer.java 2011-04-23
22:51:24 UTC (rev 30810)
@@ -32,14 +32,14 @@
import org.jboss.as.controller.client.OperationBuilder;
import org.jboss.as.protocol.StreamUtils;
import org.jboss.dmr.ModelNode;
-import org.jboss.ide.eclipse.as.core.server.internal.v7.JBoss7ManangementException;
+import org.jboss.ide.eclipse.as.core.server.internal.v7.JBoss7ManangerException;
/**
* @author André Dietisheim
*/
public class DetypedDeployer {
- public static void undeploy(String name, String host, int port) throws
JBoss7ManangementException {
+ public static void undeploy(String name, String host, int port) throws
JBoss7ManangerException {
ModelControllerClient client = null;
try {
client = ModelControllerClient.Factory.create(host, port);
@@ -53,13 +53,13 @@
remove(name, host, port);
} catch (Exception e) {
- throw new JBoss7ManangementException(e);
+ throw new JBoss7ManangerException(e);
} finally {
StreamUtils.safeClose(client);
}
}
- public static void remove(String name, String host, int port) throws
JBoss7ManangementException {
+ public static void remove(String name, String host, int port) throws
JBoss7ManangerException {
ModelControllerClient client = null;
try {
client = ModelControllerClient.Factory.create(host, port);
@@ -70,17 +70,17 @@
request.get(ADDRESS).add(DEPLOYMENT, name);
client.execute(request);
} catch (Exception e) {
- throw new JBoss7ManangementException(e);
+ throw new JBoss7ManangerException(e);
} finally {
StreamUtils.safeClose(client);
}
}
- public static void deploy(File file, String host, int port) throws
JBoss7ManangementException {
+ public static void deploy(File file, String host, int port) throws
JBoss7ManangerException {
deploy(file.getName(), file, host, port);
}
- public static void deploy(String name, File file, String host, int port) throws
JBoss7ManangementException {
+ public static void deploy(String name, File file, String host, int port) throws
JBoss7ManangerException {
ModelControllerClient client = null;
try {
client = ModelControllerClient.Factory.create(host, port);
@@ -100,13 +100,13 @@
throwOnFailure(result);
} catch (Exception e) {
- throw new JBoss7ManangementException(e);
+ throw new JBoss7ManangerException(e);
} finally {
StreamUtils.safeClose(client);
}
}
- public static void replace(String name, File file, String host, int port) throws
JBoss7ManangementException {
+ public static void replace(String name, File file, String host, int port) throws
JBoss7ManangerException {
ModelControllerClient client = null;
try {
client = ModelControllerClient.Factory.create(host, port);
@@ -124,7 +124,7 @@
throwOnFailure(result);
} catch (Exception e) {
- throw new JBoss7ManangementException(e);
+ throw new JBoss7ManangerException(e);
} finally {
StreamUtils.safeClose(client);
}
@@ -144,9 +144,9 @@
return AS7ManagerUtil.getDeployments(client);
}
- private static void throwOnFailure(ModelNode result) throws JBoss7ManangementException
{
+ private static void throwOnFailure(ModelNode result) throws JBoss7ManangerException {
if (!AS7ManagerUtil.isSuccess(result)) {
- throw new JBoss7ManangementException(AS7ManagerUtil.getFailureDescription(result));
+ throw new JBoss7ManangerException(AS7ManagerUtil.getFailureDescription(result));
}
}
Copied:
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/JBoss7Manager.java
(from rev 30804,
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/JBossDeploymentManager.java)
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/JBoss7Manager.java
(rev 0)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/JBoss7Manager.java 2011-04-23
22:51:24 UTC (rev 30810)
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.ide.eclipse.as.management.as7.deployment;
+
+import java.io.File;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.jboss.ide.eclipse.as.core.server.internal.v7.IJBoss7DeploymentResult;
+import org.jboss.ide.eclipse.as.core.server.internal.v7.IJBoss7Manager;
+import org.jboss.ide.eclipse.as.core.server.internal.v7.JBoss7DeploymentState;
+
+/**
+ * @author Rob Stryker
+ */
+public class JBoss7Manager implements IJBoss7Manager {
+
+ public IJBoss7DeploymentResult deployAsync(String host, int port, String
deploymentName,
+ File file, IProgressMonitor monitor) throws Exception {
+ AS7Manager manager = new AS7Manager(host, port);
+ return manager.deploy(deploymentName, file);
+ }
+
+ public IJBoss7DeploymentResult deploySync(String host, int port, String deploymentName,
+ File file, IProgressMonitor monitor) throws Exception {
+ AS7Manager manager = new AS7Manager(host, port);
+ return manager.deploySync(deploymentName, file, monitor);
+ }
+
+ public IJBoss7DeploymentResult undeployAsync(String host, int port, String
deploymentName,
+ boolean removeFile, IProgressMonitor monitor) throws Exception {
+ AS7Manager manager = new AS7Manager(host, port);
+ return manager.undeploy(deploymentName);
+ }
+
+ public IJBoss7DeploymentResult syncUndeploy(String host, int port, String
deploymentName,
+ boolean removeFile, IProgressMonitor monitor) throws Exception {
+ AS7Manager manager = new AS7Manager(host, port);
+ return manager.undeploySync(deploymentName, monitor);
+ }
+
+ public JBoss7DeploymentState getDeploymentState(String host, int port, String
deploymentName) throws Exception {
+ AS7Manager manager = new AS7Manager(host, port);
+ return manager.getDeploymentState(deploymentName);
+ }
+}
Deleted:
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/JBossDeploymentManager.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/JBossDeploymentManager.java 2011-04-23
21:56:54 UTC (rev 30809)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/JBossDeploymentManager.java 2011-04-23
22:51:24 UTC (rev 30810)
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.ide.eclipse.as.management.as7.deployment;
-
-import java.io.File;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.jboss.ide.eclipse.as.core.server.internal.v7.IJBoss7DeploymentManager;
-import org.jboss.ide.eclipse.as.core.server.internal.v7.IJBoss7DeploymentResult;
-import org.jboss.ide.eclipse.as.core.server.internal.v7.JBoss7DeploymentState;
-
-/**
- * @author Rob Stryker
- */
-public class JBossDeploymentManager implements IJBoss7DeploymentManager {
-
- public IJBoss7DeploymentResult deployAsync(String host, int port, String
deploymentName,
- File file, IProgressMonitor monitor) throws Exception {
- AS7Manager manager = new AS7Manager(host, port);
- return manager.deploy(deploymentName, file);
- }
-
- public IJBoss7DeploymentResult deploySync(String host, int port, String deploymentName,
- File file, IProgressMonitor monitor) throws Exception {
- AS7Manager manager = new AS7Manager(host, port);
- return manager.deploySync(deploymentName, file, monitor);
- }
-
- public IJBoss7DeploymentResult undeployAsync(String host, int port, String
deploymentName,
- boolean removeFile, IProgressMonitor monitor) throws Exception {
- AS7Manager manager = new AS7Manager(host, port);
- return manager.undeploy(deploymentName);
- }
-
- public IJBoss7DeploymentResult syncUndeploy(String host, int port, String
deploymentName,
- boolean removeFile, IProgressMonitor monitor) throws Exception {
- AS7Manager manager = new AS7Manager(host, port);
- return manager.undeploySync(deploymentName, monitor);
- }
-
- public JBoss7DeploymentState getDeploymentState(String host, int port, String
deploymentName) throws Exception {
- AS7Manager manager = new AS7Manager(host, port);
- return manager.getDeploymentState(deploymentName);
-
- }
-}
Deleted:
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/JBossManagementService.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/JBossManagementService.java 2011-04-23
21:56:54 UTC (rev 30809)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/JBossManagementService.java 2011-04-23
22:51:24 UTC (rev 30810)
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.ide.eclipse.as.management.as7.deployment;
-
-import org.jboss.ide.eclipse.as.core.server.internal.v7.IJBoss7DeploymentManager;
-import org.jboss.ide.eclipse.as.core.server.internal.v7.IJBoss7ManagementInterface;
-import org.jboss.ide.eclipse.as.core.server.internal.v7.IJBoss7ManagementService;
-
-/**
- * @author Rob Stryker
- */
-public class JBossManagementService implements IJBoss7ManagementService {
-
- private IJBoss7DeploymentManager deploymentManager = null;
- private IJBoss7ManagementInterface manager = null;
-
- public IJBoss7DeploymentManager getDeploymentManager() {
- if( deploymentManager == null )
- deploymentManager = new JBossDeploymentManager();
- return deploymentManager;
- }
-
- public IJBoss7ManagementInterface getManagementInterface() {
- // TODO Auto-generated method stub
- return null;
- }
-}
Deleted:
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/JBossManagentSerivceTest.java
===================================================================
---
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/JBossManagentSerivceTest.java 2011-04-23
21:56:54 UTC (rev 30809)
+++
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/JBossManagentSerivceTest.java 2011-04-23
22:51:24 UTC (rev 30810)
@@ -1,72 +0,0 @@
-package org.jboss.ide.eclipse.as.test.server;
-
-import static org.junit.Assert.assertNotNull;
-
-import java.util.Dictionary;
-import java.util.Hashtable;
-
-import org.jboss.ide.eclipse.as.core.server.internal.v7.IJBoss7DeploymentManager;
-import org.jboss.ide.eclipse.as.core.server.internal.v7.IJBoss7ManagementInterface;
-import org.jboss.ide.eclipse.as.core.server.internal.v7.IJBoss7ManagementService;
-import org.jboss.ide.eclipse.as.core.server.internal.v7.JBoss7ManagentServiceProxy;
-import org.jboss.ide.eclipse.as.core.server.internal.v7.JBoss7ManangementException;
-import org.jboss.ide.eclipse.as.test.ASTest;
-import org.junit.Test;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.InvalidSyntaxException;
-
-public class JBossManagentSerivceTest {
-
- @Test
- public void canUseService() throws JBoss7ManangementException, InvalidSyntaxException {
- BundleContext context = ASTest.getContext();
- JBoss7ManagentServiceProxy serviceProxy = new JBoss7ManagentServiceProxy(context,
- IJBoss7ManagementService.AS_VERSION_700);
- serviceProxy.open();
- IJBoss7DeploymentManager manager = serviceProxy.getDeploymentManager();
- assertNotNull(manager);
- }
-
- @Test
- public void canUseServiceEvenIfAlternativeIsRegistered() throws
JBoss7ManangementException, InvalidSyntaxException {
- BundleContext context = ASTest.getDefault().getBundle().getBundleContext();
- registerFakeASService("710");
- JBoss7ManagentServiceProxy serviceProxy = new JBoss7ManagentServiceProxy(context,
- IJBoss7ManagementService.AS_VERSION_700);
- serviceProxy.open();
- IJBoss7DeploymentManager manager = serviceProxy.getDeploymentManager();
- assertNotNull(manager);
- }
-
- @Test(expected = UnsupportedOperationException.class)
- public void canUseAlternative() throws JBoss7ManangementException,
InvalidSyntaxException {
- BundleContext context = ASTest.getDefault().getBundle().getBundleContext();
- registerFakeASService("710");
- JBoss7ManagentServiceProxy serviceProxy =
- new JBoss7ManagentServiceProxy(context, "710");
- serviceProxy.open();
- IJBoss7DeploymentManager manager = serviceProxy.getDeploymentManager();
- assertNotNull(manager);
- }
-
- private void registerFakeASService(String version) {
- Dictionary<String, String> serviceProperties = new Hashtable<String,
String>();
- serviceProperties.put(IJBoss7ManagementService.AS_VERSION_PROPERTY, version);
- ASTest.getContext().registerService(IJBoss7ManagementService.class, new
JBoss71ManagementService(),
- serviceProperties);
- }
-
- private static class JBoss71ManagementService implements IJBoss7ManagementService {
-
- @Override
- public IJBoss7DeploymentManager getDeploymentManager() throws
JBoss7ManangementException {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public IJBoss7ManagementInterface getManagementInterface() throws
JBoss7ManangementException {
- throw new UnsupportedOperationException();
- }
-
- }
-}
Copied:
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/JBossManagerTest.java
(from rev 30809,
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/JBossManagentSerivceTest.java)
===================================================================
---
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/JBossManagerTest.java
(rev 0)
+++
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/JBossManagerTest.java 2011-04-23
22:51:24 UTC (rev 30810)
@@ -0,0 +1,94 @@
+package org.jboss.ide.eclipse.as.test.server;
+
+import static org.junit.Assert.assertNotNull;
+
+import java.io.File;
+import java.util.Dictionary;
+import java.util.Hashtable;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.jboss.ide.eclipse.as.core.server.internal.v7.IJBoss7DeploymentResult;
+import org.jboss.ide.eclipse.as.core.server.internal.v7.IJBoss7Manager;
+import org.jboss.ide.eclipse.as.core.server.internal.v7.JBoss7DeploymentState;
+import org.jboss.ide.eclipse.as.core.server.internal.v7.JBoss7ManagerProxy;
+import org.jboss.ide.eclipse.as.core.server.internal.v7.JBoss7ManangerException;
+import org.jboss.ide.eclipse.as.test.ASTest;
+import org.junit.Test;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.InvalidSyntaxException;
+
+public class JBossManagerTest {
+
+ @Test
+ public void canUseService() throws JBoss7ManangerException, InvalidSyntaxException {
+ BundleContext context = ASTest.getContext();
+ JBoss7ManagerProxy serviceProxy = new JBoss7ManagerProxy(context,
+ IJBoss7Manager.AS_VERSION_700);
+ serviceProxy.open();
+ IJBoss7Manager manager = serviceProxy.getService();
+ assertNotNull(manager);
+ }
+
+ @Test
+ public void canUseServiceEvenIfAlternativeIsRegistered() throws JBoss7ManangerException,
InvalidSyntaxException {
+ BundleContext context = ASTest.getDefault().getBundle().getBundleContext();
+ registerFakeASService("710");
+ JBoss7ManagerProxy serviceProxy =
+ new JBoss7ManagerProxy(context, IJBoss7Manager.AS_VERSION_700);
+ serviceProxy.open();
+ IJBoss7Manager manager = serviceProxy.getService();
+ assertNotNull(manager);
+ }
+
+ @Test(expected = UnsupportedOperationException.class)
+ public void canUseAlternative() throws Exception {
+ BundleContext context = ASTest.getDefault().getBundle().getBundleContext();
+ registerFakeASService("710");
+ JBoss7ManagerProxy managerProxy =
+ new JBoss7ManagerProxy(context, "710");
+ managerProxy.open();
+ IJBoss7Manager manager = managerProxy.getService();
+ assertNotNull(manager);
+ manager.getDeploymentState("fake", 4242, "fake");
+ }
+
+ private void registerFakeASService(String version) {
+ Dictionary<String, String> serviceProperties = new Hashtable<String,
String>();
+ serviceProperties.put(IJBoss7Manager.AS_VERSION_PROPERTY, version);
+ ASTest.getContext().registerService(IJBoss7Manager.class, new JBoss71Manager(),
+ serviceProperties);
+ }
+
+ private static class JBoss71Manager implements IJBoss7Manager {
+
+ @Override
+ public IJBoss7DeploymentResult deployAsync(String host, int port, String
deploymentName, File file,
+ IProgressMonitor monitor) throws JBoss7ManangerException {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public IJBoss7DeploymentResult deploySync(String host, int port, String deploymentName,
File file,
+ IProgressMonitor monitor) throws JBoss7ManangerException {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public IJBoss7DeploymentResult undeployAsync(String host, int port, String
deploymentName, boolean removeFile,
+ IProgressMonitor monitor) throws JBoss7ManangerException {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public IJBoss7DeploymentResult syncUndeploy(String host, int port, String
deploymentName, boolean removeFile,
+ IProgressMonitor monitor) throws JBoss7ManangerException {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public JBoss7DeploymentState getDeploymentState(String host, int port, String
deploymentName)
+ throws JBoss7ManangerException {
+ throw new UnsupportedOperationException();
+ }
+ }
+}
Property changes on:
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/JBossManagerTest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain