Search in sources :

Example 21 with RootDeploymentDescriptor

use of org.glassfish.deployment.common.RootDeploymentDescriptor in project Payara by payara.

the class StandAloneAppClientInfo method populateDescriptor.

private RootDeploymentDescriptor populateDescriptor(ReadableArchive archive, Archivist theArchivist, ClassLoader loader) throws IOException, SAXParseException, Exception {
    // @@@ Optimize it later.
    // Here the application.xml is read twice for NestedAppClientInfo.
    // Once already in expand() method.
    theArchivist.setAnnotationProcessingRequested(true);
    // @@@ setting of the classloader would trigger annotation processing
    // for appclients that have only partial deployment descriptors or no
    // descriptors at all.
    // Note that the annotation processing is bypassed if the descriptors
    // are meta-complete=true", which will be the case for anything that is
    // generated by the backend, i.e. if the appclient being executed here
    // is a generated jar produced by the appserver, obtained by deploying
    // the original application client and retrieve.
    theArchivist.setClassLoader(loader);
    // open with Archivist./pen(AbstractArchive) to also ensure the
    // validation is not called
    // return archivist.open(archive);
    RootDeploymentDescriptor d = null;
    try {
        d = theArchivist.open(archive);
    } catch (Exception ex) {
        // make sure there is no junk tmp director left
        close();
        throw ex;
    }
    // depend on the type of the appclient, additional work needs
    // to be done.
    massageDescriptor();
    theArchivist.setDescriptor((BundleDescriptor) d);
    return d;
}
Also used : RootDeploymentDescriptor(org.glassfish.deployment.common.RootDeploymentDescriptor) URISyntaxException(java.net.URISyntaxException) AnnotationProcessorException(org.glassfish.apf.AnnotationProcessorException) MalformedURLException(java.net.MalformedURLException) IOException(java.io.IOException) FileNotFoundException(java.io.FileNotFoundException) SAXParseException(org.xml.sax.SAXParseException)

Example 22 with RootDeploymentDescriptor

use of org.glassfish.deployment.common.RootDeploymentDescriptor in project Payara by payara.

the class PrincipalNameNode method setElementValue.

/**
 * receives notiification of the value for a particular tag
 *
 * @param element the xml element
 * @param value it's associated value
 */
public void setElementValue(XMLElement element, String value) {
    PrincipalNameDescriptor principal = (PrincipalNameDescriptor) getDescriptor();
    if (RuntimeTagNames.PRINCIPAL_NAME.equals(element.getQName())) {
        principal.setName(value);
        Object rootDesc = getParentNode().getParentNode().getDescriptor();
        if (rootDesc instanceof RootDeploymentDescriptor) {
            principal.setClassLoader(((RootDeploymentDescriptor) rootDesc).getClassLoader());
        }
    } else
        super.setElementValue(element, value);
}
Also used : RootDeploymentDescriptor(org.glassfish.deployment.common.RootDeploymentDescriptor) PrincipalNameDescriptor(com.sun.enterprise.deployment.runtime.common.PrincipalNameDescriptor)

Example 23 with RootDeploymentDescriptor

use of org.glassfish.deployment.common.RootDeploymentDescriptor in project Payara by payara.

the class DOLUtils method setElementValue.

/**
 * receives notification of the value for a particular tag
 *
 * @param element the xml element
 * @param value it's associated value
 * @param o
 * @return
 */
