if (annotation == null) {
// scan intefaces for remotable
Set<Class> interfaces = getAllInterfaces(clazz);
for (Class<?> interfaze : interfaces) {
if (interfaze.getAnnotation(Remotable.class) != null) {
JavaMappedService service;
try {
service = implService.createService(interfaze);
} catch (InvalidServiceContractException e) {
throw new ProcessingException(e);
}
type.getServices().put(service.getName(), service);
}
}
return;
}
Class<?>[] interfaces = annotation.interfaces();
if (interfaces.length == 0) {
Class<?> interfaze = annotation.value();
if (Void.class.equals(interfaze)) {
throw new IllegalServiceDefinitionException("No interfaces specified");
} else {
interfaces = new Class<?>[1];
interfaces[0] = interfaze;
}
}
for (Class<?> interfaze : interfaces) {
if (!interfaze.isInterface()) {
InvalidServiceType e = new InvalidServiceType("Service must be an interface");
e.setIdentifier(interfaze.getName());
throw e;
}
JavaMappedService service;
try {
service = implService.createService(interfaze);
} catch (InvalidServiceContractException e) {
throw new ProcessingException(e);
}
type.getServices().put(service.getName(), service);
}
}