use of com.sun.enterprise.deployment.ApplicationClientDescriptor in project Payara by payara.
the class ACCPersistenceArchivist method open.
@Override
public Object open(Archivist main, ReadableArchive archive, RootDeploymentDescriptor descriptor) throws IOException, SAXParseException {
if (deplLogger.isLoggable(Level.FINE)) {
deplLogger.logp(Level.FINE, "ACCPersistencerArchivist", "readPersistenceDeploymentDescriptors", "archive = {0}", archive.getURI());
}
final Map<String, ReadableArchive> candidatePersistenceArchives = new HashMap<String, ReadableArchive>();
/*
* The descriptor had better be an ApplicationClientDescriptor!
*/
if (!(descriptor instanceof ApplicationClientDescriptor)) {
return null;
}
final ApplicationClientDescriptor acDescr = ApplicationClientDescriptor.class.cast(descriptor);
try {
final Manifest mf = archive.getManifest();
final Attributes mainAttrs = mf.getMainAttributes();
/*
* We must scan the app client archive itself.
*/
URI clientURI = clientURI(archive, acDescr);
candidatePersistenceArchives.put(clientURI.toASCIIString(), archive);
/*
* If this app client
* was deployed as part of an EAR then scan any library JARs and, if the
* client was also deployed or launched in v2-compatibility mode, any
* top-level JARs in the EAR.
*
* Exactly how we do this depends on whether this is a deployed client
* (which will reside in a client download directory) or a non-deployed
* one (which will reside either as a stand-alone client or within an
* EAR).
*/
if (isDeployed(mainAttrs)) {
if (!isDeployedClientAlsoStandAlone(mainAttrs)) {
addOtherDeployedScanTargets(archive, mainAttrs, candidatePersistenceArchives);
}
} else if (!isStandAlone(acDescr)) {
addOtherNondeployedScanTargets(archive, acDescr, candidatePersistenceArchives);
}
for (Map.Entry<String, ReadableArchive> pathToArchiveEntry : candidatePersistenceArchives.entrySet()) {
readPersistenceDeploymentDescriptor(main, pathToArchiveEntry.getValue(), pathToArchiveEntry.getKey(), descriptor);
}
} finally {
for (Map.Entry<String, ReadableArchive> pathToArchiveEntry : candidatePersistenceArchives.entrySet()) {
// pathToArchiveEntry.getValue().close();
}
}
return null;
}
use of com.sun.enterprise.deployment.ApplicationClientDescriptor in project Payara by payara.
the class JavaWebStartAccessNode method getDescriptor.
// public JavaWebStartAccessNode(XMLElement element) {
// register();
// setXMLRootTag(element);
// }
/**
* @return the descriptor instance to associate with this XMLNode
*/
@Override
public JavaWebStartAccessDescriptor getDescriptor() {
if (descriptor == null) {
descriptor = new JavaWebStartAccessDescriptor();
XMLNode parentNode = getParentNode();
if (parentNode != null && (parentNode instanceof AppClientRuntimeNode)) {
Object parentDescriptor = parentNode.getDescriptor();
if (parentDescriptor != null && (parentDescriptor instanceof ApplicationClientDescriptor)) {
ApplicationClientDescriptor acDescriptor = (ApplicationClientDescriptor) parentDescriptor;
acDescriptor.setJavaWebStartAccessDescriptor(descriptor);
}
}
}
return descriptor;
}
use of com.sun.enterprise.deployment.ApplicationClientDescriptor in project Payara by payara.
the class Verifier method verifyArchive.
private void verifyArchive() {
if (!getApplication().isVirtual()) {
// don't run app tests for standalone module
runVerifier(new ApplicationVerifier(verifierFrameworkContext));
}
for (Iterator itr = getApplication().getBundleDescriptors(EjbBundleDescriptor.class).iterator(); itr.hasNext(); ) {
EjbBundleDescriptor ejbd = (EjbBundleDescriptor) itr.next();
runVerifier(new EjbVerifier(verifierFrameworkContext, ejbd));
}
for (Iterator itr = getApplication().getBundleDescriptors(WebBundleDescriptor.class).iterator(); itr.hasNext(); ) {
WebBundleDescriptor webd = (WebBundleDescriptor) itr.next();
runVerifier(new WebVerifier(verifierFrameworkContext, webd));
}
for (Iterator itr = getApplication().getBundleDescriptors(ApplicationClientDescriptor.class).iterator(); itr.hasNext(); ) {
ApplicationClientDescriptor appClientDescriptor = (ApplicationClientDescriptor) itr.next();
runVerifier(new AppClientVerifier(verifierFrameworkContext, appClientDescriptor));
}
for (Iterator itr = getApplication().getBundleDescriptors(ConnectorDescriptor.class).iterator(); itr.hasNext(); ) {
ConnectorDescriptor cond = (ConnectorDescriptor) itr.next();
runVerifier(new ConnectorVerifier(verifierFrameworkContext, cond));
}
}
use of com.sun.enterprise.deployment.ApplicationClientDescriptor in project Payara by payara.
the class PUTransactionType method check.
public Result check(Descriptor descriptor) {
ApplicationClientDescriptor appClient = (ApplicationClientDescriptor) descriptor;
Result result = getInitializedResult();
addErrorDetails(result, getVerifierContext().getComponentNameConstructor());
// default status is PASSED
result.setStatus(Result.PASSED);
for (PersistenceUnitsDescriptor pus : appClient.getExtensionsDescriptors(PersistenceUnitsDescriptor.class)) {
for (PersistenceUnitDescriptor nextPU : pus.getPersistenceUnitDescriptors()) {
if ("JTA".equals(nextPU.getTransactionType())) {
result.failed(smh.getLocalString(getClass().getName() + ".puName", "Found a persistence unit by name [ {0} ] in persistence unit root [ {1} ] with JTA transaction type.", new Object[] { nextPU.getName(), nextPU.getPuRoot() }));
}
}
}
for (EntityManagerFactoryReferenceDescriptor emfRef : appClient.getEntityManagerFactoryReferenceDescriptors()) {
String unitName = emfRef.getUnitName();
PersistenceUnitDescriptor nextPU = appClient.findReferencedPU(unitName);
if (nextPU == null)
continue;
if ("JTA".equals(nextPU.getTransactionType())) {
result.failed(smh.getLocalString(getClass().getName() + ".puRefName", "Found a reference to a persistence unit by name [ {0} ] in persistence unit root [ {1} ] with JTA transaction type.", new Object[] { nextPU.getName(), nextPU.getPuRoot() }));
}
}
return result;
}
use of com.sun.enterprise.deployment.ApplicationClientDescriptor in project Payara by payara.
the class TokenHelper method buildTokens.
private Properties buildTokens() {
final Properties t = new Properties();
t.setProperty("app.codebase.path", appCodebasePath());
t.setProperty("main.jnlp.path", mainJNLP());
t.setProperty("system.context.root", systemContextRoot());
t.setProperty("agent.jar", agentJar());
t.setProperty("system.jnlp", systemJNLP());
// t.setProperty("client.facade.jnlp.path", clientFacadeJNLP());
t.setProperty("client.jnlp.path", clientJNLP());
t.setProperty(JavaWebStartInfo.APP_LIBRARY_EXTENSION_PROPERTY_NAME, appLibraryExtensions());
t.setProperty("anchor.subpath", anchorSubpath());
t.setProperty("dyn", dyn());
t.setProperty("client.facade.jar.path", clientFacadeJARPath());
t.setProperty("client.security", "<all-permissions/>");
final ApplicationClientDescriptor acDesc = dHelper.appClientDesc();
/*
* Set the JNLP information title to the app client module's display name,
* if one is present.
*/
String displayName = acDesc.getDisplayName();
String jnlpInformationTitle = (displayName != null && displayName.length() > 0) ? displayName : localStrings.get("jws.information.title.prefix") + " " + dHelper.appName();
t.setProperty("appclient.main.information.title", jnlpInformationTitle);
t.setProperty("appclient.client.information.title", jnlpInformationTitle);
/*
* Set the one-line description the same as the title for now.
*/
t.setProperty("appclient.main.information.description.one-line", jnlpInformationTitle);
t.setProperty("appclient.client.information.description.one-line", jnlpInformationTitle);
/*
*Set the short description to the description from the descriptor, if any.
*/
String description = acDesc.getDescription();
String jnlpInformationShortDescription = (description != null && description.length() > 0) ? description : jnlpInformationTitle;
t.setProperty("appclient.main.information.description.short", jnlpInformationShortDescription);
t.setProperty("appclient.client.information.description.short", jnlpInformationShortDescription);
t.setProperty("appclient.vendor", vendorInfo.getVendor());
/*
* Construct the icon elements, if the user specified any in the
* optional descriptor element.
*/
t.setProperty("appclient.main.information.images", iconElements(vendorInfo));
/*
* For clients in an EAR there will be an EAR-level generated group facade
* JAR to include in the downloaded files.
*/
final URI groupFacadeUserURI = dHelper.groupFacadeUserURI(dHelper.dc());
t.setProperty(GROUP_JAR_ELEMENT_PROPERTY_NAME, (groupFacadeUserURI == null ? "" : "<jar href=\"" + groupFacadeUserURI.toASCIIString() + "\"/>"));
setSystemJNLPTokens(t);
return t;
}
Aggregations