On Jun 23, 2010, at 7:58 PM, viola.lu (JIRA) wrote:

> Hi, david: i have one question about this test case: currently, it just 
> listed all mbean attributes/operations information.
> But i should get its all attributes value, so i have to connect to a jmx 
> connector server which has a jmxurl(such as 
> service:jmx:rmi://localhost/jndi/rmi://localhost:1099/jmxrmi somthing like 
> what we did in jconsole, but in this unit test case, we just use openejb 
> assembler to create a container, i am not sure whether this already started a 
> jmx connector server that i can connect using code:
> JMXServiceURL jmxUrl = new 
> JMXServiceURL("service:jmx:rmi://localhost/jndi/rmi://localhost:1099/jmxrmi");
> JMXConnector connector =JMXConnectorFactory.connect(jmxUrl);
> MBeanServerConnection mbsc = connector.getMBeanServerConnection();
> ObjectName poolName = new 
> ObjectName("openejb.management:J2EEServer=openejb,J2EEApplication=null,EJBModule=StatsModule,StatelessSessionBean=CounterBean,j2eeType=Pool,name=CounterBean");
> Long avail = (Long)mbsc.getAttribute(poolName,"Available");
> 
> If it doesn't start a jmx connector server port 1099, how to? is there any 
> method that i can use to start this port?thanks

Hi Viola!

I'm sort of a JMX beginner myself.  Ideally we'd be able to invoke the mbean in 
the test case without a port open -- one would hope that this is possible as 
the mbean server is right there in the VM.

If not, maybe we can start a connector for the test case.

-David

Reply via email to