public WebImplementation load(XMLStreamReader reader, IntrospectionContext context) throws XMLStreamException { Location startLocation = reader.getLocation(); URI uri = parseUri(reader, startLocation, context); WebImplementation impl = new WebImplementation(uri); validateAttributes(reader, context, impl); for (WebImplementationIntrospector introspector : introspectors) { introspector.introspect(impl, context); } try { ComponentType type = impl.getComponentType(); // FIXME we should allow implementation to specify the component type; ComponentType componentType = loadComponentType(context); for (Map.Entry<String, ReferenceDefinition> entry : componentType.getReferences().entrySet()) { type.add(entry.getValue()); } for (Map.Entry<String, Property> entry : componentType.getProperties().entrySet()) { type.add(entry.getValue()); } } catch (LoaderException e) { if (e.getCause() instanceof FileNotFoundException) { // ignore since we allow component types not to be specified in the web app } else { ElementLoadFailure failure = new ElementLoadFailure("Error loading web.componentType", e, startLocation); context.addError(failure); return null; } } LoaderUtil.skipToEndElement(reader); return impl; }
ElementLoadFailure failure = new ElementLoadFailure("Error loading web.componentType", e, startLocation); context.addError(failure); return null;
private WsdlServiceContract resolveContract(QName portTypeName, XMLStreamReader reader, IntrospectionContext context) { Location startLocation = reader.getLocation(); WsdlServiceContractSymbol symbol = new WsdlServiceContractSymbol(portTypeName); URI contributionUri = context.getContributionUri(); ResourceElement<WsdlServiceContractSymbol, WsdlServiceContract> element; try { element = store.resolve(contributionUri, WsdlServiceContract.class, symbol, context); } catch (StoreException e) { ElementLoadFailure failure = new ElementLoadFailure("Error loading element", e, startLocation); context.addError(failure); return new WsdlServiceContract(null, null); } if (element == null) { PortTypeNotFound error = new PortTypeNotFound("Port type not found: " + portTypeName); context.addError(error); return new WsdlServiceContract(null, null); } WsdlServiceContract contract = element.getValue(); // return a copy as it may be modified return contract.copy(); }
return include; } catch (StoreException e) { ElementLoadFailure failure = new ElementLoadFailure("Error loading element", e, reader); context.addError(failure); return null;
ElementLoadFailure failure = new ElementLoadFailure("Error loading element", e, reader); introspectionContext.addError(failure); return null; ElementLoadFailure failure = new ElementLoadFailure("Error loading element", e, reader); introspectionContext.addError(failure); return null; return impl; } catch (StoreException e) { ElementLoadFailure failure = new ElementLoadFailure("Error loading element", e, reader); introspectionContext.addError(failure); return null;