This content has been marked as final.
Show 2 replies
-
1. Re: Forcing an EAR Shutdown on Exception
philippeaubertin Nov 17, 2010 8:29 AM (in response to j1.jonathan.m.clarke.dsl.pipex.com)You can use JMX to interact with your server:
Jboss should probably provide you a librairy.
Here an example with WebLogic (found on the net).
Hope this help.
import java.io.*; import weblogic.deploy.api.tools.*; //SesionHelper import weblogic.deploy.api.spi .*; //WebLogicDeploymentManager import weblogic.deploy.api.spi.DeploymentOptions; import javax.enterprise.deploy.spi.TargetModuleID; import javax.enterprise.deploy.spi.status.ProgressObject; import javax.enterprise.deploy.spi.status.DeploymentStatus; import javax.enterprise.deploy.shared.ModuleType; import javax.enterprise.deploy.spi.Target; public class ApplicationUndeployment { public static void main(String ar[]) throws Exception { ApplicationUndeployment appDeploy=new ApplicationUndeployment(); String protocol=”t3″; String hostName=”localhost”; String portString=”7001″; String adminUser=”weblogic”; String adminPassword=”weblogic”; WebLogicDeploymentManager deployManager=SessionHelper.getRemoteDeploymentManager( protocol,hostName,portString,adminUser,adminPassword); System.out.println(“\n\t WebLogicDeploymentManager: “+deployManager); DeploymentOptions options = new DeploymentOptions(); System.out.println(“\n\t DeploymentOptions: “+options); TargetModuleID[] targetModuleIDs=deployManager.getAvailableModules(ModuleType.EAR, deployManager.getTargets()); System.out.println(“targetModuleIDs length: “+targetModuleIDs.length); for(int i=0;i<targetModuleIDs.length;i++) { System.out.println(“\n\n\tUNDEPLOYING——- targetModuleIDs["+i+"]: “+targetModuleIDs[i]); ProgressObject processStatus=deployManager.undeploy(new TargetModuleID[]{targetModuleIDs[i]}); DeploymentStatus deploymentStatus=processStatus.getDeploymentStatus() ; System.out.println(“UnDeploymentStayus.getMessage(): “+deploymentStatus.getMessage() ); } }
-
2. Re: Forcing an EAR Shutdown on Exception
j1.jonathan.m.clarke.dsl.pipex.com Nov 18, 2010 6:19 AM (in response to j1.jonathan.m.clarke.dsl.pipex.com)Many thanks. Will give this a go.