FileDocCategorySizeDatePackage
NamedReferencePair.javaAPI DocGlassfish v2 API4538Fri May 04 22:31:22 BST 2007com.sun.enterprise.deployment

NamedReferencePair

public class NamedReferencePair extends Object implements Serializable
I am a pairing between a descriptor and a descriptor that has a JNDI name.
author
Danny Coward

Fields Summary
public static final int
EJB
public static final int
EJB_REF
public static final int
RESOURCE_REF
public static final int
RESOURCE_ENV_REF
private Descriptor
referant
private NamedDescriptor
referee
private int
type
Constructors Summary
protected NamedReferencePair(Descriptor referant, NamedDescriptor referee, int type)
Construct a pairing between the given descriptor and the object it has with a jndi name.

	this.referant = referant;
	this.referee  = referee;
        this.type     = type;
    
Methods Summary
public static com.sun.enterprise.deployment.NamedReferencePaircreateEjbPair(EjbDescriptor referant, EjbDescriptor referee)

    
       
            
    
        return new NamedReferencePair(referant, referee, EJB);
    
public static com.sun.enterprise.deployment.NamedReferencePaircreateEjbRefPair(Descriptor referant, EjbReferenceDescriptor referee)

        return new NamedReferencePair(referant, referee, EJB_REF);
    
public static com.sun.enterprise.deployment.NamedReferencePaircreateResourceEnvRefPair(Descriptor referant, JmsDestinationReferenceDescriptor referee)

        return new NamedReferencePair(referant, referee, RESOURCE_ENV_REF);
    
public static com.sun.enterprise.deployment.NamedReferencePaircreateResourceRefPair(Descriptor referant, ResourceReferenceDescriptor referee)

        return new NamedReferencePair(referant, referee, RESOURCE_REF);
    
public intgetPairType()

        return this.type;
    
public java.lang.StringgetPairTypeName()

        switch(this.type) {
            case EJB : return "EJB"; 
            case EJB_REF : return "EJB REF";
            case RESOURCE_REF : return "RESOURCE REF";
            case RESOURCE_ENV_REF : return "RESOURCE ENV REF";
        }
        throw new IllegalStateException("unknown type = " + type);        
    
public DescriptorgetReferant()
Gets the descriptor with the named descriptor.

	return this.referant;
    
public NamedDescriptorgetReferee()
Gets the named descriptor for the decriptor.

	return this.referee;
    
public voidprint(java.lang.StringBuffer toStringBuffer)
My pretty format.

	toStringBuffer.append("NRP: ").append(referant.getName()).append(" -> ").append(((Descriptor) referee).getName());