Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.bea.wlevs.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.

- Deploys a deployable jar file or a serialized byte array
- Undeploys a deployed application
- Updates a deployed application
- Starts a deployed application
- Stops a deployed application
- Queries for applications that has been deployed

All the operations of the MBean wrap around 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.wlevs:type=com.bea.wlevs.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.wlevs.example.helloworld_2.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.wlevs.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.wlevs.deployment.AppDeploymentException -

### deployApplication

    public void deployApplication(String applicationName,
                                  byte[] contentsOfJarFile)
                           throws com.bea.wlevs.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.wlevs.deployment.AppDeploymentException -

### undeployApplication

    public void undeployApplication(String applicationName)
                             throws com.bea.wlevs.deployment.AppDeploymentException

  This method will undeploy an application named `applicationName`

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

### updateDeployedApplication

    public void updateDeployedApplication(String applicationName,
                                          File jarFile)
                                   throws com.bea.wlevs.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.wlevs.deployment.AppDeploymentException -

### updateDeployedApplication

    public void updateDeployedApplication(String applicationName,
                                          byte[] contentsOfJarFile)
                                   throws com.bea.wlevs.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.wlevs.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

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD