Here's a link to some code used in the JBoss testsuite
that invokes the deployer.
You should be able to modify it to your needs.
Does anyone know how to connect via http to an MBean server and query the MBeans ? I also need to know how to do the same via RMI...I have been searching around and can't find how, some sample code would be very helpful
The link above does an RMI connection.
JBoss comes with Sun's html adaptor in jmxtools.jar.
That's not very useful for your requirement unless you are
willing to parse the html.
the book explains how to build a simple SOAP connector (using GLUE) that travels over HTTP.. you can query and invoke, etc. Also has RMI stuffs. Plain source code can also be downloaded there.