1 23 package com.sun.enterprise.repository; 24 25 import java.io.Serializable ; 26 import com.sun.enterprise.util.LocalStringManagerImpl; 27 28 29 35 36 public class JmsDestinationResource extends J2EEResourceBase 37 implements Serializable { 38 39 private static LocalStringManagerImpl localStrings = 40 new LocalStringManagerImpl(JmsCnxFactoryResource.class); 41 42 private boolean isQueue_; 43 44 public JmsDestinationResource(String name) { 45 super(name); 46 } 47 48 protected J2EEResource doClone(String name) { 49 JmsDestinationResource clone = new JmsDestinationResource(name); 50 clone.setIsQueue(getIsQueue()); 51 return clone; 52 } 53 54 public int getType() { 55 return J2EEResource.JMS_DESTINATION; 56 } 57 58 public String getTypeString() { 60 if (getIsQueue()) return IASJ2EEResourceFactoryImpl.JMS_QUEUE; 61 return IASJ2EEResourceFactoryImpl.JMS_TOPIC; 62 } 63 65 public boolean getIsQueue() { 66 return isQueue_; 67 } 68 69 public void setIsQueue(boolean isQueue) { 70 isQueue_ = isQueue; 71 } 72 73 public String toString() { 74 String propsString = getPropsString(); 76 77 String npMsg = localStrings.getLocalString("enterprise.repository.resource_noproperties", "No Properties"); 78 79 return "< JMS Destination: " + getName() + ", " + 80 getTypeString()+ ", " + 81 ((propsString.length() > 0) ? 82 propsString : npMsg) + " >"; 83 } 85 } 86 | Popular Tags |