* not eligable to be redefined.
*/
interfaces.removeAll(all.local);
interfaces.removeAll(all.remote);
/**
* OK, now start checking the class metadata
*/
final Local local = clazz.getAnnotation(Local.class);
final Remote remote = clazz.getAnnotation(Remote.class);
final boolean impliedLocal = local != null && local.value().length == 0;
final 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.
*/
final BusinessInterfaces bean = new BusinessInterfaces();
if (local != null) {
bean.local.addAll(Arrays.asList(local.value()));
}
if (remote != null) {
bean.remote.addAll(Arrays.asList(remote.value()));
}
if (strict) {
for (final 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
final List<String> interfaceNames = new ArrayList<String>();
for (final 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.join(", ", interfaceNames));
// we don't go out to let be deployed
} else if (impliedLocal) {
validation.fail(ejbName, "ann.local.noAttributes", Join.join(", ", interfaceNames));
/**