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

AppclientContentOrigin

public class AppclientContentOrigin extends UserContentOrigin
Records mappings of paths to content that stem from a single app client.
author
tjquinn

Fields Summary
private String
contextRoot
records the content origin's context root
protected com.sun.enterprise.deployment.util.ModuleDescriptor
moduleDescriptor
module descriptor for the content origin
private VendorInfo
vendorInfo
vendor info derived from the element in the sun-application-client.xml element.
Constructors Summary
public AppclientContentOrigin(com.sun.enterprise.deployment.Application application, com.sun.enterprise.deployment.util.ModuleDescriptor moduleDescriptor, String contextRoot)
Creates a new instance of the appclient content origin.

param
Application object for the appclient (either an artificial wrapper around a stand-alone app client or the parent ear's Application if this is an embedded app client)
param
ModuleDescriptor for the specific app client
param
the context root to be used for this app client

    
                                                          
           
        super(application);
        this.moduleDescriptor = moduleDescriptor;

        /*
         *Make sure the context root is not empty and has a 
         *slash at the beginning.  The default value is legal but
         *a user-supplied one might not be.
         */
        if (contextRoot.length() < 2 || ( ! contextRoot.substring(0,1).equals("/") )) {
            String regName = application.getRegistrationName();
            throw new IllegalArgumentException("Java Web Start-related context root of '" + contextRoot + "' specified for app client " + regName + " must begin with a slash and contain at least one other character");
        }
        this.contextRoot = contextRoot;
    
Methods Summary
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 app client resides.

return
the path to the client jar file

        return NamingConventions.TopLevelAppclient.appclientJarPath(this);
    
protected java.lang.StringgetContentKeyPrefix()

        return NamingConventions.TopLevelAppclient.contentKeyPrefix(this);
    
public java.lang.StringgetContextRoot()
Returns the origin's context root.

return
the string value for the context root

        return contextRoot;
    
public java.lang.StringgetDescription()
Returns the descriptor for the app client.

return
the descriptor

        return getApplication().getDescription();
    
public java.lang.StringgetDisplayName()
Returns the display name for the app client.

return
the display name as a String

        return moduleDescriptor.getDescriptor().getDisplayName();        
    
public java.lang.StringgetImageURI()

        return getVendorInfo().getImageURI();
    
public java.lang.StringgetName()

        return application.getRegistrationName();
    
public java.lang.StringgetSplashImageURI()

        return getVendorInfo().getSplashImageURI();
    
protected java.lang.StringgetTargetPath()
Returns the path to which requests for the virtual path for this origin should be dispatched so they can be served by the system servlet.

return
the path to which the virtual path should be mapped

        return NamingConventions.TopLevelAppclient.actualContextRoot(application);
    
public java.lang.StringgetVendor()

        return getVendorInfo().getVendor();
    
private com.sun.enterprise.appclient.jws.AppclientContentOrigin$VendorInfogetVendorInfo()

        if (vendorInfo == null) {
            vendorInfo = new VendorInfo(((ApplicationClientDescriptor) 
                (moduleDescriptor.getDescriptor())).getJavaWebStartAccessDescriptor().getVendor());
        }
        return vendorInfo;
    
public java.lang.StringgetVirtualPath()
Returns the virtual path users can use to refer to the app client from this origin. If the developer did not specify one, the default path is returned.

return
the path by which users can access the app client

        return NamingConventions.TopLevelAppclient.virtualContextRoot(application, moduleDescriptor);
    
public java.io.FilelocateFile(com.sun.enterprise.instance.BaseManager manager, java.lang.String URI)
Returns a File object for the actual File in the app's directory corresponding to the specified URI.

This implementation covers the top-level app client case and is overridden by an implementation for a nested app client.

        File file = new File(manager.getLocation(getApplication().getRegistrationName()), URI);
        return file;
    
public java.lang.StringtoString()

        return super.toString() + ", context root=" + getVirtualPath() + ", module name=" + moduleDescriptor.getName();