use of org.jboss.as.test.integration.ejb.mdb.dynamic.api.Command in project wildfly by wildfly.
the class TelnetActivationSpec method validate.
@Override
public void validate() throws InvalidPropertyException {
if (beanClassName == null)
throw new InvalidPropertyException("beanClass is null");
final Class<?> beanClass = beanClass();
// Set Prompt
final Prompt prompt = beanClass.getAnnotation(Prompt.class);
if (prompt != null) {
this.prompt = prompt.value();
}
// Get Commands
final Method[] methods = beanClass.getMethods();
for (Method method : methods) {
if (method.isAnnotationPresent(Command.class)) {
final Command command = method.getAnnotation(Command.class);
cmds.add(new Cmd(command.value(), method));
}
}
// Validate
if (this.prompt == null || this.prompt.length() == 0) {
this.prompt = "prompt>";
}
if (this.cmds.size() == 0) {
throw new InvalidPropertyException("No @Command methods");
}
}
Aggregations