1 23 24 29 30 package com.sun.enterprise.tools.common.dd.ejb; 31 32 import org.w3c.dom.*; 33 import org.netbeans.modules.schema2beans.*; 34 import java.beans.*; 35 import java.util.*; 36 import com.sun.enterprise.tools.common.dd.DefaultResourcePrincipal; 37 38 40 public class MdbConnectionFactory extends com.sun.enterprise.tools.common.dd.SunBaseBean 41 { 42 43 static Vector comparators = new Vector(); 44 45 static public final String JNDI_NAME = "JndiName"; static public final String DEFAULT_RESOURCE_PRINCIPAL = "DefaultResourcePrincipal"; 48 public MdbConnectionFactory() { 49 this(Common.USE_DEFAULT_VALUES); 50 } 51 52 public MdbConnectionFactory(int options) 53 { 54 super(comparators, new org.netbeans.modules.schema2beans.Version(1, 2, 0)); 55 this.createProperty("jndi-name", JNDI_NAME, 58 Common.TYPE_1 | Common.TYPE_STRING | Common.TYPE_KEY, 59 String .class); 60 this.createProperty("default-resource-principal", DEFAULT_RESOURCE_PRINCIPAL, 62 Common.TYPE_0_1 | Common.TYPE_BEAN | Common.TYPE_KEY, 63 DefaultResourcePrincipal.class); 64 this.initialize(options); 65 } 66 67 void initialize(int options) 69 { 70 71 } 72 73 public void setJndiName(String value) { 75 this.setValue(JNDI_NAME, value); 76 } 77 78 public String getJndiName() { 80 return (String )this.getValue(JNDI_NAME); 81 } 82 83 public void setDefaultResourcePrincipal(DefaultResourcePrincipal value) { 85 this.setValue(DEFAULT_RESOURCE_PRINCIPAL, value); 86 } 87 88 public DefaultResourcePrincipal getDefaultResourcePrincipal() { 90 return (DefaultResourcePrincipal)this.getValue(DEFAULT_RESOURCE_PRINCIPAL); 91 } 92 93 public static void addComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 95 comparators.add(c); 96 } 97 98 public static void removeComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 100 comparators.remove(c); 101 } 102 public void validate() throws org.netbeans.modules.schema2beans.ValidateException { 103 boolean restrictionFailure = false; 104 if (getJndiName() == null) { 106 throw new org.netbeans.modules.schema2beans.ValidateException("getJndiName() == null", "jndiName", this); } 108 if (getDefaultResourcePrincipal() != null) { 110 getDefaultResourcePrincipal().validate(); 111 } 112 } 113 114 public void dump(StringBuffer str, String indent){ 116 String s; 117 Object o; 118 org.netbeans.modules.schema2beans.BaseBean n; 119 str.append(indent); 120 str.append("JndiName"); str.append(indent+"\t"); str.append("<"); s = this.getJndiName(); 124 str.append((s==null?"null":s.trim())); str.append(">\n"); this.dumpAttributes(JNDI_NAME, 0, str, indent); 127 128 str.append(indent); 129 str.append("DefaultResourcePrincipal"); n = (org.netbeans.modules.schema2beans.BaseBean) this.getDefaultResourcePrincipal(); 131 if (n != null) 132 n.dump(str, indent + "\t"); else 134 str.append(indent+"\tnull"); this.dumpAttributes(DEFAULT_RESOURCE_PRINCIPAL, 0, str, indent); 136 137 } 138 public String dumpBeanNode(){ 139 StringBuffer str = new StringBuffer (); 140 str.append("MdbConnectionFactory\n"); this.dump(str, "\n "); return str.toString(); 143 }} 144 145 147 148 992 | Popular Tags |