Мы можем добиться этого, используя weblogic mbeans. Пожалуйста, найдите ниже код для вашей справки.
appRuntime.stop ();
appRuntime.start ();
@Override public void stop(String deploymentName) { System.out.println("*** Stopping webapp..."); // The DeploymentManagerMBean is used for the initial deployment of an application. // After the initial deployment, the AppDeploymentRuntimeMBean is used for stop, start, // redeploy, and undeploy of an application. AppDeploymentRuntimeMBean appRuntime = deploymentManager.lookupAppDeploymentRuntime(deploymentName); DeploymentProgressObjectMBean progressObj = appRuntime.stop(); printCompletionStatus(progressObj); } @Override public void start(String deploymentName) { System.out.println("*** Starting webapp..."); // The DeploymentManagerMBean is used for the initial deployment of an application. // After the initial deployment, the AppDeploymentRuntimeMBean is used for stop, start, // redeploy, and undeploy of an application. AppDeploymentRuntimeMBean appRuntime = deploymentManager.lookupAppDeploymentRuntime(deploymentName); DeploymentProgressObjectMBean progressObj = appRuntime.start(); printCompletionStatus(progressObj); }
нам нужно передать имя развертывания как perameter при доступе к appRuntime