Removing dependencies on ConfigurationException.

This commit is contained in:
Mark Fisher
2008-10-10 00:57:05 +00:00
parent 01c9efef66
commit b68f7ca17a
9 changed files with 35 additions and 56 deletions

View File

@@ -20,7 +20,6 @@ import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.integration.ConfigurationException;
import org.springframework.integration.util.DefaultMethodInvoker;
import org.springframework.integration.util.MethodInvoker;
import org.springframework.integration.util.MethodValidator;
@@ -70,7 +69,7 @@ public class MethodInvokingSource implements MessageSource<Object>, Initializing
this.invoker = nrmi;
}
else {
throw new ConfigurationException("either 'method' or 'methodName' is required");
throw new IllegalArgumentException("either 'method' or 'methodName' is required");
}
}
@@ -101,9 +100,8 @@ public class MethodInvokingSource implements MessageSource<Object>, Initializing
private static class MessageReceivingMethodValidator implements MethodValidator {
public void validate(Method method) {
if (method.getReturnType().equals(void.class)) {
throw new ConfigurationException("MethodInvokingSource requires a non-void returning method.");
}
Assert.isTrue(!method.getReturnType().equals(void.class),
"MethodInvokingSource requires a non-void returning method.");
}
}

View File

@@ -23,7 +23,6 @@ import java.util.Collection;
import java.util.List;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.integration.ConfigurationException;
import org.springframework.integration.channel.ChannelRegistry;
import org.springframework.integration.channel.ChannelRegistryAware;
import org.springframework.integration.channel.MessageChannel;
@@ -90,7 +89,7 @@ public class MethodInvokingChannelResolver implements ChannelResolver, ChannelRe
this.addChannel((String) result, channels);
}
else {
throw new ConfigurationException(
throw new IllegalStateException(
"router method must return type 'MessageChannel' or 'String'");
}
return channels;