28.01.2015 Views

Annotations for JMX - The Gmbal project

Annotations for JMX - The Gmbal project

Annotations for JMX - The Gmbal project

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Virtual “Demo”<br />

Simple Test Case<br />

@ManagedObject<br />

public class <strong>JMX</strong>Test {<br />

public static void main( String[] args ) { (new <strong>JMX</strong>Test()).run() ; }<br />

@ManagedOperation<br />

@Description( "An operation to shutdown this test" )<br />

public synchronized void shutdown() { notifyAll() ; }<br />

}<br />

public synchronized void run() {<br />

Properties props = new Properties() ;<br />

props.setProperty( "org.omg.CORBA.ORBClass", "com.sun.corba.ee.impl.orb.ORBImpl" ) ;<br />

ORB orb = (ORB)ORB.init( (String[])null, props ) ;<br />

orb.mom().register( this ) ;<br />

try {<br />

wait() ;<br />

System.out.println( "Test is terminating" ) ;<br />

} catch (Exception exc) {<br />

exc.printStackTrace() ;<br />

}<br />

}<br />

Friday, December 11, 2009<br />

26

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!