/** * Gets all component names with types that extend or implement specific * component type. * * @param componentType * the component type to match * @return a list of component names that match with supplied type. * @throws UnifyException * if container is not started. */ public List<String> getComponentNames(Class<? extends UnifyComponent> componentType) throws UnifyException { // checkStarted(); List<String> names = new ArrayList<String>(); for (InternalUnifyComponentInfo iuc : internalUnifyComponentInfos.values()) { if (componentType.isAssignableFrom(iuc.getType())) { names.add(iuc.getName()); } } return names; }
/** * Gets all component configurations with types that extend or implement * specific component type. * * @param componentType * the component types to match * @return a list of component configurations that match with supplied type. * @throws UnifyException * if container is not started. */ public List<UnifyComponentConfig> getComponentConfigs(Class<? extends UnifyComponent> componentType) throws UnifyException { checkStarted(); List<UnifyComponentConfig> configList = new ArrayList<UnifyComponentConfig>(); for (InternalUnifyComponentInfo iuc : internalUnifyComponentInfos.values()) { if (componentType.isAssignableFrom(iuc.getType())) { configList.add(iuc.getUnifyComponentConfig()); } } return configList; }
Method[] methods = iuci.getType().getMethods(); for (Method method : methods) { if (ReflectUtils.isInterface(iuci.getType(), BusinessService.class)) { logDebug("Business component '" + iuci.getName() + "' detected."); managedBusinessServiceConfigList.add(iuci.getUnifyComponentConfig()); InternalUnifyComponentInfo iuci = entry.getValue(); Plugin pla = iuci.getType().getAnnotation(Plugin.class); if (pla != null) { if (BusinessLogicUnit.class.isAssignableFrom(iuci.getType())) { InternalUnifyComponentInfo busServInfo = internalUnifyComponentInfos.get(pla.target()); if (busServInfo == null) { if (!BusinessService.class.isAssignableFrom(busServInfo.getType())) { throw new UnifyException(UnifyCoreErrorConstants.BUSINESSLOGIC_PLUGIN_TARGET_NON_BUSINESSMODULE, iuci.getName(), pla.target()); method = busServInfo.getType().getMethod(pla.method(), pla.paramTypes()); } catch (Exception e) { throw new UnifyException(UnifyCoreErrorConstants.BUSINESSLOGIC_PLUGIN_TARGET_NON_SOCKET, for (BroadcastInfo broadcastInfo : broadcastInfoMap.values()) { InternalUnifyComponentInfo iuc = getInternalUnifyComponentInfo(broadcastInfo.getComponentName()); Method method = ReflectUtils.getMethod(iuc.getType(), broadcastInfo.getMethodName(), String[].class); broadcastInfo.setMethod(method);