private Collection<org.switchyard.metadata.ServiceOperation> getInterfaceOperations(InterfaceModel interfaceModel) { if (interfaceModel == null || EsbInterfaceModel.ESB.equals(interfaceModel.getType())) { return Collections.emptySet(); } else if (InterfaceModel.JAVA.equals(interfaceModel.getType())) { return JavaService.fromClass(Classes.forName(interfaceModel.getInterface())).getOperations(); } else if (InterfaceModel.WSDL.equals(interfaceModel.getType())) { try { return WSDLService.fromWSDL(interfaceModel.getInterface()).getOperations(); } catch (WSDLReaderException e) { // not sure what should do here.. - service should not be deployed // so we won't collect metrics for it anyway return Collections.emptySet(); } } return Collections.emptySet(); }
private void addComponents() { _componentServices = new LinkedHashMap<QName, ComponentService>(); if (getConfig().getComposite().getComponents() == null) { return; } for (ComponentModel component : getConfig().getComposite().getComponents()) { // TODO: we need a separate node for components, to support cases // where the component implements no services. Should also consider // multiple services per component. if (component.getServices().size() > 0) { ComponentServiceModel service = component.getServices().get(0); if (service.getInterface() == null || EsbInterfaceModel.ESB.equals(service.getInterface().getType())) { _componentServices.put(service.getQName(), new BaseNoopComponentService(service, component, this)); } else if (InterfaceModel.JAVA.equals(service.getInterface().getType())) { _componentServices.put(service.getQName(), new BaseJavaComponentService(service, component, this)); } else if (InterfaceModel.WSDL.equals(service.getInterface().getType())) { _componentServices.put(service.getQName(), new BaseWsdlComponentService(service, component, this)); } } } }
if (isJavaInterface(intfModel.getType())) { String interfaceClass = intfModel.getInterface(); Class<?> serviceInterfaceType = loadClass(interfaceClass); } else if (InterfaceModel.WSDL.equals(intfModel.getType())) { try { serviceInterface = WSDLService.fromWSDL(intfModel.getInterface()); throw new SwitchYardException(wsdlre); } else if (EsbInterfaceModel.ESB.equals(intfModel.getType())) { EsbInterfaceModel esbIntf = (EsbInterfaceModel)intfModel; validateEsbInterface(esbIntf);