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

NestedAppclientContentOrigin

public class NestedAppclientContentOrigin extends AppclientContentOrigin
Represents a nested (embedded) app client as an origin of content.
author
tjquinn

Fields Summary
private ApplicationContentOrigin
parent
the origin corresponding to the embedded app client's enclosing parent application
private String
name
unique identifier for this embedded app client within its parent
Constructors Summary
public NestedAppclientContentOrigin(ApplicationContentOrigin parent, com.sun.enterprise.deployment.util.ModuleDescriptor moduleDescr, String contextRoot)
Creates a new instance of NestedAppclientContentOrigin

param
the parent ApplicationContentOrigin object
param
the ModuleDescriptor for this embedded app client
param
the context root by which this app client's content is to be addressable

        super(parent.getApplication(), moduleDescr, contextRoot);
        this.parent = parent;
        this.name = NamingConventions.NestedAppclient.archiveURIToName(moduleDescr.getArchiveUri());
    
Methods Summary
public java.lang.StringgetAppclientJarPath()
This method should not be called. To prevent the superclass's method from gaining control in case of an inadvertent invocation, throw an exception.

return
the path to the client jar file

        throw new RuntimeException("Unexpected invocation");
    
public java.lang.StringgetContentKeyPrefix()
Returns the prefix for the content map key that is common to all content from this origin.

return
the common content key prefix

        return NamingConventions.NestedAppclient.contentKeyPrefix(this);
    
public java.lang.StringgetName()
Returns the unique name for this embedded app client within its containing application.

return
the app client's name

        return name;
    
public ApplicationContentOrigingetParent()
Returns the parent origin of this nested app client origin.

return
the parent ApplicationContentOrigin

        return parent;
    
protected java.lang.StringgetTargetPath()

        return NamingConventions.NestedAppclient.actualContextRoot(this);
    
public java.lang.StringgetTopLevelRegistrationName()
Returns the registration name for the top-level module associated with this nested app client.

This method is primarily used to get a name to use in checking whether the relevant module has been enabled or disabled for Java Web Start access. This implementation returns the name from the parent, whereas top-level app clients return their own reg. name.

return
the parent's registration name

        return parent.getApplication().getRegistrationName();
    
public java.lang.StringgetVirtualPath()

        return NamingConventions.NestedAppclient.virtualContextRoot(parent.application, moduleDescriptor);
    
public booleanisEnabled()
Returns whether this nested app client's parent application is currently enabled for Java Web Start access.

        return parent.isEnabled();
    
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.

        File dir = new File(manager.getLocation(getApplication().getRegistrationName()), 
                FileUtils.makeFriendlyFileName(moduleDescriptor.getArchiveUri()));
        return new File (dir, URI);
    
public java.lang.StringtoString()

        return super.toString() + lineSep + ", parent=" + getTopLevelRegistrationName();