|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This MBean will manage the deployment of a deployable application in the Weblogic Event Server. It 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.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 Collectiondeployments = 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 |
public static final String OBJECT_NAME
Method Detail |
public void deployApplication(String applicationName, File jarFile) throws com.bea.wlrt.deployment.AppDeploymentException
applicationName
- - String name of the application for the deployed jar filejarFile
- - File application jar filepublic void deployApplication(String applicationName, byte[] contentsOfJarFile) throws com.bea.wlrt.deployment.AppDeploymentException
applicationName-
- String name of the application for the deployed jar file as serialized bytescontentsOfJarFile
- - byte[] byte array representing a jar file to be deployedpublic void undeployApplication(String applicationName) throws com.bea.wlrt.deployment.AppDeploymentException
applicationName
applicationName
- - String name of the application to undeploypublic void updateDeployedApplication(String applicationName, File jarFile) throws com.bea.wlrt.deployment.AppDeploymentException
applicationName
- - String name of the application to updatejarFile
- - File a jarfile representing the appliction to be updatedpublic void updateDeployedApplication(String applicationName, byte[] contentsOfJarFile) throws com.bea.wlrt.deployment.AppDeploymentException
applicationName
- - String name of the applicationcontentsOfJarFile
- - byte[] - serialized byte array of a deployable jar filepublic void startApplication(String applicationName) throws IllegalArgumentException, IllegalStateException
applicationName
- - String name of the application to startpublic void stopApplication(String applicationName) throws IllegalArgumentException, IllegalStateException
applicationName
- - String name of the application to stoppublic Collection listDeployedApplications()
java.util.Collection
of application names which has been
deployed in the Weblogic Event Server
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |