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;
}
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);
}
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;
}
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;
}
Aggregations