com.bea.wlevs.deployment.mbean
Interface AppDeploymentMBean


public interface AppDeploymentMBean
extends WebLogicMBean

This MBean will manage the deployment of a deployable application in the Weblogic Event Server or in a cluster of WebLogic Event Servers.

In a non-clustered environment, a Weblogic Event Server domain contains a single Event Server instance. In a clustered environment, a Weblogic Event Server domain contains groups of servers. A group represents a collection of homogeneous Weblogic Event Server instances. The application name is unique within a domain. Likewise, the group name is unique withing a domain.

This Mbean also manages the following lifecycle of a deployable application:

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:Domain=" + domainName 
             + ",Name=AppDeployment,Type=AppDeployment");

      //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_3.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);
      }

      //suspend the application
      Thread.sleep(10000);
      System.out.println("\n\tSuspend application helloworld");
      deploymentMBean.suspend("helloworld");

      //resume the application
      Thread.sleep(10000);
      System.out.println("\n\tResume application helloworld");
      deploymentMBean.resume("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 java.lang.String MBEAN_TYPE
          This MBean is registered using the following MBEAN_TYPE.
 
Method Summary
 void deployApplication(java.lang.String applicationName, byte[] contentsOfJarFile)
          This method will deploy a serialized byte array to the Weblogic Event Server.
 void deployApplication(java.lang.String applicationName, java.io.File jarFile)
          This method will deploy the jar file in the Weblogic Event Server.
 void deployApplication(java.lang.String groupName, java.lang.String applicationName, byte[] contentsOfJarFile)
          This method will deploy a serialized byte array as a clustered application in a group of WebLogic Event Servers.
 void deployApplication(java.lang.String groupName, java.lang.String applicationName, java.io.File jarFile)
          This method will deploy the jar file as a clustered application in a group of WebLogic Event Servers.
 java.util.Collection listDeployedApplications()
          This method returns a java.util.Collection of application names which has been deployed in this Weblogic Event Server instance.
 void resume(java.lang.String applicationName)
          This method resumes a deployed application.
 void startApplication(java.lang.String applicationName)
          Deprecated.  
 void stopApplication(java.lang.String applicationName)
          Deprecated.  
 void suspend(java.lang.String applicationName)
          This method suspends a deployed application.
 void undeployApplication(java.lang.String applicationName)
          This method will undeploy an application named applicationName If application is clustered, then it will undeploy application from all servers where it has been deployed.
 void updateDeployedApplication(java.lang.String applicationName, byte[] contentsOfJarFile)
          This method will update a deployed appliction in the Weblogic Event Server.
 void updateDeployedApplication(java.lang.String applicationName, java.io.File jarFile)
          This method will update a deployed application in the Weblogic Event Server.
 
Methods inherited from interface com.bea.wlevs.management.WebLogicMBean
getName, getObjectName, getType
 

Field Detail

MBEAN_TYPE

public static final java.lang.String MBEAN_TYPE
This MBean is registered using the following MBEAN_TYPE.
Method Detail

deployApplication

public void deployApplication(java.lang.String applicationName,
                              java.io.File jarFile)
                       throws javax.management.MBeanException,
                              javax.management.OperationsException,
                              javax.management.RuntimeOperationsException
This method will deploy the jar file in the Weblogic Event Server. The application is guaranteed to have been installed when this method returns successfully. The deployment is scoped to this server only, and not scoped to any other groups that this server may be member of in the case of a clustered domain.

Parameters:
applicationName - - String name of the application for the deployed jar file
jarFile - - File application jar file
Throws:
javax.management.MBeanException - wrapping IOException - if jarFile is corrupt or cannot be written to disk
javax.management.OperationsException - - if operations fails for some other unspecied reason

deployApplication

public void deployApplication(java.lang.String groupName,
                              java.lang.String applicationName,
                              java.io.File jarFile)
                       throws javax.management.MBeanException,
                              javax.management.OperationsException,
                              javax.management.RuntimeOperationsException
This method will deploy the jar file as a clustered application in a group of WebLogic Event Servers. The group must exist, otherwise IllegalArgumentException, wrapped in RuntimeOperationsException is raised. This server does not need to be a member of the target group, however this server and the target group must be part of the same domain.

Parameters:
groupName - - String name of the group
applicationName -  
jarFile -  
Throws:
javax.management.MBeanException - wrapping IOException - if jarFile is corrupt or cannot be written to disk
javax.management.OperationsException - - if operations fails for some other unspecied reason

deployApplication

public void deployApplication(java.lang.String applicationName,
                              byte[] contentsOfJarFile)
                       throws javax.management.MBeanException,
                              javax.management.OperationsException,
                              javax.management.RuntimeOperationsException
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:
javax.management.MBeanException - wrapping IOException - if byte array is corrupt or cannot be written to disk
javax.management.OperationsException - - if operations fails for some other unspecied reason

deployApplication

public void deployApplication(java.lang.String groupName,
                              java.lang.String applicationName,
                              byte[] contentsOfJarFile)
                       throws javax.management.MBeanException,
                              javax.management.OperationsException,
                              javax.management.RuntimeOperationsException
This method will deploy a serialized byte array as a clustered application in a group of WebLogic Event Servers. The group must exist, otherwise IllegalArgumentException, wrapped in RuntimeOperationsException is raised. This server does not need to be a member of the target group, however this server and the target group must be part of the same domain.

Parameters:
groupName - - String name of the group
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:
javax.management.MBeanException - wrapping IOException - if byte array is corrupt or cannot be written to disk
javax.management.OperationsException - - if operations fails for some other unspecied reason

undeployApplication

public void undeployApplication(java.lang.String applicationName)
                         throws javax.management.MBeanException,
                                javax.management.OperationsException,
                                javax.management.RuntimeOperationsException
This method will undeploy an application named applicationName If application is clustered, then it will undeploy application from all servers where it has been deployed. If any server containing application is not available, then the application will be undeployed when server becomes available again.

Parameters:
applicationName - - String name of the application to undeploy
Throws:
javax.management.MBeanException - wrapping IOException - if the state of the undeployed application could not be updated to disk
javax.management.OperationsException - - if operations fails for some other unspecied reason

updateDeployedApplication

public void updateDeployedApplication(java.lang.String applicationName,
                                      java.io.File jarFile)
                               throws javax.management.MBeanException,
                                      javax.management.OperationsException,
                                      javax.management.RuntimeOperationsException
This method will update a deployed application in the Weblogic Event Server. If application is clustered, then it will update application in all servers where it has been deployed. If any server containing application is not available, then the application will be updated when server becomes available again.

Parameters:
applicationName - - String name of the application to update
jarFile - - File a jarfile representing the appliction to be updated
Throws:
javax.management.MBeanException - wrapping IOException - if jarFile content is corrupt or cannot be written to disk
javax.management.OperationsException - - if operations fails for some other unspecied reason

updateDeployedApplication

public void updateDeployedApplication(java.lang.String applicationName,
                                      byte[] contentsOfJarFile)
                               throws javax.management.MBeanException,
                                      javax.management.OperationsException,
                                      javax.management.RuntimeOperationsException
This method will update a deployed appliction in the Weblogic Event Server. If application is clustered, then it will update application in all servers where it has been deployed. If any server containing application is not available, then the application will be updated when server becomes available again.

Parameters:
applicationName - - String name of the application
contentsOfJarFile - - byte[] - serialized byte array of a deployable jar file
Throws:
javax.management.MBeanException - wrapping IOException - if byte array is corrupt or cannot be written to disk
javax.management.OperationsException - - if operations fails for some other unspecied reason

startApplication

public void startApplication(java.lang.String applicationName)
                      throws javax.management.OperationsException,
                             javax.management.RuntimeOperationsException
Deprecated.  
This method will start a deployed application which may have been stopped. If application is clustered, then it will start application in all servers where it has been deployed. If any server containing application is not available, then the application will be started when server becomes available again.

Parameters:
applicationName - - String name of the application to start
Throws:
javax.management.OperationsException - - if operations fails for some other unspecied reason

stopApplication

public void stopApplication(java.lang.String applicationName)
                     throws javax.management.OperationsException,
                            javax.management.RuntimeOperationsException
Deprecated.  
This method will stop a deployed application. If application is clustered, then it will stop application in all servers where it has been deployed. If any server containing application is not available, then the application will be stopped when server becomes available again.

Parameters:
applicationName - - String name of the application to stop
Throws:
javax.management.OperationsException - - if operations fails for some other unspecied reason

suspend

public void suspend(java.lang.String applicationName)
             throws javax.management.MBeanException,
                    javax.management.RuntimeOperationsException
This method suspends a deployed application. If application is clustered, then it will suspend application in all servers where it has been deployed. If any server containing application is not available, then the application will be suspended when server becomes available again.

Parameters:
applicationName - - the name of the application to update
Throws:
javax.management.MBeanException - wrapping IOException - if the deployed application bits is corrupted or cannot be read in disk

resume

public void resume(java.lang.String applicationName)
            throws javax.management.MBeanException,
                   javax.management.RuntimeOperationsException
This method resumes a deployed application. If application is clustered, then it will resume application in all servers where it has been deployed. If any server containing application is not available, then the application will be resumed when server becomes available again.

Parameters:
applicationName - - the name of the application to update
Throws:
javax.management.MBeanException - wrapping IOException - if the deployed application bits is corrupted or cannot be read in disk

listDeployedApplications

public java.util.Collection listDeployedApplications()
                                              throws javax.management.JMException
This method returns a java.util.Collection of application names which has been deployed in this Weblogic Event Server instance. This java.util.Collection does not include other applications that may have been deployed to other servers through this MBean.

Returns:
- Collection collection of application names deployed in this WebLogic Event Server instance.
Throws:
javax.management.JMException -  


Copyright © 2007 BEA Systems All Rights Reserved.