-
1. Re: programatically handle datasources
schaefera Jul 27, 2002 5:32 PM (in response to gabrielm)Hi
A servlet (as long as deployed on the same box) can look up the JMX MBeanServer with the MBeanServerFactory. Then you can manage the JCA Connection MBeans through the JMX MBeanServer factory.
Hope this helps
Andy -
2. Re: programatically handle datasources
davidjencks Jul 27, 2002 5:34 PM (in response to gabrielm)Since you mention wanting the 3.0 book, I assume you are using a jboss 3 version. Look in the testsuite in jmx/test/DeployConnectionManagerUnitTestCase to see an example (slightly messy) of creating a datasource deployment via code.
-
3. Re: programatically handle datasources
gabrielm Jul 27, 2002 5:45 PM (in response to gabrielm)Where is that? I couldn't find anything in the CVS tree (that thing is HUGE!).
Should I download the source?
P.S. sorry about the crosspost. -
4. Re: programatically handle datasources
gabrielm Jul 27, 2002 5:55 PM (in response to gabrielm)org.jboss.test.jmx.test.DeployConnectionManagerUnitTestCase is not in the jboss main source, if that's what I'm looking for.
-
6. Re: programatically handle datasources
gabrielm Jul 30, 2002 2:39 PM (in response to gabrielm)That class didn't really helped since I can't tell what's JUnit, what's part of JMX, what's JBoss and what's this class's stuff...
This is what I have so far:
ObjectName cmName = new ObjectName("jboss.jca:service=LocalTxCM,name=TestDS");
ObjectName mcfName = new ObjectName("jboss.jca:service=LocalTxDS,name=TestDS");
ObjectName mcpName = new ObjectName("jboss.jca:service=LocalTxPool,name=TestDS");
ObjectName serviceControllerName = new ObjectName("jboss.system:service=ServiceController");
AttributeList al = new AttributeList();
al.add(new Attribute("JndiName", "ConnectionManagerTestDS"));
al.add(new Attribute("ManagedConnectionFactoryName", mcfName));
al.add(new Attribute("ManagedConnectionPool", mcpName));
al.add(new Attribute("CachedConnectionManager", new ObjectName("jboss.jca:service=CachedConnectionManager")));
al.add(new Attribute("JaasSecurityManagerService", new ObjectName("jboss.security:service=JaasSecurityManager")));
al.add(new Attribute("TransactionManager", "java:/TransactionManager"));
al.add(new Attribute("MinSize", new Integer(0)));
al.add(new Attribute("MaxSize", new Integer(50)));
al.add(new Attribute("BlockingTimeoutMillis", new Long(5000)));
al.add(new Attribute("IdleTimeoutMinutes", new Integer(15)));
al.add(new Attribute("Criteria", "ByContainer"));
Is this ok? How do I turn this into a datasource? Will this datasource be saved, and reinitialized after reboot? How can I remove a datasource programatically?
I can't wait for the Jboss3 books!!!