dev@glassfish.java.net

Re: how do I get gf to find my new local asadmin command

From: Snjezana Sevo-Zenzerovic <snjezana.sevozenzerovic_at_oracle.com>
Date: Wed, 11 Aug 2010 13:06:26 -0700

This is part of shoal-gms-impl.jar, right? I think you need to add this
jar to admin-cli.jar classpath in admin/cli/pom.xml since the jar would
need to be in glassfish/lib/asadmin directory in order to be
automagically detected as local command...

HTH...

Bobby Bissett wrote:
> I've written this, packaged it, and it's in the modules dir. What do I
> need to do to make asadmin aware of my command?
>
> ---begin code---
> package org.glassfish.gms.admin;
>
> import com.sun.enterprise.admin.cli.CLICommand;
> import org.glassfish.api.admin.CommandException;
> import org.jvnet.hk2.annotations.Scoped;
> import org.jvnet.hk2.annotations.Service;
> import org.jvnet.hk2.component.PerLookup;
>
> import javax.swing.JOptionPane; //temp
>
> /**
> * asadmin local command that wraps the multicast validator tool
> * in shoal-gms-impl.jar
> */
> @Service(name="validate-multicast")
> @Scoped(PerLookup.class)
> public class ValidateMulticastCommand extends CLICommand {
>
> @Override
> protected int executeCommand() throws CommandException {
> JOptionPane.showMessageDialog(null,
> "Yay, you found me");
> return 0;
> }
> }
> ---end code---
>
> ---begin output---
> hostname% asadmin validate-multicast --verbose
> Remote server does not listen for requests on [localhost:4848]. Is the
> server up?
> No such local command, validate-multicast. To run remote commands,
> start the application server (e.g. 'asadmin start-domain').
> Command validate-multicast failed.
> ---end output---
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>


-- 
Oracle <http://www.oracle.com>
Snjezana Sevo-Zenzerovic
Green Oracle <http://www.oracle.com/commitment> Oracle is committed to 
developing practices and products that help protect the environment