User: d_jencks Date: 02/02/21 20:24:54 Modified: src/main/org/jboss/resource RARDeployer.java Log: Made classes visible across all subpackages in a deployment such as an ear. (bug 520676. Restructured deployment process to involve 3 phases: classloading, create where components set up their externally visible aspects, and start where components connect to other components. Renamed Application to EjbModule. Revision Changes Path 1.21 +39 -19 jbosscx/src/main/org/jboss/resource/RARDeployer.java Index: RARDeployer.java =================================================================== RCS file: /cvsroot/jboss/jbosscx/src/main/org/jboss/resource/RARDeployer.java,v retrieving revision 1.20 retrieving revision 1.21 diff -u -r1.20 -r1.21 --- RARDeployer.java 15 Feb 2002 06:18:28 -0000 1.20 +++ RARDeployer.java 22 Feb 2002 04:24:54 -0000 1.21 @@ -52,7 +52,7 @@ * * @author Toby Allsopp ([EMAIL PROTECTED]) * @author <a href="mailto:[EMAIL PROTECTED]">David Jencks</a> - * @version $Revision: 1.20 $ + * @version $Revision: 1.21 $ * @see org.jboss.resource.ConnectionFactoryLoader <p> * * <b>Revisions:</b> <p> @@ -179,7 +179,7 @@ * @exception IOException if an error occurs * @exception DeploymentException if an error occurs */ - public void deploy(DeploymentInfo rdi) + public void create(DeploymentInfo rdi) throws DeploymentException { if (log.isDebugEnabled()) { @@ -190,16 +190,27 @@ RARMetaData metaData = (RARMetaData) rdi.metaData; //set up the RARDeployment mbean for dependency management. - ObjectName deploymentName = + rdi.deployedObject = new ObjectName("jboss.jca:service=RARDeployment,name=" + metaData.getDisplayName()); - server.createMBean("org.jboss.resource.RARDeployment", - deploymentName, - new Object[] {metaData}, - new String[] {"org.jboss.resource.RARMetaData"}); + rdi.deployedObject, + new Object[] {metaData}, + new String[] {"org.jboss.resource.RARMetaData"}); - serviceController.create(deploymentName); - serviceController.start(deploymentName); + serviceController.create(rdi.deployedObject); + } + catch (Exception e) + { + log.error("Problem deploying RARDeployment MBean", e); + throw new DeploymentException("Problem making RARDeployment MBean", e); + } + } + + public void start(DeploymentInfo rdi) throws DeploymentException + { + try + { + serviceController.start(rdi.deployedObject); } catch (Exception e) { @@ -208,31 +219,40 @@ } } - public void undeploy(DeploymentInfo rdi) + public void stop(DeploymentInfo rdi) throws DeploymentException { if (log.isDebugEnabled()) { log.debug("Undeploying RAR at '" + rdi.url + "'"); } - RARMetaData metadata = (RARMetaData) rdi.metaData; try { - ObjectName deploymentName = - new ObjectName("jboss.jca:service=RARDeployment,name=" + metadata.getDisplayName()); - log.info("About to undeploy RARDeploymentMBean, objectname: " + deploymentName); - - serviceController.stop(deploymentName); - serviceController.destroy(deploymentName); - serviceController.remove(deploymentName); + log.info("About to undeploy RARDeploymentMBean, objectname: " + rdi.deployedObject); + + serviceController.stop(rdi.deployedObject); + } + catch (Exception e) { + log.error("Problem undeploying RARDeployment MBean", e); + throw new DeploymentException("Problem undeploying RARDeployment MBean", e); + } + } + + public void destroy(DeploymentInfo rdi) + throws DeploymentException + { + try + { + serviceController.destroy(rdi.deployedObject); + serviceController.remove(rdi.deployedObject); } catch (Exception e) { log.error("Problem undeploying RARDeployment MBean", e); throw new DeploymentException("Problem undeploying RARDeployment MBean", e); } - metadata.setClassLoader(null); + ((RARMetaData) rdi.metaData).setClassLoader(null); } public void startService()
_______________________________________________ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development