TestServiceMetaDataICF tsicf = new TestServiceMetaDataICF();
mof.setInstanceClassFactory(TestServiceMetaData.class, tsicf);
// Deploy a datasource with local and xa factories
Deployment ctx1 = createSimpleDeployment("deployment1");
DSMetaData dsmd = new DSMetaData();
dsmd.setDiplayName("deployment1 DS");
// TODO: dsmd.setUrl(new URL("vfsfile:/tmp/some-ds.xml"));
// The base LocalDataSourceMeta
LocalDataSourceMetaData ds = new LocalDataSourceMetaData();
ds.setJndiName("java:DefaultDS1");
ds.setMaxSize(100);
ds.setMinSize(10);
ds.setPassword("password1".toCharArray());
ds.setUsername("username1");
SecMetaData smd1 = new SecMetaData();
smd1.setDomain("java:/jaas/domain1");
ds.setSecurityMetaData(smd1);
XADataSourceMetaData xads = new XADataSourceMetaData();
xads.setJndiName("java:DefaultXADS2");
ds.setMaxSize(100);
ds.setMinSize(10);
ds.setPassword("password2".toCharArray());
ds.setUsername("username2");
xads.setXaDataSourceClass("org.jboss.xa.SomeXADS");
xads.setXaResourceTimeout(300);
SecMetaData smd2 = new SecMetaData();
smd2.setDomain("java:/jaas/domain2");
xads.setSecurityMetaData(smd2);
ArrayList<ConnMetaData> deployments = new ArrayList<ConnMetaData>();
deployments.add(ds);
deployments.add(xads);
dsmd.setDeployments(deployments);
MutableAttachments a1 = (MutableAttachments) ctx1.getPredeterminedManagedObjects();
a1.addAttachment(DSMetaData.class, dsmd);
// The mbeans associated with the local DS
TestServiceMetaData localMBeans = new TestServiceMetaData();