Check that either implementation or ref are specified

This commit is contained in:
Paul Pacheco 2010-11-09 13:25:59 -06:00
parent 79f20df7f2
commit 76f0bf86ee

View file

@ -55,6 +55,12 @@ trait ActorParser extends BeanParser with DispatcherParser {
objectProperties.timeoutStr = element.getAttribute(TIMEOUT)
objectProperties.target = if (element.getAttribute(IMPLEMENTATION).isEmpty) null else element.getAttribute(IMPLEMENTATION)
objectProperties.beanRef = if (element.getAttribute(BEANREF).isEmpty) null else element.getAttribute(BEANREF)
if (objectProperties.target == null && objectProperties.beanRef == null) {
throw new IllegalArgumentException("Mandatory attribute missing, you need to provide either implementation or ref ")
}
objectProperties.transactional = if (element.getAttribute(TRANSACTIONAL).isEmpty) false else element.getAttribute(TRANSACTIONAL).toBoolean
if (element.hasAttribute(INTERFACE)) {