Author: rob.stryker(a)jboss.com
Date: 2011-11-29 09:52:09 -0500 (Tue, 29 Nov 2011)
New Revision: 36730
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/v7/management/AS7ManagementDetails.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IServerStatePoller.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/PollThread.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagerServicePoller.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7BehaviorDelegate.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/JBoss7ManagerServiceProxy.java
trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JMXPoller.java
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.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/JBoss71ManagerService.java
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEJBoss7BehaviourDelegate.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/launch/JBTWebLaunchableClient.java
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/JBossManagerTest.java
Log:
JBIDE-10224 - Changing of the management service API to better handle the situation for
credential callbacks
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IServerStatePoller.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IServerStatePoller.java 2011-11-29
14:13:23 UTC (rev 36729)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IServerStatePoller.java 2011-11-29
14:52:09 UTC (rev 36730)
@@ -15,7 +15,6 @@
import org.eclipse.wst.server.core.IServer;
import org.jboss.ide.eclipse.as.core.extensions.events.IEventCodes;
-import org.jboss.ide.eclipse.as.core.server.internal.PollThread;
import org.jboss.ide.eclipse.as.core.server.internal.ServerStatePollerType;
/**
@@ -55,11 +54,18 @@
/*
* expected to launch own thread
*/
- @Deprecated
- public void beginPolling(IServer server, boolean expectedState, PollThread pt) throws
Exception;
public void beginPolling(IServer server, boolean expectedState) throws PollingException;
public IServer getServer();
public boolean isComplete() throws PollingException, RequiresInfoException;
+
+ /**
+ * Called only after poller is "done".
+ * Should return cached final state rather than poll again.
+ *
+ * @return
+ * @throws PollingException
+ * @throws RequiresInfoException
+ */
public boolean getState() throws PollingException, RequiresInfoException;
/*
* clean up any resources / processes. Will ALWAYS be called
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/PollThread.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/PollThread.java 2011-11-29
14:13:23 UTC (rev 36729)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/PollThread.java 2011-11-29
14:52:09 UTC (rev 36730)
@@ -137,13 +137,7 @@
// This way each request for new info is checked only once.
if (!rie.getChecked()) {
rie.setChecked();
- String action = expectedState == IServerStatePoller.SERVER_UP ? SERVER_STARTING
- : SERVER_STOPPING;
- IPollerFailureHandler handler = ExtensionManager
- .getDefault().getFirstPollFailureHandler(poller,
- action, poller.getRequiredProperties());
- handler.handle(poller, action, poller
- .getRequiredProperties());
+ firePollerFailureHandler(expectedState, poller);
}
}
stateStartedOrStopped = checkServerState();
@@ -177,7 +171,6 @@
try {
currentState = poller.getState();
poller.cleanup();
-// alertBehavior(currentState);
alertListener(currentState);
if (finalAlert) {
alertEventLog(currentState);
@@ -187,7 +180,6 @@
poller.cancel(IServerStatePoller.CANCEL);
poller.cleanup();
alertEventLogPollerException(pe);
-// alertBehavior(!expectedState);
alertListener(!expectedState);
return;
} catch (RequiresInfoException rie) {
@@ -234,19 +226,6 @@
alertEventLogSuccess(currentState);
}
}
-
- @Deprecated
- protected void alertBehavior(boolean currentState) {
- if (currentState != expectedState) {
- // it didnt work... cancel all processes! force stop
- behavior.stop(true);
- } else {
- if (currentState == IServerStatePoller.SERVER_UP)
- behavior.setServerStarted();
- else
- behavior.stop(true);
- }
- }
protected void alertListener(boolean currentState) {
if (currentState != expectedState) {
@@ -327,4 +306,13 @@
return STATE_STARTED;
return STATE_STOPPED;
}
+
+ public static void firePollerFailureHandler(boolean expectedState, IServerStatePoller
poller) {
+ String action = expectedState == IServerStatePoller.SERVER_UP ? SERVER_STARTING
+ : SERVER_STOPPING;
+ IPollerFailureHandler handler = ExtensionManager
+ .getDefault().getFirstPollFailureHandler(poller,
+ action, poller.getRequiredProperties());
+ handler.handle(poller, action, poller.getRequiredProperties());
+ }
}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagerServicePoller.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagerServicePoller.java 2011-11-29
14:13:23 UTC (rev 36729)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagerServicePoller.java 2011-11-29
14:52:09 UTC (rev 36730)
@@ -11,7 +11,8 @@
******************************************************************************/
package org.jboss.ide.eclipse.as.core.server.internal.v7;
-import java.util.Collections;
+import java.util.ArrayList;
+import java.util.Arrays;
import java.util.List;
import java.util.Properties;
@@ -24,13 +25,13 @@
import org.jboss.ide.eclipse.as.core.Messages;
import org.jboss.ide.eclipse.as.core.server.IServerStatePoller;
import org.jboss.ide.eclipse.as.core.server.IServerStatePoller2;
-import org.jboss.ide.eclipse.as.core.server.internal.PollThread;
import org.jboss.ide.eclipse.as.core.server.internal.ServerStatePollerType;
+import org.jboss.ide.eclipse.as.core.server.v7.management.AS7ManagementDetails;
import org.jboss.ide.eclipse.as.core.server.v7.management.IJBoss7ManagerService;
import org.jboss.ide.eclipse.as.core.server.v7.management.JBoss7ManagerUtil;
+import
org.jboss.ide.eclipse.as.core.server.v7.management.JBoss7ManagerUtil.IServiceAware;
import
org.jboss.ide.eclipse.as.core.server.v7.management.JBoss7ManangerConnectException;
import org.jboss.ide.eclipse.as.core.server.v7.management.JBoss7ServerState;
-import
org.jboss.ide.eclipse.as.core.server.v7.management.JBoss7ManagerUtil.IServiceAware;
import org.osgi.framework.InvalidSyntaxException;
/**
@@ -40,24 +41,58 @@
public static final String POLLER_ID =
"org.jboss.ide.eclipse.as.core.server.JBoss7ManagerServicePoller";
//$NON-NLS-1$
private IServer server;
+ private AS7ManagementDetails managementDetails;
private ServerStatePollerType type;
private boolean expectedState;
private IJBoss7ManagerService service;
+ private boolean done = false;
+ private boolean canceled = false;
+ private PollingException pollingException = null;
+ private RequiresInfoException requiresInfoException = null;
+ private List<String> requiredProperties = null;
+ private Properties requiredPropertiesReturned = null;
- @Deprecated
- public void beginPolling(IServer server, boolean expectedState, PollThread pollTread)
throws Exception {
- }
-
public void beginPolling(IServer server, boolean expectedState) throws PollingException
{
try {
this.service = JBoss7ManagerUtil.getService(server);
+ this.managementDetails = createManagementDetails();
this.server = server;
this.expectedState = expectedState;
+ launchPollingThread();
} catch(InvalidSyntaxException e) {
throw new PollingException(NLS.bind(Messages.CouldNotBeginPolling,server.getName()),
e);
}
}
+ private AS7ManagementDetails createManagementDetails() {
+ return new AS7ManagementDetails(server) {
+ public String[] handleCallbacks(String[] prompts) {
+ return handleAsynchCallbacks(prompts);
+ }
+ };
+ }
+
+
+ private String[] handleAsynchCallbacks(String[] prompts) {
+ List<String> tmp = new ArrayList<String>();
+ tmp.addAll(Arrays.asList(prompts));
+ requiredProperties = tmp;
+ requiresInfoException = new RequiresInfoException("Requires proper
credentials"); //$NON-NLS-1$
+ while( !done && !canceled && requiredPropertiesReturned == null ) {
+ try {
+ Thread.sleep(500);
+ } catch(InterruptedException ie) {/* Do nothing */}
+ }
+
+ if( done || canceled )
+ return new String[0];
+ String[] retPrompts = new String[prompts.length];
+ for( int i = 0; i < retPrompts.length; i++) {
+ retPrompts[i] = (String)requiredPropertiesReturned.get(prompts[i]);
+ }
+ return retPrompts;
+ }
+
public ServerStatePollerType getPollerType() {
return type;
}
@@ -69,45 +104,63 @@
public IServer getServer() {
return server;
}
+
+ public boolean isComplete() throws PollingException, RequiresInfoException {
+ if (pollingException != null)
+ throw pollingException;
+ if( requiresInfoException != null )
+ throw requiresInfoException;
+ return done;
+ }
- private int getManagementPort(IServer server) {
- if( server != null ) {
- JBoss7Server jbossServer = (JBoss7Server) server.loadAdapter(JBoss7Server.class, new
NullProgressMonitor());
- return jbossServer.getManagementPort();
- }
- return IJBoss7ManagerService.MGMT_PORT;
+ public boolean getState() throws PollingException, RequiresInfoException {
+ if( done )
+ return expectedState;
+ return !expectedState;
}
- public boolean isComplete() throws PollingException, RequiresInfoException {
+ public void launchPollingThread() {
+ new Thread() {
+ public void run() {
+ runLoop();
+ }
+ }.start();
+ }
+
+ public void runLoop() {
try {
- if (expectedState == SERVER_DOWN) {
- return awaitShutdown(service);
- } else {
- return awaitRunning(service);
+ while( !done && !canceled ) {
+ if (expectedState == SERVER_DOWN) {
+ done = checkShutdown(service);
+ } else {
+ done = checkRunning(service);
+ }
+ if( !done ) {
+ try {
+ Thread.sleep(300);
+ } catch(InterruptedException ie) {
+ // Ignore
+ }
+ }
}
} catch (Exception e) {
- throw new PollingException(e.getMessage());
+ pollingException = new PollingException(e.getMessage());
}
}
- private Boolean awaitRunning(IJBoss7ManagerService service) {
+ private boolean checkRunning(IJBoss7ManagerService service) {
try {
JBoss7ServerState serverState = null;
- do {
- serverState = service.getServerState(getServer().getHost(),
getManagementPort(getServer()));
- } while (serverState == JBoss7ServerState.STARTING);
+ serverState = service.getServerState(managementDetails);
return serverState == JBoss7ServerState.RUNNING;
} catch (Exception e) {
return false;
}
}
- private Boolean awaitShutdown(IJBoss7ManagerService service) {
+ private boolean checkShutdown(IJBoss7ManagerService service) {
try {
- JBoss7ServerState serverState = null;
- do {
- serverState = service.getServerState(getServer().getHost(),
getManagementPort(getServer()));
- } while (serverState == JBoss7ServerState.RUNNING);
+ service.getServerState(managementDetails);
return false;
} catch (JBoss7ManangerConnectException e) {
return true;
@@ -116,42 +169,41 @@
}
}
- public boolean getState() throws PollingException, RequiresInfoException {
- try {
- JBoss7ServerState serverState = service.getServerState(getServer().getHost(),
getManagementPort(getServer()));
- return serverState == JBoss7ServerState.RUNNING
- || serverState == JBoss7ServerState.RESTART_REQUIRED;
- } catch (Exception e) {
- throw new PollingException(e.getMessage());
- }
- }
-
public void cleanup() {
JBoss7ManagerUtil.dispose(service);
}
public List<String> getRequiredProperties() {
- return Collections.emptyList();
+ return requiredProperties == null ? new ArrayList<String>() :
requiredProperties;
}
public void failureHandled(Properties properties) {
+ requiredPropertiesReturned = properties;
}
public void cancel(int type) {
+ canceled = true;
}
public int getTimeoutBehavior() {
return TIMEOUT_BEHAVIOR_FAIL;
}
+
+ /* Code related to synchronous state checking */
+ private boolean callbacksCalled = false;
public IStatus getCurrentStateSynchronous(final IServer server) {
try {
Boolean result = JBoss7ManagerUtil.executeWithService(new
IServiceAware<Boolean>() {
-
@Override
public Boolean execute(IJBoss7ManagerService service) throws Exception {
- JBoss7ServerState state = service.getServerState(server.getHost(),
getManagementPort(server));
- return state == JBoss7ServerState.RUNNING ? IServerStatePoller.SERVER_UP :
IServerStatePoller.SERVER_DOWN;
+ try {
+ JBoss7ServerState state =
service.getServerState(createSynchronousManagementDetails(server));
+ return state == JBoss7ServerState.RUNNING ? IServerStatePoller.SERVER_UP :
IServerStatePoller.SERVER_DOWN;
+ } catch(Exception e) {
+ /* Should be JBoss7ManagerException, but cannot compile against since it is in
jboss-as jars */
+ return callbacksCalled ? IServerStatePoller.SERVER_UP :
IServerStatePoller.SERVER_DOWN;
+ }
}
}, server);
if( result.booleanValue()) {
@@ -171,4 +223,24 @@
return s;
}
}
+
+ private AS7ManagementDetails createSynchronousManagementDetails(IServer server) {
+ return new AS7ManagementDetails(server) {
+ public String[] handleCallbacks(String[] prompts) throws UnsupportedOperationException
{
+ // No need to do verification here... simply know that a server responded requesting
callbacks
+ // This means a server is up already
+ callbacksCalled = true;
+ throw new UnsupportedOperationException();
+ }
+ };
+ }
+
+ private int getManagementPort(IServer server) {
+ if( server != null ) {
+ JBoss7Server jbossServer = (JBoss7Server) server.loadAdapter(JBoss7Server.class, new
NullProgressMonitor());
+ return jbossServer.getManagementPort();
+ }
+ return IJBoss7ManagerService.MGMT_PORT;
+ }
+
}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7BehaviorDelegate.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7BehaviorDelegate.java 2011-11-29
14:13:23 UTC (rev 36729)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7BehaviorDelegate.java 2011-11-29
14:52:09 UTC (rev 36730)
@@ -19,6 +19,7 @@
import org.jboss.ide.eclipse.as.core.extensions.polling.WebPortPoller;
import org.jboss.ide.eclipse.as.core.server.IServerStatePoller;
import org.jboss.ide.eclipse.as.core.server.internal.LocalJBossBehaviorDelegate;
+import org.jboss.ide.eclipse.as.core.server.v7.management.AS7ManagementDetails;
import org.jboss.ide.eclipse.as.core.server.v7.management.IJBoss7ManagerService;
import org.jboss.ide.eclipse.as.core.server.v7.management.JBoss7ManagerUtil;
import org.jboss.ide.eclipse.as.core.util.PollThreadUtils;
@@ -53,8 +54,7 @@
protected IStatus gracefullStop() {
IServer server = getServer();
try {
- JBoss7Server jbossServer = ServerConverter.checkedGetJBossServer(server,
JBoss7Server.class);
- getService().stop(jbossServer.getHost(), jbossServer.getManagementPort());
+ getService().stop(new AS7ManagementDetails(getServer()));
return Status.OK_STATUS;
} catch (Exception e) {
return new Status(
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/v7/management/AS7ManagementDetails.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/v7/management/AS7ManagementDetails.java
(rev 0)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/v7/management/AS7ManagementDetails.java 2011-11-29
14:52:09 UTC (rev 36730)
@@ -0,0 +1,55 @@
+/*******************************************************************************
+ * 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;
+
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.wst.server.core.IServer;
+import org.jboss.ide.eclipse.as.core.server.internal.v7.JBoss7Server;
+
+public class AS7ManagementDetails {
+ private IServer server;
+ private String hardHost = null;
+ private int hardPort = -1;
+ public AS7ManagementDetails(IServer server) {
+ this.server = server;
+ }
+
+ public AS7ManagementDetails(String host, int port) {
+ this.hardHost = host;
+ this.hardPort = port;
+ }
+
+ public String getHost() {
+ return hardHost == null ? server.getHost() : hardHost;
+ }
+
+ public int getManagementPort() {
+ if( hardPort != -1 )
+ return hardPort;
+
+ JBoss7Server jbossServer = (JBoss7Server) server.loadAdapter(JBoss7Server.class, new
NullProgressMonitor());
+ if( jbossServer != null )
+ return jbossServer.getManagementPort();
+ return IJBoss7ManagerService.MGMT_PORT;
+ }
+
+ public String getManagementUsername() {
+ return null;
+ }
+
+ public String getManagementPassword() {
+ return null;
+ }
+
+ public String[] handleCallbacks(String[] prompts) throws UnsupportedOperationException
{
+ return new String[0];
+ }
+}
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-29
14:13:23 UTC (rev 36729)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/v7/management/IJBoss7ManagerService.java 2011-11-29
14:52:09 UTC (rev 36730)
@@ -26,98 +26,74 @@
/**
* Asynchronously deploy a file to a server
- * @param host
+ * @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
*
- * 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,
+ public IJBoss7DeploymentResult deployAsync(AS7ManagementDetails details,
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
+ * @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,
+ public IJBoss7DeploymentResult deploySync(AS7ManagementDetails details,
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
+ * @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,
+ public IJBoss7DeploymentResult undeployAsync(AS7ManagementDetails details,
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
+ * @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,
+ public IJBoss7DeploymentResult syncUndeploy(AS7ManagementDetails details,
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
+ * @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;
+ public JBoss7DeploymentState getDeploymentState(AS7ManagementDetails details, String
deploymentName) throws Exception;
/**
* Returns the state of the server
@@ -128,7 +104,7 @@
*
* @throws Exception
*/
- public JBoss7ServerState getServerState(String host, int port) throws Exception;
+ public JBoss7ServerState getServerState(AS7ManagementDetails details) throws Exception;
/**
* Returns <code>true</code> if the server is running,
<code>false</code>
@@ -139,21 +115,15 @@
* @return true if it's running, false otherwise
* @throws Exception
*/
- public boolean isRunning(String host, int port) throws Exception;
+ public boolean isRunning(AS7ManagementDetails details) throws Exception;
- @Deprecated
- public JBoss7ServerState getServerState(String host) throws Exception;
-
/**
* Stops the given server
*
* @throws JBoss7ManangerException
* @throws Exception
*/
- public void stop(String host, int port) throws Exception;
+ public void stop(AS7ManagementDetails details) throws Exception;
- @Deprecated
- public void stop(String host) throws Exception;
-
public void dispose();
}
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-29
14:13:23 UTC (rev 36729)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/v7/management/JBoss7ManagerServiceProxy.java 2011-11-29
14:52:09 UTC (rev 36730)
@@ -35,56 +35,46 @@
checkedGetService().init();
}
- public IJBoss7DeploymentResult deployAsync(String host, int port, String deploymentName,
File file,
+ public IJBoss7DeploymentResult deployAsync(AS7ManagementDetails details, String
deploymentName, File file,
IProgressMonitor monitor) throws Exception {
- return checkedGetService().deployAsync(host, port, deploymentName, file, monitor);
+ return checkedGetService().deployAsync(details, deploymentName, file, monitor);
}
- public IJBoss7DeploymentResult deploySync(String host, int port, String deploymentName,
File file,
+ public IJBoss7DeploymentResult deploySync(AS7ManagementDetails details, String
deploymentName, File file,
IProgressMonitor monitor) throws Exception {
- return checkedGetService().deployAsync(host, port, deploymentName, file, monitor);
+ return checkedGetService().deployAsync(details, deploymentName, file, monitor);
}
- public IJBoss7DeploymentResult undeployAsync(String host, int port, String
deploymentName, boolean removeFile,
+ public IJBoss7DeploymentResult undeployAsync(AS7ManagementDetails details, String
deploymentName, boolean removeFile,
IProgressMonitor monitor) throws Exception {
- return checkedGetService().undeployAsync(host, port, deploymentName, removeFile,
monitor);
+ return checkedGetService().undeployAsync(details, deploymentName, removeFile,
monitor);
}
- public IJBoss7DeploymentResult syncUndeploy(String host, int port, String
deploymentName, boolean removeFile,
+ public IJBoss7DeploymentResult syncUndeploy(AS7ManagementDetails details, String
deploymentName, boolean removeFile,
IProgressMonitor monitor) throws Exception {
- return checkedGetService().syncUndeploy(host, port, deploymentName, removeFile,
monitor);
+ return checkedGetService().syncUndeploy(details, deploymentName, removeFile, monitor);
}
- public JBoss7DeploymentState getDeploymentState(String host, int port, String
deploymentName) throws Exception {
- return checkedGetService().getDeploymentState(host, port, deploymentName);
+ public JBoss7DeploymentState getDeploymentState(AS7ManagementDetails details, String
deploymentName) throws Exception {
+ return checkedGetService().getDeploymentState(details, deploymentName);
}
- public JBoss7ServerState getServerState(String host, int port) throws Exception {
- return checkedGetService().getServerState(host, port);
+ public JBoss7ServerState getServerState(AS7ManagementDetails details) throws Exception
{
+ return checkedGetService().getServerState(details);
}
- public boolean isRunning(String host, int port) throws Exception {
+ public boolean isRunning(AS7ManagementDetails details) throws Exception {
try {
- return checkedGetService().isRunning(host, port);
+ return checkedGetService().isRunning(details);
} catch (Exception e) {
return false;
}
}
- @Deprecated
- public JBoss7ServerState getServerState(String host) throws Exception {
- return checkedGetService().getServerState(host);
+ public void stop(AS7ManagementDetails details) throws Exception {
+ checkedGetService().stop(details);
}
- public void stop(String host, int port) throws Exception {
- checkedGetService().stop(host, port);
- }
-
- @Deprecated
- public void stop(String host) throws Exception {
- checkedGetService().stop(host);
- }
-
private IJBoss7ManagerService checkedGetService() throws JBoss7ManangerException {
IJBoss7ManagerService service = getService();
if (service == null) {
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JMXPoller.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JMXPoller.java 2011-11-29
14:13:23 UTC (rev 36729)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JMXPoller.java 2011-11-29
14:52:09 UTC (rev 36730)
@@ -74,14 +74,6 @@
launchJMXPoller();
}
- @Deprecated
- public void beginPolling(IServer server, boolean expectedState,
- PollThread pt) {
- ceFound = nnfeFound = startingFound = canceled = done = false;
- this.server = server;
- launchJMXPoller();
- }
-
private static class JMXPollerRunnable implements IJMXRunnable {
private boolean result;
public void run(MBeanServerConnection connection) throws Exception {
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-29
14:13:23 UTC (rev 36729)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/internal/management/as7/AS7Manager.java 2011-11-29
14:52:09 UTC (rev 36730)
@@ -42,6 +42,7 @@
import org.jboss.as.controller.client.helpers.standalone.ServerDeploymentPlanResult;
import org.jboss.as.protocol.old.StreamUtils;
import org.jboss.dmr.ModelNode;
+import org.jboss.ide.eclipse.as.core.server.v7.management.AS7ManagementDetails;
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;
@@ -57,13 +58,15 @@
private ModelControllerClient client;
private ServerDeploymentManager manager;
+ private AS7ManagementDetails details;
public AS7Manager(String host) throws UnknownHostException {
- this(host, MGMT_PORT);
+ this(new AS7ManagementDetails(host, MGMT_PORT));
}
- public AS7Manager(String host, int port) throws UnknownHostException {
- this.client = ModelControllerClient.Factory.create(host, port);
+ public AS7Manager(AS7ManagementDetails details) throws UnknownHostException {
+ this.details = details;
+ this.client = ModelControllerClient.Factory.create(details.getHost(),
details.getManagementPort());
this.manager = ServerDeploymentManager.Factory.create(client);
}
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-29
14:13:23 UTC (rev 36729)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/internal/management/as7/JBoss7ManagerService.java 2011-11-29
14:52:09 UTC (rev 36730)
@@ -13,6 +13,7 @@
import java.io.File;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.jboss.ide.eclipse.as.core.server.v7.management.AS7ManagementDetails;
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;
@@ -26,9 +27,9 @@
public void init() throws Exception {
}
- public IJBoss7DeploymentResult deployAsync(String host, int port, String
deploymentName,
+ public IJBoss7DeploymentResult deployAsync(AS7ManagementDetails details, String
deploymentName,
File file, IProgressMonitor monitor) throws Exception {
- AS7Manager manager = new AS7Manager(host, port);
+ AS7Manager manager = new AS7Manager(details);
try {
IJBoss7DeploymentResult result = manager.deploy(deploymentName, file);
return result;
@@ -37,9 +38,9 @@
}
}
- public IJBoss7DeploymentResult deploySync(String host, int port, String deploymentName,
+ public IJBoss7DeploymentResult deploySync(AS7ManagementDetails details, String
deploymentName,
File file, IProgressMonitor monitor) throws Exception {
- AS7Manager manager = new AS7Manager(host, port);
+ AS7Manager manager = new AS7Manager(details);
try {
IJBoss7DeploymentResult result = manager.deploySync(deploymentName, file, monitor);
return result;
@@ -48,9 +49,9 @@
}
}
- public IJBoss7DeploymentResult undeployAsync(String host, int port, String
deploymentName,
+ public IJBoss7DeploymentResult undeployAsync(AS7ManagementDetails details, String
deploymentName,
boolean removeFile, IProgressMonitor monitor) throws Exception {
- AS7Manager manager = new AS7Manager(host, port);
+ AS7Manager manager = new AS7Manager(details);
try {
IJBoss7DeploymentResult result = manager.undeploy(deploymentName);
return result;
@@ -59,9 +60,9 @@
}
}
- public IJBoss7DeploymentResult syncUndeploy(String host, int port, String
deploymentName,
+ public IJBoss7DeploymentResult syncUndeploy(AS7ManagementDetails details, String
deploymentName,
boolean removeFile, IProgressMonitor monitor) throws Exception {
- AS7Manager manager = new AS7Manager(host, port);
+ AS7Manager manager = new AS7Manager(details);
try {
IJBoss7DeploymentResult result = manager.undeploySync(deploymentName, monitor);
return result;
@@ -70,8 +71,8 @@
}
}
- public JBoss7DeploymentState getDeploymentState(String host, int port, String
deploymentName) throws Exception {
- AS7Manager manager = new AS7Manager(host, port);
+ public JBoss7DeploymentState getDeploymentState(AS7ManagementDetails details, String
deploymentName) throws Exception {
+ AS7Manager manager = new AS7Manager(details);
try {
JBoss7DeploymentState result = manager.getDeploymentStateSafe(deploymentName);
return result;
@@ -80,13 +81,8 @@
}
}
- @Deprecated
- public JBoss7ServerState getServerState(String host) throws Exception {
- return getServerState(host, AS7Manager.MGMT_PORT);
- }
-
- public JBoss7ServerState getServerState(String host, int port) throws Exception {
- AS7Manager manager = new AS7Manager(host, port);
+ public JBoss7ServerState getServerState(AS7ManagementDetails details) throws Exception
{
+ AS7Manager manager = new AS7Manager(details);
try {
JBoss7ServerState state = manager.getServerState();
return state;
@@ -95,8 +91,8 @@
}
}
- public boolean isRunning(String host, int port) throws Exception {
- AS7Manager manager = new AS7Manager(host, port);
+ public boolean isRunning(AS7ManagementDetails details) throws Exception {
+ AS7Manager manager = new AS7Manager(details);
try {
boolean ret = manager.isRunning();
return ret;
@@ -105,13 +101,8 @@
}
}
- @Deprecated
- public void stop(String host) throws Exception {
- stop(host, AS7Manager.MGMT_PORT);
- }
-
- public void stop(String host, int port) throws Exception {
- AS7Manager manager = new AS7Manager(host, port);
+ public void stop(AS7ManagementDetails details) throws Exception {
+ AS7Manager manager = new AS7Manager(details);
try {
manager.stopServer();
} finally {
Modified:
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 2011-11-29
14:13:23 UTC (rev 36729)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/as71/AS71Manager.java 2011-11-29
14:52:09 UTC (rev 36730)
@@ -38,8 +38,6 @@
import javax.security.auth.callback.NameCallback;
import javax.security.auth.callback.PasswordCallback;
import javax.security.auth.callback.UnsupportedCallbackException;
-import javax.security.sasl.RealmCallback;
-import javax.security.sasl.RealmChoiceCallback;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.osgi.util.NLS;
@@ -50,6 +48,7 @@
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.AS7ManagementDetails;
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;
@@ -65,13 +64,16 @@
private ModelControllerClient client;
private ServerDeploymentManager manager;
-
+ private AS7ManagementDetails details;
+
public AS71Manager(String host) throws UnknownHostException {
- this(host, MGMT_PORT);
+ this(new AS7ManagementDetails(host, MGMT_PORT));
}
- public AS71Manager(String host, int port) throws UnknownHostException {
- this.client = ModelControllerClient.Factory.create(host, port,getCallbackHandler());
+ public AS71Manager(AS7ManagementDetails details) throws UnknownHostException {
+ this.details = details;
+ this.client = ModelControllerClient.Factory.create(details.getHost(),
details.getManagementPort(),
+ getCallbackHandler());
this.manager = ServerDeploymentManager.Factory.create(client);
}
@@ -96,11 +98,10 @@
pass = (PasswordCallback) current;
}
}
- // TODO get the username
- String username, password;
- username = password = "test";
- name.setName(username);
- pass.setPassword(password.toCharArray());
+
+ String[] results = details.handleCallbacks(new String[] { name.getPrompt(),
pass.getPrompt()});
+ name.setName(results[0]);
+ pass.setPassword(results[1].toCharArray());
}
}
Modified:
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 2011-11-29
14:13:23 UTC (rev 36729)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/as71/JBoss71ManagerService.java 2011-11-29
14:52:09 UTC (rev 36730)
@@ -14,6 +14,7 @@
import java.security.Security;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.jboss.ide.eclipse.as.core.server.v7.management.AS7ManagementDetails;
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;
@@ -32,9 +33,9 @@
}
}
- public IJBoss7DeploymentResult deployAsync(String host, int port, String
deploymentName,
+ public IJBoss7DeploymentResult deployAsync(AS7ManagementDetails details, String
deploymentName,
File file, IProgressMonitor monitor) throws Exception {
- AS71Manager manager = new AS71Manager(host, port);
+ AS71Manager manager = new AS71Manager(details);
try {
IJBoss7DeploymentResult result = manager.deploy(deploymentName, file);
return result;
@@ -43,9 +44,9 @@
}
}
- public IJBoss7DeploymentResult deploySync(String host, int port, String deploymentName,
+ public IJBoss7DeploymentResult deploySync(AS7ManagementDetails details, String
deploymentName,
File file, IProgressMonitor monitor) throws Exception {
- AS71Manager manager = new AS71Manager(host, port);
+ AS71Manager manager = new AS71Manager(details);
try {
IJBoss7DeploymentResult result = manager.deploySync(deploymentName, file, monitor);
return result;
@@ -54,9 +55,9 @@
}
}
- public IJBoss7DeploymentResult undeployAsync(String host, int port, String
deploymentName,
+ public IJBoss7DeploymentResult undeployAsync(AS7ManagementDetails details, String
deploymentName,
boolean removeFile, IProgressMonitor monitor) throws Exception {
- AS71Manager manager = new AS71Manager(host, port);
+ AS71Manager manager = new AS71Manager(details);
try {
IJBoss7DeploymentResult result = manager.undeploy(deploymentName);
return result;
@@ -65,9 +66,9 @@
}
}
- public IJBoss7DeploymentResult syncUndeploy(String host, int port, String
deploymentName,
+ public IJBoss7DeploymentResult syncUndeploy(AS7ManagementDetails details, String
deploymentName,
boolean removeFile, IProgressMonitor monitor) throws Exception {
- AS71Manager manager = new AS71Manager(host, port);
+ AS71Manager manager = new AS71Manager(details);
try {
IJBoss7DeploymentResult result = manager.undeploySync(deploymentName, monitor);
return result;
@@ -76,8 +77,8 @@
}
}
- public JBoss7DeploymentState getDeploymentState(String host, int port, String
deploymentName) throws Exception {
- AS71Manager manager = new AS71Manager(host, port);
+ public JBoss7DeploymentState getDeploymentState(AS7ManagementDetails details, String
deploymentName) throws Exception {
+ AS71Manager manager = new AS71Manager(details);
try {
JBoss7DeploymentState result = manager.getDeploymentStateSafe(deploymentName);
return result;
@@ -86,13 +87,8 @@
}
}
- @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);
+ public JBoss7ServerState getServerState(AS7ManagementDetails details) throws Exception
{
+ AS71Manager manager = new AS71Manager(details);
try {
JBoss7ServerState state = manager.getServerState();
return state;
@@ -101,8 +97,8 @@
}
}
- public boolean isRunning(String host, int port) throws Exception {
- AS71Manager manager = new AS71Manager(host, port);
+ public boolean isRunning(AS7ManagementDetails details) throws Exception {
+ AS71Manager manager = new AS71Manager(details);
try {
boolean ret = manager.isRunning();
return ret;
@@ -111,13 +107,8 @@
}
}
- @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);
+ public void stop(AS7ManagementDetails details) throws Exception {
+ AS71Manager manager = new AS71Manager(details);
try {
manager.stopServer();
} finally {
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEJBoss7BehaviourDelegate.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEJBoss7BehaviourDelegate.java 2011-11-29
14:13:23 UTC (rev 36729)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEJBoss7BehaviourDelegate.java 2011-11-29
14:52:09 UTC (rev 36730)
@@ -19,10 +19,9 @@
import org.eclipse.wst.server.core.IServer;
import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
import org.jboss.ide.eclipse.as.core.Messages;
-import org.jboss.ide.eclipse.as.core.server.internal.v7.JBoss7Server;
+import org.jboss.ide.eclipse.as.core.server.v7.management.AS7ManagementDetails;
import org.jboss.ide.eclipse.as.core.server.v7.management.IJBoss7ManagerService;
import org.jboss.ide.eclipse.as.core.server.v7.management.JBoss7ManagerUtil;
-import org.jboss.ide.eclipse.as.core.util.ServerConverter;
public class RSEJBoss7BehaviourDelegate extends RSEBehaviourDelegate {
@@ -32,8 +31,7 @@
protected IStatus gracefullStop() {
IServer server = getServer();
try {
- JBoss7Server jbossServer = ServerConverter.checkedGetJBossServer(server,
JBoss7Server.class);
- getService().stop(jbossServer.getHost(), jbossServer.getManagementPort());
+ getService().stop(new AS7ManagementDetails(server));
return Status.OK_STATUS;
} catch (Exception e) {
return new Status(
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/launch/JBTWebLaunchableClient.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/launch/JBTWebLaunchableClient.java 2011-11-29
14:13:23 UTC (rev 36729)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/launch/JBTWebLaunchableClient.java 2011-11-29
14:52:09 UTC (rev 36730)
@@ -42,6 +42,7 @@
import
org.jboss.ide.eclipse.as.core.server.internal.JBossLaunchAdapter.JBTCustomHttpLaunchable;
import org.jboss.ide.eclipse.as.core.server.internal.JBossServer;
import org.jboss.ide.eclipse.as.core.server.internal.v7.JBoss7Server;
+import org.jboss.ide.eclipse.as.core.server.v7.management.AS7ManagementDetails;
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.JBoss7ManagerUtil;
@@ -108,7 +109,8 @@
long time = new Date().getTime();
long endTime = time + getMaxDelay();
while( new Date().getTime() < endTime ) {
- JBoss7DeploymentState state = service.getDeploymentState(jbossServer.getHost(),
jbossServer.getManagementPort(),
+ JBoss7DeploymentState state = service.getDeploymentState(
+ new AS7ManagementDetails(server),
deployPath.lastSegment());
boolean done = (state == JBoss7DeploymentState.STARTED);
if( done ) {
Modified:
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/JBossManagerTest.java
===================================================================
---
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/JBossManagerTest.java 2011-11-29
14:13:23 UTC (rev 36729)
+++
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/JBossManagerTest.java 2011-11-29
14:52:09 UTC (rev 36730)
@@ -17,6 +17,7 @@
import java.util.Hashtable;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.jboss.ide.eclipse.as.core.server.v7.management.AS7ManagementDetails;
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;
@@ -60,7 +61,7 @@
managerProxy.open();
IJBoss7ManagerService manager = managerProxy.getService();
assertNotNull(manager);
- manager.getDeploymentState("fake", 4242, "fake");
+ manager.getDeploymentState(new AS7ManagementDetails("fake", 4242),
"fake");
}
private void registerFakeASService(String version) {
@@ -72,49 +73,42 @@
private static class JBoss71Manager implements IJBoss7ManagerService {
- public IJBoss7DeploymentResult deployAsync(String host, int port, String
deploymentName, File file,
+ public IJBoss7DeploymentResult deployAsync(AS7ManagementDetails details, String
deploymentName, File file,
IProgressMonitor monitor) throws JBoss7ManangerException {
throw new UnsupportedOperationException();
}
- public IJBoss7DeploymentResult deploySync(String host, int port, String deploymentName,
File file,
+ public IJBoss7DeploymentResult deploySync(AS7ManagementDetails details, String
deploymentName, File file,
IProgressMonitor monitor) throws JBoss7ManangerException {
throw new UnsupportedOperationException();
}
- public IJBoss7DeploymentResult undeployAsync(String host, int port, String
deploymentName, boolean removeFile,
+ public IJBoss7DeploymentResult undeployAsync(AS7ManagementDetails details, String
deploymentName, boolean removeFile,
IProgressMonitor monitor) throws JBoss7ManangerException {
throw new UnsupportedOperationException();
}
- public IJBoss7DeploymentResult syncUndeploy(String host, int port, String
deploymentName, boolean removeFile,
+ public IJBoss7DeploymentResult syncUndeploy(AS7ManagementDetails details, String
deploymentName, boolean removeFile,
IProgressMonitor monitor) throws JBoss7ManangerException {
throw new UnsupportedOperationException();
}
- public JBoss7DeploymentState getDeploymentState(String host, int port, String
deploymentName)
+ public JBoss7DeploymentState getDeploymentState(AS7ManagementDetails details, String
deploymentName)
throws JBoss7ManangerException {
throw new UnsupportedOperationException();
}
- public JBoss7ServerState getServerState(String host, int port) throws Exception {
+ public JBoss7ServerState getServerState(AS7ManagementDetails details) throws Exception
{
throw new UnsupportedOperationException();
}
- public JBoss7ServerState getServerState(String host) throws Exception {
+ public boolean isRunning(AS7ManagementDetails details) {
throw new UnsupportedOperationException();
}
- public boolean isRunning(String host, int port) {
- throw new UnsupportedOperationException();
+ public void stop(AS7ManagementDetails details) throws JBoss7ManangerException {
}
- public void stop(String host, int port) throws JBoss7ManangerException {
- }
-
- public void stop(String host) throws JBoss7ManangerException {
- }
-
public void dispose() {
}