/** * Deploy * @param raa The resource adapter archive * @exception Throwable If an error occurs */ public void deploy(ResourceAdapterArchive raa) throws Throwable { if (raa == null) throw new IllegalArgumentException("Url is null"); if (!raa.getName().endsWith(".rar")) throw new IllegalArgumentException(raa.getName() + " doesn't end with .rar"); if (!started) throw new IllegalStateException("Container not started"); File parentDirectory = new File(SecurityActions.getSystemProperty("java.io.tmpdir")); File raaFile = new File(parentDirectory, raa.getName()); if (shrinkwrapDeployments != null && shrinkwrapDeployments.contains(raaFile)) throw new IOException(raa.getName() + " already deployed"); if (raaFile.exists()) recursiveDelete(raaFile); raa.as(ZipExporter.class).exportTo(raaFile, true); if (shrinkwrapDeployments == null) shrinkwrapDeployments = new ArrayList<File>(1); shrinkwrapDeployments.add(raaFile); log.debugf("Deploying: %s", raaFile); kernel.getMainDeployer().deploy(raaFile.toURI().toURL()); }
/** * Deploy * @param raa The resource adapter archive * @exception Throwable If an error occurs */ public void deploy(ResourceAdapterArchive raa) throws Throwable { if (raa == null) throw new IllegalArgumentException("Url is null"); if (!raa.getName().endsWith(".rar")) throw new IllegalArgumentException(raa.getName() + " doesn't end with .rar"); if (!started) throw new IllegalStateException("Container not started"); File parentDirectory = new File(SecurityActions.getSystemProperty("java.io.tmpdir")); File raaFile = new File(parentDirectory, raa.getName()); if (shrinkwrapDeployments != null && shrinkwrapDeployments.contains(raaFile)) throw new IOException(raa.getName() + " already deployed"); if (raaFile.exists()) recursiveDelete(raaFile); raa.as(ZipExporter.class).exportTo(raaFile, true); if (shrinkwrapDeployments == null) shrinkwrapDeployments = new ArrayList<File>(1); shrinkwrapDeployments.add(raaFile); log.debugf("Deploying: %s", raaFile); kernel.getMainDeployer().deploy(raaFile.toURI().toURL()); }