FileDocCategorySizeDatePackage
ApplicationContentOrigin.javaAPI DocGlassfish v2 API5822Fri May 04 22:34:12 BST 2007com.sun.enterprise.appclient.jws

ApplicationContentOrigin

public class ApplicationContentOrigin extends UserContentOrigin
Records mappings of paths to content that stem from app clients nested within a Java EE application or jars in the Java EE app itself.
author
tjquinn

Fields Summary
private Vector
appclientOrigins
this application origin's child app client origins
Constructors Summary
public ApplicationContentOrigin(com.sun.enterprise.deployment.Application application)
Returns a new instance, representing a single application that is an origin of served content.

param
the Application descriptor object for the app of interest

        super(application);
        appclientOrigins = new Vector<AppclientContentOrigin>();
    
Methods Summary
public voidaddNestedOrigin(AppclientContentOrigin origin)
Adds an origin representing an embedded app client to the application's origin.

param
the app client content origin of the embedded app client

        appclientOrigins.add(origin);
    
public java.lang.StringgetAppclientJarPath()
Returns the path, within the virtual namespace provided by the JWS system servlet, where the app client jar file for this application resides.

return
the path to the client jar file

        return NamingConventions.TopLevelApplication.appclientJarPath(this);
    
public java.util.VectorgetAppclientOrigins()
Returns the embedded app client origins.

return
the sub-origins

        return appclientOrigins;
    
public java.lang.StringgetContentKeyPrefix()
Reports the prefix for the content key for all content related to this origin.

The content key is used as the key when content is stored in any of the maps

return
the content key prefix for any content from this origin

        return NamingConventions.TopLevelApplication.contentKeyPrefix(this);
    
public java.lang.StringgetContextRoot()
Returns the context root for this origin, as specified by the developer of the app client or (if missing) as defaulted by us during loading.

return
the context root under which the origin's documents are addressable

        return NamingConventions.TopLevelApplication.contextRoot(application);
    
public booleanisEnabled()
Returns whether this content origin's appclient is enabled for Java Web Start access.

return
boolean indicating whether the application is enabled for JWS access

        try {
            return AppclientJWSSupportInfo.getInstance().isEnabled(this);
        } catch (IOException ioe) {
            /*
             *An IOException can occur if some infrastructure objects cannot be
             *located in obtaining the instance.  Very unlikely and also logged elsewhere.
             */
            return false;
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    
public booleanremoveNestedOrigin(AppclientContentOrigin origin)
Removes the specified child origin and reports if it was present

param
the app client content origin to be removed
return
boolean indicating if the sub-origin was present

        return appclientOrigins.remove(origin);
    
public java.lang.StringtoString()

        StringBuilder sb = new StringBuilder(super.toString());
        for (AppclientContentOrigin child : appclientOrigins) {
            sb.append(lineSep).append("    ").append(child.toString());
        }
        return sb.toString();