1 23 24 package com.sun.enterprise.deployment; 25 26 32 33 import java.util.Set ; 34 import java.util.HashSet ; 35 import java.util.Iterator ; 36 37 import com.sun.enterprise.deployment.types.MessageDestinationReferencer; 38 39 public class MessageDestinationDescriptor extends Descriptor implements NamedDescriptor{ 40 41 private String msgDestName; 42 43 private String jndiName; 46 private String mappedName; 47 48 private Set referencers = new HashSet (); 50 51 private BundleDescriptor bundleDescriptor; 53 54 public MessageDestinationDescriptor() { 55 } 56 57 public MessageDestinationDescriptor(String name, String description) { 58 super("", description); 59 msgDestName = name; 60 } 61 62 public boolean hasName() { 63 return (msgDestName != null); 64 } 65 66 public void setName(String name) { 67 msgDestName = name; 68 } 69 70 public String getName() { 71 return msgDestName; 72 } 73 74 public void setDisplayName(String displayName) { 75 setLocalizedDisplayName(null, displayName); 76 } 77 78 public String getDisplayName() { 79 return getLocalizedDisplayName(null); 80 } 81 82 public Set getAllReferencers() { 83 return referencers; 84 } 85 86 public void addReferencer(MessageDestinationReferencer referencer) { 87 referencers.add(referencer); 88 } 89 90 public void removeReferencer(MessageDestinationReferencer referencer) { 91 referencers.remove(referencer); 92 } 93 94 public BundleDescriptor getBundleDescriptor() { 95 return bundleDescriptor; 96 } 97 98 public void setBundleDescriptor(BundleDescriptor bundleDesc) { 99 if( bundleDesc == null ) { 100 for(Iterator iter = referencers.iterator(); iter.hasNext();) { 101 MessageDestinationReferencer next = 102 (MessageDestinationReferencer) iter.next(); 103 next.setMessageDestination(null); 104 } 105 referencers.clear(); 106 } 107 bundleDescriptor = bundleDesc; 108 } 109 110 public String getJndiName() { 111 return (jndiName != null) ? jndiName : mappedName; 112 } 113 114 public void setJndiName(String physicalDestinationName) { 115 jndiName = physicalDestinationName; 116 } 117 118 public String getMappedName() { 119 return mappedName; 120 } 121 122 public void getMappedName(String mappedName) { 123 this.mappedName = mappedName; 124 } 125 } 126 | Popular Tags |