< prev index next >
jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/ParserPool.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
--- 1,7 ----
/*
! * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
*** 43,54 ****
private final BlockingQueue<SAXParser> queue;
private SAXParserFactory factory;
public ParserPool(int capacity) {
queue = new ArrayBlockingQueue<SAXParser>(capacity);
! //factory = SAXParserFactory.newInstance();
! factory = new com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl();
factory.setNamespaceAware(true);
for (int i = 0; i < capacity; i++) {
try {
queue.put(factory.newSAXParser());
} catch (InterruptedException ex) {
--- 43,53 ----
private final BlockingQueue<SAXParser> queue;
private SAXParserFactory factory;
public ParserPool(int capacity) {
queue = new ArrayBlockingQueue<SAXParser>(capacity);
! factory = SAXParserFactory.newInstance("com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl", SAAJUtil.getSystemClassLoader());
factory.setNamespaceAware(true);
for (int i = 0; i < capacity; i++) {
try {
queue.put(factory.newSAXParser());
} catch (InterruptedException ex) {
*** 77,87 ****
return queue.offer(parser);
}
public void returnParser(SAXParser saxParser) {
saxParser.reset();
! resetSaxParser(saxParser);
put(saxParser);
}
/**
--- 76,87 ----
return queue.offer(parser);
}
public void returnParser(SAXParser saxParser) {
saxParser.reset();
! //TODO!! Ask about jaxp issue (https://jaxp.dev.java.net/issues/show_bug.cgi?id=59) multirelease if needed
! // resetSaxParser(saxParser);
put(saxParser);
}
/**
*** 90,108 ****
* So we are trying to reset it using the proprietary code below.
* Temporary Until the bug : https://jaxp.dev.java.net/issues/show_bug.cgi?id=59
* is fixed.
* @param parser the parser from the pool whose Symbol Table needs to be reset.
*/
! private void resetSaxParser(SAXParser parser) {
try {
//Object obj = parser.getProperty("http://apache.org/xml/properties/internal/symbol-table");
com.sun.org.apache.xerces.internal.util.SymbolTable table = new com.sun.org.apache.xerces.internal.util.SymbolTable();
parser.setProperty("http://apache.org/xml/properties/internal/symbol-table", table);
//obj = parser.getProperty("http://apache.org/xml/properties/internal/symbol-table");
} catch (SAXNotRecognizedException ex) {
//nothing to do
} catch (SAXNotSupportedException ex) {
//nothing to do
}
! }
}
--- 90,108 ----
* So we are trying to reset it using the proprietary code below.
* Temporary Until the bug : https://jaxp.dev.java.net/issues/show_bug.cgi?id=59
* is fixed.
* @param parser the parser from the pool whose Symbol Table needs to be reset.
*/
! /*private void resetSaxParser(SAXParser parser) {
try {
//Object obj = parser.getProperty("http://apache.org/xml/properties/internal/symbol-table");
com.sun.org.apache.xerces.internal.util.SymbolTable table = new com.sun.org.apache.xerces.internal.util.SymbolTable();
parser.setProperty("http://apache.org/xml/properties/internal/symbol-table", table);
//obj = parser.getProperty("http://apache.org/xml/properties/internal/symbol-table");
} catch (SAXNotRecognizedException ex) {
//nothing to do
} catch (SAXNotSupportedException ex) {
//nothing to do
}
! }*/
}
< prev index next >