protected void readExtendedElement(XMLStreamReader reader, Extensible extensible, StAXArtifactProcessor extensionProcessor, ProcessorContext context) throws ContributionReadException, XMLStreamException { Object ext = extensionProcessor.read(reader, context); if (extensible != null) { extensible.getExtensions().add(ext); } }
protected void readExtendedElement(XMLStreamReader reader, Extensible extensible, StAXArtifactProcessor extensionProcessor, ProcessorContext context) throws ContributionReadException, XMLStreamException { Object ext = extensionProcessor.read(reader, context); if (extensible != null) { extensible.getExtensions().add(ext); } }
public Object read(XMLStreamReader inputSource, ProcessorContext context) throws ContributionReadException, XMLStreamException { return getProcessor().read(inputSource, context); }
public Object read(XMLStreamReader inputSource, ProcessorContext context) throws ContributionReadException, XMLStreamException { return getProcessor().read(inputSource, context); }
public EndpointReference readEndpointReference(String xml) { try { XMLStreamReader reader = inputFactory.createXMLStreamReader(new StringReader(xml)); EndpointReference result = refProcessor.read(reader, new ProcessorContext(registry)); reader.close(); return result; } catch (Exception e) { throw new ServiceRuntimeException(e); } }
protected Binding createDelegatingBinding(QName bindingType) throws XMLStreamException, ContributionReadException { StAXArtifactProcessor processor = processors.getProcessor(bindingType); if (processor == null) { logger.warning("Mapped binding for binding.sca is not supported: " + bindingType); } StringBuffer xml = new StringBuffer(); xml.append("<").append(bindingType.getLocalPart()).append(" xmlns:b=\"").append(bindingType.getNamespaceURI()) .append("\"/>"); StAXHelper staxHelper = StAXHelper.getInstance(registry); XMLStreamReader reader = staxHelper.createXMLStreamReader(new StringReader(xml.toString())); reader.nextTag(); Binding binding = (Binding)processor.read(reader, new ProcessorContext(registry)); return binding; }
protected Binding createDelegatingBinding(QName bindingType) throws XMLStreamException, ContributionReadException { StAXArtifactProcessor processor = processors.getProcessor(bindingType); if (processor == null) { logger.warning("Mapped binding for binding.sca is not supported: " + bindingType); } StringBuffer xml = new StringBuffer(); xml.append("<").append(bindingType.getLocalPart()).append(" xmlns:b=\"").append(bindingType.getNamespaceURI()) .append("\"/>"); StAXHelper staxHelper = StAXHelper.getInstance(registry); XMLStreamReader reader = staxHelper.createXMLStreamReader(new StringReader(xml.toString())); reader.nextTag(); Binding binding = (Binding)processor.read(reader, new ProcessorContext(registry)); return binding; }
public Endpoint readEndpoint(String xml) { try { //System.out.println("Read Endpoint string >> " + xml); XMLStreamReader reader = inputFactory.createXMLStreamReader(new StringReader(xml)); Endpoint result = processor.read(reader, new ProcessorContext(registry)); result.setRemote(true); reader.close(); return result; } catch (Exception e) { throw new ServiceRuntimeException(e); } }
public Object read(XMLStreamReader source, ProcessorContext context) throws ContributionReadException, XMLStreamException { Monitor monitor = context.getMonitor(); // Delegate to the processor associated with the element QName int event = source.getEventType(); if (event == XMLStreamConstants.START_DOCUMENT) { while (source.next() != XMLStreamReader.START_ELEMENT); } QName name = source.getName(); StAXArtifactProcessor<?> processor = (StAXArtifactProcessor<?>)processors.getProcessor(name); if (processor == null) { Location location = source.getLocation(); error(monitor, "ElementCannotBeProcessed", processors, name, location); StAXArtifactProcessor anyElementProcessor = processors.getProcessor(ANY_ELEMENT); if (anyElementProcessor != null) { return anyElementProcessor.read(source, context); } else { return null; } } return processor.read(source, context); }
public Object read(XMLStreamReader source, ProcessorContext context) throws ContributionReadException, XMLStreamException { Monitor monitor = context.getMonitor(); // Delegate to the processor associated with the element QName int event = source.getEventType(); if (event == XMLStreamConstants.START_DOCUMENT) { while (source.next() != XMLStreamReader.START_ELEMENT); } QName name = source.getName(); StAXArtifactProcessor<?> processor = (StAXArtifactProcessor<?>)processors.getProcessor(name); if (processor == null) { Location location = source.getLocation(); error(monitor, "ElementCannotBeProcessed", processors, name, location); StAXArtifactProcessor anyElementProcessor = processors.getProcessor(ANY_ELEMENT); if (anyElementProcessor != null) { return anyElementProcessor.read(source, context); } else { return null; } } return processor.read(source, context); }
public ServiceDescriptions read(URL contributionURL, URI artifactURI, URL artifactURL, ProcessorContext context) throws ContributionReadException { InputStream is = null; try { URLConnection connection = artifactURL.openConnection(); connection.setUseCaches(false); is = connection.getInputStream(); } catch (IOException e) { ContributionReadException ce = new ContributionReadException(e); throw ce; } try { XMLStreamReader reader = inputFactory.createXMLStreamReader(is); ValidatingXMLInputFactory.setMonitor(reader, context.getMonitor()); Object result = extensionProcessor.read(reader, context); return (ServiceDescriptions)result; } catch (XMLStreamException e) { ContributionReadException ce = new ContributionReadException(e); throw ce; } finally { try { if (is != null) { is.close(); is = null; } } catch (IOException ioe) { //ignore } } }
Object model = extensionProcessor.read(reader, context); if (model instanceof Composite) { Composite composite = (Composite)model;
Object model = extensionProcessor.read(reader, context); if (model instanceof Composite) { Composite composite = (Composite)model;
parseResponseActivationSpec(reader, jmsBinding, monitor); } else { Object extension = extensionProcessor.read(reader, context); if (extension != null) { if (extension instanceof WireFormat) {
parseResponseActivationSpec(reader, jmsBinding, monitor); } else { Object extension = extensionProcessor.read(reader, context); if (extension != null) { if (extension instanceof WireFormat) {
public ContributionMetadata read(URL contributionURL, URI uri, URL url, ProcessorContext context) throws ContributionReadException { InputStream urlStream = null; try { // Create a stream reader urlStream = IOHelper.openStream(url); XMLStreamReader reader = inputFactory.createXMLStreamReader(url.toString(), urlStream); ValidatingXMLInputFactory.setMonitor(reader, context.getMonitor()); reader.nextTag(); // Read the contribution model ContributionMetadata contribution = (ContributionMetadata)staxProcessor.read(reader, context); return contribution; } catch (XMLStreamException e) { ContributionReadException ex = new ContributionReadException(e); error(context.getMonitor(), "XMLStreamException", inputFactory, ex); throw ex; } catch (IOException e) { ContributionReadException ex = new ContributionReadException(e); error(context.getMonitor(), "IOException", inputFactory, ex); throw ex; } finally { try { if (urlStream != null) { urlStream.close(); urlStream = null; } } catch (IOException ioe) { //ignore } } }
public ContributionMetadata read(URL contributionURL, URI uri, URL url, ProcessorContext context) throws ContributionReadException { InputStream urlStream = null; try { // Create a stream reader urlStream = IOHelper.openStream(url); XMLStreamReader reader = inputFactory.createXMLStreamReader(url.toString(), urlStream); ValidatingXMLInputFactory.setMonitor(reader, context.getMonitor()); reader.nextTag(); // Read the contribution model ContributionMetadata contribution = (ContributionMetadata)staxProcessor.read(reader, context); return contribution; } catch (XMLStreamException e) { ContributionReadException ex = new ContributionReadException(e); error(context.getMonitor(), "XMLStreamException", inputFactory, ex); throw ex; } catch (IOException e) { ContributionReadException ex = new ContributionReadException(e); error(context.getMonitor(), "IOException", inputFactory, ex); throw ex; } finally { try { if (urlStream != null) { urlStream.close(); urlStream = null; } } catch (IOException ioe) { //ignore } } }
ComponentType componentType = (ComponentType)extensionProcessor.read(reader, context); if (componentType != null) { componentType.setURI(uri.toString());
reader.nextTag(); Object model = extensionProcessor.read(reader, context); if (model instanceof Composite) { Composite composite = (Composite)model;
reader.nextTag(); Object model = extensionProcessor.read(reader, context); if (model instanceof Composite) { Composite composite = (Composite)model;