dev@glassfish.java.net

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

From: Bobby Bissett <bobby.bissett_at_oracle.com>
Date: Wed, 11 Aug 2010 15:56:11 -0400

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---