We are using an embedded Glassfish Server in our testing environment. We use the org.glassfish.embeddable.CommandRunner
interface to execute administrative tasks (i.e., what we do with asadmin
with a standard standalone Glassfish server)
Example:
GlassFish glassfish = GlassFishRuntime.bootstrap( bp ).newGlassFish( gfp );
CommandRunner commandRunner = glassfish.getService( CommandRunner.class );
commandRunner.run(
"create-jms-resource",
"--restype",
"javax.jms.Queue",
"SOME_QUEUE_NAME"
);
Now on the command line I am able to set queue options with imqcmd
. For example
imqcmd -u admin -passfile ../password.txt update dst -n SOME_QUEUE_NAME -t q -o maxBytesPerMsg=-1 -f
Is there a way to achieve the same with an embedded Glassfish server?