SimpleValue dsTypeSV = (SimpleValue) dsTypeMP.getValue();
cfType = dsTypeSV.getValue().toString();
}
ManagedConnectionFactoryDeploymentMetaData mcf;
ManagedObjectFactory mof = ManagedObjectFactoryBuilder.create();
ManagedObject cfMO;
String rootElementName = "datasources";
if("local-tx-datasource".equals(cfType))
{
mcf = new LocalDataSourceDeploymentMetaData();
mof.setInstanceClassFactory(LocalDataSourceDeploymentMetaData.class, new LocalDSInstanceClassFactory(mof));
cfMO = mof.initManagedObject(mcf,
KnownComponentTypes.DataSourceTypes.LocalTx.getType().getType(),
KnownComponentTypes.DataSourceTypes.LocalTx.getType().getSubtype());
}
else if("xa-datasource".equals(cfType))
{
mcf = new XADataSourceDeploymentMetaData();
mof.setInstanceClassFactory(XADataSourceDeploymentMetaData.class, new XADSInstanceClassFactory(mof));
cfMO = mof.initManagedObject(mcf,
KnownComponentTypes.DataSourceTypes.XA.getType().getType(),
KnownComponentTypes.DataSourceTypes.XA.getType().getSubtype());
}
else if("tx-connection-factory".equals(cfType))
{
rootElementName = "connection-factories";
mcf = new TxConnectionFactoryDeploymentMetaData();
mof.setInstanceClassFactory(TxConnectionFactoryDeploymentMetaData.class, new TxInstanceClassFactory(mof));
cfMO = mof.initManagedObject(mcf,
KnownComponentTypes.ConnectionFactoryTypes.XA.getType().getType(),
KnownComponentTypes.ConnectionFactoryTypes.XA.getType().getSubtype());
}
else if("no-tx-connection-factory".equals(cfType))
{
rootElementName = "connection-factories";
mcf = new NoTxConnectionFactoryDeploymentMetaData();
mof.setInstanceClassFactory(NoTxConnectionFactoryDeploymentMetaData.class, new NoTxCFInstanceClassFactory(mof));
cfMO = mof.initManagedObject(mcf,
KnownComponentTypes.ConnectionFactoryTypes.NoTx.getType().getType(),
KnownComponentTypes.ConnectionFactoryTypes.NoTx.getType().getSubtype());
}
else if("no-tx-datasource".equals(cfType))
{
mcf = new NoTxDataSourceDeploymentMetaData();
mof.setInstanceClassFactory(NoTxDataSourceDeploymentMetaData.class, new NoTxInstanceClassFactory(mof));
cfMO = mof.initManagedObject(mcf,
KnownComponentTypes.DataSourceTypes.NoTx.getType().getType(),
KnownComponentTypes.DataSourceTypes.NoTx.getType().getSubtype());
}
else
throw new IllegalStateException("Unexpected value connection factory type: " + cfType);