public WireDefinition load(XMLStreamReader reader, IntrospectionContext context) throws XMLStreamException { validateAttributes(reader, context); String source = reader.getAttributeValue(null, "source"); String target = reader.getAttributeValue(null, "target"); LoaderUtil.skipToEndElement(reader); URI sourceURI = helper.getURI(source); URI targetURI = helper.getURI(target); return new WireDefinition(sourceURI, targetURI); }
private void parseCorrelationScheme(JmsBindingMetadata metadata, NamespaceContext namespace, String targetNamespace, XMLStreamReader reader, IntrospectionContext context) { Location startLocation = reader.getLocation(); String correlationScheme = reader.getAttributeValue(null, "correlationScheme"); if (correlationScheme != null) { QName scheme = LoaderUtil.getQName(correlationScheme, targetNamespace, namespace); // support lax namespaces String localPart = scheme.getLocalPart(); if ("messageID".equalsIgnoreCase(localPart)) { metadata.setCorrelationScheme(CorrelationScheme.MESSAGE_ID); } else if ("correlationID".equalsIgnoreCase(localPart)) { metadata.setCorrelationScheme(CorrelationScheme.CORRELATION_ID); } else if ("none".equalsIgnoreCase(localPart)) { metadata.setCorrelationScheme(CorrelationScheme.NONE); } else { InvalidValue error = new InvalidValue("Invalid value specified for correlationScheme attribute: " + localPart, startLocation); context.addError(error); } } }
return null; QName name = LoaderUtil.getQName(nameAttr, context.getTargetNamespace(), reader.getNamespaceContext()); String scdlLocation = reader.getAttributeValue(null, "scdlLocation"); String scdlResource = reader.getAttributeValue(null, "scdlResource"); LoaderUtil.skipToEndElement(reader);
String scdlLocation = reader.getAttributeValue(null, "scdlLocation"); String scdlResource = reader.getAttributeValue(null, "scdlResource"); LoaderUtil.skipToEndElement(reader); return null; QName name = LoaderUtil.getQName(nameAttr, introspectionContext.getTargetNamespace(), reader.getNamespaceContext());
private boolean processImplementationClass(TimerImplementation implementation, XMLStreamReader reader, IntrospectionContext context) throws XMLStreamException { Location startLocation = reader.getLocation(); String implClass = reader.getAttributeValue(null, "class"); if (implClass == null) { MissingAttribute failure = new MissingAttribute("The class attribute was not specified", startLocation); context.addError(failure); LoaderUtil.skipToEndElement(reader); return false; } implementation.setImplementationClass(implClass); try { Class<?> clazz = context.getClassLoader().loadClass(implClass); if (!(Runnable.class.isAssignableFrom(clazz))) { InvalidTimerInterface failure = new InvalidTimerInterface(clazz, implementation); context.addError(failure); LoaderUtil.skipToEndElement(reader); return false; } } catch (ClassNotFoundException e) { ImplementationArtifactNotFound failure = new ImplementationArtifactNotFound(implClass, e.getMessage(), implementation); context.addError(failure); LoaderUtil.skipToEndElement(reader); return false; } return true; }
QName name = LoaderUtil.getQName(nameAttr, targetNamespace, namespaceContext); QNameSymbol symbol = new QNameSymbol(name); ResourceElement<QNameSymbol, AbstractDefinition> element =
MissingAttribute error = new MissingAttribute("Persistence unit name not specified", startLocation); context.addError(error); LoaderUtil.skipToEndElement(reader); return null;
/** * Parses a deployable mapping * * @param plan the deployment plan * @param reader the XML reader * @param context the validation context * @return true if the mapping was processed successfully, false if there was a validation error */ private boolean processDeployableMapping(DeploymentPlan plan, XMLStreamReader reader, IntrospectionContext context) { String deployableName = reader.getAttributeValue(null, "deployable"); if (deployableName == null) { context.addError(new MissingAttribute("Deployable name not specified in mapping", reader)); return false; } QName deployable = LoaderUtil.getQName(deployableName, null, reader.getNamespaceContext()); String zoneName = reader.getAttributeValue(null, "zone"); if (zoneName == null) { context.addError(new MissingAttribute("Zone not specified in mapping", reader)); return false; } plan.addDeployableMapping(deployable, zoneName); return true; }
MissingAttribute error = new MissingAttribute("Persistence unit name not specified", startLocation); context.addError(error); LoaderUtil.skipToEndElement(reader); return null;
public Intent load(XMLStreamReader reader, IntrospectionContext context) throws XMLStreamException { validateAttributes(reader, context); String name = reader.getAttributeValue(null, "name"); QName qName = LoaderUtil.getQName(name, context.getTargetNamespace(), reader.getNamespaceContext());
MissingAttribute error = new MissingAttribute("Persistence unit name not specified", startLocation); context.addError(error); LoaderUtil.skipToEndElement(reader); return null;
NamespaceContext namespace = reader.getNamespaceContext(); String constrainingTypeAttrbute = reader.getAttributeValue(null, "constrainingType"); QName constrainingType = LoaderUtil.getQName(constrainingTypeAttrbute, targetNamespace, namespace);
public FileBinding load(XMLStreamReader reader, IntrospectionContext context) throws XMLStreamException { Location startLocation = reader.getLocation(); String bindingName = reader.getAttributeValue(null, "name"); String location = reader.getAttributeValue(null, "location"); if (location == null) { MissingAttribute error = new MissingAttribute("The location attribute must be specified", startLocation); context.addError(error); } String archiveLocation = reader.getAttributeValue(null, "archive.location"); Strategy strategy = parseStrategy(reader); if (Strategy.ARCHIVE == strategy && archiveLocation == null) { MissingAttribute error = new MissingAttribute("An archive location must be specified", startLocation); context.addError(error); } String errorLocation = reader.getAttributeValue(null, "error.location"); String adapterClass = reader.getAttributeValue(null, "adapter"); String adapterUri = reader.getAttributeValue(null, "adapter.component"); String pattern = reader.getAttributeValue(null, "pattern"); long delay = parseDelay(reader, context); FileBinding binding = new FileBinding(bindingName, pattern, location, strategy, archiveLocation, errorLocation, adapterClass, adapterUri, delay); validateAttributes(reader, context, binding); LoaderUtil.skipToEndElement(reader); return binding; }
public ComponentType load(XMLStreamReader reader, IntrospectionContext introspectionContext) throws XMLStreamException { QName constrainingType = LoaderUtil.getQName(reader.getAttributeValue(null, "constrainingType"), introspectionContext.getTargetNamespace(), reader.getNamespaceContext());
public PropertyValue load(XMLStreamReader reader, IntrospectionContext context) throws XMLStreamException { validateAttributes(reader, context); String name = reader.getAttributeValue(null, "name"); if (name == null || name.length() == 0) { MissingAttribute failure = new MissingAttribute("Missing name attribute", reader); context.addError(failure); return null; } String source = reader.getAttributeValue(null, "source"); String file = reader.getAttributeValue(null, "file"); if (source != null) { LoaderUtil.skipToEndElement(reader); return new PropertyValue(name, source); } else if (file != null) { try { URI uri = new URI(file); if (!uri.isAbsolute()) { uri = context.getSourceBase().toURI().resolve(uri); } LoaderUtil.skipToEndElement(reader); return new PropertyValue(name, uri); } catch (URISyntaxException e) { InvalidValue failure = new InvalidValue("File specified for property " + name + " is invalid: " + file, reader, e); context.addError(failure); return null; } } else { return loadInlinePropertyValue(name, reader, context); } }
public WsdlServiceContract load(XMLStreamReader reader, IntrospectionContext context) throws XMLStreamException { Location startLocation = reader.getLocation(); validateRemotable(reader, startLocation, context); WsdlServiceContract wsdlContract = processInterface(reader, startLocation, context); processCallbackInterface(reader, wsdlContract, context); helper.loadPolicySetsAndIntents(wsdlContract, reader, context); validateAttributes(reader, context, wsdlContract); LoaderUtil.skipToEndElement(reader); return wsdlContract; }
while (true) { LoaderUtil.skipToEndElement(reader); if ("binding.ftp".equals(reader.getName().getLocalPart())) { return bd; LoaderUtil.skipToEndElement(reader); return bd;
while (true) { LoaderUtil.skipToEndElement(reader); if ("binding.ftp".equals(reader.getName().getLocalPart())) { return bd; LoaderUtil.skipToEndElement(reader); return bd;
public JavaImplementation load(XMLStreamReader reader, IntrospectionContext introspectionContext) throws XMLStreamException { Location startLocation = reader.getLocation(); JavaImplementation implementation = new JavaImplementation(); validateAttributes(reader, introspectionContext, implementation); String implClass = reader.getAttributeValue(null, "class"); if (implClass == null) { MissingAttribute failure = new MissingAttribute("The class attribute was not specified", startLocation); introspectionContext.addError(failure); LoaderUtil.skipToEndElement(reader); return implementation; } Class<?> clazz; try { clazz = introspectionContext.getClassLoader().loadClass(implClass); } catch (ClassNotFoundException e) { ImplementationArtifactNotFound failure = new ImplementationArtifactNotFound(implClass, e.getMessage(), implementation); introspectionContext.addError(failure); LoaderUtil.skipToEndElement(reader); return null; } LoaderUtil.skipToEndElement(reader); implementation.setImplementationClass(clazz); InjectingComponentType componentType = new InjectingComponentType(clazz); introspector.introspect(componentType, introspectionContext); implementation.setComponentType(componentType); return implementation; }
public OperationDefinition load(XMLStreamReader reader, IntrospectionContext context) throws XMLStreamException { validateAttributes(reader, context); OperationDefinition operationDefinition = new OperationDefinition(); String name = reader.getAttributeValue(null, "name"); if (name == null) { MissingAttribute failure = new MissingAttribute("Operation name not specified", reader); context.addError(failure); } operationDefinition.setName(name); loaderHelper.loadPolicySetsAndIntents(operationDefinition, reader, context); LoaderUtil.skipToEndElement(reader); return operationDefinition; }