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

MessageDestinationReferenceDescriptor

public class MessageDestinationReferenceDescriptor extends EnvironmentProperty implements com.sun.enterprise.deployment.types.MessageDestinationReference
An object representing the use of a message destination in a J2EE component.
author
Kenneth Saks

Fields Summary
public static final String
CONSUMES
public static final String
PRODUCES
public static final String
CONSUMES_PRODUCES
private static com.sun.enterprise.util.LocalStringManagerImpl
localStrings
private BundleDescriptor
referringBundle
private String
usage
private String
destinationType
private String
jndiName
private MessageDestinationReferencerImpl
referencer
Constructors Summary
public MessageDestinationReferenceDescriptor(MessageDestinationReferenceDescriptor other)
copy constructor

    
           
       
	super(other);
	referringBundle = other.referringBundle; // copy as-is
	usage = other.usage; // immutable String
	destinationType = other.destinationType; // immutable String
        referencer = new MessageDestinationReferencerImpl(other.referencer);
    
public MessageDestinationReferenceDescriptor(String name, String desc)
Construct an message destination reference with the given name and descriptor of the reference.

param
name the message-destination-ref name as used in the referencing component
param
optional description

	super(name, "", desc);
        referencer = new MessageDestinationReferencerImpl(this);
    
public MessageDestinationReferenceDescriptor()
Constructs a reference in the extrernal state.

        referencer = new MessageDestinationReferencerImpl(this);
    
Methods Summary
public booleanequals(java.lang.Object object)

	if (object instanceof MessageDestinationReference) {
	    MessageDestinationReference reference = 
                (MessageDestinationReference) object;
	    return reference.getName().equals(this.getName());
	}
	return false;
    
public java.lang.StringgetDestinationType()

        return destinationType;
    
public java.lang.StringgetInjectResourceType()

        return getDestinationType();
    
public java.lang.StringgetJndiName()

        return (jndiName != null  && ! jndiName.equals("")) ? 
            jndiName : mappedName;
    
public EjbMessageBeanDescriptorgetMessageBeanOwner()
Get the descriptor for the message-driven bean owner.

        return null;
    
public MessageDestinationDescriptorgetMessageDestination()

return
the message destination to which I refer. Can be NULL.

        return referencer.getMessageDestination();
    
public java.lang.StringgetMessageDestinationLinkName()

return
the name of the message destination to which I refer

        return referencer.getMessageDestinationLinkName();
    
public com.sun.enterprise.deployment.MessageDestinationReferenceDescriptorgetMessageDestinationRefOwner()
Get the descriptor for the message destination reference owner.

        return this;
    
public BundleDescriptorgetReferringBundleDescriptor()
Get the referring bundle, i.e. the bundle within which this message destination reference is declared.

	return referringBundle;
    
public java.lang.StringgetUsage()

return
the usage type of the message destination reference (Consumes, Produces, ConsumesProduces)

        return usage;
    
public booleanisLinkedToMessageDestination()

        return referencer.isLinkedToMessageDestination();
    
public booleanownedByMessageBean()
True if the owner is a message-driven bean.

        return false;
    
public booleanownedByMessageDestinationRef()

        return true;
    
public voidprint(java.lang.StringBuffer toStringBuffer)
returns a formatted string representing me.

        if (isLinkedToMessageDestination()) {
	    toStringBuffer.append("Resolved Message-Destination-Ref ").append(getName()).append( 
                "points to logical message destination ").append(getMessageDestination().getName());
	} else {
	    toStringBuffer.append("Unresolved Message-Destination-Ref ").append(getName()).append(
                "@").append(getType()).append("@").append(usage);
	}	
    
public MessageDestinationDescriptorresolveLinkName()

        return referencer.resolveLinkName();
    
public voidsetDestinationType(java.lang.String type)

        destinationType = type;
    
public voidsetInjectResourceType(java.lang.String resourceType)

        setDestinationType(resourceType);
    
public voidsetJndiName(java.lang.String physicalDestinationName)

        jndiName = physicalDestinationName;
    
public voidsetMessageDestination(MessageDestinationDescriptor newMsgDest)

param
messageDestiation the message destination to which I refer.

        referencer.setMessageDestination(newMsgDest);
    
public voidsetMessageDestinationLinkName(java.lang.String linkName)
Sets the name of the message destination to which I refer.

        referencer.setMessageDestinationLinkName(linkName);
    
public MessageDestinationDescriptorsetMessageDestinationLinkName(java.lang.String linkName, boolean resolveLink)

        return referencer.setMessageDestinationLinkName(linkName, resolveLink);
    
public voidsetReferringBundleDescriptor(BundleDescriptor referringBundle)
Set the referring bundle, i.e. the bundle within which this message destination reference is declared.

	this.referringBundle = referringBundle;
    
public voidsetUsage(java.lang.String destUsage)

param
usage the usage type of the message destination reference (Consumes, Produces, ConsumesProduces)

        usage = destUsage;