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

UserContentOrigin

public abstract class UserContentOrigin extends ContentOrigin
Represents an origin of user-provided content - application origins or app client origins.
author
tjquinn

Fields Summary
protected com.sun.enterprise.deployment.Application
application
descriptor for the origin
Constructors Summary
public UserContentOrigin(com.sun.enterprise.deployment.Application application)
Creates a new instance of the content origin.

param
the Application object for the content origin

        super();
        this.application = application;
    
Methods Summary
public com.sun.enterprise.deployment.ApplicationgetApplication()
Returns the origin's corresponding Application object.

return
Application descriptor from which this origin was derived

        return application;
    
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.

return
the application's registration name

        return getApplication().getRegistrationName();
    
public booleanisEnabled()
Returns whether this content origin's appclient is enabled for Java Web Start access.

return
boolean indicating whether the appclient 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 java.io.FilelocateGeneratedAppclientJarFile(java.lang.String generatedXMLLocation)
Returns a File object for the generated app client jar file for this top-level app client.

return
File for the generated jar file

        String generatedAppClientJarName = getTopLevelRegistrationName() + DeploymentImplConstants.ClientJarSuffix;
        
        File generatedAppClientJar = new File (generatedXMLLocation, generatedAppClientJarName);
        if ( ! generatedAppClientJar.exists()) {
            throw new FileNotFoundException(generatedAppClientJar.getAbsolutePath());
        }
        return generatedAppClientJar;        
    
public java.lang.StringtoString()
Returns a string representation of this content origin.

return
string describing the origin's current state

        StringBuilder sb = new StringBuilder(super.toString());
        sb.append(" registration name=").append(application.getRegistrationName());
//                .append(", enabled=").append(enabled);
        return sb.toString();