FileDocCategorySizeDatePackage
PrincipalNameDescriptor.javaAPI DocGlassfish v2 API3611Fri May 04 22:31:52 BST 2007com.sun.enterprise.deployment.runtime.common

PrincipalNameDescriptor

public class PrincipalNameDescriptor extends com.sun.enterprise.deployment.Descriptor
This is an in memory representation of the principal-name with its name of the implementation class.
author
deployment dev team

Fields Summary
private static final String
defaultClassName
private String
principalName
private String
className
Constructors Summary
public PrincipalNameDescriptor()


      
Methods Summary
public java.lang.StringgetClassName()

        if (className == null) {
            return defaultClassName;
        }
        return className;
    
public java.lang.StringgetName()

        return principalName;
    
public java.security.PrincipalgetPrincipal()

        try {
            Class clazz = Class.forName(getClassName(), true, 
                Thread.currentThread().getContextClassLoader());
            Constructor constructor = 
                            clazz.getConstructor(new Class[]{String.class});
            Object o = constructor.newInstance(new Object[]{principalName});
            return (Principal) o;
        } catch(Exception ex) {
            RuntimeException e = new RuntimeException();
            e.initCause(ex);
            throw e;
        }
    
public voidsetClassName(java.lang.String name)

        className = name;
    
public voidsetName(java.lang.String name)

        principalName = name;
    
public java.lang.StringtoString()

        return "principal-name " + principalName + "; className " + getClassName();