[JBoss-dev] CVS update: jbosscx/src/main/org/jboss/resource RARDeployer.java
User: d_jencks Date: 02/04/14 19:48:52 Modified:src/main/org/jboss/resource RARDeployer.java Log: Changed to use UnifiedLoaderRepository and UnifiedClassLoader from jbossmx. Removed ServiceLibraries, UnifiedClassLoader, and MBeanClassLoader from jboss-system Revision ChangesPath 1.26 +1 -22 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.25 retrieving revision 1.26 diff -u -r1.25 -r1.26 --- RARDeployer.java 14 Apr 2002 01:19:48 - 1.25 +++ RARDeployer.java 15 Apr 2002 02:48:52 - 1.26 @@ -8,38 +8,17 @@ package org.jboss.resource; import java.io.File; -import java.io.FileFilter; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.FilenameFilter; import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.net.JarURLConnection; -import java.net.MalformedURLException; import java.net.URL; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Enumeration; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; -import java.util.jar.JarEntry; -import java.util.jar.JarFile; -import javax.management.Notification; import javax.management.ObjectName; import org.jboss.deployment.DeploymentInfo; import org.jboss.deployment.SubDeployerSupport; import org.jboss.deployment.DeploymentException; -import org.jboss.logging.Logger; import org.jboss.metadata.XmlFileLoader; -import org.jboss.system.ServiceLibraries; -import org.jboss.system.ServiceMBeanSupport; import org.jboss.system.ServiceControllerMBean; -import org.jboss.system.UnifiedClassLoader; import org.jboss.util.jmx.MBeanProxy; import org.w3c.dom.Document; @@ -54,7 +33,7 @@ * * @author Toby Allsopp ([EMAIL PROTECTED]) * @author a href=mailto:[EMAIL PROTECTED];David Jencks/a - * @version$Revision: 1.25 $ + * @version$Revision: 1.26 $ * @seeorg.jboss.resource.ConnectionFactoryLoader p * * bRevisions:/b p ___ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jbosscx/src/main/org/jboss/resource RARDeployer.java
User: d_jencks Date: 02/04/13 18:19:49 Modified:src/main/org/jboss/resource RARDeployer.java Log: Larry Sanderson's patch to enable deploying unpacked directories Revision ChangesPath 1.25 +5 -5 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.24 retrieving revision 1.25 diff -u -r1.24 -r1.25 --- RARDeployer.java 9 Apr 2002 01:06:38 - 1.24 +++ RARDeployer.java 14 Apr 2002 01:19:48 - 1.25 @@ -54,7 +54,7 @@ * * @author Toby Allsopp ([EMAIL PROTECTED]) * @author a href=mailto:[EMAIL PROTECTED];David Jencks/a - * @version$Revision: 1.24 $ + * @version$Revision: 1.25 $ * @seeorg.jboss.resource.ConnectionFactoryLoader p * * bRevisions:/b p @@ -100,10 +100,8 @@ */ public boolean accepts(DeploymentInfo sdi) { - // To be accepted the deployment's root name must end in rar - if (sdi.url.getFile().endsWith(rar)) return true; - - else return false; + String urlStr = sdi.url.toString(); + return urlStr.endsWith(rar) || urlStr.endsWith(rar/); } /** @@ -171,6 +169,8 @@ throw new DeploymentException(problem with init in RARDeployer , e); } + // invoke super-class initialization + processNestedDeployments(rdi); } /** ___ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jbosscx/src/main/org/jboss/resource RARDeployer.java
User: mclaugs Date: 02/04/08 18:06:38 Modified:src/main/org/jboss/resource RARDeployer.java Log: Changed parent param for ResourceAdapterModule.create from null to the same as name for stand-alone modules Revision ChangesPath 1.24 +2 -2 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.23 retrieving revision 1.24 diff -u -r1.23 -r1.24 --- RARDeployer.java 3 Apr 2002 08:23:26 - 1.23 +++ RARDeployer.java 9 Apr 2002 01:06:38 - 1.24 @@ -54,7 +54,7 @@ * * @author Toby Allsopp ([EMAIL PROTECTED]) * @author a href=mailto:[EMAIL PROTECTED];David Jencks/a - * @version$Revision: 1.23 $ + * @version$Revision: 1.24 $ * @seeorg.jboss.resource.ConnectionFactoryLoader p * * bRevisions:/b p @@ -206,7 +206,7 @@ ObjectName lModule = org.jboss.management.j2ee.ResourceAdapterModule.create( server, - (rdi.parent == null)? null:rdi.parent.shortName, + (rdi.parent == null)? rdi.shortName:rdi.parent.shortName, rdi.shortName, rdi.localUrl, rdi.deployedObject Sponsored by http://www.ThinkGeek.com/ ___ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jbosscx/src/main/org/jboss/resource RARDeployer.java RARDeployerMBean.java
User: user57 Date: 02/04/03 00:23:27 Modified:src/main/org/jboss/resource RARDeployer.java RARDeployerMBean.java Log: o DeployerMBean - SubDeployer o Extending SubDeployerSupport Revision ChangesPath 1.23 +9 -39 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.22 retrieving revision 1.23 diff -u -r1.22 -r1.23 --- RARDeployer.java 6 Mar 2002 01:07:45 - 1.22 +++ RARDeployer.java 3 Apr 2002 08:23:26 - 1.23 @@ -31,7 +31,9 @@ import javax.management.ObjectName; import org.jboss.deployment.DeploymentInfo; +import org.jboss.deployment.SubDeployerSupport; import org.jboss.deployment.DeploymentException; + import org.jboss.logging.Logger; import org.jboss.metadata.XmlFileLoader; import org.jboss.system.ServiceLibraries; @@ -44,15 +46,15 @@ import org.w3c.dom.Element; /** - * Service that deploys .rar files containing resource adapters. Deploying - * the RAR file is the first step in making the resource adapter available to - * application components; once it is deployed, one or more connection - * factories must be configured and bound into JNDI, a task performed by the - * codeConnectionFactoryLoader/code service. + * Service that deploys .rar files containing resource adapters. Deploying + * the RAR file is the first step in making the resource adapter available to + * application components; once it is deployed, one or more connection + * factories must be configured and bound into JNDI, a task performed by the + * codeConnectionFactoryLoader/code service. * * @author Toby Allsopp ([EMAIL PROTECTED]) * @author a href=mailto:[EMAIL PROTECTED];David Jencks/a - * @version$Revision: 1.22 $ + * @version$Revision: 1.23 $ * @seeorg.jboss.resource.ConnectionFactoryLoader p * * bRevisions:/b p @@ -74,7 +76,7 @@ * /ul */ public class RARDeployer - extends ServiceMBeanSupport + extends SubDeployerSupport implements RARDeployerMBean { private static int nextNum = 0; @@ -282,37 +284,5 @@ server, rdi.shortName ); - } - - public void startService() - { - try - { - // Register with the main deployer - server.invoke( -org.jboss.deployment.MainDeployerMBean.OBJECT_NAME, -addDeployer, -new Object[] {this}, -new String[] {org.jboss.deployment.DeployerMBean}); - } - catch (Exception e) { - log.error(Could not register with MainDeployer, e); - } - } - - public void stopService() - { - try - { - // Register with the main deployer - server.invoke( -org.jboss.deployment.MainDeployerMBean.OBJECT_NAME, -removeDeployer, -new Object[] {this}, -new String[] {org.jboss.deployment.DeployerMBean}); - } - catch (Exception e) { - log.error(Could not register with MainDeployer, e); - } } } 1.10 +3 -3 jbosscx/src/main/org/jboss/resource/RARDeployerMBean.java Index: RARDeployerMBean.java === RCS file: /cvsroot/jboss/jbosscx/src/main/org/jboss/resource/RARDeployerMBean.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- RARDeployerMBean.java 15 Feb 2002 06:18:28 - 1.9 +++ RARDeployerMBean.java 3 Apr 2002 08:23:26 - 1.10 @@ -11,16 +11,16 @@ import org.jboss.util.jmx.ObjectNameFactory; -import org.jboss.deployment.DeployerMBean; +import org.jboss.deployment.SubDeployerMBean; /** * Exposed management interface for the codeRARDeployer/code service. * * @author Toby Allsopp ([EMAIL PROTECTED]) - * @version$Revision: 1.9 $ + * @version$Revision: 1.10 $ */ public interface RARDeployerMBean - extends DeployerMBean + extends SubDeployerMBean { ObjectName OBJECT_NAME = ObjectNameFactory.create(jboss.jca:service=RARDeployer); } ___ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jbosscx/src/main/org/jboss/resource RARDeployer.java
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 ChangesPath 1.21 +39 -19jbosscx/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 - 1.20 +++ RARDeployer.java 22 Feb 2002 04:24:54 - 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 $ * @seeorg.jboss.resource.ConnectionFactoryLoader p * * bRevisions:/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
Re: [JBoss-dev] CVS update: jbosscx/src/main/org/jboss/resource RARDeployer.java
Jason, Is there a reason you are getting the serviceController in postRegister rather than start or create? Also are you working on EJBDeployer/Application/Container today? Thanks david jencks On 2002.02.11 22:22:01 -0500 Jason Dillon wrote: User: user57 Date: 02/02/11 19:22:01 Modified:src/main/org/jboss/resource RARDeployer.java Log: o Adding SafeObjectFactory, which simply makes ObjectNames and turns ant malformed exceptions into Errors. This is used to create ObjectName OBJECT_NAME fields, so we don't have to keep creating new ObjectNames all the time. o MainDeployer ServiceController use new ObjectName OBJECT_NAME o Updated refering classes to not wrap OBJECT_NAME with new ObjectName o Using MBeanProxy to talk to ServiceController (and MainDeployer in some areas). MBeanProxy is a central location to put in that pesky JMX exception handling + is tidies up the code base. Can evevntually optimize this to make it veru efficient too. o Putting org.jboss.util classes into lib/ext/jboss-util.jar and adding it to the bootlibraries, so that the core system components have access to these when loading (not just when running, aka after jboss-service.xml loads). * Need to clean up jboss-util, move deployable stuff out of it and such (they don't really belong there). o updated modules that needed util, to include jboss-util.jar in there external module config Revision ChangesPath 1.19 +109 -115 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.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- RARDeployer.java29 Jan 2002 21:12:22 - 1.18 +++ RARDeployer.java12 Feb 2002 03:22:01 - 1.19 @@ -1,9 +1,9 @@ /* -* JBoss, the OpenSource J2EE webOS -* -* Distributable under LGPL license. -* See terms of license at gnu.org. -*/ + * JBoss, the OpenSource J2EE webOS + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ package org.jboss.resource; @@ -26,8 +26,10 @@ import java.util.Map; import java.util.jar.JarEntry; import java.util.jar.JarFile; + import javax.management.Notification; import javax.management.ObjectName; + import org.jboss.deployment.DeploymentInfo; import org.jboss.deployment.DeploymentException; import org.jboss.logging.Logger; @@ -36,59 +38,64 @@ import org.jboss.system.ServiceMBeanSupport; import org.jboss.system.ServiceControllerMBean; import org.jboss.system.UnifiedClassLoader; +import org.jboss.util.MBeanProxy; + import org.w3c.dom.Document; import org.w3c.dom.Element; /** -* Service that deploys .rar files containing resource adapters. Deploying -* the RAR file is the first step in making the resource adapter available to -* application components; once it is deployed, one or more connection -* factories must be configured and bound into JNDI, a task performed by the -* codeConnectionFactoryLoader/code service. -* -* @author Toby Allsopp ([EMAIL PROTECTED]) -* @author a href=mailto:[EMAIL PROTECTED];David Jencks/a -* @version$Revision: 1.18 $ -* @seeorg.jboss.resource.ConnectionFactoryLoader p -* -* bRevisions:/b p -* -* b20010725 Toby Allsopp (patch from David Jencks)/b -* ul -*li Implemented codegetMetaData/code so that connection factories -*can be loaded after RAR deployment/li -* /ul -* b20011219 Marc Fleury/b -* ul -*li Make the deployer call create and start on the service it deploys/li -* /ul -* b20011227 Marc Fleury/b -* ul -*li Unification of deployers/li -* /ul -* -*/ + * Service that deploys .rar files containing resource adapters. Deploying + * the RAR file is the first step in making the resource adapter available to + * application components; once it is deployed, one or more connection + * factories must be configured and bound into JNDI, a task performed by the + * codeConnectionFactoryLoader/code service. + * + * @author Toby Allsopp ([EMAIL PROTECTED]) + * @author a href=mailto:[EMAIL PROTECTED];David Jencks/a + * @version$Revision: 1.19 $ + * @seeorg.jboss.resource.ConnectionFactoryLoader p + * + * bRevisions:/b p + * + * b20010725 Toby Allsopp (patch from David Jencks)/b + * ul + * li Implemented codegetMetaData/code so that connection factories + *can be loaded after RAR deployment/li + * /ul + * + * b20011219 Marc Fleury/b + *
[JBoss-dev] CVS update: jbosscx/src/main/org/jboss/resource RARDeployer.java
User: user57 Date: 02/02/11 19:22:01 Modified:src/main/org/jboss/resource RARDeployer.java Log: o Adding SafeObjectFactory, which simply makes ObjectNames and turns ant malformed exceptions into Errors. This is used to create ObjectName OBJECT_NAME fields, so we don't have to keep creating new ObjectNames all the time. o MainDeployer ServiceController use new ObjectName OBJECT_NAME o Updated refering classes to not wrap OBJECT_NAME with new ObjectName o Using MBeanProxy to talk to ServiceController (and MainDeployer in some areas). MBeanProxy is a central location to put in that pesky JMX exception handling + is tidies up the code base. Can evevntually optimize this to make it veru efficient too. o Putting org.jboss.util classes into lib/ext/jboss-util.jar and adding it to the bootlibraries, so that the core system components have access to these when loading (not just when running, aka after jboss-service.xml loads). * Need to clean up jboss-util, move deployable stuff out of it and such (they don't really belong there). o updated modules that needed util, to include jboss-util.jar in there external module config Revision ChangesPath 1.19 +109 -115 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.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- RARDeployer.java 29 Jan 2002 21:12:22 - 1.18 +++ RARDeployer.java 12 Feb 2002 03:22:01 - 1.19 @@ -1,9 +1,9 @@ /* -* JBoss, the OpenSource J2EE webOS -* -* Distributable under LGPL license. -* See terms of license at gnu.org. -*/ + * JBoss, the OpenSource J2EE webOS + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ package org.jboss.resource; @@ -26,8 +26,10 @@ import java.util.Map; import java.util.jar.JarEntry; import java.util.jar.JarFile; + import javax.management.Notification; import javax.management.ObjectName; + import org.jboss.deployment.DeploymentInfo; import org.jboss.deployment.DeploymentException; import org.jboss.logging.Logger; @@ -36,59 +38,64 @@ import org.jboss.system.ServiceMBeanSupport; import org.jboss.system.ServiceControllerMBean; import org.jboss.system.UnifiedClassLoader; +import org.jboss.util.MBeanProxy; + import org.w3c.dom.Document; import org.w3c.dom.Element; /** -* Service that deploys .rar files containing resource adapters. Deploying -* the RAR file is the first step in making the resource adapter available to -* application components; once it is deployed, one or more connection -* factories must be configured and bound into JNDI, a task performed by the -* codeConnectionFactoryLoader/code service. -* -* @author Toby Allsopp ([EMAIL PROTECTED]) -* @author a href=mailto:[EMAIL PROTECTED];David Jencks/a -* @version$Revision: 1.18 $ -* @seeorg.jboss.resource.ConnectionFactoryLoader p -* -* bRevisions:/b p -* -* b20010725 Toby Allsopp (patch from David Jencks)/b -* ul -*li Implemented codegetMetaData/code so that connection factories -*can be loaded after RAR deployment/li -* /ul -* b20011219 Marc Fleury/b -* ul -*li Make the deployer call create and start on the service it deploys/li -* /ul -* b20011227 Marc Fleury/b -* ul -*li Unification of deployers/li -* /ul -* -*/ + * Service that deploys .rar files containing resource adapters. Deploying + * the RAR file is the first step in making the resource adapter available to + * application components; once it is deployed, one or more connection + * factories must be configured and bound into JNDI, a task performed by the + * codeConnectionFactoryLoader/code service. + * + * @author Toby Allsopp ([EMAIL PROTECTED]) + * @author a href=mailto:[EMAIL PROTECTED];David Jencks/a + * @version$Revision: 1.19 $ + * @seeorg.jboss.resource.ConnectionFactoryLoader p + * + * bRevisions:/b p + * + * b20010725 Toby Allsopp (patch from David Jencks)/b + * ul + * li Implemented codegetMetaData/code so that connection factories + *can be loaded after RAR deployment/li + * /ul + * + * b20011219 Marc Fleury/b + * ul + * li Make the deployer call create and start on the service it deploys/li + * /ul + * + * b20011227 Marc Fleury/b + * ul + * li Unification of deployers/li + * /ul + */ public class RARDeployer -extends ServiceMBeanSupport -implements RARDeployerMBean + extends ServiceMBeanSupport + implements RARDeployerMBean { private static int nextNum =
[JBoss-dev] CVS update: jbosscx/src/main/org/jboss/resource RARDeployer.java RARDeployerMBean.java
User: d_jencks Date: 02/01/29 13:12:22 Modified:src/main/org/jboss/resource RARDeployer.java RARDeployerMBean.java Log: cleaned up hardcoded object name problems from new deployer work Revision ChangesPath 1.18 +2 -2 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.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- RARDeployer.java 2002/01/20 15:06:06 1.17 +++ RARDeployer.java 2002/01/29 21:12:22 1.18 @@ -48,7 +48,7 @@ * * @author Toby Allsopp ([EMAIL PROTECTED]) * @author a href=mailto:[EMAIL PROTECTED];David Jencks/a -* @version$Revision: 1.17 $ +* @version$Revision: 1.18 $ * @seeorg.jboss.resource.ConnectionFactoryLoader p * * bRevisions:/b p @@ -169,7 +169,7 @@ RARMetaData metaData = (RARMetaData) rdi.metaData; //set up the RARDeployment mbean for dependency management. - ObjectName deploymentName = new ObjectName(JCA:service=RARDeployment,name= + metaData.getDisplayName()); + ObjectName deploymentName = new ObjectName(jboss.jca:service=RARDeployment,name= + metaData.getDisplayName()); server.createMBean(org.jboss.resource.RARDeployment, deploymentName, new Object[] {metaData}, 1.7 +2 -2 jbosscx/src/main/org/jboss/resource/RARDeployerMBean.java Index: RARDeployerMBean.java === RCS file: /cvsroot/jboss/jbosscx/src/main/org/jboss/resource/RARDeployerMBean.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- RARDeployerMBean.java 2001/11/10 21:38:03 1.6 +++ RARDeployerMBean.java 2002/01/29 21:12:22 1.7 @@ -12,14 +12,14 @@ * Exposed management interface for the codeRARDeployer/code service. * * @author Toby Allsopp ([EMAIL PROTECTED]) - * @version$Revision: 1.6 $ + * @version$Revision: 1.7 $ */ public interface RARDeployerMBean extends DeployerMBean { // Constants - - String OBJECT_NAME = :service=RARDeployer; + String OBJECT_NAME = jboss.jca:service=RARDeployer; // Public ___ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jbosscx/src/main/org/jboss/resource RARDeployer.java
User: mnf999 Date: 02/01/20 07:06:07 Modified:src/main/org/jboss/resource RARDeployer.java Log: New deployer and integration of CL Revision ChangesPath 1.17 +169 -154 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.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- RARDeployer.java 2002/01/03 04:00:52 1.16 +++ RARDeployer.java 2002/01/20 15:06:06 1.17 @@ -1,9 +1,9 @@ /* - * JBoss, the OpenSource J2EE webOS - * - * Distributable under LGPL license. - * See terms of license at gnu.org. - */ +* JBoss, the OpenSource J2EE webOS +* +* Distributable under LGPL license. +* See terms of license at gnu.org. +*/ package org.jboss.resource; @@ -28,233 +28,248 @@ import java.util.jar.JarFile; import javax.management.Notification; import javax.management.ObjectName; -import org.jboss.deployment.DeployerMBeanSupport; +import org.jboss.deployment.DeploymentInfo; import org.jboss.deployment.DeploymentException; -import org.jboss.deployment.ServiceDeploymentInfo; import org.jboss.logging.Logger; import org.jboss.metadata.XmlFileLoader; import org.jboss.system.ServiceLibraries; -import org.jboss.system.URLClassLoader; +import org.jboss.system.ServiceMBeanSupport; +import org.jboss.system.ServiceControllerMBean; +import org.jboss.system.UnifiedClassLoader; import org.w3c.dom.Document; import org.w3c.dom.Element; /** - * Service that deploys .rar files containing resource adapters. Deploying - * the RAR file is the first step in making the resource adapter available to - * application components; once it is deployed, one or more connection - * factories must be configured and bound into JNDI, a task performed by the - * codeConnectionFactoryLoader/code service. - * - * @author Toby Allsopp ([EMAIL PROTECTED]) - * @author a href=mailto:[EMAIL PROTECTED];David Jencks/a - * @version$Revision: 1.16 $ - * @seeorg.jboss.resource.ConnectionFactoryLoader p - * - * bRevisions:/b p - * - * b20010725 Toby Allsopp (patch from David Jencks)/b - * ul - * li Implemented codegetMetaData/code so that connection factories - * can be loaded after RAR deployment/li - * /ul - * b20011219 Marc Fleury/b - * ul - * li Make the deployer call create and start on the service it deploys/li - * /ul - */ +* Service that deploys .rar files containing resource adapters. Deploying +* the RAR file is the first step in making the resource adapter available to +* application components; once it is deployed, one or more connection +* factories must be configured and bound into JNDI, a task performed by the +* codeConnectionFactoryLoader/code service. +* +* @author Toby Allsopp ([EMAIL PROTECTED]) +* @author a href=mailto:[EMAIL PROTECTED];David Jencks/a +* @version$Revision: 1.17 $ +* @seeorg.jboss.resource.ConnectionFactoryLoader p +* +* bRevisions:/b p +* +* b20010725 Toby Allsopp (patch from David Jencks)/b +* ul +*li Implemented codegetMetaData/code so that connection factories +*can be loaded after RAR deployment/li +* /ul +* b20011219 Marc Fleury/b +* ul +*li Make the deployer call create and start on the service it deploys/li +* /ul +* b20011227 Marc Fleury/b +* ul +*li Unification of deployers/li +* /ul +* +*/ public class RARDeployer - extends DeployerMBeanSupport - implements RARDeployerMBean +extends ServiceMBeanSupport +implements RARDeployerMBean { private static int nextNum = 0; + // Constants - + + // Attributes + + /** -* The next sequence number to be used in notifications about (un)deployment -*/ + * The next sequence number to be used in notifications about (un)deployment + */ private int nextMessageNum = 0; /** -* Gets the DeployableFilter attribute of the RARDeployer object -* -* @returnThe DeployableFilter value -*/ - public FilenameFilter getDeployableFilter() + * Gets the DeployableFilter attribute of the RARDeployer object + * + * @returnThe DeployableFilter value + */ + public boolean accepts(DeploymentInfo sdi) { - return - new FilenameFilter() - { - /** - * #Description of the Method - * - * @param dir Description of Parameter - * @param filename Description of Parameter - * @return
[JBoss-dev] CVS update: jbosscx/src/main/org/jboss/resource RARDeployer.java
User: mnf999 Date: 01/12/18 13:06:30 Modified:src/main/org/jboss/resource RARDeployer.java Log: Make the RARDeployer use create and start on the services it deploys Revision ChangesPath 1.15 +112 -101 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.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- RARDeployer.java 2001/11/26 03:24:52 1.14 +++ RARDeployer.java 2001/12/18 21:06:30 1.15 @@ -1,9 +1,9 @@ /* - * JBoss, the OpenSource J2EE webOS - * - * Distributable under LGPL license. - * See terms of license at gnu.org. - */ +* JBoss, the OpenSource J2EE webOS +* +* Distributable under LGPL license. +* See terms of license at gnu.org. +*/ package org.jboss.resource; @@ -33,6 +33,7 @@ import javax.management.ObjectName; import org.jboss.deployment.DeployerMBeanSupport; import org.jboss.deployment.DeploymentException; +import org.jboss.deployment.ServiceDeploymentInfo; import org.jboss.logging.Logger; import org.jboss.metadata.XmlFileLoader; import org.jboss.system.ServiceLibraries; @@ -49,7 +50,7 @@ * * @author Toby Allsopp ([EMAIL PROTECTED]) * @author a href=mailto:[EMAIL PROTECTED];David Jencks/a -* @version$Revision: 1.14 $ +* @version$Revision: 1.15 $ * @seeorg.jboss.resource.ConnectionFactoryLoader p * * bRevisions:/b p @@ -59,88 +60,93 @@ *li Implemented codegetMetaData/code so that connection factories *can be loaded after RAR deployment/li * /ul +* b20011219 Marc Fleury/b +* ul +*li Make the deployer call create and start on the service it deploys/li +* /ul * */ public class RARDeployer - extends DeployerMBeanSupport - implements RARDeployerMBean +extends DeployerMBeanSupport +implements RARDeployerMBean { - + // Package protected - - + // Protected - - + // Private --- - + private static int nextNum = 0; // Constants - - + // Attributes - - + + /** -* The next sequence number to be used in notifications about (un)deployment -*/ + * The next sequence number to be used in notifications about (un)deployment + */ private int nextMessageNum = 0; - + // Static - + // Constructors -- - + // Public - + /** -* Gets the DeployableFilter attribute of the RARDeployer object -* -* @returnThe DeployableFilter value -*/ + * Gets the DeployableFilter attribute of the RARDeployer object + * + * @returnThe DeployableFilter value + */ public FilenameFilter getDeployableFilter() { return - new FilenameFilter() + new FilenameFilter() + { + /** + * #Description of the Method + * + * @param dir Description of Parameter + * @param filename Description of Parameter + * @return Description of the Returned Value + */ + public boolean accept(File dir, String filename) { -/** - * #Description of the Method - * - * @param dir Description of Parameter - * @param filename Description of Parameter - * @return Description of the Returned Value - */ -public boolean accept(File dir, String filename) -{ - return filename.endsWith(.rar); -} - }; +return filename.endsWith(.rar); + } + }; } - + // RARDeployerMBean implementation --- - + // DeployerMBeanSupport overrides - - + /** -* Gets the Name attribute of the RARDeployer object -* -* @returnThe Name value -*/ + * Gets the Name attribute of the RARDeployer object + * + * @returnThe Name value + */ public String getName() { return RARDeployer; } - - -/** - * The codedeploy/code method deploys a rar at the given url. - * - *
[JBoss-dev] CVS update: jbosscx/src/main/org/jboss/resource RARDeployer.java
User: d_jencks Date: 01/11/18 22:58:56 Modified:src/main/org/jboss/resource RARDeployer.java Log: Cleaned up deployment a bit and enabled jar in sar Revision ChangesPath 1.13 +22 -42jbosscx/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.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- RARDeployer.java 2001/11/10 21:38:03 1.12 +++ RARDeployer.java 2001/11/19 06:58:56 1.13 @@ -49,7 +49,7 @@ * * @author Toby Allsopp ([EMAIL PROTECTED]) * @author a href=mailto:[EMAIL PROTECTED];David Jencks/a -* @version$Revision: 1.12 $ +* @version$Revision: 1.13 $ * @seeorg.jboss.resource.ConnectionFactoryLoader p * * bRevisions:/b p @@ -139,15 +139,13 @@ protected Object deploy(URL url) throws IOException, DeploymentException { - category.info(Attempting to deploy RAR at ' + url + '); - File localCopy = getLocalCopy(url, null); + getLog().info(Attempting to deploy RAR at ' + url + '); + RarDeploymentInfo rdi = new RarDeploymentInfo(url); + File localCopy = getLocalCopy(url, rdi); URL localUrl =localCopy.toURL(); - Collection jars = new ArrayList(); - Collection xmls = new ArrayList(); - File unpackedDir = recursiveUnpack(localUrl, jars, xmls); + extractPackages(localUrl, rdi); URL ddUrl = null; - Iterator i = xmls.iterator(); - while (i.hasNext()) + for (Iterator i = rdi.getXmlUrls().iterator(); i.hasNext();) { URL xml = (URL)i.next(); if (xml.getFile().endsWith(META-INF/ra.xml)) @@ -180,7 +178,7 @@ metadata.importXml(root); // Create a class loader that can load classes from any JARs - // inside the RAR. RecursiveUnpack found the JARs. + // inside the RAR. extractPackages found the JARs. // Ok, now we have the URLs of the JARs contained in the RAR we @@ -189,9 +187,7 @@ //will be universally available without unavailable interface //problems! //We use the original (uncopied) url as the id key. - ClassLoader cl = new org.jboss.system.URLClassLoader( -(URL[])jars.toArray(new URL[0]), url); - + ClassLoader cl = rdi.createClassLoader(); metadata.setClassLoader(cl); //set up the RARDeployment mbean for dependency management. @@ -217,26 +213,24 @@ throw new DeploymentException(Problem making RARDeployment MBean, e); } // end of try-catch - DeploymentInfo info = new DeploymentInfo(); - info.metadata = metadata; - info.unpackedDir = unpackedDir; - return info; + rdi.metadata = metadata; + return rdi; } protected void undeploy(URL url, Object o) throws DeploymentException { - category.info(Undeploying RAR at ' + url + '); + getLog().info(Undeploying RAR at ' + url + '); - DeploymentInfo info = (DeploymentInfo)o; + RarDeploymentInfo rdi = (RarDeploymentInfo)o; - if (info == null) + if (rdi == null) { throw new DeploymentException(There doesn't appear to be a RAR + deployed at ' + url + '); } - RARMetaData metadata = info.metadata; + RARMetaData metadata = rdi.metadata; try { ObjectName deploymentName = new ObjectName(JCA:service=RARDeployment,name= + metadata.getDisplayName()); @@ -268,26 +262,7 @@ } metadata.setClassLoader(null); // Remove the temporary copy - - File unpackedDir = info.unpackedDir; - if (!recursiveDelete(unpackedDir)) - { - category.warn(Unable to recursively delete temp directory ' + - unpackedDir + ' - this should be cleaned up either + - when the server is shut down or when it restarts.); - } - URL[] urls = cl.getURLs(); - for (int i = urls.length - 1; i=0; i--) - { - File dir = new File(urls[i].getFile()); - if (!recursiveDelete(dir)) - { -category.warn(Unable to recursively delete temp directory ' + - dir + ' - this should be cleaned up either + - when the server is shut down or when it restarts.); - } - } - + rdi.cleanup(getLog()); } @@ -295,9 +270,14 @@ /** */ - private static class DeploymentInfo + private static class RarDeploymentInfo extends DeployerMBeanSupport.DeploymentInfo { public RARMetaData metadata; - public File unpackedDir; + + public
[JBoss-dev] CVS update: jbosscx/src/main/org/jboss/resource RARDeployer.java RARMetaData.java
User: starksm Date: 01/11/02 00:38:08 Modified:src/main/org/jboss/resource Tag: Branch_2_4 RARDeployer.java RARMetaData.java Log: Add the RAR jar files to the server MLet class loader on deployment to make the adapapter available to all components. Revision ChangesPath No revision No revision 1.3.2.2 +12 -31jbosscx/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.3.2.1 retrieving revision 1.3.2.2 diff -u -r1.3.2.1 -r1.3.2.2 --- RARDeployer.java 2001/09/30 22:44:26 1.3.2.1 +++ RARDeployer.java 2001/11/02 08:38:06 1.3.2.2 @@ -28,6 +28,7 @@ import java.util.jar.JarFile; import javax.management.Notification; +import javax.management.loading.MLet; import org.jboss.deployment.DeployerMBeanSupport; import org.jboss.deployment.DeploymentException; @@ -46,7 +47,8 @@ * * @author Toby Allsopp ([EMAIL PROTECTED]) * @author a href=mailto:[EMAIL PROTECTED];David Jencks/a - * @version$Revision: 1.3.2.1 $ + * @author [EMAIL PROTECTED] + * @version$Revision: 1.3.2.2 $ * @seeorg.jboss.resource.ConnectionFactoryLoader p * * bRevisions:/b p @@ -283,58 +285,38 @@ } Document dd; - try - { - dd = XmlFileLoader.getDocument(ddFile.toURL()); - } - catch (org.jboss.ejb.DeploymentException de) - { - throw new DeploymentException(de.getMessage(), de.getCause()); - } + dd = XmlFileLoader.getDocument(ddFile.toURL()); Element root = dd.getDocumentElement(); RARMetaData metadata = new RARMetaData(); metadata.importXml(root); - // Create a class loader that can load classes from any JARs - // inside the RAR. First, we need to find the JARs. - + // First, we need to find the JARs in the RAR archive Collection jars = new ArrayList(); - FileFilter filter = new FileFilter() { -/** - * #Description of the Method - * - * @param file Description of Parameter - * @return Description of the Returned Value - */ public boolean accept(File file) { return file.getName().endsWith(.jar); } }; Collection jarFiles = recursiveFind(unpackedDir, filter); + /* We need to make all of the RAR jars available to all components in the + app server so we need to add the jars to the main MLet class loader. + */ + MLet mlet = (MLet) Thread.currentThread().getContextClassLoader(); category.debug(Adding the following URLs to classpath:); for (Iterator i = jarFiles.iterator(); i.hasNext(); ) { - File file = (File)i.next(); + File file = (File) i.next(); URL jarUrl = file.toURL(); - jars.add(jarUrl); category.debug(jarUrl.toString()); + mlet.addURL(jarUrl); } + metadata.setClassLoader(mlet); - // Ok, now we have the URLs of the JARs contained in the RAR we - // can create a classloader that loads classes from them - - ClassLoader cl = new URLClassLoader( -(URL[])jars.toArray(new URL[0]), -Thread.currentThread().getContextClassLoader()); - - metadata.setClassLoader(cl); - // Let's tell the waiting hordes (of connection factory loaders) // that this resource adapter is available @@ -375,7 +357,6 @@ sendNotification(notification); // Remove the temporary copy - File unpackedDir = info.unpackedDir; if (!recursiveDelete(unpackedDir)) { 1.3.2.2 +10 -22jbosscx/src/main/org/jboss/resource/RARMetaData.java Index: RARMetaData.java === RCS file: /cvsroot/jboss/jbosscx/src/main/org/jboss/resource/RARMetaData.java,v retrieving revision 1.3.2.1 retrieving revision 1.3.2.2 diff -u -r1.3.2.1 -r1.3.2.2 --- RARMetaData.java 2001/09/30 22:44:26 1.3.2.1 +++ RARMetaData.java 2001/11/02 08:38:07 1.3.2.2 @@ -25,7 +25,7 @@ * * @author Toby Allsopp ([EMAIL PROTECTED]) * @seeRARDeployer - * @version$Revision: 1.3.2.1 $ + * @version$Revision: 1.3.2.2 $ */ public class RARMetaData // extends Y @@ -278,8 +278,6 @@ private void setConfigProperty(Element element) throws DeploymentException { - try - { Element nameE =
[JBoss-dev] CVS update: jbosscx/src/main/org/jboss/resource RARDeployer.java
User: d_jencks Date: 01/09/26 14:47:03 Modified:src/main/org/jboss/resource RARDeployer.java Log: ServiceDeployer: added local dir support, undeploy support for depends, reworked classpath dependencies. Changed config files to work. REMOVE core-service.xml or build.sh cleancvs update -d -P update11.log Revision ChangesPath 1.11 +59 -313 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.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- RARDeployer.java 2001/09/11 18:38:58 1.10 +++ RARDeployer.java 2001/09/26 21:47:03 1.11 @@ -17,7 +17,7 @@ import java.net.JarURLConnection; import java.net.MalformedURLException; import java.net.URL; -import java.net.URLClassLoader; +//import java.net.URLClassLoader;Replaced with org.jboss.system.URLClassLoader. import java.util.ArrayList; import java.util.Collection; import java.util.Enumeration; @@ -33,6 +33,8 @@ import org.jboss.deployment.DeploymentException; import org.jboss.logging.Logger; import org.jboss.metadata.XmlFileLoader; +import org.jboss.system.ServiceLibraries; +import org.jboss.system.URLClassLoader; import org.w3c.dom.Document; import org.w3c.dom.Element; @@ -46,7 +48,7 @@ * * @author Toby Allsopp ([EMAIL PROTECTED]) * @author a href=mailto:[EMAIL PROTECTED];David Jencks/a -* @version$Revision: 1.10 $ +* @version$Revision: 1.11 $ * @seeorg.jboss.resource.ConnectionFactoryLoader p * * bRevisions:/b p @@ -74,27 +76,12 @@ // Attributes - /* -* log4j Category for logging -*/ - private Logger category = Logger.create(RARDeployer.class); /** -* The directory that will contain local copies of deployed RARs -*/ - private File rarTmpDir; - - /** * The next sequence number to be used in notifications about (un)deployment */ private int nextMessageNum = 0; - private static String generateUniqueDirName(URL u) - { - int thisNum = nextNum++; - return rar. + thisNum; - } - // Static // Constructors -- @@ -160,121 +147,36 @@ return null; } - /** -* #Description of the Method -* -* @exception Exception Description of Exception -*/ - public void initService() - throws Exception - { - // find the temp directory - referenced to jboss.system.home property - File jbossHomeDir = new File(System.getProperty(jboss.system.home)); - File tmpDir = new File(jbossHomeDir, tmp+File.separator); - - // Create our temp directory - File deployTmpDir = new File(tmpDir, deploy); - rarTmpDir = new File(deployTmpDir, getName()); - if (rarTmpDir.exists()) - { - category.info(Found a temp directory left over from a previous run - + - deleting it.); - // What could it mean? - if (!recursiveDelete(rarTmpDir)) - { -category.warn(Unable to recursively delete temp directory ' + - rarTmpDir + ' that appears to be left over from + - the previous run. This might cause problems.); - } - } - if (!rarTmpDir.exists() !rarTmpDir.mkdirs()) - { - throw new DeploymentException(Can't create temp directory ' + - rarTmpDir + '); - } - } - - /** -* #Description of the Method -*/ - public void destroyService() - { - // Remove our temp directory - if (!recursiveDelete(rarTmpDir)) - { - category.warn(Unable to recursively delete the temp directory ' + - rarTmpDir + ' - it should be cleaned up when the + - server is next restarted.); - } - } - - protected Object deploy(URL url) +/** + * The codedeploy/code method deploys a rar at the given url. + * + * @param url The codeURL/code location of the rar to deploy. + * @return an codeObject/code to identify this deployment. + * @exception IOException if an error occurs + * @exception DeploymentException if an error occurs + */ +protected Object deploy(URL url) throws IOException, DeploymentException { category.info(Attempting to deploy RAR at ' + url + '); - - // We want to take a local copy of the RAR so that we don't run - // into problems if the original is removed/replaced. We also - // need the RAR in
[JBoss-dev] CVS update: jbosscx/src/main/org/jboss/resource RARDeployer.java
User: user57 Date: 01/08/16 14:49:11 Modified:src/main/org/jboss/resource RARDeployer.java Log: o use mkdirs() instead of mkdir() when creating the temp directory to avoid exceptions when the base directory does not exist. Revision ChangesPath 1.5 +6 -4 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.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- RARDeployer.java 2001/07/25 09:47:46 1.4 +++ RARDeployer.java 2001/08/16 21:49:10 1.5 @@ -46,7 +46,7 @@ * service. * * @author Toby Allsopp ([EMAIL PROTECTED]) - * @version $Revision: 1.4 $ + * @version $Revision: 1.5 $ * * @see org.jboss.resource.ConnectionFactoryLoader * @@ -67,8 +67,10 @@ /** The directory that will contain local copies of deployed RARs */ private File rarTmpDir; - /** The next sequence number to be used in notifications about - (un)deployment */ + /** +* The next sequence number to be used in notifications about +* (un)deployment +*/ private int nextMessageNum = 0; // Static @@ -131,7 +133,7 @@ the previous run. This might cause problems.); } } - if (!rarTmpDir.exists() !rarTmpDir.mkdir()) + if (!rarTmpDir.exists() !rarTmpDir.mkdirs()) { throw new DeploymentException(Can't create temp directory ' + rarTmpDir + '); ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jbosscx/src/main/org/jboss/resource RARDeployer.java
User: tobyallsopp Date: 01/05/04 23:38:28 Modified:src/main/org/jboss/resource Tag: Branch_2_2 RARDeployer.java Log: Fixed the RAR redployment bug (#415516) thanks to a patch from Claudio Vesco. Revision ChangesPath No revision No revision 1.1.1.1.2.1 +22 -9 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.1.1.1 retrieving revision 1.1.1.1.2.1 diff -u -r1.1.1.1 -r1.1.1.1.2.1 --- RARDeployer.java 2001/02/06 06:54:40 1.1.1.1 +++ RARDeployer.java 2001/05/05 06:38:28 1.1.1.1.2.1 @@ -47,7 +47,7 @@ * codeConnectionFactoryLoader/code service. * * @author Toby Allsopp ([EMAIL PROTECTED]) - * @version $Revision: 1.1.1.1 $ + * @version $Revision: 1.1.1.1.2.1 $ * * @see org.jboss.resource.ConnectionFactoryLoader */ @@ -128,7 +128,8 @@ // included JARs for classloading (I don't think URLClassLoader // deals with JARs within JARs). - File unpackedDir = new File(rarTmpDir, generateUniqueDirName(url)); + String unpackedDirName = generateUniqueDirName(url); + File unpackedDir = new File(rarTmpDir, unpackedDirName); if (unpackedDir.exists()) { throw new DeploymentException(The application at URL ' + url + ' + @@ -150,8 +151,21 @@ } else { - // this is a .rar file somewhere - inflateJar(url, unpackedDir); + // this is a .rar file somewhere so we copy it to the temp + // dir because otherwise we run into problems when we try to + // open it again later + File copyFile = new File(rarTmpDir, copy + unpackedDirName); + InputStream input = url.openStream(); + try + { +OutputStream output = new FileOutputStream(copyFile); +try +{ + copy(input, output); +} finally { output.close(); } + } finally { input.close(); } + // then we can inflate the copy without fear of retribution + inflateJar(copyFile.toURL(), unpackedDir); } // Right, now we can forget about URLs and just use the file @@ -202,15 +216,14 @@ } }; Collection jarFiles = recursiveFind(unpackedDir, filter); + log.debug(Adding the following URLs to classpath:); for (Iterator i = jarFiles.iterator(); i.hasNext(); ) { File file = (File) i.next(); - jars.add(file.toURL()); + URL jarUrl = file.toURL(); + jars.add(jarUrl); + log.debug(jarUrl.toString()); } - - log.debug(Adding the following URLs to classpath:); - for (Iterator i = jars.iterator(); i.hasNext(); ) - log.debug(((URL) i.next()).toString()); // Ok, now we have the URLs of the JARs contained in the RAR we // can create a classloader that loads classes from them ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jbosscx/src/main/org/jboss/resource RARDeployer.java
User: tobyallsopp Date: 01/05/05 00:12:46 Modified:src/main/org/jboss/resource RARDeployer.java Log: Fixed the RAR redployment bug (#415516) thanks to a patch from Claudio Vesco. Revision ChangesPath 1.3 +22 -9 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.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- RARDeployer.java 2001/04/15 04:31:39 1.2 +++ RARDeployer.java 2001/05/05 07:12:46 1.3 @@ -48,7 +48,7 @@ * codeConnectionFactoryLoader/code service. * * @author Toby Allsopp ([EMAIL PROTECTED]) - * @version $Revision: 1.2 $ + * @version $Revision: 1.3 $ * * @see org.jboss.resource.ConnectionFactoryLoader */ @@ -140,7 +140,8 @@ // included JARs for classloading (I don't think URLClassLoader // deals with JARs within JARs). - File unpackedDir = new File(rarTmpDir, generateUniqueDirName(url)); + String unpackedDirName = generateUniqueDirName(url); + File unpackedDir = new File(rarTmpDir, unpackedDirName); if (unpackedDir.exists()) { throw new DeploymentException(The application at URL ' + url + ' + @@ -162,8 +163,21 @@ } else { - // this is a .rar file somewhere - inflateJar(url, unpackedDir); + // this is a .rar file somewhere so we copy it to the temp + // dir because otherwise we run into problems when we try to + // open it again later + File copyFile = new File(rarTmpDir, copy + unpackedDirName); + InputStream input = url.openStream(); + try + { +OutputStream output = new FileOutputStream(copyFile); +try +{ + copy(input, output); +} finally { output.close(); } + } finally { input.close(); } + // then we can inflate the copy without fear of retribution + inflateJar(copyFile.toURL(), unpackedDir); } // Right, now we can forget about URLs and just use the file @@ -214,15 +228,14 @@ } }; Collection jarFiles = recursiveFind(unpackedDir, filter); + log.debug(Adding the following URLs to classpath:); for (Iterator i = jarFiles.iterator(); i.hasNext(); ) { File file = (File) i.next(); - jars.add(file.toURL()); + URL jarUrl = file.toURL(); + jars.add(jarUrl); + log.debug(jarUrl.toString()); } - - log.debug(Adding the following URLs to classpath:); - for (Iterator i = jars.iterator(); i.hasNext(); ) - log.debug(((URL) i.next()).toString()); // Ok, now we have the URLs of the JARs contained in the RAR we // can create a classloader that loads classes from them ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development