arch@glassfish.java.net

asadmin extensibility

From: Bill Shannon <bill.shannon_at_sun.com>
Date: Thu, 17 Sep 2009 14:10:11 -0700

I changed asadmin recently to use HK2 to allow the set of local commands
to be extensible. That solved only part of the problem. Since asadmin
doesn't use OSGi, there's no convenient, automatic way to install a new
jar file that includes support for a new local command and have it be
seen by asadmin. Essentially there needs to be a way to add a new jar
file to asadmin's CLASSPATH.

Here's the ways I've thought of to solve this problem:

1. Use OSGi. I think this is excessive but I list it for completeness.

2. Have the asadmin code explicitly create a ClassLoader to load classes
    from some specific directory where asadmin extension commands can be dropped.

3. Have the asadmin shell script add all jar files in a specific directory
    to the CLASSPATH before running the java command.

4. Have the asadmin shell script invoke the java command with the System
    property java.ext.dirs pointing to a specific directory where command
    extensions can be dropped.

Preferences? Other alternatives?

I'm assuming HK2 will work fine with any of the above.

Right now I prefer #4, with a directory something like "lib/asadmin".