1 17 package org.apache.geronimo.connector.deployment.jsr88; 18 19 import org.apache.geronimo.deployment.plugin.XmlBeanSupport; 20 import org.apache.geronimo.xbeans.geronimo.GerSinglepoolType; 21 import org.apache.xmlbeans.SchemaTypeLoader; 22 23 28 public class SinglePool extends XmlBeanSupport { 29 public SinglePool() { 30 super(null); 31 } 32 public SinglePool(GerSinglepoolType pool) { 33 super(null); 34 configure(pool); 35 } 36 37 protected GerSinglepoolType getSinglePool() { 38 return (GerSinglepoolType) getXmlObject(); 39 } 40 41 protected void configure(GerSinglepoolType pool) { 42 setXmlObject(pool); 43 if(!isSelectOneAssumeMatch() && !isMatchOne() && !isMatchAll()) { 44 setMatchOne(true); 45 } 46 } 47 48 50 public Integer getMinSize() { 51 return getSinglePool().isSetMinSize() ? new Integer (getSinglePool().getMinSize()) : null; 52 } 53 54 public void setMinSize(Integer value) { 55 Integer old = getMinSize(); 56 if(value == null) { 57 if(getSinglePool().isSetMinSize()) { 58 getSinglePool().unsetMinSize(); 59 } 60 } else { 61 getSinglePool().setMinSize(value.intValue()); 62 } 63 pcs.firePropertyChange("minSize", old, value); 64 } 65 66 public Integer getMaxSize() { 67 return getSinglePool().isSetMaxSize() ? new Integer (getSinglePool().getMaxSize()) : null; 68 } 69 70 public void setMaxSize(Integer value) { 71 Integer old = getMaxSize(); 72 if(value == null) { 73 if(getSinglePool().isSetMaxSize()) { 74 getSinglePool().unsetMaxSize(); 75 } 76 } else { 77 getSinglePool().setMaxSize(value.intValue()); 78 } 79 pcs.firePropertyChange("maxSize", old, value); 80 } 81 82 public Integer getBlockingTimeoutMillis() { 83 return getSinglePool().isSetBlockingTimeoutMilliseconds() ? new Integer (getSinglePool().getBlockingTimeoutMilliseconds()) : null; 84 } 85 86 public void setBlockingTimeoutMillis(Integer value) { 87 Integer old = getBlockingTimeoutMillis(); 88 if(value == null) { 89 if(getSinglePool().isSetBlockingTimeoutMilliseconds()) { 90 getSinglePool().unsetBlockingTimeoutMilliseconds(); 91 } 92 } else { 93 getSinglePool().setBlockingTimeoutMilliseconds(value.intValue()); 94 } 95 pcs.firePropertyChange("blockingTimeoutMillis", old, value); 96 } 97 98 public Integer getIdleTimeoutMinutes() { 99 return getSinglePool().isSetIdleTimeoutMinutes() ? new Integer (getSinglePool().getIdleTimeoutMinutes()) : null; 100 } 101 102 public void setIdleTimeoutMinutes(Integer value) { 103 Integer old = getIdleTimeoutMinutes(); 104 if(value == null) { 105 if(getSinglePool().isSetIdleTimeoutMinutes()) { 106 getSinglePool().unsetIdleTimeoutMinutes(); 107 } 108 } else { 109 getSinglePool().setIdleTimeoutMinutes(value.intValue()); 110 } 111 pcs.firePropertyChange("idleTimeoutMinutes", old, value); 112 } 113 114 public boolean isMatchAll() { 115 return getSinglePool().isSetMatchAll(); 116 } 117 118 public void setMatchAll(boolean set) { 119 if(set) { 120 if(!isMatchAll()) { 121 getSinglePool().addNewMatchAll(); 122 pcs.firePropertyChange("matchAll", !set, set); 123 } 124 if(isMatchOne()) setMatchOne(false); 125 if(isSelectOneAssumeMatch()) setSelectOneAssumeMatch(false); 126 } else { 127 if(isMatchAll()) { 128 getSinglePool().unsetMatchAll(); 129 pcs.firePropertyChange("matchAll", !set, set); 130 } 131 } 132 } 133 134 public boolean isMatchOne() { 135 return getSinglePool().isSetMatchOne(); 136 } 137 138 public void setMatchOne(boolean set) { 139 if(set) { 140 if(!isMatchOne()) { 141 getSinglePool().addNewMatchOne(); 142 pcs.firePropertyChange("matchOne", !set, set); 143 } 144 if(isMatchAll()) setMatchAll(false); 145 if(isSelectOneAssumeMatch()) setSelectOneAssumeMatch(false); 146 } else { 147 if(isMatchOne()) { 148 getSinglePool().unsetMatchOne(); 149 pcs.firePropertyChange("matchOne", !set, set); 150 } 151 } 152 } 153 154 public boolean isSelectOneAssumeMatch() { 155 return getSinglePool().isSetSelectOneAssumeMatch(); 156 } 157 158 public void setSelectOneAssumeMatch(boolean set) { 159 if(set) { 160 if(!isSelectOneAssumeMatch()) { 161 getSinglePool().addNewSelectOneAssumeMatch(); 162 pcs.firePropertyChange("selectOneAssumeMatch", !set, set); 163 } 164 if(isMatchAll()) setMatchAll(false); 165 if(isMatchOne()) setMatchOne(false); 166 } else { 167 if(isSelectOneAssumeMatch()) { 168 getSinglePool().unsetSelectOneAssumeMatch(); 169 pcs.firePropertyChange("selectOneAssumeMatch", !set, set); 170 } 171 } 172 } 173 174 176 protected SchemaTypeLoader getSchemaTypeLoader() { 177 return Connector15DCBRoot.SCHEMA_TYPE_LOADER; 178 } 179 } 180 | Popular Tags |