-1

I want to stop a application which is deployed on weblogic temporarily, that means I should be able to start the application immediately without deploying on weblogic.

0

We can achieve this by using weblogic mbeans. Please find below code for your reference.

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);
}

we need to pass the deployment name as perameter while accessing appRuntime

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.