interfaces.removeAll(all.remote);
/**
* OK, now start checking the class metadata
*/
Local local = clazz.getAnnotation(Local.class);
Remote remote = clazz.getAnnotation(Remote.class);
boolean impliedLocal = local != null && local.value().length == 0;
boolean impliedRemote = remote != null && remote.value().length == 0;
/**
* This set holds the values of @Local and @Remote
* when applied to the bean class itself
*
* These declarations override any similar declaration
* on the interface.
*/
BusinessInterfaces bean = new BusinessInterfaces();
if (local != null) bean.local.addAll(asList(local.value()));
if (remote != null) bean.remote.addAll(asList(remote.value()));
if (strict) for (Class interfce : bean.local) {
if (bean.remote.contains(interfce)) {
validation.fail(ejbName, "ann.localRemote.conflict", interfce.getName());
}
}
/**
* Anything listed explicitly via @Local or @Remote
* on the bean class does not need to be investigated.
* We do not need to check these interfaces for @Local or @Remote
*/
interfaces.removeAll(bean.local);
interfaces.removeAll(bean.remote);
if (impliedLocal || impliedRemote) {
if (interfaces.size() != 1) {
/**
* Cannot imply either @Local or @Remote and list multiple interfaces
*/
// Need to extract the class names and append .class to them to show proper validation level 3 message
List<String> interfaceNames = new ArrayList<String>();
for (Class<?> intrfce : interfaces) {
interfaceNames.add(intrfce.getName()+".class");
}
// just warn for @Local since Glassfish supports it even if it is weird
// still fail for @Remote!
if (impliedLocal && local.value().length == 0 && interfaces.size() == 0 && !strict) {
validation.warn(ejbName, "ann.local.forLocalBean", join(", ", interfaceNames));
// we don't go out to let be deployed
} else if (impliedLocal) {
validation.fail(ejbName, "ann.local.noAttributes", join(", ", interfaceNames));
/**