Fields Summary |
---|
public static final String | SYSTEM_WEBAPP_URLfixed prefix for URLs handled by the Java Web Start support web app |
public static final String | APPCLIENT_CATEGORYCategory definitions |
public static final String | APPLICATION_CATEGORY |
public static final String | APPSERVER_CATEGORY |
public static final String | APPSERVER_SIGNED_CATEGORY |
public static final String | APPSERVER_LIB_FILESSubcategories of appserver content. |
public static final String | APPSERVER_MQLIB_FILES |
public static final String | APPSERVER_JMSRALIB_FILES |
public static final String | APPSERVER_EXTJAR_FILES |
public static final String | APPSERVER_DERBY_FILES |
public static final String | APPCLIENT_MAIN_JNLP_TEMPLATE_NAMETemplates for dynamic documents are packaged in the jar file with this class.
These names are used in getResource method invocations to retrieve the templates. |
public static final String | APPCLIENT_CLIENT_JNLP_TEMPLATE_NAME |
public static final String | APPCLIENT_MAIN_HTML_TEMPLATE_NAME |
public static final String | APPCLIENT_CLIENT_HTML_TEMPLATE_NAME |
public static final String | APPCLIENT_MAIN_JNLP_EXT_TEMPLATE_NAME |
private static final String | MAIN_JNLP_SUFFIXSeveral generated virtual file names use the context root as part of the
name with fixed suffix appended. |
private static final String | MAIN_HTML_SUFFIX |
private static final String | CLIENT_JNLP_SUFFIX |
private static final String | CLIENT_HTML_SUFFIX |
private static final String | MAIN_EXT_JNLP_SUFFIX |
public static final String | JWS_LOGGERthe logger to use for Java Web Start-related code |
private com.sun.enterprise.instance.AppsManager | appsManagerthe instance's apps manager |
private com.sun.enterprise.instance.AppclientModulesManager | appclientModulesManagerthe instance's app client modules manager |
Methods Summary |
---|
public static java.lang.String | appServerCodebasePath()
return SYSTEM_WEBAPP_URL + "/" + APPSERVER_CATEGORY;
|
public static java.lang.String | appclientCodebasePath(AppclientContentOrigin origin)
String result = SYSTEM_WEBAPP_URL + "/" + APPCLIENT_CATEGORY + /* "/" + */ origin.getContextRoot();
return result;
|
private static java.lang.String | appclientJarFilename(java.lang.String regName)
return regName + DeploymentImplConstants.ClientJarSuffix;
|
private static java.lang.String | chooseContextRoot(java.lang.String explicitValue, java.lang.String defaultValue)Returns the explicit context root, if non-null, or the default value otherwise.
return (explicitValue == null) ? defaultValue : explicitValue;
|
public static java.lang.String | contentKeyToPath(java.lang.String contentKey)Converts the content key into the corresponding path for URLs.
return contentKey;
|
public static java.lang.String | extJarFilePath(int extDirNumber, java.io.File extJarFile)
String path = "/" + extDirNumber + "/" + extJarFile.getName();
return path;
|
public static java.lang.String | fullJarPath(java.lang.String contentKey)
return SYSTEM_WEBAPP_URL + contentKeyToPath(contentKey);
|
public static com.sun.enterprise.deployment.util.ModuleDescriptor[] | getEligibleAppclientModuleDescriptors(com.sun.enterprise.deployment.Application app)Returns an array of ModuleDescriptors corresponding to the app clients
in this application that are eligible for Java Web Start access.
return getEligibleAppclientModuleDescriptors(app, null);
|
public static com.sun.enterprise.deployment.util.ModuleDescriptor[] | getEligibleAppclientModuleDescriptors(com.sun.enterprise.deployment.Application app, java.util.logging.Logger logger)Returns an array of ModuleDescriptors corresponding to the app clients
in this application that are eligible for Java Web Start access. Provides
logging if the expected nested ModuleDescriptor(s) are not found.
Vector<ModuleDescriptor> mds = new Vector<ModuleDescriptor>();
/*
*Iterate through the app's app client modules. For each, get the bundle
*descriptor and make sure it's an app client descriptor. If so, get
*that descriptor's Java Web Start access descriptor. If that is null, or
*if it's non-null and the JWS access descriptor says the app client is
*eligible for JWS access, add the module descriptor to the collection
*to be returned.
*/
for (Iterator it = app.getModulesByType(ModuleType.CAR); it.hasNext();) {
Object o = it.next();
if (o instanceof ModuleDescriptor) {
ModuleDescriptor moduleDescriptor = (ModuleDescriptor) o;
BundleDescriptor bd = moduleDescriptor.getDescriptor();
if (bd instanceof ApplicationClientDescriptor) {
ApplicationClientDescriptor appclientDescriptor = (ApplicationClientDescriptor) bd;
JavaWebStartAccessDescriptor jwsAD = appclientDescriptor.getJavaWebStartAccessDescriptor();
if (jwsAD == null || jwsAD.isEligible()) {
mds.add(moduleDescriptor);
}
} else {
if (logger != null) {
logger.warning("During app/app client loading, expected bundleDescriptor for app client module to be of type ApplicationClientDescriptor but it is " + bd.getClass().getName() + "; ignoring it and continuing");
}
}
} else {
if (logger != null) {
logger.warning("During app/app client loading, expected descriptor of type ModuleDescriptor but found " + o.getClass().getName() + " instead; ignoring it and continuing");
}
}
}
return mds.toArray(new ModuleDescriptor[mds.size()]);
|
private static java.lang.String | getExplicitContextRoot(com.sun.enterprise.deployment.util.ModuleDescriptor moduleDescr)Returns the developer-specified context root from the app client's
runtime descriptor.
/*
*Return the developer-specified context root, if there is one.
*/
String result = null;
BundleDescriptor bd = moduleDescr.getDescriptor();
if (bd instanceof ApplicationClientDescriptor) {
ApplicationClientDescriptor acd = (ApplicationClientDescriptor) bd;
JavaWebStartAccessDescriptor jwsAD = acd.getJavaWebStartAccessDescriptor();
if (jwsAD != null) {
result = jwsAD.getContextRoot();
}
}
return result;
|
public java.lang.String | getLaunchURLPath(java.lang.String appclientModuleID)Returns the URL path for use in launching the stand-alone app client with the
specified module ID.
String result = null;
try {
Application app = appclientModulesManager.getDescriptor(appclientModuleID, Thread.currentThread().getContextClassLoader(), false);
/*
*There should be exactly one app client ModuleDescriptor in this wrapper app.
*/
ModuleDescriptor[] moduleDescrs = getEligibleAppclientModuleDescriptors(app);
if (moduleDescrs.length == 1) {
/*
*With the app client's module descr, find the path using either
*the developer-provided path or the default one.
*/
result = TopLevelAppclient.virtualContextRoot(app, moduleDescrs[0]);
}
} catch (ConfigException ce) {
/*
*Allow the return to be null if we cannot locate the app client.
*/
}
return result;
|
public java.lang.String | getLaunchURLPath(java.lang.String appModuleID, java.lang.String appclientArchiveURI)Returns the URL path for use in launching the app client with the specified
archive URI embedded in the application with the specified module ID.
String result = null;
try {
Application app = appsManager.getDescriptor(appModuleID, Thread.currentThread().getContextClassLoader(), false);
ModuleDescriptor[] moduleDescrs = getEligibleAppclientModuleDescriptors(app);
/*
*Search the eligible module descriptors for one with an archive
*URI that matches the desired one.
*/
for (ModuleDescriptor m : moduleDescrs) {
String archiveURI = m.getArchiveUri();
if (archiveURI != null && archiveURI.equals(appclientArchiveURI)) {
result = NestedAppclient.virtualContextRoot(app, m);
break;
}
}
} catch (ConfigException ce) {
/*
*Allow the return to be null if we cannot locate the app.
*/
}
return result;
|
public static java.lang.String | pathToContentKey(java.lang.String requestPath)Performs any conversion needed from the HTTP request path information to
the corresponding content key
return requestPath;
|
public static java.lang.String | relativeFilePath(java.net.URI instanceRootDirURI, java.io.File targetFile)
URI targetURI = targetFile.toURI();
URI relativeURI = instanceRootDirURI.relativize(targetURI);
return relativeURI.toString();
|
private static java.lang.String | trimJarFileType(java.lang.String jarURI, java.lang.String replacement)Replaces the final appearance of ".jar" in the input string with the
replacement string.
int startOfType = jarURI.lastIndexOf(".jar");
if (startOfType == -1) {
startOfType = jarURI.length();
}
String result = jarURI.substring(0, startOfType) + replacement;
return result;
|
public static java.lang.String | webAppURI()
return SYSTEM_WEBAPP_URL;
|