@Override public ReadableArchive getOriginalSource() { try { File appRoot = context.getSourceDir(); File origModuleFile = new File(appRoot, moduleUri); return archiveFactory.openArchive( origModuleFile); } catch (IOException ioe) { return null; } }
public void validateSniffers(Collection<? extends Sniffer> snifferCol, DeploymentContext context) { for (Sniffer sniffer : snifferCol) { String[] incompatTypes = sniffer.getIncompatibleSnifferTypes(); if (incompatTypes==null) return; for (String type : incompatTypes) { for (Sniffer sniffer2 : snifferCol) { if (sniffer2.getModuleType().equals(type)) { throw new IllegalArgumentException( localStrings.getLocalString( "invalidarchivepackaging", "Invalid archive packaging {2}", sniffer.getModuleType(), type, context.getSourceDir().getPath())); } } } } } }
classpath.append(ctx.getSourceDir().toURI().getPath()); classpath.append(File.pathSeparator);
private WebModuleConfig loadWebModuleConfig(DeploymentContext dc) { WebModuleConfig wmInfo = new WebModuleConfig(); try { DeployCommandParameters params = dc.getCommandParameters(DeployCommandParameters.class); wmInfo.setDescriptor(dc.getModuleMetaData(WebBundleDescriptor.class)); wmInfo.setVirtualServers(params.virtualservers); wmInfo.setLocation(dc.getSourceDir()); wmInfo.setObjectType(dc.getAppProps().getProperty(ServerTags.OBJECT_TYPE)); } catch (Exception ex) { String msg = rb.getString("webdeployer.loadWebModuleConfig"); msg = MessageFormat.format(msg, wmInfo.getName()); logger.log(Level.WARNING, msg, ex); } return wmInfo; }
protected void saveAppDescriptor(Application application, DeploymentContext context) throws IOException { if (application != null) { ReadableArchive archive = archiveFactory.openArchive( context.getSourceDir()); boolean isMkdirs = context.getScratchDir("xml").mkdirs(); if (isMkdirs) { WritableArchive archive2 = archiveFactory.createArchive( context.getScratchDir("xml")); descriptorArchivist.write(application, archive, archive2); // copy the additional webservice elements etc applicationArchivist.copyExtraElements(archive, archive2); } else { context.getLogger().log(Level.WARNING, "Error in creating directory " + context.getScratchDir("xml").getAbsolutePath()); } } }
new GFEjbJarXMLParser(context.getSourceDir()); compatProp = gfEjbJarXMLParser.getCompatibilityValue(); if (compatProp != null) { new SunEjbJarXMLParser(context.getSourceDir()); compatProp = sunEjbJarXMLParser.getCompatibilityValue(); if (compatProp != null) { List<URL> moduleRootLibraries = ASClassLoaderUtil.getURLsAsList(null, new File[] {context.getSourceDir()}, true); for (URL url : moduleRootLibraries) { cloader.addURL(url);
/** * This is to be used for filepublishing only. Incase of wsdlImports and wsdlIncludes * we need to copy the nested wsdls from applications folder to the generated/xml folder * */ private void copyExtraFilesToGeneratedFolder( DeploymentContext context) throws IOException{ Archivist archivist = habitat.getByContract(Archivist.class); ReadableArchive archive = archiveFactory.openArchive( context.getSourceDir()); WritableArchive archive2 = archiveFactory.createArchive( context.getScratchDir("xml")); // copy the additional webservice elements etc archivist.copyExtraElements(archive, archive2); }
new SunEjbJarXMLParser(context.getSourceDir()); compatProp = sunEjbJarXMLParser.getCompatibilityValue(); if (compatProp != null) { List<URL> moduleRootLibraries = ASClassLoaderUtil.getURLsAsList(null, new File[]{context.getSourceDir()}, true); for (URL url : moduleRootLibraries) { cloader.addURL(url);
/** * Clean any files and artifacts that were created during the execution * of the prepare method. * * @param dc deployment context */ public void clean(DeploymentContext dc) { super.clean(dc); //delete resource configuration UndeployCommandParameters dcp = dc.getCommandParameters(UndeployCommandParameters.class); if (dcp != null && dcp.origin == OpsParams.Origin.undeploy) { if (dcp.cascade != null && dcp.cascade) { File sourceDir = dc.getSourceDir(); String moduleName = sourceDir.getName(); if (ConnectorsUtil.isEmbedded(dc)) { String applicationName = ConnectorsUtil.getApplicationName(dc); moduleName = ConnectorsUtil.getEmbeddedRarModuleName(applicationName, moduleName); } deleteAllResources(moduleName, dcp.target); } } }
String errMsg = localStrings.getLocalString("context.contains.no.ejb", "DeploymentContext does not contain any EJB", dc.getSourceDir()); throw new RuntimeException(errMsg);
_logger.log( Level.FINE, "EjbDeployer Loading app from: " + dc.getSourceDir()); " Check archive to ensure correct packaging for " + dc.getSourceDir());
_logger.log( Level.FINE, "EjbDeployer Loading app from: " + dc.getSourceDir()); " Check archive to ensure correct packaging for " + dc.getSourceDir());
File moduleDir = dc.getSourceDir();
String errMsg = localStrings.getLocalString("context.contains.no.ejb", "DeploymentContext does not contain any EJB", dc.getSourceDir()); throw new RuntimeException(errMsg);
File f = new File(dc.getSourceDir(),next.getWsdlFileUri()) ; url = f.toURL();
try { final File outDir = dc.getScratchDir(env.kCompileJspDirName); final File inDir = dc.getSourceDir(); boolean delegate = true; com.sun.enterprise.deployment.runtime.web.ClassLoader clBean =
@Override public void run(Habitat habitat, DeploymentContext context, String cp) throws Exception { rootLocation_ = new FileArchive(); BundleDescriptor bundle = DOLUtils.getCurrentBundleForContext(context); if (bundle.hasWebServiceClients() && (bundle instanceof ApplicationClientDescriptor)) { hasWebServiceClients = true; } if(bundle.isStandalone()) { rootLocation_.open(context.getSourceDir().toURI()); } else { rootLocation_.open(context.getSource().getParentArchive().getURI()); } this.context = context; this.habitat = habitat; this.moduleClassPath = cp; Application application = context.getModuleMetaData(Application.class); application.visit((ApplicationVisitor) this); }
public ConnectorApplication load(ConnectorContainer container, DeploymentContext context) { super.load(container, context); File sourceDir = context.getSourceDir(); String sourcePath = sourceDir.getAbsolutePath(); String moduleName = sourceDir.getName();
} catch(Exception e) { throw new DeploymentException("Static RMI-IIOP Stub Generation exception for " + dc.getSourceDir(), e);
} catch(Exception e) { throw new DeploymentException("Static RMI-IIOP Stub Generation exception for " + dc.getSourceDir(), e);