private static Map createMapping()

in core/src/main/java/org/apache/ignite/activestore/impl/config/RPCServiceImpl.java [67:101]


    private static Map<Class, QName> createMapping(Class... implementations) {
        Map<Class, QName> result = new HashMap<>(implementations.length);
        for (Class implementation : implementations) {
            Deque<Class> toProcess = new ArrayDeque<>();
            toProcess.add(implementation);
            Class webServiceInterface = null;
            do {
                Class clazz = toProcess.poll();
                if (clazz.getAnnotation(WebService.class) != null && clazz.isInterface()) {
                    webServiceInterface = clazz;
                    break;
                }
                if (clazz.getSuperclass() != null) {
                    toProcess.add(clazz.getSuperclass());
                }
                if (clazz.getInterfaces() != null) {
                    toProcess.addAll(Arrays.asList(clazz.getInterfaces()));
                }
            }
            while (!toProcess.isEmpty());
            if (webServiceInterface != null) {
                WebService webService = (WebService)webServiceInterface.getAnnotation(WebService.class);
                String targetNamespace = webService.targetNamespace();
                if (targetNamespace.isEmpty()) {
                    targetNamespace = getDefaultTargetNamespace(implementation);
                }
                String serviceName = webService.serviceName();
                if (serviceName.isEmpty()) {
                    serviceName = getDefaultServiceName(implementation);
                }
                result.put(webServiceInterface, new QName(targetNamespace, serviceName));
            }
        }
        return result;
    }