I finally got around to writing a command line console fraemwork for executing
commands.  There are still some issue to be worked out, but I think the basic
concept is solid.  I created a command line tool to execute commands called
'twiddle'.  

Twiddle supports cvs-like commands (though currently command names must be
specific) and the initial checkin only has a crude invoke command.  The invoke
command lets you invoke an MBean operation from the command line, on one ore
more mbeans matched from a query.

I will be adding more command framework support as well as other commands
shortly.  I expect that the interfaces might change as more commands are
imlemented too.

Anyways, if you want to have a look, you will need to pull jboss-all again, or
check out _jboss_console from inside the jboss-all directory.  Then build the
console module:

./build/build.sh -Dmodules=console

Make sure you have an updated build/build.xml and that you have built the server
with it, or the right files might not be in the right place.

The try:

./build/output/jboss*/bin/twiddle.sh

Which should produce the follwing if the build is ok:
A JMX client to "twiddle" with a remote JBoss server.

usage: twiddle.sh [options] <command> [command_options_and_arguments]

options:
    -h, --help                Show this help message
        --help-commands       Show a list of commands
    -H=<command>              Show command specific help
    -D<name>[=<value>]        Set a system property
    --                        Stop processing options
    -S, --server=<url>        The JNDI URL of the remote server
    -A, --adapter=<name>      The JNDI name of the RMI adapter to use

--help-commands doesn't work at the time of this writing, so just skip to the
only registered command with:

./build/output/jboss*/bin/twiddle.sh invoke

Which should produce:

Invoke an operation on an MBean

usage: twiddle.sh invoke [options] <query> <operation> (<arg>)*

options:
    -h, --help             Display this message
    -q, --query[=<type>]   Treat object name as a query
    --                     Stop processing options

query type:
    f[irst]    Only invoke on the first matching name [default]
    a[ll]      Invoke on all matching names

Then make sure you have JBoss running and then try to invoke an operation.  I
have only been testing with:

./build/output/jboss*/bin/twiddle.sh invoke "*:type=ServerInfo"
displayInfoForClass foo

Which should display:

<h2>Class:foo Not Found!</h2>

Not really useful, but shows that (most of) the moving parts work.

I am using twiddle as a learning tool to come up with a generic solution for a
texted based console, suitable for telnet'ing to ssh'ing to, but that is a ways
off at the moment.

Anyways, enjoy.  Let me know if you find any problems.  I would like to make
this part of the default build, so update your workspaces.  I won't do this for
a few days... so consider yourselves warned of an impending addition to the
default build.

--jason


-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/

_______________________________________________________________

Don't miss the 2002 Sprint PCS Application Developer's Conference
August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to