public static boolean setElementValue(XMLElement element, String value, Object o) {
    if (SCHEMA_LOCATION_TAG.equals(element.getCompleteName())) {
        // we need to keep all the non j2ee/javaee schemaLocation tags
        StringTokenizer st = new StringTokenizer(value);
        StringBuffer sb = new StringBuffer();
        while (st.hasMoreElements()) {
            String namespace = (String) st.nextElement();
            String schema;
            if (st.hasMoreElements()) {
                schema = (String) st.nextElement();
            } else {
                schema = namespace;
                namespace = TagNames.JAVAEE_NAMESPACE;
            }
            if (namespace.equals(TagNames.J2EE_NAMESPACE))
                continue;
            if (namespace.equals(TagNames.JAVAEE_NAMESPACE))
                continue;
            if (namespace.equals(W3C_XML_SCHEMA))
                continue;
            sb.append(namespace);
            sb.append(" ");
            sb.append(schema);
        }
        String clientSchemaLocation = sb.toString();
        if (clientSchemaLocation != null && clientSchemaLocation.length() != 0) {
            if (o instanceof RootDeploymentDescriptor) {
                ((RootDeploymentDescriptor) o).setSchemaLocation(clientSchemaLocation);
            }
        }
        return true;
    } else if (element.getQName().equals(TagNames.METADATA_COMPLETE)) {
        if (o instanceof BundleDescriptor) {
            ((BundleDescriptor) o).setFullAttribute(value);
        }
        return true;
    }
    return false;
}
Also used : BundleDescriptor(com.sun.enterprise.deployment.BundleDescriptor) WebBundleDescriptor(com.sun.enterprise.deployment.WebBundleDescriptor) EjbBundleDescriptor(com.sun.enterprise.deployment.EjbBundleDescriptor) StringTokenizer(java.util.StringTokenizer) RootDeploymentDescriptor(org.glassfish.deployment.common.RootDeploymentDescriptor)

Example 24 with RootDeploymentDescriptor

use of org.glassfish.deployment.common.RootDeploymentDescriptor in project Payara by payara.

the class WebBundleDescriptorImpl method findReferencedPUs.

/**
 * {@inheritDoc}
 */
@Override
public Collection<? extends PersistenceUnitDescriptor> findReferencedPUs() {
    Collection<PersistenceUnitDescriptor> pus = new HashSet<PersistenceUnitDescriptor>(findReferencedPUsViaPURefs(this));
    pus.addAll(findReferencedPUsViaPCRefs(this));
    if (extensions.containsKey(EjbBundleDescriptor.class)) {
        for (RootDeploymentDescriptor extension : extensions.get(EjbBundleDescriptor.class)) {
            pus.addAll(((EjbBundleDescriptor) extension).findReferencedPUs());
        }
    }
    return pus;
}
Also used : RootDeploymentDescriptor(org.glassfish.deployment.common.RootDeploymentDescriptor) PersistenceUnitDescriptor(com.sun.enterprise.deployment.PersistenceUnitDescriptor) HashSet(java.util.HashSet)

Aggregations

RootDeploymentDescriptor (org.glassfish.deployment.common.RootDeploymentDescriptor)24 BundleDescriptor (com.sun.enterprise.deployment.BundleDescriptor)9 EjbBundleDescriptor (com.sun.enterprise.deployment.EjbBundleDescriptor)6 ModuleDescriptor (org.glassfish.deployment.common.ModuleDescriptor)6 HashMap (java.util.HashMap)3 Application (com.sun.enterprise.deployment.Application)2 ApplicationClientDescriptor (com.sun.enterprise.deployment.ApplicationClientDescriptor)2 EjbDescriptor (com.sun.enterprise.deployment.EjbDescriptor)2 PersistenceUnitDescriptor (com.sun.enterprise.deployment.PersistenceUnitDescriptor)2 WebBundleDescriptor (com.sun.enterprise.deployment.WebBundleDescriptor)2 PrincipalNameDescriptor (com.sun.enterprise.deployment.runtime.common.PrincipalNameDescriptor)2 StringTokenizer (java.util.StringTokenizer)2 ArchiveType (org.glassfish.api.deployment.archive.ArchiveType)2 ReadableArchive (org.glassfish.api.deployment.archive.ReadableArchive)2 ArchiveFactory (com.sun.enterprise.deploy.shared.ArchiveFactory)1 DataSourceDefinitionDescriptor (com.sun.enterprise.deployment.DataSourceDefinitionDescriptor)1 ManagedBeanDescriptor (com.sun.enterprise.deployment.ManagedBeanDescriptor)1 PersistenceUnitsDescriptor (com.sun.enterprise.deployment.PersistenceUnitsDescriptor)1 WebComponentDescriptor (com.sun.enterprise.deployment.WebComponentDescriptor)1 EjbBundleContext (com.sun.enterprise.deployment.annotation.context.EjbBundleContext)1