com.bea.wlrt.deployment.mbean
Interface AppDeploymentMBean


public interface AppDeploymentMBean

This MBean will manage the deployment of a deployable application in the Weblogic Event Server. It manages the following lifecycle of a deployable application.

All the operations of the MBean wrap around com.bea.wlrt.deployment.Deployment Deployment).

An example of using this MBean to manage the life cycle of a deployed application is given below

      //get the remote JMX service URL assuming RMI protocol and the listening RMI port is 1099
      JMXServiceURL url = new JMXServiceURL("rmi", "localhost",1099, "/jndi/rmi://localhost:" + 1099 + "/jmxrmi");

      //get a remote JMX connector
        JMXConnector jmxc = JMXConnectorFactory.connect(url,null);

        //get the MBean server connection
        MBeanServerConnection mbsc = jmxc.getMBeanServerConnection();

        //get the AppDeployment MBean name as registered in the MBean server
        ObjectName deploymentName =
           ObjectName.getInstance("com.bea.wlrt:type=com.bea.wlrt.jmx.standard.AppDeploymentMBean");

        //look up the AppDeployment MBean
        AppDeploymentMBean deploymentMBean = (AppDeploymentMBean)
               MBeanServerInvocationHandler.newProxyInstance(
                                mbsc,
                                deploymentName,
                                AppDeploymentMBean.class,
                                true);

        //deploy
        System.out.println("\n\t Deploying application - helloworld");
        deploymentMBean.deployApplication("helloworld",
                new File("com.bea.wlrt.example.helloworld_1.0.0.0.jar"));

        //get the list of applications deployed in the server
        Collection deployments = deploymentMBean.listDeployedApplications();

        for(String s : deployments) {
            System.out.println("\n\t Deployed Application " + s);
        }

        //stop the application
        Thread.sleep(10000);
        System.out.println("\n\tStopping application helloworld");
        deploymentMBean.stopApplication("helloworld");

        //start the application
        Thread.sleep(10000);
        System.out.println("\n\tStarting application helloworld");
        deploymentMBean.startApplication("helloworld");

        //undeploy
        Thread.sleep(10000);
        System.out.println("\n\tUndeploying application helloworld");
        deploymentMBean.undeployApplication("helloworld");

        //close the MBean remote connection
        jmxc.close();


 


Field Summary
static String OBJECT_NAME
           
 
Method Summary
 void deployApplication(String applicationName, byte[] contentsOfJarFile)
          This method will deploy a serialized byte array to the Weblogic Event Server.
 void deployApplication(String applicationName, File jarFile)
          This method will deploy the jar file in the Weblogic Event Server.
 Collection listDeployedApplications()
          This method will return a java.util.Collection of application names which has been deployed in the Weblogic Event Server
 void startApplication(String applicationName)
          This method will start a deployed application which may have been stopped.
 void stopApplication(String applicationName)
          This method will stop a deployed appliction.
 void undeployApplication(String applicationName)
          This method will undeploy an application named applicationName
 void updateDeployedApplication(String applicationName, byte[] contentsOfJarFile)
          This method will update a deployed appliction in the Weblogic Event Server.
 void updateDeployedApplication(String applicationName, File jarFile)
          This method will update a deployed application in the Weblogic Event Server.
 

Field Detail

OBJECT_NAME

public static final String OBJECT_NAME
Method Detail

deployApplication

public void deployApplication(String applicationName,
                              File jarFile)
                       throws com.bea.wlrt.deployment.AppDeploymentException
This method will deploy the jar file in the Weblogic Event Server.

Parameters:
applicationName - - String name of the application for the deployed jar file
jarFile - - File application jar file
Throws:
com.bea.wlrt.deployment.AppDeploymentException -  

deployApplication

public void deployApplication(String applicationName,
                              byte[] contentsOfJarFile)
                       throws com.bea.wlrt.deployment.AppDeploymentException
This method will deploy a serialized byte array to the Weblogic Event Server.

Parameters:
applicationName- - String name of the application for the deployed jar file as serialized bytes
contentsOfJarFile - - byte[] byte array representing a jar file to be deployed
Throws:
com.bea.wlrt.deployment.AppDeploymentException -  

undeployApplication

public void undeployApplication(String applicationName)
                         throws com.bea.wlrt.deployment.AppDeploymentException
This method will undeploy an application named applicationName

Parameters:
applicationName - - String name of the application to undeploy
Throws:
com.bea.wlrt.deployment.AppDeploymentException -  

updateDeployedApplication

public void updateDeployedApplication(String applicationName,
                                      File jarFile)
                               throws com.bea.wlrt.deployment.AppDeploymentException
This method will update a deployed application in the Weblogic Event Server.

Parameters:
applicationName - - String name of the application to update
jarFile - - File a jarfile representing the appliction to be updated
Throws:
com.bea.wlrt.deployment.AppDeploymentException -  

updateDeployedApplication

public void updateDeployedApplication(String applicationName,
                                      byte[] contentsOfJarFile)
                               throws com.bea.wlrt.deployment.AppDeploymentException
This method will update a deployed appliction in the Weblogic Event Server.

Parameters:
applicationName - - String name of the application
contentsOfJarFile - - byte[] - serialized byte array of a deployable jar file
Throws:
com.bea.wlrt.deployment.AppDeploymentException -  

startApplication

public void startApplication(String applicationName)
                      throws IllegalArgumentException,
                             IllegalStateException
This method will start a deployed application which may have been stopped.

Parameters:
applicationName - - String name of the application to start
Throws:
IllegalArgumentException -  
IllegalStateException -  

stopApplication

public void stopApplication(String applicationName)
                     throws IllegalArgumentException,
                            IllegalStateException
This method will stop a deployed appliction.

Parameters:
applicationName - - String name of the application to stop
Throws:
IllegalArgumentException -  
IllegalStateException -  

listDeployedApplications

public Collection listDeployedApplications()
This method will return a java.util.Collection of application names which has been deployed in the Weblogic Event Server

Returns:
- Collection collection of application names