Java Code Examples for com.sun.xml.internal.ws.api.streaming.XMLStreamReaderFactory#recycle()
The following examples show how to use
com.sun.xml.internal.ws.api.streaming.XMLStreamReaderFactory#recycle() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: EndpointArgumentsBuilder.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
protected void readWrappedRequest(Message msg, Object[] args) throws JAXBException, XMLStreamException { if (!msg.hasPayload()) { throw new WebServiceException("No payload. Expecting payload with "+wrapperName+" element"); } XMLStreamReader reader = msg.readPayload(); XMLStreamReaderUtil.verifyTag(reader,wrapperName); reader.nextTag(); while(reader.getEventType()==XMLStreamReader.START_ELEMENT) { // TODO: QName has a performance issue QName name = reader.getName(); WrappedPartBuilder part = wrappedParts.get(name); if(part==null) { // no corresponding part found. ignore XMLStreamReaderUtil.skipElement(reader); reader.nextTag(); } else { part.readRequest(args,reader, msg.getAttachments()); } XMLStreamReaderUtil.toNextTag(reader, name); } // we are done with the body reader.close(); XMLStreamReaderFactory.recycle(reader); }
Example 2
Source File: EndpointArgumentsBuilder.java From openjdk-jdk9 with GNU General Public License v2.0 | 6 votes |
protected void readWrappedRequest(Message msg, Object[] args) throws JAXBException, XMLStreamException { if (!msg.hasPayload()) { throw new WebServiceException("No payload. Expecting payload with "+wrapperName+" element"); } XMLStreamReader reader = msg.readPayload(); XMLStreamReaderUtil.verifyTag(reader,wrapperName); reader.nextTag(); while(reader.getEventType()==XMLStreamReader.START_ELEMENT) { // TODO: QName has a performance issue QName name = reader.getName(); WrappedPartBuilder part = wrappedParts.get(name); if(part==null) { // no corresponding part found. ignore XMLStreamReaderUtil.skipElement(reader); reader.nextTag(); } else { part.readRequest(args,reader, msg.getAttachments()); } XMLStreamReaderUtil.toNextTag(reader, name); } // we are done with the body reader.close(); XMLStreamReaderFactory.recycle(reader); }
Example 3
Source File: EndpointArgumentsBuilder.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
protected void readWrappedRequest(Message msg, Object[] args) throws JAXBException, XMLStreamException { if (!msg.hasPayload()) { throw new WebServiceException("No payload. Expecting payload with "+wrapperName+" element"); } XMLStreamReader reader = msg.readPayload(); XMLStreamReaderUtil.verifyTag(reader,wrapperName); reader.nextTag(); while(reader.getEventType()==XMLStreamReader.START_ELEMENT) { // TODO: QName has a performance issue QName name = reader.getName(); WrappedPartBuilder part = wrappedParts.get(name); if(part==null) { // no corresponding part found. ignore XMLStreamReaderUtil.skipElement(reader); reader.nextTag(); } else { part.readRequest(args,reader, msg.getAttachments()); } XMLStreamReaderUtil.toNextTag(reader, name); } // we are done with the body reader.close(); XMLStreamReaderFactory.recycle(reader); }
Example 4
Source File: EndpointArgumentsBuilder.java From hottub with GNU General Public License v2.0 | 6 votes |
protected void readWrappedRequest(Message msg, Object[] args) throws JAXBException, XMLStreamException { if (!msg.hasPayload()) { throw new WebServiceException("No payload. Expecting payload with "+wrapperName+" element"); } XMLStreamReader reader = msg.readPayload(); XMLStreamReaderUtil.verifyTag(reader,wrapperName); reader.nextTag(); while(reader.getEventType()==XMLStreamReader.START_ELEMENT) { // TODO: QName has a performance issue QName name = reader.getName(); WrappedPartBuilder part = wrappedParts.get(name); if(part==null) { // no corresponding part found. ignore XMLStreamReaderUtil.skipElement(reader); reader.nextTag(); } else { part.readRequest(args,reader, msg.getAttachments()); } XMLStreamReaderUtil.toNextTag(reader, name); } // we are done with the body reader.close(); XMLStreamReaderFactory.recycle(reader); }
Example 5
Source File: EndpointArgumentsBuilder.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
protected void readWrappedRequest(Message msg, Object[] args) throws JAXBException, XMLStreamException { if (!msg.hasPayload()) { throw new WebServiceException("No payload. Expecting payload with "+wrapperName+" element"); } XMLStreamReader reader = msg.readPayload(); XMLStreamReaderUtil.verifyTag(reader,wrapperName); reader.nextTag(); while(reader.getEventType()==XMLStreamReader.START_ELEMENT) { // TODO: QName has a performance issue QName name = reader.getName(); WrappedPartBuilder part = wrappedParts.get(name); if(part==null) { // no corresponding part found. ignore XMLStreamReaderUtil.skipElement(reader); reader.nextTag(); } else { part.readRequest(args,reader, msg.getAttachments()); } XMLStreamReaderUtil.toNextTag(reader, name); } // we are done with the body reader.close(); XMLStreamReaderFactory.recycle(reader); }
Example 6
Source File: EndpointArgumentsBuilder.java From openjdk-8 with GNU General Public License v2.0 | 6 votes |
protected void readWrappedRequest(Message msg, Object[] args) throws JAXBException, XMLStreamException { if (!msg.hasPayload()) { throw new WebServiceException("No payload. Expecting payload with "+wrapperName+" element"); } XMLStreamReader reader = msg.readPayload(); XMLStreamReaderUtil.verifyTag(reader,wrapperName); reader.nextTag(); while(reader.getEventType()==XMLStreamReader.START_ELEMENT) { // TODO: QName has a performance issue QName name = reader.getName(); WrappedPartBuilder part = wrappedParts.get(name); if(part==null) { // no corresponding part found. ignore XMLStreamReaderUtil.skipElement(reader); reader.nextTag(); } else { part.readRequest(args,reader, msg.getAttachments()); } XMLStreamReaderUtil.toNextTag(reader, name); } // we are done with the body reader.close(); XMLStreamReaderFactory.recycle(reader); }
Example 7
Source File: EndpointArgumentsBuilder.java From hottub with GNU General Public License v2.0 | 5 votes |
public void readRequest(Message msg, Object[] args) throws JAXBException, XMLStreamException { if (dynamicWrapper) { readWrappedRequest(msg, args); } else { if (parts.length>0) { if (!msg.hasPayload()) { throw new WebServiceException("No payload. Expecting payload with "+wrapperName+" element"); } XMLStreamReader reader = msg.readPayload(); XMLStreamReaderUtil.verifyTag(reader, wrapperName); Object wrapperBean = wrapper.unmarshal(reader, (msg.getAttachments() != null) ? new AttachmentUnmarshallerImpl(msg.getAttachments()): null); try { for (PartBuilder part : parts) { part.readRequest(args,wrapperBean); } } catch (DatabindingException e) { // this can happen when the set method throw a checked exception or something like that throw new WebServiceException(e); // TODO:i18n } // we are done with the body reader.close(); XMLStreamReaderFactory.recycle(reader); } else { msg.consume(); } } }
Example 8
Source File: EndpointArgumentsBuilder.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
public void readRequest(Message msg, Object[] args) throws JAXBException, XMLStreamException { if (dynamicWrapper) { readWrappedRequest(msg, args); } else { if (parts.length>0) { if (!msg.hasPayload()) { throw new WebServiceException("No payload. Expecting payload with "+wrapperName+" element"); } XMLStreamReader reader = msg.readPayload(); XMLStreamReaderUtil.verifyTag(reader, wrapperName); Object wrapperBean = wrapper.unmarshal(reader, (msg.getAttachments() != null) ? new AttachmentUnmarshallerImpl(msg.getAttachments()): null); try { for (PartBuilder part : parts) { part.readRequest(args,wrapperBean); } } catch (DatabindingException e) { // this can happen when the set method throw a checked exception or something like that throw new WebServiceException(e); // TODO:i18n } // we are done with the body reader.close(); XMLStreamReaderFactory.recycle(reader); } else { msg.consume(); } } }
Example 9
Source File: AbstractHeaderImpl.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
/** * Default implementation that copies the infoset. Not terribly efficient. */ public WSEndpointReference readAsEPR(AddressingVersion expected) throws XMLStreamException { XMLStreamReader xsr = readHeader(); WSEndpointReference epr = new WSEndpointReference(xsr, expected); XMLStreamReaderFactory.recycle(xsr); return epr; }
Example 10
Source File: AbstractHeaderImpl.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
/** * Default implementation that copies the infoset. Not terribly efficient. */ public WSEndpointReference readAsEPR(AddressingVersion expected) throws XMLStreamException { XMLStreamReader xsr = readHeader(); WSEndpointReference epr = new WSEndpointReference(xsr, expected); XMLStreamReaderFactory.recycle(xsr); return epr; }
Example 11
Source File: EndpointArgumentsBuilder.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
public void readRequest(Message msg, Object[] args) throws JAXBException, XMLStreamException { if (dynamicWrapper) { readWrappedRequest(msg, args); } else { if (parts.length>0) { if (!msg.hasPayload()) { throw new WebServiceException("No payload. Expecting payload with "+wrapperName+" element"); } XMLStreamReader reader = msg.readPayload(); XMLStreamReaderUtil.verifyTag(reader, wrapperName); Object wrapperBean = wrapper.unmarshal(reader, (msg.getAttachments() != null) ? new AttachmentUnmarshallerImpl(msg.getAttachments()): null); try { for (PartBuilder part : parts) { part.readRequest(args,wrapperBean); } } catch (DatabindingException e) { // this can happen when the set method throw a checked exception or something like that throw new WebServiceException(e); // TODO:i18n } // we are done with the body reader.close(); XMLStreamReaderFactory.recycle(reader); } else { msg.consume(); } } }
Example 12
Source File: AbstractHeaderImpl.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
/** * Default implementation that copies the infoset. Not terribly efficient. */ public WSEndpointReference readAsEPR(AddressingVersion expected) throws XMLStreamException { XMLStreamReader xsr = readHeader(); WSEndpointReference epr = new WSEndpointReference(xsr, expected); XMLStreamReaderFactory.recycle(xsr); return epr; }
Example 13
Source File: EndpointArgumentsBuilder.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
public void readRequest(Message msg, Object[] args) throws JAXBException, XMLStreamException { if (dynamicWrapper) { readWrappedRequest(msg, args); } else { if (parts.length>0) { if (!msg.hasPayload()) { throw new WebServiceException("No payload. Expecting payload with "+wrapperName+" element"); } XMLStreamReader reader = msg.readPayload(); XMLStreamReaderUtil.verifyTag(reader, wrapperName); Object wrapperBean = wrapper.unmarshal(reader, (msg.getAttachments() != null) ? new AttachmentUnmarshallerImpl(msg.getAttachments()): null); try { for (PartBuilder part : parts) { part.readRequest(args,wrapperBean); } } catch (DatabindingException e) { // this can happen when the set method throw a checked exception or something like that throw new WebServiceException(e); // TODO:i18n } // we are done with the body reader.close(); XMLStreamReaderFactory.recycle(reader); } else { msg.consume(); } } }
Example 14
Source File: AbstractHeaderImpl.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
/** * Default implementation that copies the infoset. Not terribly efficient. */ public WSEndpointReference readAsEPR(AddressingVersion expected) throws XMLStreamException { XMLStreamReader xsr = readHeader(); WSEndpointReference epr = new WSEndpointReference(xsr, expected); XMLStreamReaderFactory.recycle(xsr); return epr; }
Example 15
Source File: EndpointArgumentsBuilder.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
public void readRequest(Message msg, Object[] args) throws JAXBException, XMLStreamException { if (dynamicWrapper) { readWrappedRequest(msg, args); } else { if (parts.length>0) { if (!msg.hasPayload()) { throw new WebServiceException("No payload. Expecting payload with "+wrapperName+" element"); } XMLStreamReader reader = msg.readPayload(); XMLStreamReaderUtil.verifyTag(reader, wrapperName); Object wrapperBean = wrapper.unmarshal(reader, (msg.getAttachments() != null) ? new AttachmentUnmarshallerImpl(msg.getAttachments()): null); try { for (PartBuilder part : parts) { part.readRequest(args,wrapperBean); } } catch (DatabindingException e) { // this can happen when the set method throw a checked exception or something like that throw new WebServiceException(e); // TODO:i18n } // we are done with the body reader.close(); XMLStreamReaderFactory.recycle(reader); } else { msg.consume(); } } }
Example 16
Source File: XMLStreamReaderFilter.java From openjdk-jdk8u with GNU General Public License v2.0 | 4 votes |
public void onRecycled() { XMLStreamReaderFactory.recycle(reader); reader = null; }
Example 17
Source File: XMLStreamReaderFilter.java From jdk8u60 with GNU General Public License v2.0 | 4 votes |
public void onRecycled() { XMLStreamReaderFactory.recycle(reader); reader = null; }
Example 18
Source File: XMLStreamReaderFilter.java From openjdk-8 with GNU General Public License v2.0 | 4 votes |
public void onRecycled() { XMLStreamReaderFactory.recycle(reader); reader = null; }
Example 19
Source File: XMLStreamReaderFilter.java From openjdk-8-source with GNU General Public License v2.0 | 4 votes |
public void onRecycled() { XMLStreamReaderFactory.recycle(reader); reader = null; }
Example 20
Source File: XMLStreamReaderFilter.java From hottub with GNU General Public License v2.0 | 4 votes |
public void onRecycled() { XMLStreamReaderFactory.recycle(reader); reader = null; }