Search in sources :

Example 56 with Application

use of com.sun.enterprise.deployment.Application in project Payara by payara.

the class ApplicationArchivist method copyInto.

/**
 * Copy this archivist to a new abstract archive
 *
 * @param source
 *            the archive to copy from
 * @param target
 *            the new archive to use to copy our contents into
 */
public void copyInto(ReadableArchive source, WritableArchive target) throws IOException {
    try {
        Application a = readStandardDeploymentDescriptor(source);
        copyInto(a, source, target);
    } catch (SAXParseException spe) {
        DOLUtils.getDefaultLogger().log(SEVERE, "enterprise.deployment.backend.fileCopyFailure", spe);
    }
}
Also used : SAXParseException(org.xml.sax.SAXParseException) Application(com.sun.enterprise.deployment.Application)

Example 57 with Application

use of com.sun.enterprise.deployment.Application in project Payara by payara.

the class ApplicationFactory method openArchive.

/**
 * Open a jar file and return an application object for the modules contained
 * in the archive/directory. If the archive/directory is a standalone module, this API will
 * create an empty application and add the standalone module to it
 *
 * @param archivist         to use to open the archive file
 * @param jarFile           the archive file
 * @param handleRuntimeInfo set to true to read configuration deployment descriptors
 * @return the application object
 */
public Application openArchive(Archivist archivist, URI jarFile, boolean handleRuntimeInfo) throws IOException, SAXParseException {
    // never read the runtime deployment descriptor before the
    // module type is found and the application object created
    ReadableArchive archive = archiveFactory.openArchive(jarFile);
    Application application = openArchive(archivist, archive, handleRuntimeInfo);
    archive.close();
    return application;
}
Also used : ReadableArchive(org.glassfish.api.deployment.archive.ReadableArchive) Application(com.sun.enterprise.deployment.Application)

Example 58 with Application

use of com.sun.enterprise.deployment.Application in project Payara by payara.

the class WLSApplicationRuntimeDDFile method getRootXMLNode.

/**
 * @return a RootXMLNode responsible for handling the deployment
 * descriptors associated with this J2EE module
 *
 * @param the descriptor for which we need the node
 */
public RootXMLNode getRootXMLNode(Descriptor descriptor) {
    if (descriptor instanceof Application) {
        Application application = (Application) descriptor;
        RootXMLNode node = application.getRootNode(getDeploymentDescriptorPath());
        if (node == null) {
            node = new WeblogicApplicationNode(application);
            application.addRootNode(getDeploymentDescriptorPath(), node);
        }
        return node;
    }
    return new WeblogicApplicationNode();
}
Also used : WeblogicApplicationNode(com.sun.enterprise.deployment.node.runtime.application.wls.WeblogicApplicationNode) RootXMLNode(com.sun.enterprise.deployment.node.RootXMLNode) Application(com.sun.enterprise.deployment.Application)

Example 59 with Application

use of com.sun.enterprise.deployment.Application in project Payara by payara.

the class ApplicationParamNode method writeDescriptors.

/**
 * write all occurrences of the descriptor corresponding to the current
 * node from the parent descriptor to an JAXP DOM node and return it
 *
 * This API will be invoked by the parent node when the parent node
 * writes out a mix of statically and dynamically registered sub nodes.
 *
 * This method should be overriden by the sub classes if it
 * needs to be called by the parent node.
 *
 * @param parent node in the DOM tree
 * @param nodeName the name of the node
 * @param parentDesc parent descriptor of the descriptor to be written
 * @return the JAXP DOM node
 */
@Override
public Node writeDescriptors(Node parent, String nodeName, Descriptor parentDesc) {
    if (parentDesc instanceof Application) {
        Application application = (Application) parentDesc;
        // application-param*
        Set<ApplicationParam> applicationParams = application.getApplicationParams();
        for (ApplicationParam appParam : applicationParams) {
            writeDescriptor(parent, nodeName, (EnvironmentProperty) appParam);
        }
    }
    return parent;
}
Also used : ApplicationParam(com.sun.enterprise.deployment.runtime.application.wls.ApplicationParam) Application(com.sun.enterprise.deployment.Application)

Example 60 with Application

use of com.sun.enterprise.deployment.Application in project Payara by payara.

the class ResourceValidator method getJavaGlobalJndiNamePrefix.

private String getJavaGlobalJndiNamePrefix(EjbDescriptor ejbDescriptor) {
    String appName = null;
    Application app = ejbDescriptor.getApplication();
    if (!app.isVirtual()) {
        appName = ejbDescriptor.getApplication().getAppName();
    }
    EjbBundleDescriptor ejbBundle = ejbDescriptor.getEjbBundleDescriptor();
    String modName = ejbBundle.getModuleDescriptor().getModuleName();
    String ejbName = ejbDescriptor.getName();
    StringBuilder javaGlobalPrefix = new StringBuilder("java:global/");
    if (appName != null) {
        javaGlobalPrefix.append(appName);
        javaGlobalPrefix.append("/");
    }
    javaGlobalPrefix.append(modName);
    javaGlobalPrefix.append("/");
    javaGlobalPrefix.append(ejbName);
    return javaGlobalPrefix.toString();
}
Also used : Application(com.sun.enterprise.deployment.Application)

Aggregations

Application (com.sun.enterprise.deployment.Application)66 BundleDescriptor (com.sun.enterprise.deployment.BundleDescriptor)17 WebBundleDescriptor (com.sun.enterprise.deployment.WebBundleDescriptor)10 DeployCommandParameters (org.glassfish.api.deployment.DeployCommandParameters)10 ApplicationInfo (org.glassfish.internal.data.ApplicationInfo)10 IOException (java.io.IOException)9 File (java.io.File)8 ModuleDescriptor (org.glassfish.deployment.common.ModuleDescriptor)8 EjbBundleDescriptor (com.sun.enterprise.deployment.EjbBundleDescriptor)7 ReadableArchive (org.glassfish.api.deployment.archive.ReadableArchive)7 EjbDescriptor (com.sun.enterprise.deployment.EjbDescriptor)5 DeploymentException (org.glassfish.deployment.common.DeploymentException)5 SAXParseException (org.xml.sax.SAXParseException)5 ApplicationClientDescriptor (com.sun.enterprise.deployment.ApplicationClientDescriptor)4 ArrayList (java.util.ArrayList)4 WebappClassLoader (org.glassfish.web.loader.WebappClassLoader)4 OpsParams (org.glassfish.api.deployment.OpsParams)3 EjbBundleDescriptorImpl (org.glassfish.ejb.deployment.descriptor.EjbBundleDescriptorImpl)3 Applications (com.sun.enterprise.config.serverbeans.Applications)2 WebComponentDescriptor (com.sun.enterprise.deployment.WebComponentDescriptor)2