if (bean != null) {
holder = new ConstantBeanHolder(bean, exchange.getContext());
} else if (beanName != null) {
holder = new RegistryBean(exchange.getContext(), beanName);
} else if (type != null) {
holder = new ConstantTypeBeanHolder(type, exchange.getContext());
} else {
throw new IllegalArgumentException("Either bean, beanName or type should be set on " + this);
}
// invoking the bean can either be the easy way or using OGNL