package org.jboss.console.twiddle.command;
import org.jboss.util.NullArgumentException;
import org.jboss.logging.Logger;
public abstract class AbstractCommand
implements Command
{
protected Logger log = Logger.getLogger(getClass());
protected final String desc;
protected final String name;
protected CommandContext context;
protected AbstractCommand(final String name, final String desc)
{
this.name = name;
this.desc = desc;
}
public String getName()
{
return name;
}
public String getDescription()
{
return desc;
}
public void setCommandContext(final CommandContext context)
{
if (context == null)
throw new NullArgumentException("context");
this.context = context;
}
public void unsetCommandContext()
{
this.context = null;
}
public Object clone()
{
try
{
return super.clone();
}
catch (CloneNotSupportedException e)
{
throw new InternalError();
}
}
}