/* */ }
/* */
/* */ public ServiceMetaData createDsServiceMetaData(DataSourceDeployment ds)
/* */ throws Exception
/* */ {
/* 163 */ ServiceMetaData dsMbean = new ServiceMetaData();
/* 164 */ this.log.info("DataSource settings: " + ds);
/* */
/* 166 */ String jndiName = ds.getJndiName() == null ? "DefaultFakeDS" : ds.getJndiName();
/* 167 */ ObjectName objectName = new ObjectName("jboss.jca:type=FakeDataSourceConn,jndiName=" + jndiName);
/* 168 */ dsMbean.setObjectName(objectName);
/* 169 */ dsMbean.setCode(FakeDataSourceConn.class.getName());
/* */
/* 171 */ ServiceConstructorMetaData constructor = new ServiceConstructorMetaData();
/* 172 */ constructor.setSignature(new String[] { DataSourceDeployment.class.getName() });
/* 173 */ constructor.setParameters(new Object[] { ds });
/* 174 */ dsMbean.setConstructor(constructor);
/* */
/* 177 */ List attributes = new ArrayList();
/* 178 */ ServiceAttributeMetaData attribute = new ServiceAttributeMetaData();
/* */
/* 180 */ attribute.setName("JndiName");
/* 181 */ attribute.setReplace(true);
/* 182 */ attribute.setTrim(true);
/* 183 */ attribute.setValue(new ServiceTextValueMetaData(jndiName));
/* 184 */ attributes.add(attribute);
/* */
/* 186 */ attribute = new ServiceAttributeMetaData();
/* 187 */ attribute.setName("JdbcURL");
/* 188 */ if (ds.getJdbcURL() != null)
/* 189 */ attribute.setValue(new ServiceTextValueMetaData(ds.getJdbcURL()));
/* 190 */ attributes.add(attribute);
/* */
/* 192 */ attribute = new ServiceAttributeMetaData();
/* 193 */ attribute.setName("DriverClass");
/* 194 */ if (ds.getDriverClass() != null)
/* 195 */ attribute.setValue(new ServiceTextValueMetaData(ds.getDriverClass()));
/* 196 */ attributes.add(attribute);
/* */
/* 198 */ attribute = new ServiceAttributeMetaData();
/* 199 */ attribute.setName("Username");
/* 200 */ if (ds.getUsername() != null)
/* 201 */ attribute.setValue(new ServiceTextValueMetaData(ds.getUsername()));
/* 202 */ attributes.add(attribute);
/* */
/* 204 */ attribute = new ServiceAttributeMetaData();
/* 205 */ attribute.setName("Password");
/* 206 */ if (ds.getPassword() != null)
/* 207 */ attribute.setValue(new ServiceTextValueMetaData(ds.getPassword()));
/* 208 */ attributes.add(attribute);
/* */
/* 210 */ attribute = new ServiceAttributeMetaData();
/* 211 */ attribute.setName("SecurityDomain");
/* 212 */ if (ds.getSecurityDomain() != null)
/* 213 */ attribute.setValue(new ServiceTextValueMetaData(ds.getSecurityDomain()));
/* 214 */ attributes.add(attribute);
/* */
/* 216 */ attribute = new ServiceAttributeMetaData();
/* 217 */ attribute.setName("MinPoolSize");
/* 218 */ if (ds.getMinPoolSize() != null)
/* 219 */ attribute.setValue(new ServiceTextValueMetaData(ds.getMinPoolSize()));
/* 220 */ attributes.add(attribute);
/* */
/* 222 */ attribute = new ServiceAttributeMetaData();
/* 223 */ attribute.setName("MaxPoolSize");
/* 224 */ if (ds.getMaxPoolSize() != null)
/* 225 */ attribute.setValue(new ServiceTextValueMetaData(ds.getMaxPoolSize()));
/* 226 */ attributes.add(attribute);
/* */
/* 228 */ attribute = new ServiceAttributeMetaData();
/* 229 */ attribute.setName("ConnectionProperties");
/* 230 */ if (ds.getMaxPoolSize() != null)
/* 231 */ attribute.setValue(new ServiceTextValueMetaData(ds.getMaxPoolSize()));
/* 232 */ attributes.add(attribute);
/* */
/* 234 */ dsMbean.setAttributes(attributes);
/* */
/* 237 */ Collection depends = ds.getDepends();
/* 238 */ List dependencies = new ArrayList();
/* 239 */ for (String iDependOn : depends)
/* */ {
/* 241 */ ServiceDependencyMetaData sdmd = new ServiceDependencyMetaData();
/* 242 */ sdmd.setIDependOn(iDependOn);
/* */ }
/* 244 */ dsMbean.setDependencies(dependencies);
/* 245 */ return dsMbean;
/* */ }