/* */ protected void writeTemplate(File dsXml, DeploymentTemplateInfo values)
/* */ throws Exception
/* */ {
/* 90 */ String cfType = ((DsDataSourceTemplateInfo)values).getConnectionFactoryType();
/* */
/* 93 */ ManagedObjectFactory mof = ManagedObjectFactoryBuilder.create();
/* */
/* 96 */ String rootElementName = "datasources";
/* */ ManagedObject cfMO;
/* 97 */ if ("local-tx-datasource".equals(cfType))
/* */ {
/* 99 */ ManagedConnectionFactoryDeploymentMetaData mcf = new LocalDataSourceDeploymentMetaData();
/* 100 */ mof.setBuilder(mcf.getClass(), new XADataSourceDeploymentMetaDataBuilder());
/* 101 */ cfMO = mof.initManagedObject(mcf, KnownComponentTypes.DataSourceTypes.LocalTx.getType().getType(), KnownComponentTypes.DataSourceTypes.LocalTx.getType().getSubtype());
/* */ }
/* */ else
/* */ {
/* */ ManagedObject cfMO;
/* 105 */ if ("xa-datasource".equals(cfType))
/* */ {
/* 107 */ ManagedConnectionFactoryDeploymentMetaData mcf = new XADataSourceDeploymentMetaData();
/* 108 */ mof.setBuilder(mcf.getClass(), new XADataSourceDeploymentMetaDataBuilder());
/* 109 */ cfMO = mof.initManagedObject(mcf, KnownComponentTypes.DataSourceTypes.XA.getType().getType(), KnownComponentTypes.DataSourceTypes.XA.getType().getSubtype());
/* */ }
/* */ else
/* */ {
/* */ ManagedObject cfMO;
/* 113 */ if ("tx-connection-factory".equals(cfType))
/* */ {
/* 115 */ rootElementName = "connection-factories";
/* 116 */ ManagedConnectionFactoryDeploymentMetaData mcf = new TxConnectionFactoryDeploymentMetaData();
/* 117 */ mof.setBuilder(mcf.getClass(), new XADataSourceDeploymentMetaDataBuilder());
/* */
/* 119 */ cfMO = mof.initManagedObject(mcf, "ConnectionFactory", "XA");
/* */ }
/* */ else
/* */ {
/* */ ManagedObject cfMO;
/* 123 */ if ("no-tx-connection-factory".equals(cfType))
/* */ {
/* 125 */ rootElementName = "connection-factories";
/* 126 */ ManagedConnectionFactoryDeploymentMetaData mcf = new NoTxConnectionFactoryDeploymentMetaData();
/* 127 */ mof.setBuilder(mcf.getClass(), new XADataSourceDeploymentMetaDataBuilder());
/* */
/* 129 */ cfMO = mof.initManagedObject(mcf, "ConnectionFactory", "NoTx");
/* */ }
/* */ else
/* */ {
/* */ ManagedObject cfMO;
/* 133 */ if ("no-tx-datasource".equals(cfType))
/* */ {
/* 135 */ ManagedConnectionFactoryDeploymentMetaData mcf = new NoTxDataSourceDeploymentMetaData();
/* 136 */ mof.setBuilder(mcf.getClass(), new XADataSourceDeploymentMetaDataBuilder());
/* 137 */ cfMO = mof.initManagedObject(mcf, KnownComponentTypes.DataSourceTypes.NoTx.getType().getType(), KnownComponentTypes.DataSourceTypes.NoTx.getType().getSubtype());
/* */ }
/* */ else
/* */ {
/* 142 */ throw new IllegalStateException("Unexpected value connection factory type: " + cfType);
/* */ }